Analytics Hub V1 API - Class Google::Cloud::Bigquery::AnalyticsHub::V1::JavaScriptUDF (v0.14.0)
Stay organized with collections
Save and categorize content based on your preferences.
Reference documentation and code samples for the Analytics Hub V1 API class Google::Cloud::Bigquery::AnalyticsHub::V1::JavaScriptUDF.
User-defined JavaScript function that can transform or filter a Pub/Sub
message.
Extended By
-
Google::Protobuf::MessageExts::ClassMethods
Includes
-
Google::Protobuf::MessageExts
Methods
#code
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Analytics Hub V1 API - Class Google::Cloud::Bigquery::AnalyticsHub::V1::JavaScriptUDF (v0.13.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.13.1 (latest)](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/latest/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.13.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.13.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.12.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.12.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.11.1](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.11.1/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.10.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.10.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.9.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.9.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.8.1](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.8.1/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.7.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.7.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.6.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.6.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.5.2](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.5.2/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.4.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.4.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.3.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.3.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.2.1](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.2.1/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF)\n- [0.1.0](/ruby/docs/reference/google-cloud-bigquery-analytics_hub-v1/0.1.0/Google-Cloud-Bigquery-AnalyticsHub-V1-JavaScriptUDF) \nReference documentation and code samples for the Analytics Hub V1 API class Google::Cloud::Bigquery::AnalyticsHub::V1::JavaScriptUDF.\n\nUser-defined JavaScript function that can transform or filter a Pub/Sub\nmessage. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #code\n\n def code() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. JavaScript code that contains a function `function_name` with the below signature:\n\n\n \\`\\`\\`\n /\\*\\*\n - Transforms a Pub/Sub message.\n\n - @return {(Object\n\n \u003cbr /\u003e\n\n - filter a message, return `null`. To transform a message return a map\n\n - with the following keys:\n\n -\n - (required) 'data' : {string}\n -\n - (optional) 'attributes' : {Object\n - Returning empty `attributes` will remove all attributes from the\n\n - message.\n \\*\n\n - @param {(Object\n\n \u003cbr /\u003e\n\n - message. Keys:\n\n -\n - (required) 'data' : {string}\n -\n - (required) 'attributes' : {Object\n - @param {Object\n\n \u003cbr /\u003e\n\n - Keys:\n\n -\n - (required) 'message_id' : {string}\n -\n - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format\n -\n - (optional) 'ordering_key': {string} \\*/\n\n function\n\n### #code=\n\n def code=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. JavaScript code that contains a function `function_name` with the below signature:\n\n\n \\`\\`\\`\n /\\*\\*\n - Transforms a Pub/Sub message.\n\n - @return {(Object\n\n \u003cbr /\u003e\n\n - filter a message, return `null`. To transform a message return a map\n\n - with the following keys:\n\n -\n - (required) 'data' : {string}\n -\n - (optional) 'attributes' : {Object\n - Returning empty `attributes` will remove all attributes from the\n\n - message.\n \\*\n\n - @param {(Object\n\n \u003cbr /\u003e\n\n - message. Keys:\n\n -\n - (required) 'data' : {string}\n -\n - (required) 'attributes' : {Object\n - @param {Object\n\n \u003cbr /\u003e\n\n - Keys:\n\n -\n - (required) 'message_id' : {string}\n -\n - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format\n -\n - (optional) 'ordering_key': {string} \\*/\n\nfunction \n**Returns**\n\n- (::String) --- Required. JavaScript code that contains a function `function_name` with the below signature:\n\n\n \\`\\`\\`\n /\\*\\*\n - Transforms a Pub/Sub message.\n\n - @return {(Object\n\n \u003cbr /\u003e\n\n - filter a message, return `null`. To transform a message return a map\n\n - with the following keys:\n\n -\n - (required) 'data' : {string}\n -\n - (optional) 'attributes' : {Object\n - Returning empty `attributes` will remove all attributes from the\n\n - message.\n \\*\n\n - @param {(Object\n\n \u003cbr /\u003e\n\n - message. Keys:\n\n -\n - (required) 'data' : {string}\n -\n - (required) 'attributes' : {Object\n - @param {Object\n\n \u003cbr /\u003e\n\n - Keys:\n\n -\n - (required) 'message_id' : {string}\n -\n - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format\n -\n - (optional) 'ordering_key': {string} \\*/\n\n function\n\n### #function_name\n\n def function_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Name of the JavasScript function that should applied to Pub/Sub messages.\n\n### #function_name=\n\n def function_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Name of the JavasScript function that should applied to Pub/Sub messages. \n**Returns**\n\n- (::String) --- Required. Name of the JavasScript function that should applied to Pub/Sub messages."]]