Class JavaScriptUDF.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
com.google.pubsub.v1.JavaScriptUDF.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, JavaScriptUDFOrBuilder, Cloneable
Enclosing class:
JavaScriptUDF

public static final class JavaScriptUDF.Builder extends com.google.protobuf.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
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • clear

      public JavaScriptUDF.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • getDefaultInstanceForType

      public JavaScriptUDF getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public JavaScriptUDF build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public JavaScriptUDF buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public JavaScriptUDF.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • setField

      public JavaScriptUDF.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • clearField

      public JavaScriptUDF.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • clearOneof

      public JavaScriptUDF.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • setRepeatedField

      public JavaScriptUDF.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • addRepeatedField

      public JavaScriptUDF.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • mergeFrom

      public JavaScriptUDF.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<JavaScriptUDF.Builder>
    • mergeFrom

      public JavaScriptUDF.Builder mergeFrom(JavaScriptUDF other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • mergeFrom

      public JavaScriptUDF.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<JavaScriptUDF.Builder>
      Throws:
      IOException
    • 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];
      Specified by:
      getFunctionName in interface JavaScriptUDFOrBuilder
      Returns:
      The functionName.
    • getFunctionNameBytes

      public com.google.protobuf.ByteString getFunctionNameBytes()
       Required. Name of the JavasScript function that should applied to Pub/Sub
       messages.
       
      string function_name = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getFunctionNameBytes in interface JavaScriptUDFOrBuilder
      Returns:
      The bytes for functionName.
    • setFunctionName

      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];
      Parameters:
      value - The functionName to set.
      Returns:
      This builder for chaining.
    • 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:
      This builder for chaining.
    • setFunctionNameBytes

      public JavaScriptUDF.Builder setFunctionNameBytes(com.google.protobuf.ByteString value)
       Required. Name of the JavasScript function that should applied to Pub/Sub
       messages.
       
      string function_name = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for functionName to set.
      Returns:
      This builder for chaining.
    • 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:
         *   - (optional) '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];
      Specified by:
      getCode in interface JavaScriptUDFOrBuilder
      Returns:
      The code.
    • getCodeBytes

      public com.google.protobuf.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:
         *   - (optional) '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];
      Specified by:
      getCodeBytes in interface JavaScriptUDFOrBuilder
      Returns:
      The bytes for code.
    • setCode

      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:
         *   - (optional) '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];
      Parameters:
      value - The code to set.
      Returns:
      This builder for chaining.
    • 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:
         *   - (optional) '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:
      This builder for chaining.
    • setCodeBytes

      public JavaScriptUDF.Builder setCodeBytes(com.google.protobuf.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:
         *   - (optional) '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];
      Parameters:
      value - The bytes for code to set.
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final JavaScriptUDF.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>
    • mergeUnknownFields

      public final JavaScriptUDF.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<JavaScriptUDF.Builder>