- 1.55.0 (latest)
- 1.54.0
- 1.53.0
- 1.52.0
- 1.51.0
- 1.49.0
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.37.0
- 1.36.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.2.4
public static final class Pipeline.Destination.HttpEndpoint.Builder extends GeneratedMessageV3.Builder<Pipeline.Destination.HttpEndpoint.Builder> implements Pipeline.Destination.HttpEndpointOrBuilder
Represents a HTTP endpoint destination.
Protobuf type google.cloud.eventarc.v1.Pipeline.Destination.HttpEndpoint
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > Pipeline.Destination.HttpEndpoint.BuilderImplements
Pipeline.Destination.HttpEndpointOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Pipeline.Destination.HttpEndpoint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
build()
public Pipeline.Destination.HttpEndpoint build()
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint |
buildPartial()
public Pipeline.Destination.HttpEndpoint buildPartial()
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint |
clear()
public Pipeline.Destination.HttpEndpoint.Builder clear()
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
clearField(Descriptors.FieldDescriptor field)
public Pipeline.Destination.HttpEndpoint.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
FieldDescriptor |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
clearMessageBindingTemplate()
public Pipeline.Destination.HttpEndpoint.Builder clearMessageBindingTemplate()
Optional. The CEL expression used to modify how the destination-bound HTTP request is constructed.
If a binding expression is not specified here, the message
is treated as a CloudEvent and is mapped to the HTTP request according
to the CloudEvent HTTP Protocol Binding Binary Content Mode. In this
representation, all fields except the data
and datacontenttype
field on the message are mapped to HTTP request headers with a prefix
of ce-
.
To construct the HTTP request payload and the value of the content-type HTTP header, the payload format is defined as follows: 1) Use the output_payload_format_type on the Pipeline.Destination if it is set, else: 2) Use the input_payload_format_type on the Pipeline if it is set, else: 3) Treat the payload as opaque binary data.
The data
field of the message is converted to the payload format or
left as-is for case 3) and then attached as the payload of the HTTP
request. The content-type
header on the HTTP request is set to the
payload format type or left empty for case 3). However, if a mediation
has updated the datacontenttype
field on the message so that it is
not the same as the payload format type but it is still a prefix of the
payload format type, then the content-type
header on the HTTP request
is set to this datacontenttype
value. For example, if the
datacontenttype
is "application/json" and the payload format type is
"application/json; charset=utf-8", then the content-type
header on
the HTTP request is set to "application/json; charset=utf-8".
If a non-empty binding expression is specified then this expression is used to modify the default CloudEvent HTTP Protocol Binding Binary Content representation. The result of the CEL expression must be a map of key/value pairs which is used as follows:
- If a map named
headers
exists on the result of the expression, then its key/value pairs are directly mapped to the HTTP request headers. The headers values are constructed from the corresponding value type’s canonical representation. If theheaders
field doesn’t exist then the resulting HTTP request will be the headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message. Note: If the specified binding expression, has updated thedatacontenttype
field on the message so that it is not the same as the payload format type but it is still a prefix of the payload format type, then thecontent-type
header in theheaders
map is set to thisdatacontenttype
value. - If a field named
body
exists on the result of the expression then its value is directly mapped to the body of the request. If the value of thebody
field is of type bytes or string then it is used for the HTTP request body as-is, with no conversion. If the body field is of any other type then it is converted to a JSON string. If the body field does not exist then the resulting payload of the HTTP request will be data value of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. Any other fields in the resulting expression will be ignored.
The CEL expression may access the incoming CloudEvent message in its definition, as follows:
- The
data
field of the incoming CloudEvent message can be accessed using themessage.data
value. Subfields ofmessage.data
may also be accessed if an input_payload_format has been specified on the Pipeline. - Each attribute of the incoming CloudEvent message can be accessed
using the
message.<key>
value, where <key> is replaced with the name of the attribute. Existing headers can be accessed in the CEL expression using the
headers
variable. Theheaders
variable defines a map of key/value pairs corresponding to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. For example, the following CEL expression can be used to construct an HTTP request by adding an additional header to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message and by overwriting the body of the request:<code><code> { "headers": headers.merge({"new-header-key": "new-header-value"}), "body": "new-body" } </code></code>
Additionally, the following CEL extension functions are provided for use in this CEL expression:
- toBase64Url:
map.toBase64Url() -> string
- Converts a CelValue to a base64url encoded string
- toJsonString: map.toJsonString() -> string
- Converts a CelValue to a JSON string
- merge:
map1.merge(map2) -> map3
- Merges the passed CEL map with the existing CEL map the function is applied to.
- If the same key exists in both maps, if the key's value is type map both maps are merged else the value from the passed map is used.
- denormalize:
map.denormalize() -> map
- Denormalizes a CEL map such that every value of type map or key in the map is expanded to return a single level map.
- The resulting keys are "." separated indices of the map keys.
- For example: { "a": 1, "b": { "c": 2, "d": 3 } "e": [4, 5] } .denormalize() -> { "a": 1, "b.c": 2, "b.d": 3, "e.0": 4, "e.1": 5 }
- setField:
map.setField(key, value) -> message
- Sets the field of the message with the given key to the given value.
- If the field is not present it will be added.
- If the field is present it will be overwritten.
- The key can be a dot separated path to set a field in a nested message.
- Key must be of type string.
- Value may be any valid type.
- removeFields:
map.removeFields([key1, key2, ...]) -> message
- Removes the fields of the map with the given keys.
- The keys can be a dot separated path to remove a field in a nested message.
- If a key is not found it will be ignored.
- Keys must be of type string.
- toMap:
[map1, map2, ...].toMap() -> map
- Converts a CEL list of CEL maps to a single CEL map
- toDestinationPayloadFormat():
message.data.toDestinationPayloadFormat() -> string or bytes
- Converts the message data to the destination payload format specified in Pipeline.Destination.output_payload_format
- This function is meant to be applied to the message.data field.
- If the destination payload format is not set, the function will return the message data unchanged.
toCloudEventJsonWithPayloadFormat: message.toCloudEventJsonWithPayloadFormat() -> map
- Converts a message to the corresponding structure of JSON format for CloudEvents
- This function applies toDestinationPayloadFormat() to the message data. It also sets the corresponding datacontenttype of the CloudEvent, as indicated by Pipeline.Destination.output_payload_format. If no output_payload_format is set it will use the existing datacontenttype on the CloudEvent if present, else leave datacontenttype absent.
- This function expects that the content of the message will adhere to the standard CloudEvent format. If it doesn’t then this function will fail.
- The result is a CEL map that corresponds to the JSON representation of the CloudEvent. To convert that data to a JSON string it can be chained with the toJsonString function.
The Pipeline expects that the message it receives adheres to the standard CloudEvent format. If it doesn’t then the outgoing message request may fail with a persistent error.
string message_binding_template = 3 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public Pipeline.Destination.HttpEndpoint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof |
OneofDescriptor |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
clearUri()
public Pipeline.Destination.HttpEndpoint.Builder clearUri()
Required. The URI of the HTTP enpdoint.
The value must be a RFC2396 URI string.
Examples: https://svc.us-central1.p.local:8080/route
.
Only the HTTPS protocol is supported.
string uri = 1 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
This builder for chaining. |
clone()
public Pipeline.Destination.HttpEndpoint.Builder clone()
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
getDefaultInstanceForType()
public Pipeline.Destination.HttpEndpoint getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
getMessageBindingTemplate()
public String getMessageBindingTemplate()
Optional. The CEL expression used to modify how the destination-bound HTTP request is constructed.
If a binding expression is not specified here, the message
is treated as a CloudEvent and is mapped to the HTTP request according
to the CloudEvent HTTP Protocol Binding Binary Content Mode. In this
representation, all fields except the data
and datacontenttype
field on the message are mapped to HTTP request headers with a prefix
of ce-
.
To construct the HTTP request payload and the value of the content-type HTTP header, the payload format is defined as follows: 1) Use the output_payload_format_type on the Pipeline.Destination if it is set, else: 2) Use the input_payload_format_type on the Pipeline if it is set, else: 3) Treat the payload as opaque binary data.
The data
field of the message is converted to the payload format or
left as-is for case 3) and then attached as the payload of the HTTP
request. The content-type
header on the HTTP request is set to the
payload format type or left empty for case 3). However, if a mediation
has updated the datacontenttype
field on the message so that it is
not the same as the payload format type but it is still a prefix of the
payload format type, then the content-type
header on the HTTP request
is set to this datacontenttype
value. For example, if the
datacontenttype
is "application/json" and the payload format type is
"application/json; charset=utf-8", then the content-type
header on
the HTTP request is set to "application/json; charset=utf-8".
If a non-empty binding expression is specified then this expression is used to modify the default CloudEvent HTTP Protocol Binding Binary Content representation. The result of the CEL expression must be a map of key/value pairs which is used as follows:
- If a map named
headers
exists on the result of the expression, then its key/value pairs are directly mapped to the HTTP request headers. The headers values are constructed from the corresponding value type’s canonical representation. If theheaders
field doesn’t exist then the resulting HTTP request will be the headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message. Note: If the specified binding expression, has updated thedatacontenttype
field on the message so that it is not the same as the payload format type but it is still a prefix of the payload format type, then thecontent-type
header in theheaders
map is set to thisdatacontenttype
value. - If a field named
body
exists on the result of the expression then its value is directly mapped to the body of the request. If the value of thebody
field is of type bytes or string then it is used for the HTTP request body as-is, with no conversion. If the body field is of any other type then it is converted to a JSON string. If the body field does not exist then the resulting payload of the HTTP request will be data value of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. Any other fields in the resulting expression will be ignored.
The CEL expression may access the incoming CloudEvent message in its definition, as follows:
- The
data
field of the incoming CloudEvent message can be accessed using themessage.data
value. Subfields ofmessage.data
may also be accessed if an input_payload_format has been specified on the Pipeline. - Each attribute of the incoming CloudEvent message can be accessed
using the
message.<key>
value, where <key> is replaced with the name of the attribute. Existing headers can be accessed in the CEL expression using the
headers
variable. Theheaders
variable defines a map of key/value pairs corresponding to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. For example, the following CEL expression can be used to construct an HTTP request by adding an additional header to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message and by overwriting the body of the request:<code><code> { "headers": headers.merge({"new-header-key": "new-header-value"}), "body": "new-body" } </code></code>
Additionally, the following CEL extension functions are provided for use in this CEL expression:
- toBase64Url:
map.toBase64Url() -> string
- Converts a CelValue to a base64url encoded string
- toJsonString: map.toJsonString() -> string
- Converts a CelValue to a JSON string
- merge:
map1.merge(map2) -> map3
- Merges the passed CEL map with the existing CEL map the function is applied to.
- If the same key exists in both maps, if the key's value is type map both maps are merged else the value from the passed map is used.
- denormalize:
map.denormalize() -> map
- Denormalizes a CEL map such that every value of type map or key in the map is expanded to return a single level map.
- The resulting keys are "." separated indices of the map keys.
- For example: { "a": 1, "b": { "c": 2, "d": 3 } "e": [4, 5] } .denormalize() -> { "a": 1, "b.c": 2, "b.d": 3, "e.0": 4, "e.1": 5 }
- setField:
map.setField(key, value) -> message
- Sets the field of the message with the given key to the given value.
- If the field is not present it will be added.
- If the field is present it will be overwritten.
- The key can be a dot separated path to set a field in a nested message.
- Key must be of type string.
- Value may be any valid type.
- removeFields:
map.removeFields([key1, key2, ...]) -> message
- Removes the fields of the map with the given keys.
- The keys can be a dot separated path to remove a field in a nested message.
- If a key is not found it will be ignored.
- Keys must be of type string.
- toMap:
[map1, map2, ...].toMap() -> map
- Converts a CEL list of CEL maps to a single CEL map
- toDestinationPayloadFormat():
message.data.toDestinationPayloadFormat() -> string or bytes
- Converts the message data to the destination payload format specified in Pipeline.Destination.output_payload_format
- This function is meant to be applied to the message.data field.
- If the destination payload format is not set, the function will return the message data unchanged.
toCloudEventJsonWithPayloadFormat: message.toCloudEventJsonWithPayloadFormat() -> map
- Converts a message to the corresponding structure of JSON format for CloudEvents
- This function applies toDestinationPayloadFormat() to the message data. It also sets the corresponding datacontenttype of the CloudEvent, as indicated by Pipeline.Destination.output_payload_format. If no output_payload_format is set it will use the existing datacontenttype on the CloudEvent if present, else leave datacontenttype absent.
- This function expects that the content of the message will adhere to the standard CloudEvent format. If it doesn’t then this function will fail.
- The result is a CEL map that corresponds to the JSON representation of the CloudEvent. To convert that data to a JSON string it can be chained with the toJsonString function.
The Pipeline expects that the message it receives adheres to the standard CloudEvent format. If it doesn’t then the outgoing message request may fail with a persistent error.
string message_binding_template = 3 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
String |
The messageBindingTemplate. |
getMessageBindingTemplateBytes()
public ByteString getMessageBindingTemplateBytes()
Optional. The CEL expression used to modify how the destination-bound HTTP request is constructed.
If a binding expression is not specified here, the message
is treated as a CloudEvent and is mapped to the HTTP request according
to the CloudEvent HTTP Protocol Binding Binary Content Mode. In this
representation, all fields except the data
and datacontenttype
field on the message are mapped to HTTP request headers with a prefix
of ce-
.
To construct the HTTP request payload and the value of the content-type HTTP header, the payload format is defined as follows: 1) Use the output_payload_format_type on the Pipeline.Destination if it is set, else: 2) Use the input_payload_format_type on the Pipeline if it is set, else: 3) Treat the payload as opaque binary data.
The data
field of the message is converted to the payload format or
left as-is for case 3) and then attached as the payload of the HTTP
request. The content-type
header on the HTTP request is set to the
payload format type or left empty for case 3). However, if a mediation
has updated the datacontenttype
field on the message so that it is
not the same as the payload format type but it is still a prefix of the
payload format type, then the content-type
header on the HTTP request
is set to this datacontenttype
value. For example, if the
datacontenttype
is "application/json" and the payload format type is
"application/json; charset=utf-8", then the content-type
header on
the HTTP request is set to "application/json; charset=utf-8".
If a non-empty binding expression is specified then this expression is used to modify the default CloudEvent HTTP Protocol Binding Binary Content representation. The result of the CEL expression must be a map of key/value pairs which is used as follows:
- If a map named
headers
exists on the result of the expression, then its key/value pairs are directly mapped to the HTTP request headers. The headers values are constructed from the corresponding value type’s canonical representation. If theheaders
field doesn’t exist then the resulting HTTP request will be the headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message. Note: If the specified binding expression, has updated thedatacontenttype
field on the message so that it is not the same as the payload format type but it is still a prefix of the payload format type, then thecontent-type
header in theheaders
map is set to thisdatacontenttype
value. - If a field named
body
exists on the result of the expression then its value is directly mapped to the body of the request. If the value of thebody
field is of type bytes or string then it is used for the HTTP request body as-is, with no conversion. If the body field is of any other type then it is converted to a JSON string. If the body field does not exist then the resulting payload of the HTTP request will be data value of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. Any other fields in the resulting expression will be ignored.
The CEL expression may access the incoming CloudEvent message in its definition, as follows:
- The
data
field of the incoming CloudEvent message can be accessed using themessage.data
value. Subfields ofmessage.data
may also be accessed if an input_payload_format has been specified on the Pipeline. - Each attribute of the incoming CloudEvent message can be accessed
using the
message.<key>
value, where <key> is replaced with the name of the attribute. Existing headers can be accessed in the CEL expression using the
headers
variable. Theheaders
variable defines a map of key/value pairs corresponding to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. For example, the following CEL expression can be used to construct an HTTP request by adding an additional header to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message and by overwriting the body of the request:<code><code> { "headers": headers.merge({"new-header-key": "new-header-value"}), "body": "new-body" } </code></code>
Additionally, the following CEL extension functions are provided for use in this CEL expression:
- toBase64Url:
map.toBase64Url() -> string
- Converts a CelValue to a base64url encoded string
- toJsonString: map.toJsonString() -> string
- Converts a CelValue to a JSON string
- merge:
map1.merge(map2) -> map3
- Merges the passed CEL map with the existing CEL map the function is applied to.
- If the same key exists in both maps, if the key's value is type map both maps are merged else the value from the passed map is used.
- denormalize:
map.denormalize() -> map
- Denormalizes a CEL map such that every value of type map or key in the map is expanded to return a single level map.
- The resulting keys are "." separated indices of the map keys.
- For example: { "a": 1, "b": { "c": 2, "d": 3 } "e": [4, 5] } .denormalize() -> { "a": 1, "b.c": 2, "b.d": 3, "e.0": 4, "e.1": 5 }
- setField:
map.setField(key, value) -> message
- Sets the field of the message with the given key to the given value.
- If the field is not present it will be added.
- If the field is present it will be overwritten.
- The key can be a dot separated path to set a field in a nested message.
- Key must be of type string.
- Value may be any valid type.
- removeFields:
map.removeFields([key1, key2, ...]) -> message
- Removes the fields of the map with the given keys.
- The keys can be a dot separated path to remove a field in a nested message.
- If a key is not found it will be ignored.
- Keys must be of type string.
- toMap:
[map1, map2, ...].toMap() -> map
- Converts a CEL list of CEL maps to a single CEL map
- toDestinationPayloadFormat():
message.data.toDestinationPayloadFormat() -> string or bytes
- Converts the message data to the destination payload format specified in Pipeline.Destination.output_payload_format
- This function is meant to be applied to the message.data field.
- If the destination payload format is not set, the function will return the message data unchanged.
toCloudEventJsonWithPayloadFormat: message.toCloudEventJsonWithPayloadFormat() -> map
- Converts a message to the corresponding structure of JSON format for CloudEvents
- This function applies toDestinationPayloadFormat() to the message data. It also sets the corresponding datacontenttype of the CloudEvent, as indicated by Pipeline.Destination.output_payload_format. If no output_payload_format is set it will use the existing datacontenttype on the CloudEvent if present, else leave datacontenttype absent.
- This function expects that the content of the message will adhere to the standard CloudEvent format. If it doesn’t then this function will fail.
- The result is a CEL map that corresponds to the JSON representation of the CloudEvent. To convert that data to a JSON string it can be chained with the toJsonString function.
The Pipeline expects that the message it receives adheres to the standard CloudEvent format. If it doesn’t then the outgoing message request may fail with a persistent error.
string message_binding_template = 3 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for messageBindingTemplate. |
getUri()
public String getUri()
Required. The URI of the HTTP enpdoint.
The value must be a RFC2396 URI string.
Examples: https://svc.us-central1.p.local:8080/route
.
Only the HTTPS protocol is supported.
string uri = 1 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
String |
The uri. |
getUriBytes()
public ByteString getUriBytes()
Required. The URI of the HTTP enpdoint.
The value must be a RFC2396 URI string.
Examples: https://svc.us-central1.p.local:8080/route
.
Only the HTTPS protocol is supported.
string uri = 1 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for uri. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeFrom(Pipeline.Destination.HttpEndpoint other)
public Pipeline.Destination.HttpEndpoint.Builder mergeFrom(Pipeline.Destination.HttpEndpoint other)
Parameter | |
---|---|
Name | Description |
other |
Pipeline.Destination.HttpEndpoint |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Pipeline.Destination.HttpEndpoint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public Pipeline.Destination.HttpEndpoint.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other |
Message |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Pipeline.Destination.HttpEndpoint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
setField(Descriptors.FieldDescriptor field, Object value)
public Pipeline.Destination.HttpEndpoint.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
setMessageBindingTemplate(String value)
public Pipeline.Destination.HttpEndpoint.Builder setMessageBindingTemplate(String value)
Optional. The CEL expression used to modify how the destination-bound HTTP request is constructed.
If a binding expression is not specified here, the message
is treated as a CloudEvent and is mapped to the HTTP request according
to the CloudEvent HTTP Protocol Binding Binary Content Mode. In this
representation, all fields except the data
and datacontenttype
field on the message are mapped to HTTP request headers with a prefix
of ce-
.
To construct the HTTP request payload and the value of the content-type HTTP header, the payload format is defined as follows: 1) Use the output_payload_format_type on the Pipeline.Destination if it is set, else: 2) Use the input_payload_format_type on the Pipeline if it is set, else: 3) Treat the payload as opaque binary data.
The data
field of the message is converted to the payload format or
left as-is for case 3) and then attached as the payload of the HTTP
request. The content-type
header on the HTTP request is set to the
payload format type or left empty for case 3). However, if a mediation
has updated the datacontenttype
field on the message so that it is
not the same as the payload format type but it is still a prefix of the
payload format type, then the content-type
header on the HTTP request
is set to this datacontenttype
value. For example, if the
datacontenttype
is "application/json" and the payload format type is
"application/json; charset=utf-8", then the content-type
header on
the HTTP request is set to "application/json; charset=utf-8".
If a non-empty binding expression is specified then this expression is used to modify the default CloudEvent HTTP Protocol Binding Binary Content representation. The result of the CEL expression must be a map of key/value pairs which is used as follows:
- If a map named
headers
exists on the result of the expression, then its key/value pairs are directly mapped to the HTTP request headers. The headers values are constructed from the corresponding value type’s canonical representation. If theheaders
field doesn’t exist then the resulting HTTP request will be the headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message. Note: If the specified binding expression, has updated thedatacontenttype
field on the message so that it is not the same as the payload format type but it is still a prefix of the payload format type, then thecontent-type
header in theheaders
map is set to thisdatacontenttype
value. - If a field named
body
exists on the result of the expression then its value is directly mapped to the body of the request. If the value of thebody
field is of type bytes or string then it is used for the HTTP request body as-is, with no conversion. If the body field is of any other type then it is converted to a JSON string. If the body field does not exist then the resulting payload of the HTTP request will be data value of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. Any other fields in the resulting expression will be ignored.
The CEL expression may access the incoming CloudEvent message in its definition, as follows:
- The
data
field of the incoming CloudEvent message can be accessed using themessage.data
value. Subfields ofmessage.data
may also be accessed if an input_payload_format has been specified on the Pipeline. - Each attribute of the incoming CloudEvent message can be accessed
using the
message.<key>
value, where <key> is replaced with the name of the attribute. Existing headers can be accessed in the CEL expression using the
headers
variable. Theheaders
variable defines a map of key/value pairs corresponding to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. For example, the following CEL expression can be used to construct an HTTP request by adding an additional header to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message and by overwriting the body of the request:<code><code> { "headers": headers.merge({"new-header-key": "new-header-value"}), "body": "new-body" } </code></code>
Additionally, the following CEL extension functions are provided for use in this CEL expression:
- toBase64Url:
map.toBase64Url() -> string
- Converts a CelValue to a base64url encoded string
- toJsonString: map.toJsonString() -> string
- Converts a CelValue to a JSON string
- merge:
map1.merge(map2) -> map3
- Merges the passed CEL map with the existing CEL map the function is applied to.
- If the same key exists in both maps, if the key's value is type map both maps are merged else the value from the passed map is used.
- denormalize:
map.denormalize() -> map
- Denormalizes a CEL map such that every value of type map or key in the map is expanded to return a single level map.
- The resulting keys are "." separated indices of the map keys.
- For example: { "a": 1, "b": { "c": 2, "d": 3 } "e": [4, 5] } .denormalize() -> { "a": 1, "b.c": 2, "b.d": 3, "e.0": 4, "e.1": 5 }
- setField:
map.setField(key, value) -> message
- Sets the field of the message with the given key to the given value.
- If the field is not present it will be added.
- If the field is present it will be overwritten.
- The key can be a dot separated path to set a field in a nested message.
- Key must be of type string.
- Value may be any valid type.
- removeFields:
map.removeFields([key1, key2, ...]) -> message
- Removes the fields of the map with the given keys.
- The keys can be a dot separated path to remove a field in a nested message.
- If a key is not found it will be ignored.
- Keys must be of type string.
- toMap:
[map1, map2, ...].toMap() -> map
- Converts a CEL list of CEL maps to a single CEL map
- toDestinationPayloadFormat():
message.data.toDestinationPayloadFormat() -> string or bytes
- Converts the message data to the destination payload format specified in Pipeline.Destination.output_payload_format
- This function is meant to be applied to the message.data field.
- If the destination payload format is not set, the function will return the message data unchanged.
toCloudEventJsonWithPayloadFormat: message.toCloudEventJsonWithPayloadFormat() -> map
- Converts a message to the corresponding structure of JSON format for CloudEvents
- This function applies toDestinationPayloadFormat() to the message data. It also sets the corresponding datacontenttype of the CloudEvent, as indicated by Pipeline.Destination.output_payload_format. If no output_payload_format is set it will use the existing datacontenttype on the CloudEvent if present, else leave datacontenttype absent.
- This function expects that the content of the message will adhere to the standard CloudEvent format. If it doesn’t then this function will fail.
- The result is a CEL map that corresponds to the JSON representation of the CloudEvent. To convert that data to a JSON string it can be chained with the toJsonString function.
The Pipeline expects that the message it receives adheres to the standard CloudEvent format. If it doesn’t then the outgoing message request may fail with a persistent error.
string message_binding_template = 3 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
value |
String The messageBindingTemplate to set. |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
This builder for chaining. |
setMessageBindingTemplateBytes(ByteString value)
public Pipeline.Destination.HttpEndpoint.Builder setMessageBindingTemplateBytes(ByteString value)
Optional. The CEL expression used to modify how the destination-bound HTTP request is constructed.
If a binding expression is not specified here, the message
is treated as a CloudEvent and is mapped to the HTTP request according
to the CloudEvent HTTP Protocol Binding Binary Content Mode. In this
representation, all fields except the data
and datacontenttype
field on the message are mapped to HTTP request headers with a prefix
of ce-
.
To construct the HTTP request payload and the value of the content-type HTTP header, the payload format is defined as follows: 1) Use the output_payload_format_type on the Pipeline.Destination if it is set, else: 2) Use the input_payload_format_type on the Pipeline if it is set, else: 3) Treat the payload as opaque binary data.
The data
field of the message is converted to the payload format or
left as-is for case 3) and then attached as the payload of the HTTP
request. The content-type
header on the HTTP request is set to the
payload format type or left empty for case 3). However, if a mediation
has updated the datacontenttype
field on the message so that it is
not the same as the payload format type but it is still a prefix of the
payload format type, then the content-type
header on the HTTP request
is set to this datacontenttype
value. For example, if the
datacontenttype
is "application/json" and the payload format type is
"application/json; charset=utf-8", then the content-type
header on
the HTTP request is set to "application/json; charset=utf-8".
If a non-empty binding expression is specified then this expression is used to modify the default CloudEvent HTTP Protocol Binding Binary Content representation. The result of the CEL expression must be a map of key/value pairs which is used as follows:
- If a map named
headers
exists on the result of the expression, then its key/value pairs are directly mapped to the HTTP request headers. The headers values are constructed from the corresponding value type’s canonical representation. If theheaders
field doesn’t exist then the resulting HTTP request will be the headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message. Note: If the specified binding expression, has updated thedatacontenttype
field on the message so that it is not the same as the payload format type but it is still a prefix of the payload format type, then thecontent-type
header in theheaders
map is set to thisdatacontenttype
value. - If a field named
body
exists on the result of the expression then its value is directly mapped to the body of the request. If the value of thebody
field is of type bytes or string then it is used for the HTTP request body as-is, with no conversion. If the body field is of any other type then it is converted to a JSON string. If the body field does not exist then the resulting payload of the HTTP request will be data value of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. Any other fields in the resulting expression will be ignored.
The CEL expression may access the incoming CloudEvent message in its definition, as follows:
- The
data
field of the incoming CloudEvent message can be accessed using themessage.data
value. Subfields ofmessage.data
may also be accessed if an input_payload_format has been specified on the Pipeline. - Each attribute of the incoming CloudEvent message can be accessed
using the
message.<key>
value, where <key> is replaced with the name of the attribute. Existing headers can be accessed in the CEL expression using the
headers
variable. Theheaders
variable defines a map of key/value pairs corresponding to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message as described earlier. For example, the following CEL expression can be used to construct an HTTP request by adding an additional header to the HTTP headers of the CloudEvent HTTP Binding Binary Content Mode representation of the final message and by overwriting the body of the request:<code><code> { "headers": headers.merge({"new-header-key": "new-header-value"}), "body": "new-body" } </code></code>
Additionally, the following CEL extension functions are provided for use in this CEL expression:
- toBase64Url:
map.toBase64Url() -> string
- Converts a CelValue to a base64url encoded string
- toJsonString: map.toJsonString() -> string
- Converts a CelValue to a JSON string
- merge:
map1.merge(map2) -> map3
- Merges the passed CEL map with the existing CEL map the function is applied to.
- If the same key exists in both maps, if the key's value is type map both maps are merged else the value from the passed map is used.
- denormalize:
map.denormalize() -> map
- Denormalizes a CEL map such that every value of type map or key in the map is expanded to return a single level map.
- The resulting keys are "." separated indices of the map keys.
- For example: { "a": 1, "b": { "c": 2, "d": 3 } "e": [4, 5] } .denormalize() -> { "a": 1, "b.c": 2, "b.d": 3, "e.0": 4, "e.1": 5 }
- setField:
map.setField(key, value) -> message
- Sets the field of the message with the given key to the given value.
- If the field is not present it will be added.
- If the field is present it will be overwritten.
- The key can be a dot separated path to set a field in a nested message.
- Key must be of type string.
- Value may be any valid type.
- removeFields:
map.removeFields([key1, key2, ...]) -> message
- Removes the fields of the map with the given keys.
- The keys can be a dot separated path to remove a field in a nested message.
- If a key is not found it will be ignored.
- Keys must be of type string.
- toMap:
[map1, map2, ...].toMap() -> map
- Converts a CEL list of CEL maps to a single CEL map
- toDestinationPayloadFormat():
message.data.toDestinationPayloadFormat() -> string or bytes
- Converts the message data to the destination payload format specified in Pipeline.Destination.output_payload_format
- This function is meant to be applied to the message.data field.
- If the destination payload format is not set, the function will return the message data unchanged.
toCloudEventJsonWithPayloadFormat: message.toCloudEventJsonWithPayloadFormat() -> map
- Converts a message to the corresponding structure of JSON format for CloudEvents
- This function applies toDestinationPayloadFormat() to the message data. It also sets the corresponding datacontenttype of the CloudEvent, as indicated by Pipeline.Destination.output_payload_format. If no output_payload_format is set it will use the existing datacontenttype on the CloudEvent if present, else leave datacontenttype absent.
- This function expects that the content of the message will adhere to the standard CloudEvent format. If it doesn’t then this function will fail.
- The result is a CEL map that corresponds to the JSON representation of the CloudEvent. To convert that data to a JSON string it can be chained with the toJsonString function.
The Pipeline expects that the message it receives adheres to the standard CloudEvent format. If it doesn’t then the outgoing message request may fail with a persistent error.
string message_binding_template = 3 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for messageBindingTemplate to set. |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Pipeline.Destination.HttpEndpoint.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final Pipeline.Destination.HttpEndpoint.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
setUri(String value)
public Pipeline.Destination.HttpEndpoint.Builder setUri(String value)
Required. The URI of the HTTP enpdoint.
The value must be a RFC2396 URI string.
Examples: https://svc.us-central1.p.local:8080/route
.
Only the HTTPS protocol is supported.
string uri = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
value |
String The uri to set. |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
This builder for chaining. |
setUriBytes(ByteString value)
public Pipeline.Destination.HttpEndpoint.Builder setUriBytes(ByteString value)
Required. The URI of the HTTP enpdoint.
The value must be a RFC2396 URI string.
Examples: https://svc.us-central1.p.local:8080/route
.
Only the HTTPS protocol is supported.
string uri = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for uri to set. |
Returns | |
---|---|
Type | Description |
Pipeline.Destination.HttpEndpoint.Builder |
This builder for chaining. |