Class Pipeline.Mediation.Transformation (1.55.0)

public static final class Pipeline.Mediation.Transformation extends GeneratedMessageV3 implements Pipeline.Mediation.TransformationOrBuilder

Transformation defines the way to transform an incoming message.

Protobuf type google.cloud.eventarc.v1.Pipeline.Mediation.Transformation

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > Pipeline.Mediation.Transformation

Static Fields

TRANSFORMATION_TEMPLATE_FIELD_NUMBER

public static final int TRANSFORMATION_TEMPLATE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Pipeline.Mediation.Transformation getDefaultInstance()
Returns
TypeDescription
Pipeline.Mediation.Transformation

getDescriptor()

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

newBuilder()

public static Pipeline.Mediation.Transformation.Builder newBuilder()
Returns
TypeDescription
Pipeline.Mediation.Transformation.Builder

newBuilder(Pipeline.Mediation.Transformation )

public static Pipeline.Mediation.Transformation.Builder newBuilder(Pipeline.Mediation.Transformation )
Parameter
NameDescription
Pipeline.Mediation.Transformation
Returns
TypeDescription
Pipeline.Mediation.Transformation.Builder

parseDelimitedFrom(InputStream input)

public static Pipeline.Mediation.Transformation parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Pipeline.Mediation.Transformation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Pipeline.Mediation.Transformation parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Pipeline.Mediation.Transformation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Pipeline.Mediation.Transformation parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Pipeline.Mediation.Transformation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Pipeline.Mediation.Transformation parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Pipeline.Mediation.Transformation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Pipeline.Mediation.Transformation parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Pipeline.Mediation.Transformation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Pipeline.Mediation.Transformation parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Pipeline.Mediation.Transformation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Pipeline.Mediation.Transformation
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Pipeline.Mediation.Transformation> parser()
Returns
TypeDescription
Parser<Transformation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Pipeline.Mediation.Transformation getDefaultInstanceForType()
Returns
TypeDescription
Pipeline.Mediation.Transformation

getParserForType()

public Parser<Pipeline.Mediation.Transformation> getParserForType()
Returns
TypeDescription
Parser<Transformation>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getTransformationTemplate()

public String getTransformationTemplate()

Optional. The CEL expression template to apply to transform messages. The following CEL extension functions are provided for use in this CEL expression:

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

string transformation_template = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The transformationTemplate.

getTransformationTemplateBytes()

public ByteString getTransformationTemplateBytes()

Optional. The CEL expression template to apply to transform messages. The following CEL extension functions are provided for use in this CEL expression:

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

string transformation_template = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for transformationTemplate.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Pipeline.Mediation.Transformation.Builder newBuilderForType()
Returns
TypeDescription
Pipeline.Mediation.Transformation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Pipeline.Mediation.Transformation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Pipeline.Mediation.Transformation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Pipeline.Mediation.Transformation.Builder toBuilder()
Returns
TypeDescription
Pipeline.Mediation.Transformation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException