Analytics Hub v1 API - Class JavaScriptUDF (1.9.0)
public sealed class JavaScriptUDF : IMessage<JavaScriptUDF>, IEquatable<JavaScriptUDF>, IDeepCloneable<JavaScriptUDF>, IBufferMessage, IMessage
Reference documentation and code samples for the Analytics Hub v1 API class JavaScriptUDF.
User-defined JavaScript function that can transform or filter a Pub/Sub
message.
Inheritance
object >
JavaScriptUDF
Namespace
Google.Cloud.BigQuery.AnalyticsHub.V1
Assembly
Google.Cloud.BigQuery.AnalyticsHub.V1.dll
Constructors
JavaScriptUDF()
JavaScriptUDF(JavaScriptUDF)
public JavaScriptUDF(JavaScriptUDF other)
Properties
Code
public string Code { get; set; }
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) {
}
Property Value |
Type |
Description |
string |
|
FunctionName
public string FunctionName { get; set; }
Required. Name of the JavasScript function that should applied to Pub/Sub
messages.
Property Value |
Type |
Description |
string |
|
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-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Analytics Hub v1 API - Class JavaScriptUDF (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.8.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.7.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.6.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.5.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.4.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.3.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.2.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.1.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/1.0.0/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF) \n\n public sealed class JavaScriptUDF : IMessage\u003cJavaScriptUDF\u003e, IEquatable\u003cJavaScriptUDF\u003e, IDeepCloneable\u003cJavaScriptUDF\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Analytics Hub v1 API class JavaScriptUDF.\n\nUser-defined JavaScript function that can transform or filter a Pub/Sub\nmessage. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e JavaScriptUDF \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[JavaScriptUDF](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[JavaScriptUDF](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[JavaScriptUDF](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.BigQuery.AnalyticsHub.V1](/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.BigQuery.AnalyticsHub.V1.dll\n\nConstructors\n------------\n\n### JavaScriptUDF()\n\n public JavaScriptUDF()\n\n### JavaScriptUDF(JavaScriptUDF)\n\n public JavaScriptUDF(JavaScriptUDF other)\n\nProperties\n----------\n\n### Code\n\n public string Code { get; set; }\n\nRequired. JavaScript code that contains a function `function_name` with the\nbelow signature: \n\n /**\n * Transforms a Pub/Sub message.\n\n * @return {(Object\u003cstring, (string | Object\u003cstring, string\u003e)\u003e|null)} - To\n * filter a message, return `null`. To transform a message return a map\n * with the following keys:\n * - (required) 'data' : {string}\n * - (optional) 'attributes' : {Object\u003cstring, string\u003e}\n * Returning empty `attributes` will remove all attributes from the\n * message.\n *\n * @param {(Object\u003cstring, (string | Object\u003cstring, string\u003e)\u003e} Pub/Sub\n * message. Keys:\n * - (required) 'data' : {string}\n * - (required) 'attributes' : {Object\u003cstring, string\u003e}\n *\n * @param {Object\u003cstring, any\u003e} metadata - Pub/Sub message metadata.\n * Keys:\n * - (required) 'message_id' : {string}\n * - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format\n * - (optional) 'ordering_key': {string}\n */\n\n function \u003cfunction_name\u003e(message, metadata) {\n }\n\n### FunctionName\n\n public string FunctionName { get; set; }\n\nRequired. Name of the JavasScript function that should applied to Pub/Sub\nmessages."]]