Class HttpTarget.Builder

public static final class HttpTarget.Builder extends GeneratedMessageV3.Builder<HttpTarget.Builder> implements HttpTargetOrBuilder

Http target. The job will be pushed to the job handler by means of an HTTP request via an 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.v1.HttpTarget

Implements

HttpTargetOrBuilder

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public HttpTarget.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
HttpTarget.Builder
Overrides

build()

public HttpTarget build()
Returns
TypeDescription
HttpTarget

buildPartial()

public HttpTarget buildPartial()
Returns
TypeDescription
HttpTarget

clear()

public HttpTarget.Builder clear()
Returns
TypeDescription
HttpTarget.Builder
Overrides

clearAuthorizationHeader()

public HttpTarget.Builder clearAuthorizationHeader()
Returns
TypeDescription
HttpTarget.Builder

clearBody()

public HttpTarget.Builder clearBody()

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.

bytes body = 4;

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public HttpTarget.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
HttpTarget.Builder
Overrides

clearHeaders()

public HttpTarget.Builder clearHeaders()
Returns
TypeDescription
HttpTarget.Builder

clearHttpMethod()

public HttpTarget.Builder clearHttpMethod()

Which HTTP method to use for the request.

.google.cloud.scheduler.v1.HttpMethod http_method = 2;

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.

clearOauthToken()

public HttpTarget.Builder clearOauthToken()

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Returns
TypeDescription
HttpTarget.Builder

clearOidcToken()

public HttpTarget.Builder clearOidcToken()

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Returns
TypeDescription
HttpTarget.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public HttpTarget.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
HttpTarget.Builder
Overrides

clearUri()

public HttpTarget.Builder clearUri()

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 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;

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.

clone()

public HttpTarget.Builder clone()
Returns
TypeDescription
HttpTarget.Builder
Overrides

containsHeaders(String key)

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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getAuthorizationHeaderCase()

public HttpTarget.AuthorizationHeaderCase getAuthorizationHeaderCase()
Returns
TypeDescription
HttpTarget.AuthorizationHeaderCase

getBody()

public 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.

bytes body = 4;

Returns
TypeDescription
ByteString

The body.

getDefaultInstanceForType()

public HttpTarget getDefaultInstanceForType()
Returns
TypeDescription
HttpTarget

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getHeaders()

public Map<String,String> getHeaders()

Use #getHeadersMap() instead.

Returns
TypeDescription
Map<String,String>

getHeadersCount()

public int getHeadersCount()

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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Returns
TypeDescription
int

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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Returns
TypeDescription
Map<String,String>

getHeadersOrDefault(String key, String defaultValue)

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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getHeadersOrThrow(String key)

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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getHttpMethod()

public HttpMethod getHttpMethod()

Which HTTP method to use for the request.

.google.cloud.scheduler.v1.HttpMethod http_method = 2;

Returns
TypeDescription
HttpMethod

The httpMethod.

getHttpMethodValue()

public int getHttpMethodValue()

Which HTTP method to use for the request.

.google.cloud.scheduler.v1.HttpMethod http_method = 2;

Returns
TypeDescription
int

The enum numeric value on the wire for httpMethod.

getMutableHeaders()

public Map<String,String> getMutableHeaders()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getOauthToken()

public OAuthToken getOauthToken()

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Returns
TypeDescription
OAuthToken

The oauthToken.

getOauthTokenBuilder()

public OAuthToken.Builder getOauthTokenBuilder()

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Returns
TypeDescription
OAuthToken.Builder

getOauthTokenOrBuilder()

public OAuthTokenOrBuilder getOauthTokenOrBuilder()

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Returns
TypeDescription
OAuthTokenOrBuilder

getOidcToken()

public OidcToken getOidcToken()

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Returns
TypeDescription
OidcToken

The oidcToken.

getOidcTokenBuilder()

public OidcToken.Builder getOidcTokenBuilder()

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Returns
TypeDescription
OidcToken.Builder

getOidcTokenOrBuilder()

public OidcTokenOrBuilder getOidcTokenOrBuilder()

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Returns
TypeDescription
OidcTokenOrBuilder

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 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;

