Struct google_api_proto::google::cloud::tasks::v2beta2::HttpTarget
source · pub struct HttpTarget {
pub uri_override: Option<UriOverride>,
pub http_method: i32,
pub header_overrides: Vec<HeaderOverride>,
pub authorization_header: Option<AuthorizationHeader>,
}
Expand description
HTTP target.
When specified as a [Queue][target_type], all the tasks with [HttpRequest] will be overridden according to the target.
Fields§
§uri_override: Option<UriOverride>
Uri override.
When specified, overrides the execution Uri for all the tasks in the queue.
http_method: i32
The HTTP method to use for the request.
When specified, it overrides [HttpRequest][google.cloud.tasks.v2beta2.HttpTarget.http_method] for the task. Note that if the value is set to [HttpMethod][GET] the [HttpRequest][body] of the task will be ignored at execution time.
header_overrides: Vec<HeaderOverride>
HTTP target headers.
This map contains the header field names and values. Headers will be set when running the [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] and/or [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask].
These headers represent a subset of the headers that will accompany the task’s HTTP request. Some HTTP request headers will be ignored or replaced.
A partial list of headers that will be ignored or replaced is:
- Any header that is prefixed with “X-CloudTasks-” will be treated as service header. Service headers define properties of the task and are predefined in CloudTask.
- Host: This will be computed by Cloud Tasks and derived from [HttpRequest.url][google.cloud.tasks.v2beta2.HttpRequest.url].
- Content-Length: This will be computed by Cloud Tasks.
- User-Agent: This will be set to
"Google-CloudTasks"
. X-Google-*
: Google use only.X-AppEngine-*
: Google use only.
Content-Type
won’t be set by Cloud Tasks. You can explicitly set
Content-Type
to a media type when the
[task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
For example, Content-Type
can be set to "application/octet-stream"
or
"application/json"
.
Headers which can have multiple values (according to RFC2616) can be specified using comma-separated values.
The size of the headers must be less than 80KB. Queue-level headers to override headers of all the tasks in the queue.
The mode for generating an Authorization
header for HTTP requests.
If specified, all Authorization
headers in the
[HttpRequest.headers][google.cloud.tasks.v2beta2.HttpRequest.headers] field
will be overridden.
Implementations§
source§impl HttpTarget
impl HttpTarget
sourcepub fn http_method(&self) -> HttpMethod
pub fn http_method(&self) -> HttpMethod
Returns the enum value of http_method
, or the default if the field is set to an invalid enum value.
sourcepub fn set_http_method(&mut self, value: HttpMethod)
pub fn set_http_method(&mut self, value: HttpMethod)
Sets http_method
to the provided enum value.
Trait Implementations§
source§impl Clone for HttpTarget
impl Clone for HttpTarget
source§fn clone(&self) -> HttpTarget
fn clone(&self) -> HttpTarget
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HttpTarget
impl Debug for HttpTarget
source§impl Default for HttpTarget
impl Default for HttpTarget
source§impl Message for HttpTarget
impl Message for HttpTarget
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for HttpTarget
impl PartialEq for HttpTarget
source§fn eq(&self, other: &HttpTarget) -> bool
fn eq(&self, other: &HttpTarget) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for HttpTarget
Auto Trait Implementations§
impl Freeze for HttpTarget
impl RefUnwindSafe for HttpTarget
impl Send for HttpTarget
impl Sync for HttpTarget
impl Unpin for HttpTarget
impl UnwindSafe for HttpTarget
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request