Cloud Pub/Sub V1 API - Class Google::Cloud::PubSub::V1::JavaScriptUDF (v1.7.0)

Reference documentation and code samples for the Cloud Pub/Sub V1 API class Google::Cloud::PubSub::V1::JavaScriptUDF.

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

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#code

def code() -> ::String
Returns
  • (::String) — Required. JavaScript code that contains a function function_name with the below signature:

    /**

    • Transforms a Pub/Sub message.

    • @return {(Object

    • filter a message, return null. To transform a message return a map

    • with the following keys:

      • (required) 'data' : {string}
      • (optional) 'attributes' : {Object
    • Returning empty attributes will remove all attributes from the

    • message. *

    • @param {(Object

    • message. Keys:

      • (required) 'data' : {string}
      • (required) 'attributes' : {Object
    • @param {Object

    • Keys:

      • (required) 'message_id' : {string}
      • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
      • (optional) 'ordering_key': {string} */

    function

#code=

def code=(value) -> ::String
Parameter
  • value (::String) — Required. JavaScript code that contains a function function_name with the below signature:

    /**

    • Transforms a Pub/Sub message.

    • @return {(Object

    • filter a message, return null. To transform a message return a map

    • with the following keys:

      • (required) 'data' : {string}
      • (optional) 'attributes' : {Object
    • Returning empty attributes will remove all attributes from the

    • message. *

    • @param {(Object

    • message. Keys:

      • (required) 'data' : {string}
      • (required) 'attributes' : {Object
    • @param {Object

    • Keys:

      • (required) 'message_id' : {string}
      • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
      • (optional) 'ordering_key': {string} */

    function

Returns
  • (::String) — Required. JavaScript code that contains a function function_name with the below signature:

    /**

    • Transforms a Pub/Sub message.

    • @return {(Object

    • filter a message, return null. To transform a message return a map

    • with the following keys:

      • (required) 'data' : {string}
      • (optional) 'attributes' : {Object
    • Returning empty attributes will remove all attributes from the

    • message. *

    • @param {(Object

    • message. Keys:

      • (required) 'data' : {string}
      • (required) 'attributes' : {Object
    • @param {Object

    • Keys:

      • (required) 'message_id' : {string}
      • (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
      • (optional) 'ordering_key': {string} */

    function

#function_name

def function_name() -> ::String
Returns
  • (::String) — Required. Name of the JavasScript function that should applied to Pub/Sub messages.

#function_name=

def function_name=(value) -> ::String
Parameter
  • value (::String) — Required. Name of the JavasScript function that should applied to Pub/Sub messages.
Returns
  • (::String) — Required. Name of the JavasScript function that should applied to Pub/Sub messages.