# Api

com.google.api.server.spi.config

## Annotation Type Api

-

  *** ** * ** ***

  <br />

  ```
  @Retention(value=RUNTIME)
   @Target(value=TYPE)
  public @interface Api
  ```
  Annotation for API-wide configuration.
-
  -

    ### Field Summary

    | Modifier and Type | Fields and Description |
    |---|---|
    | `static int` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#UNSPECIFIED_INT` |
    | `static java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#UNSPECIFIED_STRING_FOR_LIST` |
    [Fields]

  <!-- -->

  -

    ### Optional Element Summary

    | Modifier and Type | Optional Element and Description |
    |---|---|
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/AnnotationBoolean.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#apiKeyRequired--` Whether or not an API key is required. |
    | `java.lang.String[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#audiences--` Audience for IdTokens, applicable to all methods of the API unless overridden by `@ApiClass#audiences` or `@ApiMethod#audiences`. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiAuth.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#auth--` Configures authentication information. |
    | `java.lang.Class<? extends https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Authenticator.html>[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#authenticators--` Custom authenticators. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/AuthLevel.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#authLevel--` Set frontend auth level, applicable to all methods of the API unless overridden by `@ApiClass#authLevel` or `@ApiMethod#authLevel`. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#backendRoot--` Backend root URL, e.g. |
    | `ApiCacheControl` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#cacheControl--` Configures the Cache-Control header in the response. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#canonicalName--` Optional name, which indicates how an API name should be split into parts. |
    | `java.lang.String[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#clientIds--` Client IDs allowed to call this method, applicable to all methods of the API unless overridden by `@ApiClass#clientIds` or `@ApiMethod#clientIds`. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/AnnotationBoolean.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#defaultVersion--` Marks this version of an API as the default version to use when a JSON-RPC call is executed against the API. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#description--` Description of this API. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/AnnotationBoolean.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#discoverable--` Whether or not the API is discoverable. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#documentationLink--` A link to human readable documentation for the API. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiFrontendLimits.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#frontendLimits--` Configures quota enforcement. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/AnnotationBoolean.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#isAbstract--` `true` if this API configuration is used as the base for another. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiIssuerAudience.html[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#issuerAudiences--` Audiences for individual issuers, applicable to all methods of the API unless overridden by [`ApiClass.issuerAudiences()`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiClass.html#issuerAudiences--) or [`ApiMethod.issuerAudiences()`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiMethod.html#issuerAudiences--). |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiIssuer.html[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#issuers--` Custom JWT issuer configurations. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiLimitMetric.html[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#limitDefinitions--` Rate limiting metric definitions that are used in this API. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#name--` Name of the API, e.g. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiNamespace.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#namespace--` Configures namespacing for generated clients. |
    | `java.lang.Class<? extends PeerAuthenticator>[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#peerAuthenticators--` Custom peer authenticators. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#resource--` The name (in plural) of the resource collection. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#root--` Frontend root URL, e.g. |
    | `java.lang.String[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#scopes--` OAuth 2 scopes, one of which is required for calling this method, applicable to all methods of the API unless overridden by `@ApiClass#scopes` or `@ApiMethod#scopes`. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#title--` The title of an API. |
    | `java.lang.Class<? extends https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Transformer.html<?,?>>[]` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#transformers--` Custom transformers to be used for this API. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/AnnotationBoolean.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#useDatastoreForAdditionalConfig--` `AnnotationBoolean.TRUE` to request that overriding configuration be loaded from the appengine datastore for all API classes except for those classes that override using `@ApiClass#useDatastoreForAdditionalConfig`. |
    | `java.lang.String` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Api.html#version--` Version of the API, e.g. |
    [Optional Elements]

-
  -

    ### Field Detail


    -

      #### UNSPECIFIED_INT

      ```
      public static final int UNSPECIFIED_INT
      ```

  <!-- -->

  -

    -

      #### UNSPECIFIED_STRING_FOR_LIST

      ```
      public static final java.lang.String UNSPECIFIED_STRING_FOR_LIST
      ```

  <!-- -->

  -

    ### Element Detail


    -

      #### root

      ```
      public abstract java.lang.String root
      ```
      Frontend root URL, e.g. "https://example.appspot.com/_ah/api". All api methods will be exposed below this path. This will default to "https://yourapp.appspot.com/_ah/api".

      Default:
      :   ""

  <!-- -->

  -

    -

      #### name

      ```
      public abstract java.lang.String name
      ```
      Name of the API, e.g. "guestbook". This is used as the prefix for all api methods and paths. If not set a default of "myapi" will be used.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### canonicalName

      ```
      public abstract java.lang.String canonicalName
      ```
      Optional name, which indicates how an API name should be split into parts. This is useful in generating better client library names. For example, the API name might be "myapi" and the canonical name might be "My API", which indicates that the camel case name should be myApi while the underscore name should be my_api.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### version

      ```
      public abstract java.lang.String version
      ```
      Version of the API, e.g. "v0.2". If not set a default of "v1" will be used.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### title

      ```
      public abstract java.lang.String title
      ```
      The title of an API. This is the title displayed by API Explorer.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### description

      ```
      public abstract java.lang.String description
      ```
      Description of this API. This will be exposed in the discovery service to describe your API, and may also be used to generate documentation.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### documentationLink

      ```
      public abstract java.lang.String documentationLink
      ```
      A link to human readable documentation for the API. By default no link is is exposed in discovery.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### backendRoot

      ```
      public abstract java.lang.String backendRoot
      ```
      Backend root URL, e.g. "https://example.appspot.com/_ah/spi". This is the root of all backend method calls. This will default to "https://yourapp.appspot.com/_ah/spi". Non-secure http URLs will be automatically converted to use https.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### auth

      ```
      public abstract ApiAuth auth
      ```
      Configures authentication information. See [`ApiAuth`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiAuth.html "annotation in com.google.api.server.spi.config") for details.

      Default:
      :   @com.google.api.server.spi.config.ApiAuth

  <!-- -->

  -

    -

      #### frontendLimits

      ```
      public abstract ApiFrontendLimits frontendLimits
      ```
      Configures quota enforcement. See [`ApiFrontendLimits`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiFrontendLimits.html "annotation in com.google.api.server.spi.config") for details.

      Default:
      :   @com.google.api.server.spi.config.ApiFrontendLimits

  <!-- -->

  -

    -

      #### cacheControl

      ```
      public abstract ApiCacheControl cacheControl
      ```
      Configures the Cache-Control header in the response. See `ApiCacheControl` for details.

      Default:
      :   \<error\>

  <!-- -->

  -

    -

      #### authLevel

      ```
      public abstract AuthLevel authLevel
      ```
      Set frontend auth level, applicable to all methods of the API unless overridden by `@ApiClass#authLevel` or `@ApiMethod#authLevel`.

      Default:
      :   com.google.api.server.spi.config.AuthLevel.UNSPECIFIED

  <!-- -->

  -

    -

      #### scopes

      ```
      public abstract java.lang.String[] scopes
      ```
      OAuth 2 scopes, one of which is required for calling this method, applicable to all methods of the API unless overridden by `@ApiClass#scopes` or `@ApiMethod#scopes`.

      Default:
      :   "_UNSPECIFIED_LIST_STRING_VALUE"

  <!-- -->

  -

    -

      #### audiences

      ```
      public abstract java.lang.String[] audiences
      ```
      Audience for IdTokens, applicable to all methods of the API unless overridden by `@ApiClass#audiences` or `@ApiMethod#audiences`.

      Default:
      :   "_UNSPECIFIED_LIST_STRING_VALUE"

  <!-- -->

  -

    -

      #### issuers

      ```
      public abstract ApiIssuer[] issuers
      ```
      Custom JWT issuer configurations. This is only meant to be used with EspAuthenticator in endpoints-framework-auth.

      Default:
      :   @com.google.api.server.spi.config.ApiIssuer(name="_UNSPECIFIED_LIST_STRING_VALUE")

  <!-- -->

  -

    -

      #### issuerAudiences

      ```
      public abstract ApiIssuerAudience[] issuerAudiences
      ```
      Audiences for individual issuers, applicable to all methods of the API unless overridden by [`ApiClass.issuerAudiences()`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiClass.html#issuerAudiences--) or [`ApiMethod.issuerAudiences()`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiMethod.html#issuerAudiences--). This is only meant to be used with EspAuthenticator in endpoints-framework-auth.

      Default:
      :   @com.google.api.server.spi.config.ApiIssuerAudience(name="_UNSPECIFIED_LIST_STRING_VALUE", audiences="_UNSPECIFIED_LIST_STRING_VALUE")

  <!-- -->

  -

    -

      #### clientIds

      ```
      public abstract java.lang.String[] clientIds
      ```
      Client IDs allowed to call this method, applicable to all methods of the API unless overridden by `@ApiClass#clientIds` or `@ApiMethod#clientIds`.

      Default:
      :   "_UNSPECIFIED_LIST_STRING_VALUE"

  <!-- -->

  -

    -

      #### authenticators

      ```
      public abstract java.lang.Class<? extends Authenticator>[] authenticators
      ```
      Custom authenticators. Applies to all methods of the API unless overridden by `@ApiClass#authenticators` or `@ApiMethod#authenticators`. See [`Authenticator`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Authenticator.html "interface in com.google.api.server.spi.config").

      Default:
      :   com.google.api.server.spi.config.Authenticator.class

  <!-- -->

  -

    -

      #### peerAuthenticators

      ```
      public abstract java.lang.Class<? extends PeerAuthenticator>[] peerAuthenticators
      ```
      Custom peer authenticators. Applies to all methods of the API unless overridden by `@ApiClass#peerAuthenticators` or `@ApiMethod#peerAuthenticators`. See `PeerAuthenticator`.

      Default:
      :   \<error\>

  <!-- -->

  -

    -

      #### isAbstract

      ```
      public abstract AnnotationBoolean isAbstract
      ```
      `true` if this API configuration is used as the base for another. Should be `false` for most situations.

      Default:
      :   com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

  <!-- -->

  -

    -

      #### defaultVersion

      ```
      public abstract AnnotationBoolean defaultVersion
      ```
      Marks this version of an API as the default version to use when a JSON-RPC call is executed against the API.

      Default:
      :   com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

  <!-- -->

  -

    -

      #### resource

      ```
      public abstract java.lang.String resource
      ```
      The name (in plural) of the resource collection. It is used as a part of the RESTful path and RPC method name. If it is left empty, a value is deduced from inspecting each endpoint method.

      Default:
      :   ""

  <!-- -->

  -

    -

      #### transformers

      ```
      public abstract java.lang.Class<? extends Transformer<?,?>>[] transformers
      ```
      Custom transformers to be used for this API.

      Default:
      :   {}

  <!-- -->

  -

    -

      #### useDatastoreForAdditionalConfig

      ```
      public abstract AnnotationBoolean useDatastoreForAdditionalConfig
      ```
      `AnnotationBoolean.TRUE` to request that overriding configuration be loaded from the appengine datastore for all API classes except for those classes that override using `@ApiClass#useDatastoreForAdditionalConfig`.

      Default:
      :   com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

  <!-- -->

  -

    -

      #### namespace

      ```
      public abstract ApiNamespace namespace
      ```
      Configures namespacing for generated clients. See [`ApiNamespace`](https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiNamespace.html "annotation in com.google.api.server.spi.config") for details.

      Default:
      :   @com.google.api.server.spi.config.ApiNamespace(ownerDomain="", ownerName="")

  <!-- -->

  -

    -

      #### discoverable

      ```
      public abstract AnnotationBoolean discoverable
      ```
      Whether or not the API is discoverable. This prevents the JavaScript client from working, and by extension, the API Explorer.

      Default:
      :   com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

  <!-- -->

  -

    -

      #### apiKeyRequired

      ```
      public abstract AnnotationBoolean apiKeyRequired
      ```
      Whether or not an API key is required. This is used to output a Swagger specification and has no effect unless used with endpoints-management-control-appengine.

      Default:
      :   com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

  <!-- -->

  -

    -

      #### limitDefinitions

      ```
      public abstract ApiLimitMetric[] limitDefinitions
      ```
      Rate limiting metric definitions that are used in this API.

      Default:
      :   {}