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-  (::String) — Required. JavaScript code that contains a function function_namewith 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 - attributeswill remove all attributes from the
- message. * 
- @param {(Object 
- message. Keys: 
- (required) 'data' : {string}
 
- (required) 'attributes' : {Object
 
- @param {Object 
- Keys: 
- (optional) 'message_id' : {string}
 
- (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
 
- (optional) 'ordering_key': {string} */
 
 function 
#code=
def code=(value) -> ::String-  value (::String) — Required. JavaScript code that contains a function function_namewith 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 - attributeswill remove all attributes from the
- message. * 
- @param {(Object 
- message. Keys: 
- (required) 'data' : {string}
 
- (required) 'attributes' : {Object
 
- @param {Object 
- Keys: 
- (optional) 'message_id' : {string}
 
- (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
 
- (optional) 'ordering_key': {string} */
 
 function 
-  (::String) — Required. JavaScript code that contains a function function_namewith 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 - attributeswill remove all attributes from the
- message. * 
- @param {(Object 
- message. Keys: 
- (required) 'data' : {string}
 
- (required) 'attributes' : {Object
 
- @param {Object 
- Keys: 
- (optional) 'message_id' : {string}
 
- (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
 
- (optional) 'ordering_key': {string} */
 
 function 
#function_name
def function_name() -> ::String- (::String) — Required. Name of the JavasScript function that should applied to Pub/Sub messages.
#function_name=
def function_name=(value) -> ::String- value (::String) — Required. Name of the JavasScript function that should applied to Pub/Sub messages.
- (::String) — Required. Name of the JavasScript function that should applied to Pub/Sub messages.