Class HttpTarget

  • All Implemented Interfaces:
    HttpTargetOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class HttpTarget
    extends com.google.protobuf.GeneratedMessageV3
    implements HttpTargetOrBuilder
     Http target. The job will be pushed to the job handler by means of
     an HTTP request via an
     [http_method][google.cloud.scheduler.v1beta1.HttpTarget.http_method] such as
     HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP
     response code in the range [200 - 299]. A failure to receive a response
     constitutes a failed execution. For a redirected request, the response
     returned by the redirected request is considered.
     
    Protobuf type google.cloud.scheduler.v1beta1.HttpTarget
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HttpTarget.AuthorizationHeaderCase  
      static class  HttpTarget.Builder
      Http target.
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,​BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,​BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

        com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getUri

        public String getUri()
         Required. The full URI path that the request will be sent to. This string
         must begin with either "http://" or "https://". Some examples of
         valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
         `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
         encode some characters for safety and compatibility. The maximum allowed
         URL length is 2083 characters after encoding.
         
        string uri = 1;
        Specified by:
        getUri in interface HttpTargetOrBuilder
        Returns:
        The uri.
      • getUriBytes

        public com.google.protobuf.ByteString getUriBytes()
         Required. The full URI path that the request will be sent to. This string
         must begin with either "http://" or "https://". Some examples of
         valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
         `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
         encode some characters for safety and compatibility. The maximum allowed
         URL length is 2083 characters after encoding.
         
        string uri = 1;
        Specified by:
        getUriBytes in interface HttpTargetOrBuilder
        Returns:
        The bytes for uri.
      • getHttpMethodValue

        public int getHttpMethodValue()
         Which HTTP method to use for the request.
         
        .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2;
        Specified by:
        getHttpMethodValue in interface HttpTargetOrBuilder
        Returns:
        The enum numeric value on the wire for httpMethod.
      • getHttpMethod

        public HttpMethod getHttpMethod()
         Which HTTP method to use for the request.
         
        .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2;
        Specified by:
        getHttpMethod in interface HttpTargetOrBuilder
        Returns:
        The httpMethod.
      • getHeadersCount

        public int getHeadersCount()
        Description copied from interface: HttpTargetOrBuilder
         The user can specify HTTP request headers to send with the job's
         HTTP request. This map contains the header field names and
         values. Repeated headers are not supported, but a header value can
         contain commas. These headers represent a subset of the headers
         that will accompany the job's HTTP request. Some HTTP request
         headers will be ignored or replaced. A partial list of headers that
         will be ignored or replaced is below:
         - Host: This will be computed by Cloud Scheduler and derived from
         [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
         * `Content-Length`: This will be computed by Cloud Scheduler.
         * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
         * `X-Google-*`: Google internal use only.
         * `X-AppEngine-*`: Google internal use only.
         * `X-CloudScheduler`: This header will be set to true.
         * `X-CloudScheduler-JobName`: This header will contain the job name.
         * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in
         the unix-cron format, this header will contain the job schedule time in
         RFC3339 UTC "Zulu" format.
        
         The total size of headers must be less than 80KB.
         
        map<string, string> headers = 3;
        Specified by:
        getHeadersCount in interface HttpTargetOrBuilder
      • containsHeaders

        public boolean containsHeaders​(String key)
         The user can specify HTTP request headers to send with the job's
         HTTP request. This map contains the header field names and
         values. Repeated headers are not supported, but a header value can
         contain commas. These headers represent a subset of the headers
         that will accompany the job's HTTP request. Some HTTP request
         headers will be ignored or replaced. A partial list of headers that
         will be ignored or replaced is below:
         - Host: This will be computed by Cloud Scheduler and derived from
         [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
         * `Content-Length`: This will be computed by Cloud Scheduler.
         * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
         * `X-Google-*`: Google internal use only.
         * `X-AppEngine-*`: Google internal use only.
         * `X-CloudScheduler`: This header will be set to true.
         * `X-CloudScheduler-JobName`: This header will contain the job name.
         * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in
         the unix-cron format, this header will contain the job schedule time in
         RFC3339 UTC "Zulu" format.
        
         The total size of headers must be less than 80KB.
         
        map<string, string> headers = 3;
        Specified by:
        containsHeaders in interface HttpTargetOrBuilder
      • getHeadersMap

        public Map<String,​String> getHeadersMap()
         The user can specify HTTP request headers to send with the job's
         HTTP request. This map contains the header field names and
         values. Repeated headers are not supported, but a header value can
         contain commas. These headers represent a subset of the headers
         that will accompany the job's HTTP request. Some HTTP request
         headers will be ignored or replaced. A partial list of headers that
         will be ignored or replaced is below:
         - Host: This will be computed by Cloud Scheduler and derived from
         [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
         * `Content-Length`: This will be computed by Cloud Scheduler.
         * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
         * `X-Google-*`: Google internal use only.
         * `X-AppEngine-*`: Google internal use only.
         * `X-CloudScheduler`: This header will be set to true.
         * `X-CloudScheduler-JobName`: This header will contain the job name.
         * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in
         the unix-cron format, this header will contain the job schedule time in
         RFC3339 UTC "Zulu" format.
        
         The total size of headers must be less than 80KB.
         
        map<string, string> headers = 3;
        Specified by:
        getHeadersMap in interface HttpTargetOrBuilder
      • getHeadersOrDefault

        public String getHeadersOrDefault​(String key,
                                          String defaultValue)
         The user can specify HTTP request headers to send with the job's
         HTTP request. This map contains the header field names and
         values. Repeated headers are not supported, but a header value can
         contain commas. These headers represent a subset of the headers
         that will accompany the job's HTTP request. Some HTTP request
         headers will be ignored or replaced. A partial list of headers that
         will be ignored or replaced is below:
         - Host: This will be computed by Cloud Scheduler and derived from
         [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
         * `Content-Length`: This will be computed by Cloud Scheduler.
         * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
         * `X-Google-*`: Google internal use only.
         * `X-AppEngine-*`: Google internal use only.
         * `X-CloudScheduler`: This header will be set to true.
         * `X-CloudScheduler-JobName`: This header will contain the job name.
         * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in
         the unix-cron format, this header will contain the job schedule time in
         RFC3339 UTC "Zulu" format.
        
         The total size of headers must be less than 80KB.
         
        map<string, string> headers = 3;
        Specified by:
        getHeadersOrDefault in interface HttpTargetOrBuilder
      • getHeadersOrThrow

        public String getHeadersOrThrow​(String key)
         The user can specify HTTP request headers to send with the job's
         HTTP request. This map contains the header field names and
         values. Repeated headers are not supported, but a header value can
         contain commas. These headers represent a subset of the headers
         that will accompany the job's HTTP request. Some HTTP request
         headers will be ignored or replaced. A partial list of headers that
         will be ignored or replaced is below:
         - Host: This will be computed by Cloud Scheduler and derived from
         [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
         * `Content-Length`: This will be computed by Cloud Scheduler.
         * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
         * `X-Google-*`: Google internal use only.
         * `X-AppEngine-*`: Google internal use only.
         * `X-CloudScheduler`: This header will be set to true.
         * `X-CloudScheduler-JobName`: This header will contain the job name.
         * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in
         the unix-cron format, this header will contain the job schedule time in
         RFC3339 UTC "Zulu" format.
        
         The total size of headers must be less than 80KB.
         
        map<string, string> headers = 3;
        Specified by:
        getHeadersOrThrow in interface HttpTargetOrBuilder
      • getBody

        public com.google.protobuf.ByteString getBody()
         HTTP request body. A request body is allowed only if the HTTP
         method is POST, PUT, or PATCH. It is an error to set body on a job with an
         incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
         
        bytes body = 4;
        Specified by:
        getBody in interface HttpTargetOrBuilder
        Returns:
        The body.
      • hasOauthToken

        public boolean hasOauthToken()
         If specified, an
         [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
         will be generated and attached as an `Authorization` header in the HTTP
         request.
        
         This type of authorization should generally only be used when calling
         Google APIs hosted on *.googleapis.com.
         
        .google.cloud.scheduler.v1beta1.OAuthToken oauth_token = 5;
        Specified by:
        hasOauthToken in interface HttpTargetOrBuilder
        Returns:
        Whether the oauthToken field is set.
      • getOauthToken

        public OAuthToken getOauthToken()
         If specified, an
         [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
         will be generated and attached as an `Authorization` header in the HTTP
         request.
        
         This type of authorization should generally only be used when calling
         Google APIs hosted on *.googleapis.com.
         
        .google.cloud.scheduler.v1beta1.OAuthToken oauth_token = 5;
        Specified by:
        getOauthToken in interface HttpTargetOrBuilder
        Returns:
        The oauthToken.
      • getOauthTokenOrBuilder

        public OAuthTokenOrBuilder getOauthTokenOrBuilder()
         If specified, an
         [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
         will be generated and attached as an `Authorization` header in the HTTP
         request.
        
         This type of authorization should generally only be used when calling
         Google APIs hosted on *.googleapis.com.
         
        .google.cloud.scheduler.v1beta1.OAuthToken oauth_token = 5;
        Specified by:
        getOauthTokenOrBuilder in interface HttpTargetOrBuilder
      • hasOidcToken

        public boolean hasOidcToken()
         If specified, an
         [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
         token will be generated and attached as an `Authorization` header in the
         HTTP request.
        
         This type of authorization can be used for many scenarios, including
         calling Cloud Run, or endpoints where you intend to validate the token
         yourself.
         
        .google.cloud.scheduler.v1beta1.OidcToken oidc_token = 6;
        Specified by:
        hasOidcToken in interface HttpTargetOrBuilder
        Returns:
        Whether the oidcToken field is set.
      • getOidcToken

        public OidcToken getOidcToken()
         If specified, an
         [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
         token will be generated and attached as an `Authorization` header in the
         HTTP request.
        
         This type of authorization can be used for many scenarios, including
         calling Cloud Run, or endpoints where you intend to validate the token
         yourself.
         
        .google.cloud.scheduler.v1beta1.OidcToken oidc_token = 6;
        Specified by:
        getOidcToken in interface HttpTargetOrBuilder
        Returns:
        The oidcToken.
      • getOidcTokenOrBuilder

        public OidcTokenOrBuilder getOidcTokenOrBuilder()
         If specified, an
         [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
         token will be generated and attached as an `Authorization` header in the
         HTTP request.
        
         This type of authorization can be used for many scenarios, including
         calling Cloud Run, or endpoints where you intend to validate the token
         yourself.
         
        .google.cloud.scheduler.v1beta1.OidcToken oidc_token = 6;
        Specified by:
        getOidcTokenOrBuilder in interface HttpTargetOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static HttpTarget parseFrom​(ByteBuffer data)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpTarget parseFrom​(ByteBuffer data,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpTarget parseFrom​(com.google.protobuf.ByteString data)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpTarget parseFrom​(com.google.protobuf.ByteString data,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpTarget parseFrom​(byte[] data)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpTarget parseFrom​(byte[] data,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpTarget parseFrom​(com.google.protobuf.CodedInputStream input,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws IOException
        Throws:
        IOException
      • newBuilderForType

        public HttpTarget.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public HttpTarget.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected HttpTarget.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static HttpTarget getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<HttpTarget> parser()
      • getParserForType

        public com.google.protobuf.Parser<HttpTarget> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public HttpTarget getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder