Class JavaScriptUDF.Builder (1.137.0)

public static final class JavaScriptUDF.Builder extends GeneratedMessageV3.Builder<JavaScriptUDF.Builder> implements JavaScriptUDFOrBuilder

User-defined JavaScript function that can transform or filter a Pub/Sub message.

Protobuf type google.pubsub.v1.JavaScriptUDF

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public JavaScriptUDF.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
JavaScriptUDF.Builder
Overrides

build()

public JavaScriptUDF build()
Returns
Type Description
JavaScriptUDF

buildPartial()

public JavaScriptUDF buildPartial()
Returns
Type Description
JavaScriptUDF

clear()

public JavaScriptUDF.Builder clear()
Returns
Type Description
JavaScriptUDF.Builder
Overrides

clearCode()

public JavaScriptUDF.Builder clearCode()

Required. JavaScript code that contains a function function_name with the below signature:

` /**

  • Transforms a Pub/Sub message.

  • @return {(Object<string, (string | Object<string, string>)>|null)} - To

  • filter a message, return
null. To transform a message return a map
  • with the following keys:
    • (required) 'data' : {string}
    • (optional) 'attributes' : {Object<string, string>}
  • Returning empty
  • attributes will remove all attributes from the
  • message. *
  • @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
  • message. Keys:
    • (required) 'data' : {string}
    • (required) 'attributes' : {Object<string, string>} *
  • @param {Object<string, any>} metadata - Pub/Sub message metadata.
  • Keys:
    • (required) 'message_id' : {string}
    • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
    • (optional) 'ordering_key': {string} */

    function <function_name>(message, metadata) { }

  • `

    string code = 2 [(.google.api.field_behavior) = REQUIRED];

    Returns
    Type Description
    JavaScriptUDF.Builder

    This builder for chaining.

    clearField(Descriptors.FieldDescriptor field)

    public JavaScriptUDF.Builder clearField(Descriptors.FieldDescriptor field)
    Parameter
    Name Description
    field FieldDescriptor
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides

    clearFunctionName()

    public JavaScriptUDF.Builder clearFunctionName()

    Required. Name of the JavasScript function that should applied to Pub/Sub messages.

    string function_name = 1 [(.google.api.field_behavior) = REQUIRED];

    Returns
    Type Description
    JavaScriptUDF.Builder

    This builder for chaining.

    clearOneof(Descriptors.OneofDescriptor oneof)

    public JavaScriptUDF.Builder clearOneof(Descriptors.OneofDescriptor oneof)
    Parameter
    Name Description
    oneof OneofDescriptor
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides

    clone()

    public JavaScriptUDF.Builder clone()
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides

    getCode()

    public String getCode()

    Required. JavaScript code that contains a function function_name with the below signature:

    ` /**

    • Transforms a Pub/Sub message.

    • @return {(Object<string, (string | Object<string, string>)>|null)} - To

    • filter a message, return
    null. To transform a message return a map
  • with the following keys:
    • (required) 'data' : {string}
    • (optional) 'attributes' : {Object<string, string>}
  • Returning empty
  • attributes will remove all attributes from the
  • message. *
  • @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
  • message. Keys:
    • (required) 'data' : {string}
    • (required) 'attributes' : {Object<string, string>} *
  • @param {Object<string, any>} metadata - Pub/Sub message metadata.
  • Keys:
    • (required) 'message_id' : {string}
    • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
    • (optional) 'ordering_key': {string} */

    function <function_name>(message, metadata) { }

  • `

    string code = 2 [(.google.api.field_behavior) = REQUIRED];

    Returns
    Type Description
    String

    The code.

    getCodeBytes()

    public ByteString getCodeBytes()

    Required. JavaScript code that contains a function function_name with the below signature:

    ` /**

    • Transforms a Pub/Sub message.

    • @return {(Object<string, (string | Object<string, string>)>|null)} - To

    • filter a message, return
    null. To transform a message return a map
  • with the following keys:
    • (required) 'data' : {string}
    • (optional) 'attributes' : {Object<string, string>}
  • Returning empty
  • attributes will remove all attributes from the
  • message. *
  • @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
  • message. Keys:
    • (required) 'data' : {string}
    • (required) 'attributes' : {Object<string, string>} *
  • @param {Object<string, any>} metadata - Pub/Sub message metadata.
  • Keys:
    • (required) 'message_id' : {string}
    • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
    • (optional) 'ordering_key': {string} */

    function <function_name>(message, metadata) { }

  • `

    string code = 2 [(.google.api.field_behavior) = REQUIRED];

    Returns
    Type Description
    ByteString

    The bytes for code.

    getDefaultInstanceForType()

    public JavaScriptUDF getDefaultInstanceForType()
    Returns
    Type Description
    JavaScriptUDF

    getDescriptorForType()

    public Descriptors.Descriptor getDescriptorForType()
    Returns
    Type Description
    Descriptor
    Overrides

    getFunctionName()

    public String getFunctionName()

    Required. Name of the JavasScript function that should applied to Pub/Sub messages.

    string function_name = 1 [(.google.api.field_behavior) = REQUIRED];

    Returns
    Type Description
    String

    The functionName.

    getFunctionNameBytes()

    public ByteString getFunctionNameBytes()

    Required. Name of the JavasScript function that should applied to Pub/Sub messages.

    string function_name = 1 [(.google.api.field_behavior) = REQUIRED];

    Returns
    Type Description
    ByteString

    The bytes for functionName.

    internalGetFieldAccessorTable()

    protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
    Returns
    Type Description
    FieldAccessorTable
    Overrides

    isInitialized()

    public final boolean isInitialized()
    Returns
    Type Description
    boolean
    Overrides

    mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

    public JavaScriptUDF.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
    Parameters
    Name Description
    input CodedInputStream
    extensionRegistry ExtensionRegistryLite
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides
    Exceptions
    Type Description
    IOException

    mergeFrom(Message other)

    public JavaScriptUDF.Builder mergeFrom(Message other)
    Parameter
    Name Description
    other Message
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides

    mergeFrom(JavaScriptUDF other)

    public JavaScriptUDF.Builder mergeFrom(JavaScriptUDF other)
    Parameter
    Name Description
    other JavaScriptUDF
    Returns
    Type Description
    JavaScriptUDF.Builder

    mergeUnknownFields(UnknownFieldSet unknownFields)

    public final JavaScriptUDF.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
    Parameter
    Name Description
    unknownFields UnknownFieldSet
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides

    setCode(String value)

    public JavaScriptUDF.Builder setCode(String value)

    Required. JavaScript code that contains a function function_name with the below signature:

    ` /**

    • Transforms a Pub/Sub message.

    • @return {(Object<string, (string | Object<string, string>)>|null)} - To

    • filter a message, return
    null. To transform a message return a map
  • with the following keys:
    • (required) 'data' : {string}
    • (optional) 'attributes' : {Object<string, string>}
  • Returning empty
  • attributes will remove all attributes from the
  • message. *
  • @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
  • message. Keys:
    • (required) 'data' : {string}
    • (required) 'attributes' : {Object<string, string>} *
  • @param {Object<string, any>} metadata - Pub/Sub message metadata.
  • Keys:
    • (required) 'message_id' : {string}
    • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
    • (optional) 'ordering_key': {string} */

    function <function_name>(message, metadata) { }

  • `

    string code = 2 [(.google.api.field_behavior) = REQUIRED];

    Parameter
    Name Description
    value String

    The code to set.

    Returns
    Type Description
    JavaScriptUDF.Builder

    This builder for chaining.

    setCodeBytes(ByteString value)

    public JavaScriptUDF.Builder setCodeBytes(ByteString value)

    Required. JavaScript code that contains a function function_name with the below signature:

    ` /**

    • Transforms a Pub/Sub message.

    • @return {(Object<string, (string | Object<string, string>)>|null)} - To

    • filter a message, return
    null. To transform a message return a map
  • with the following keys:
    • (required) 'data' : {string}
    • (optional) 'attributes' : {Object<string, string>}
  • Returning empty
  • attributes will remove all attributes from the
  • message. *
  • @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
  • message. Keys:
    • (required) 'data' : {string}
    • (required) 'attributes' : {Object<string, string>} *
  • @param {Object<string, any>} metadata - Pub/Sub message metadata.
  • Keys:
    • (required) 'message_id' : {string}
    • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
    • (optional) 'ordering_key': {string} */

    function <function_name>(message, metadata) { }

  • `

    string code = 2 [(.google.api.field_behavior) = REQUIRED];

    Parameter
    Name Description
    value ByteString

    The bytes for code to set.

    Returns
    Type Description
    JavaScriptUDF.Builder

    This builder for chaining.

    setField(Descriptors.FieldDescriptor field, Object value)

    public JavaScriptUDF.Builder setField(Descriptors.FieldDescriptor field, Object value)
    Parameters
    Name Description
    field FieldDescriptor
    value Object
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides

    setFunctionName(String value)

    public JavaScriptUDF.Builder setFunctionName(String value)

    Required. Name of the JavasScript function that should applied to Pub/Sub messages.

    string function_name = 1 [(.google.api.field_behavior) = REQUIRED];

    Parameter
    Name Description
    value String

    The functionName to set.

    Returns
    Type Description
    JavaScriptUDF.Builder

    This builder for chaining.

    setFunctionNameBytes(ByteString value)

    public JavaScriptUDF.Builder setFunctionNameBytes(ByteString value)

    Required. Name of the JavasScript function that should applied to Pub/Sub messages.

    string function_name = 1 [(.google.api.field_behavior) = REQUIRED];

    Parameter
    Name Description
    value ByteString

    The bytes for functionName to set.

    Returns
    Type Description
    JavaScriptUDF.Builder

    This builder for chaining.

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

    public JavaScriptUDF.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
    Parameters
    Name Description
    field FieldDescriptor
    index int
    value Object
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides

    setUnknownFields(UnknownFieldSet unknownFields)

    public final JavaScriptUDF.Builder setUnknownFields(UnknownFieldSet unknownFields)
    Parameter
    Name Description
    unknownFields UnknownFieldSet
    Returns
    Type Description
    JavaScriptUDF.Builder
    Overrides