ApiMethod

com.google.api.server.spi.config

Annotation Type ApiMethod



  • @Retention(value=RUNTIME)
     @Target(value=METHOD)
    public @interface ApiMethod
    Annotation for API method configuration.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      java.lang.String[] audiences
      Audience for IdTokens.
      java.lang.Class<? extends Authenticator>[] authenticators
      Custom authenticators used for authentication for this method.
      AuthLevel authLevel
      Set frontend auth level.
      ApiMethodCacheControl cacheControl
      Deprecated. 
      ApiMethodCacheControl is deprecated and will be removed in a future version of Cloud Endpoints.
      java.lang.String[] clientIds
      Client IDs allowed to call this method.
      java.lang.String httpMethod
      The HTTP method to use to access this method.
      java.lang.String name
      The name for this method in the .api file.
      java.lang.String path
      The URI path to use to access this method.
      java.lang.Class<? extends PeerAuthenticator>[] peerAuthenticators
      Custom peer authenticators used to verify peer for this method.
      java.lang.String[] scopes
      OAuth 2 scopes, one of which is required for calling this method.
    • Element Detail

      • name

        public abstract java.lang.String name
        The name for this method in the .api file. This will automatically be prefixed with "<apiname>." to create a unique name for the method. If not set the method name will be derived from the Java method name.
        Default:
        ""
      • path

        public abstract java.lang.String path
        The URI path to use to access this method. If not set a default will be created based on the Java method name.
        Default:
        ""
      • httpMethod

        public abstract java.lang.String httpMethod
        The HTTP method to use to access this method. If not set a default will be chosen based on the name of the method.
        Default:
        ""
      • cacheControl

        @Deprecated
        public abstract ApiMethodCacheControl cacheControl
        Deprecated. ApiMethodCacheControl is deprecated and will be removed in a future version of Cloud Endpoints.
        Cache-Control header settings for this method. See ApiMethodCacheControl for details.
        Default:
        @com.google.api.server.spi.config.ApiMethodCacheControl
      • authLevel

        public abstract AuthLevel authLevel
        Set frontend auth level.
        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.
        Default:
        "_UNSPECIFIED_LIST_STRING_VALUE"
      • audiences

        public abstract java.lang.String[] audiences
        Audience for IdTokens.
        Default:
        "_UNSPECIFIED_LIST_STRING_VALUE"
      • clientIds

        public abstract java.lang.String[] clientIds
        Client IDs allowed to call this method.
        Default:
        "_UNSPECIFIED_LIST_STRING_VALUE"
      • authenticators

        public abstract java.lang.Class<? extends Authenticator>[] authenticators
        Custom authenticators used for authentication for this method.
        Default:
        com.google.api.server.spi.config.Authenticator.class
      • peerAuthenticators

        public abstract java.lang.Class<? extends PeerAuthenticator>[] peerAuthenticators
        Custom peer authenticators used to verify peer for this method.
        Default:
        com.google.api.server.spi.config.PeerAuthenticator.class