Returns
TypeDescription
String

The uri.

getUriBytes()

public 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 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;

Returns
TypeDescription
ByteString

The bytes for uri.

hasOauthToken()

public boolean hasOauthToken()

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Returns
TypeDescription
boolean

Whether the oauthToken field is set.

hasOidcToken()

public boolean hasOidcToken()

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Returns
TypeDescription
boolean

Whether the oidcToken field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(HttpTarget other)

public HttpTarget.Builder mergeFrom(HttpTarget other)
Parameter
NameDescription
otherHttpTarget
Returns
TypeDescription
HttpTarget.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public HttpTarget.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HttpTarget.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public HttpTarget.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
HttpTarget.Builder
Overrides

mergeOauthToken(OAuthToken value)

public HttpTarget.Builder mergeOauthToken(OAuthToken value)

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Parameter
NameDescription
valueOAuthToken
Returns
TypeDescription
HttpTarget.Builder

mergeOidcToken(OidcToken value)

public HttpTarget.Builder mergeOidcToken(OidcToken value)

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Parameter
NameDescription
valueOidcToken
Returns
TypeDescription
HttpTarget.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final HttpTarget.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
HttpTarget.Builder
Overrides

putAllHeaders(Map<String,String> values)

public HttpTarget.Builder putAllHeaders(Map<String,String> values)

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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
HttpTarget.Builder

putHeaders(String key, String value)

public HttpTarget.Builder putHeaders(String key, String value)

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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
HttpTarget.Builder

removeHeaders(String key)

public HttpTarget.Builder removeHeaders(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.
  • 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. The total size of headers must be less than 80KB.

map<string, string> headers = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
HttpTarget.Builder

setBody(ByteString value)

public HttpTarget.Builder setBody(ByteString value)

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.

bytes body = 4;

Parameter
NameDescription
valueByteString

The body to set.

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public HttpTarget.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
HttpTarget.Builder
Overrides

setHttpMethod(HttpMethod value)

public HttpTarget.Builder setHttpMethod(HttpMethod value)

Which HTTP method to use for the request.

.google.cloud.scheduler.v1.HttpMethod http_method = 2;

Parameter
NameDescription
valueHttpMethod

The httpMethod to set.

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.

setHttpMethodValue(int value)

public HttpTarget.Builder setHttpMethodValue(int value)

Which HTTP method to use for the request.

.google.cloud.scheduler.v1.HttpMethod http_method = 2;

Parameter
NameDescription
valueint

The enum numeric value on the wire for httpMethod to set.

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.

setOauthToken(OAuthToken value)

public HttpTarget.Builder setOauthToken(OAuthToken value)

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Parameter
NameDescription
valueOAuthToken
Returns
TypeDescription
HttpTarget.Builder

setOauthToken(OAuthToken.Builder builderForValue)

public HttpTarget.Builder setOauthToken(OAuthToken.Builder builderForValue)

If specified, an OAuth token 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.v1.OAuthToken oauth_token = 5;

Parameter
NameDescription
builderForValueOAuthToken.Builder
Returns
TypeDescription
HttpTarget.Builder

setOidcToken(OidcToken value)

public HttpTarget.Builder setOidcToken(OidcToken value)

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Parameter
NameDescription
valueOidcToken
Returns
TypeDescription
HttpTarget.Builder

setOidcToken(OidcToken.Builder builderForValue)

public HttpTarget.Builder setOidcToken(OidcToken.Builder builderForValue)

If specified, an OIDC 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.v1.OidcToken oidc_token = 6;

Parameter
NameDescription
builderForValueOidcToken.Builder
Returns
TypeDescription
HttpTarget.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public HttpTarget.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
HttpTarget.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final HttpTarget.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
HttpTarget.Builder
Overrides

setUri(String value)

public HttpTarget.Builder setUri(String value)

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 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;

Parameter
NameDescription
valueString

The uri to set.

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.

setUriBytes(ByteString value)

public HttpTarget.Builder setUriBytes(ByteString value)

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 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;

Parameter
NameDescription
valueByteString

The bytes for uri to set.

Returns
TypeDescription
HttpTarget.Builder

This builder for chaining.