|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.analyticshub.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * User-defined JavaScript function that can transform or filter a Pub/Sub message. |
| 21 | + * |
| 22 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 23 | + * transmitted over HTTP when working with the Analytics Hub API. For a detailed explanation see: |
| 24 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 25 | + * </p> |
| 26 | + * |
| 27 | + * @author Google, Inc. |
| 28 | + */ |
| 29 | +@SuppressWarnings("javadoc") |
| 30 | +public final class JavaScriptUDF extends com.google.api.client.json.GenericJson { |
| 31 | + |
| 32 | + /** |
| 33 | + * Required. JavaScript code that contains a function `function_name` with the below signature: |
| 34 | + * ``` * * Transforms a Pub/Sub message. * @return {(Object)>|null)} - To * filter a message, |
| 35 | + * return `null`. To transform a message return a map * with the following keys: * - (required) |
| 36 | + * 'data' : {string} * - (optional) 'attributes' : {Object} * Returning empty `attributes` will |
| 37 | + * remove all attributes from the * message. * * @param {(Object)>} Pub/Sub * message. Keys: * - |
| 38 | + * (required) 'data' : {string} * - (required) 'attributes' : {Object} * * @param {Object} |
| 39 | + * metadata - Pub/Sub message metadata. * Keys: * - (required) 'message_id' : {string} * - |
| 40 | + * (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format * - (optional) 'ordering_key': |
| 41 | + * {string} function (message, metadata) { } ``` |
| 42 | + * The value may be {@code null}. |
| 43 | + */ |
| 44 | + @com.google.api.client.util.Key |
| 45 | + private java.lang.String code; |
| 46 | + |
| 47 | + /** |
| 48 | + * Required. Name of the JavasScript function that should applied to Pub/Sub messages. |
| 49 | + * The value may be {@code null}. |
| 50 | + */ |
| 51 | + @com.google.api.client.util.Key |
| 52 | + private java.lang.String functionName; |
| 53 | + |
| 54 | + /** |
| 55 | + * Required. JavaScript code that contains a function `function_name` with the below signature: |
| 56 | + * ``` * * Transforms a Pub/Sub message. * @return {(Object)>|null)} - To * filter a message, |
| 57 | + * return `null`. To transform a message return a map * with the following keys: * - (required) |
| 58 | + * 'data' : {string} * - (optional) 'attributes' : {Object} * Returning empty `attributes` will |
| 59 | + * remove all attributes from the * message. * * @param {(Object)>} Pub/Sub * message. Keys: * - |
| 60 | + * (required) 'data' : {string} * - (required) 'attributes' : {Object} * * @param {Object} |
| 61 | + * metadata - Pub/Sub message metadata. * Keys: * - (required) 'message_id' : {string} * - |
| 62 | + * (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format * - (optional) 'ordering_key': |
| 63 | + * {string} function (message, metadata) { } ``` |
| 64 | + * @return value or {@code null} for none |
| 65 | + */ |
| 66 | + public java.lang.String getCode() { |
| 67 | + return code; |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * Required. JavaScript code that contains a function `function_name` with the below signature: |
| 72 | + * ``` * * Transforms a Pub/Sub message. * @return {(Object)>|null)} - To * filter a message, |
| 73 | + * return `null`. To transform a message return a map * with the following keys: * - (required) |
| 74 | + * 'data' : {string} * - (optional) 'attributes' : {Object} * Returning empty `attributes` will |
| 75 | + * remove all attributes from the * message. * * @param {(Object)>} Pub/Sub * message. Keys: * - |
| 76 | + * (required) 'data' : {string} * - (required) 'attributes' : {Object} * * @param {Object} |
| 77 | + * metadata - Pub/Sub message metadata. * Keys: * - (required) 'message_id' : {string} * - |
| 78 | + * (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format * - (optional) 'ordering_key': |
| 79 | + * {string} function (message, metadata) { } ``` |
| 80 | + * @param code code or {@code null} for none |
| 81 | + */ |
| 82 | + public JavaScriptUDF setCode(java.lang.String code) { |
| 83 | + this.code = code; |
| 84 | + return this; |
| 85 | + } |
| 86 | + |
| 87 | + /** |
| 88 | + * Required. Name of the JavasScript function that should applied to Pub/Sub messages. |
| 89 | + * @return value or {@code null} for none |
| 90 | + */ |
| 91 | + public java.lang.String getFunctionName() { |
| 92 | + return functionName; |
| 93 | + } |
| 94 | + |
| 95 | + /** |
| 96 | + * Required. Name of the JavasScript function that should applied to Pub/Sub messages. |
| 97 | + * @param functionName functionName or {@code null} for none |
| 98 | + */ |
| 99 | + public JavaScriptUDF setFunctionName(java.lang.String functionName) { |
| 100 | + this.functionName = functionName; |
| 101 | + return this; |
| 102 | + } |
| 103 | + |
| 104 | + @Override |
| 105 | + public JavaScriptUDF set(String fieldName, Object value) { |
| 106 | + return (JavaScriptUDF) super.set(fieldName, value); |
| 107 | + } |
| 108 | + |
| 109 | + @Override |
| 110 | + public JavaScriptUDF clone() { |
| 111 | + return (JavaScriptUDF) super.clone(); |
| 112 | + } |
| 113 | + |
| 114 | +} |
0 commit comments