1.12.0 (latest) 1.11.0 1.10.0 1.9.0 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

```javascript
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](https://learn.microsoft.com/dotnet/api/system.object) \> JavaScriptUDF

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[JavaScriptUDF](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[JavaScriptUDF](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[JavaScriptUDF](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.JavaScriptUDF.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.BigQuery.AnalyticsHub.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.AnalyticsHub.V1/latest/Google.Cloud.BigQuery.AnalyticsHub.V1.md.txt)

## Assembly

Google.Cloud.BigQuery.AnalyticsHub.V1.dll

## Constructors

### JavaScriptUDF()

```javascript
public JavaScriptUDF()
```

### JavaScriptUDF(JavaScriptUDF)

```javascript
public JavaScriptUDF(JavaScriptUDF other)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `JavaScriptUDF` |

## Properties

### Code

```javascript
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

```javascript
public string FunctionName { get; set; }
```
Required. Name of the JavasScript function that should applied to Pub/Sub
messages.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |