diff --git a/protos/google/cloud/dataproc/v1/clusters.proto b/protos/google/cloud/dataproc/v1/clusters.proto index 2b650c13..2e919d00 100644 --- a/protos/google/cloud/dataproc/v1/clusters.proto +++ b/protos/google/cloud/dataproc/v1/clusters.proto @@ -284,6 +284,9 @@ message ClusterConfig { // Optional. Metastore configuration. MetastoreConfig metastore_config = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Dataproc metrics configuration. + DataprocMetricConfig dataproc_metric_config = 21 [(google.api.field_behavior) = OPTIONAL]; } // Dataproc cluster config for a cluster that does not directly control the @@ -942,6 +945,49 @@ message MetastoreConfig { ]; } + +// Specifies Dataproc OSS Metric. +message Metric { + enum MetricSource { + // Unspecified metric source + METRIC_SOURCE_UNSPECIFIED = 0; + + // Default monitoring agent metrics. If this source is enabled, + // Dataproc enables the monitoring agent in Compute Engine, and collects + // default monitoring agent metrics, which are published with an + // agent.googleapis.com prefix. + MONITORING_AGENT_DEFAULTS = 1; + + // HDFS metric source + HDFS = 2; + + // SPARK metric source + SPARK = 3; + + // YARN metric source + YARN = 4; + + // Spark History Server metric source + SPARK_HISTORY_SERVER = 5; + + // Hiveserver2 metric source + HIVESERVER2 = 6; + } + + // Required. Specified source of metric collection + MetricSource metric_source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The set of available OSS metrics to collect from the metric + // source. + repeated string metric_overrides = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies a Dataproc metric config +message DataprocMetricConfig { + // Configuration set of metrics to collect from the cluster + repeated Metric metrics = 1 [(google.api.field_behavior) = REQUIRED]; +} + // Contains cluster daemon metrics, such as HDFS and YARN stats. // // **Beta Feature**: This report is available for testing purposes only. It may diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 203571f7..12b7d72f 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -4584,6 +4584,9 @@ export namespace google { /** ClusterConfig metastoreConfig */ metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); + + /** ClusterConfig dataprocMetricConfig */ + dataprocMetricConfig?: (google.cloud.dataproc.v1.IDataprocMetricConfig|null); } /** Represents a ClusterConfig. */ @@ -4637,6 +4640,9 @@ export namespace google { /** ClusterConfig metastoreConfig. */ public metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); + /** ClusterConfig dataprocMetricConfig. */ + public dataprocMetricConfig?: (google.cloud.dataproc.v1.IDataprocMetricConfig|null); + /** * Creates a new ClusterConfig instance using the specified properties. * @param [properties] Properties to set @@ -7139,6 +7145,220 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Metric. */ + interface IMetric { + + /** Metric metricSource */ + metricSource?: (google.cloud.dataproc.v1.Metric.MetricSource|keyof typeof google.cloud.dataproc.v1.Metric.MetricSource|null); + + /** Metric metricOverrides */ + metricOverrides?: (string[]|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IMetric); + + /** Metric metricSource. */ + public metricSource: (google.cloud.dataproc.v1.Metric.MetricSource|keyof typeof google.cloud.dataproc.v1.Metric.MetricSource); + + /** Metric metricOverrides. */ + public metricOverrides: string[]; + + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.cloud.dataproc.v1.IMetric): google.cloud.dataproc.v1.Metric; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dataproc.v1.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Metric; + + /** + * Verifies a Metric message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Metric { + + /** MetricSource enum. */ + enum MetricSource { + METRIC_SOURCE_UNSPECIFIED = 0, + MONITORING_AGENT_DEFAULTS = 1, + HDFS = 2, + SPARK = 3, + YARN = 4, + SPARK_HISTORY_SERVER = 5, + HIVESERVER2 = 6 + } + } + + /** Properties of a DataprocMetricConfig. */ + interface IDataprocMetricConfig { + + /** DataprocMetricConfig metrics */ + metrics?: (google.cloud.dataproc.v1.IMetric[]|null); + } + + /** Represents a DataprocMetricConfig. */ + class DataprocMetricConfig implements IDataprocMetricConfig { + + /** + * Constructs a new DataprocMetricConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDataprocMetricConfig); + + /** DataprocMetricConfig metrics. */ + public metrics: google.cloud.dataproc.v1.IMetric[]; + + /** + * Creates a new DataprocMetricConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataprocMetricConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDataprocMetricConfig): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Encodes the specified DataprocMetricConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @param message DataprocMetricConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDataprocMetricConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataprocMetricConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @param message DataprocMetricConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDataprocMetricConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Verifies a DataprocMetricConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataprocMetricConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataprocMetricConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Creates a plain object from a DataprocMetricConfig message. Also converts values to other types if specified. + * @param message DataprocMetricConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DataprocMetricConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataprocMetricConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataprocMetricConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ClusterMetrics. */ interface IClusterMetrics { diff --git a/protos/protos.js b/protos/protos.js index d63c7cbe..1361be2e 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -11295,6 +11295,7 @@ * @property {google.cloud.dataproc.v1.ILifecycleConfig|null} [lifecycleConfig] ClusterConfig lifecycleConfig * @property {google.cloud.dataproc.v1.IEndpointConfig|null} [endpointConfig] ClusterConfig endpointConfig * @property {google.cloud.dataproc.v1.IMetastoreConfig|null} [metastoreConfig] ClusterConfig metastoreConfig + * @property {google.cloud.dataproc.v1.IDataprocMetricConfig|null} [dataprocMetricConfig] ClusterConfig dataprocMetricConfig */ /** @@ -11425,6 +11426,14 @@ */ ClusterConfig.prototype.metastoreConfig = null; + /** + * ClusterConfig dataprocMetricConfig. + * @member {google.cloud.dataproc.v1.IDataprocMetricConfig|null|undefined} dataprocMetricConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.dataprocMetricConfig = null; + /** * Creates a new ClusterConfig instance using the specified properties. * @function create @@ -11478,6 +11487,8 @@ $root.google.cloud.dataproc.v1.EndpointConfig.encode(message.endpointConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); if (message.metastoreConfig != null && Object.hasOwnProperty.call(message, "metastoreConfig")) $root.google.cloud.dataproc.v1.MetastoreConfig.encode(message.metastoreConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.dataprocMetricConfig != null && Object.hasOwnProperty.call(message, "dataprocMetricConfig")) + $root.google.cloud.dataproc.v1.DataprocMetricConfig.encode(message.dataprocMetricConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); return writer; }; @@ -11570,6 +11581,10 @@ message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.decode(reader, reader.uint32()); break; } + case 21: { + message.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11675,6 +11690,11 @@ if (error) return "metastoreConfig." + error; } + if (message.dataprocMetricConfig != null && message.hasOwnProperty("dataprocMetricConfig")) { + var error = $root.google.cloud.dataproc.v1.DataprocMetricConfig.verify(message.dataprocMetricConfig); + if (error) + return "dataprocMetricConfig." + error; + } return null; }; @@ -11759,6 +11779,11 @@ throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.metastoreConfig: object expected"); message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.fromObject(object.metastoreConfig); } + if (object.dataprocMetricConfig != null) { + if (typeof object.dataprocMetricConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.dataprocMetricConfig: object expected"); + message.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.fromObject(object.dataprocMetricConfig); + } return message; }; @@ -11791,6 +11816,7 @@ object.autoscalingConfig = null; object.endpointConfig = null; object.metastoreConfig = null; + object.dataprocMetricConfig = null; } if (message.configBucket != null && message.hasOwnProperty("configBucket")) object.configBucket = message.configBucket; @@ -11823,6 +11849,8 @@ object.endpointConfig = $root.google.cloud.dataproc.v1.EndpointConfig.toObject(message.endpointConfig, options); if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) object.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.toObject(message.metastoreConfig, options); + if (message.dataprocMetricConfig != null && message.hasOwnProperty("dataprocMetricConfig")) + object.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.toObject(message.dataprocMetricConfig, options); return object; }; @@ -18059,6 +18087,535 @@ return MetastoreConfig; })(); + v1.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.cloud.dataproc.v1 + * @interface IMetric + * @property {google.cloud.dataproc.v1.Metric.MetricSource|null} [metricSource] Metric metricSource + * @property {Array.|null} [metricOverrides] Metric metricOverrides + */ + + /** + * Constructs a new Metric. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.cloud.dataproc.v1.IMetric=} [properties] Properties to set + */ + function Metric(properties) { + this.metricOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metric metricSource. + * @member {google.cloud.dataproc.v1.Metric.MetricSource} metricSource + * @memberof google.cloud.dataproc.v1.Metric + * @instance + */ + Metric.prototype.metricSource = 0; + + /** + * Metric metricOverrides. + * @member {Array.} metricOverrides + * @memberof google.cloud.dataproc.v1.Metric + * @instance + */ + Metric.prototype.metricOverrides = $util.emptyArray; + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {google.cloud.dataproc.v1.IMetric=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dataproc.v1.Metric.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {google.cloud.dataproc.v1.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricSource != null && Object.hasOwnProperty.call(message, "metricSource")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.metricSource); + if (message.metricOverrides != null && message.metricOverrides.length) + for (var i = 0; i < message.metricOverrides.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metricOverrides[i]); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {google.cloud.dataproc.v1.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Metric(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricSource = reader.int32(); + break; + } + case 2: { + if (!(message.metricOverrides && message.metricOverrides.length)) + message.metricOverrides = []; + message.metricOverrides.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metric message. + * @function verify + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricSource != null && message.hasOwnProperty("metricSource")) + switch (message.metricSource) { + default: + return "metricSource: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.metricOverrides != null && message.hasOwnProperty("metricOverrides")) { + if (!Array.isArray(message.metricOverrides)) + return "metricOverrides: array expected"; + for (var i = 0; i < message.metricOverrides.length; ++i) + if (!$util.isString(message.metricOverrides[i])) + return "metricOverrides: string[] expected"; + } + return null; + }; + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.Metric} Metric + */ + Metric.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.Metric) + return object; + var message = new $root.google.cloud.dataproc.v1.Metric(); + switch (object.metricSource) { + case "METRIC_SOURCE_UNSPECIFIED": + case 0: + message.metricSource = 0; + break; + case "MONITORING_AGENT_DEFAULTS": + case 1: + message.metricSource = 1; + break; + case "HDFS": + case 2: + message.metricSource = 2; + break; + case "SPARK": + case 3: + message.metricSource = 3; + break; + case "YARN": + case 4: + message.metricSource = 4; + break; + case "SPARK_HISTORY_SERVER": + case 5: + message.metricSource = 5; + break; + case "HIVESERVER2": + case 6: + message.metricSource = 6; + break; + } + if (object.metricOverrides) { + if (!Array.isArray(object.metricOverrides)) + throw TypeError(".google.cloud.dataproc.v1.Metric.metricOverrides: array expected"); + message.metricOverrides = []; + for (var i = 0; i < object.metricOverrides.length; ++i) + message.metricOverrides[i] = String(object.metricOverrides[i]); + } + return message; + }; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {google.cloud.dataproc.v1.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metricOverrides = []; + if (options.defaults) + object.metricSource = options.enums === String ? "METRIC_SOURCE_UNSPECIFIED" : 0; + if (message.metricSource != null && message.hasOwnProperty("metricSource")) + object.metricSource = options.enums === String ? $root.google.cloud.dataproc.v1.Metric.MetricSource[message.metricSource] : message.metricSource; + if (message.metricOverrides && message.metricOverrides.length) { + object.metricOverrides = []; + for (var j = 0; j < message.metricOverrides.length; ++j) + object.metricOverrides[j] = message.metricOverrides[j]; + } + return object; + }; + + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.Metric"; + }; + + /** + * MetricSource enum. + * @name google.cloud.dataproc.v1.Metric.MetricSource + * @enum {number} + * @property {number} METRIC_SOURCE_UNSPECIFIED=0 METRIC_SOURCE_UNSPECIFIED value + * @property {number} MONITORING_AGENT_DEFAULTS=1 MONITORING_AGENT_DEFAULTS value + * @property {number} HDFS=2 HDFS value + * @property {number} SPARK=3 SPARK value + * @property {number} YARN=4 YARN value + * @property {number} SPARK_HISTORY_SERVER=5 SPARK_HISTORY_SERVER value + * @property {number} HIVESERVER2=6 HIVESERVER2 value + */ + Metric.MetricSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONITORING_AGENT_DEFAULTS"] = 1; + values[valuesById[2] = "HDFS"] = 2; + values[valuesById[3] = "SPARK"] = 3; + values[valuesById[4] = "YARN"] = 4; + values[valuesById[5] = "SPARK_HISTORY_SERVER"] = 5; + values[valuesById[6] = "HIVESERVER2"] = 6; + return values; + })(); + + return Metric; + })(); + + v1.DataprocMetricConfig = (function() { + + /** + * Properties of a DataprocMetricConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IDataprocMetricConfig + * @property {Array.|null} [metrics] DataprocMetricConfig metrics + */ + + /** + * Constructs a new DataprocMetricConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DataprocMetricConfig. + * @implements IDataprocMetricConfig + * @constructor + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig=} [properties] Properties to set + */ + function DataprocMetricConfig(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataprocMetricConfig metrics. + * @member {Array.} metrics + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @instance + */ + DataprocMetricConfig.prototype.metrics = $util.emptyArray; + + /** + * Creates a new DataprocMetricConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig instance + */ + DataprocMetricConfig.create = function create(properties) { + return new DataprocMetricConfig(properties); + }; + + /** + * Encodes the specified DataprocMetricConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig} message DataprocMetricConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataprocMetricConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.cloud.dataproc.v1.Metric.encode(message.metrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataprocMetricConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig} message DataprocMetricConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataprocMetricConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataprocMetricConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.cloud.dataproc.v1.Metric.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataprocMetricConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataprocMetricConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataprocMetricConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.cloud.dataproc.v1.Metric.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + return null; + }; + + /** + * Creates a DataprocMetricConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig + */ + DataprocMetricConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DataprocMetricConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig(); + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.metrics: object expected"); + message.metrics[i] = $root.google.cloud.dataproc.v1.Metric.fromObject(object.metrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataprocMetricConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.DataprocMetricConfig} message DataprocMetricConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataprocMetricConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.cloud.dataproc.v1.Metric.toObject(message.metrics[j], options); + } + return object; + }; + + /** + * Converts this DataprocMetricConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @instance + * @returns {Object.} JSON object + */ + DataprocMetricConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataprocMetricConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataprocMetricConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DataprocMetricConfig"; + }; + + return DataprocMetricConfig; + })(); + v1.ClusterMetrics = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index 508b1d5d..14b4594f 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1658,6 +1658,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "dataprocMetricConfig": { + "type": "DataprocMetricConfig", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -2339,6 +2346,50 @@ } } }, + "Metric": { + "fields": { + "metricSource": { + "type": "MetricSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "metricOverrides": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MetricSource": { + "values": { + "METRIC_SOURCE_UNSPECIFIED": 0, + "MONITORING_AGENT_DEFAULTS": 1, + "HDFS": 2, + "SPARK": 3, + "YARN": 4, + "SPARK_HISTORY_SERVER": 5, + "HIVESERVER2": 6 + } + } + } + }, + "DataprocMetricConfig": { + "fields": { + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "ClusterMetrics": { "fields": { "hdfsMetrics": { diff --git a/test/gapic_autoscaling_policy_service_v1.ts b/test/gapic_autoscaling_policy_service_v1.ts index 93ce32d8..26539241 100644 --- a/test/gapic_autoscaling_policy_service_v1.ts +++ b/test/gapic_autoscaling_policy_service_v1.ts @@ -249,7 +249,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent'] ); request.parent = defaultValue1; @@ -282,7 +282,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent'] ); request.parent = defaultValue1; @@ -330,7 +330,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent'] ); request.parent = defaultValue1; @@ -365,7 +365,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent'] ); request.parent = defaultValue1; @@ -391,7 +391,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { ); request.policy ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name'] ); request.policy.name = defaultValue1; @@ -425,7 +425,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { ); request.policy ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name'] ); request.policy.name = defaultValue1; @@ -474,7 +474,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { ); request.policy ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name'] ); request.policy.name = defaultValue1; @@ -510,7 +510,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { ); request.policy ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name'] ); request.policy.name = defaultValue1; @@ -534,9 +534,10 @@ describe('v1.AutoscalingPolicyServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAutoscalingPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -566,9 +567,10 @@ describe('v1.AutoscalingPolicyServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAutoscalingPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -613,9 +615,10 @@ describe('v1.AutoscalingPolicyServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAutoscalingPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -644,9 +647,10 @@ describe('v1.AutoscalingPolicyServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAutoscalingPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -666,7 +670,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name'] ); request.name = defaultValue1; @@ -699,7 +703,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name'] ); request.name = defaultValue1; @@ -747,7 +751,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name'] ); request.name = defaultValue1; @@ -782,7 +786,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteAutoscalingPolicyRequest', + '.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name'] ); request.name = defaultValue1; @@ -807,7 +811,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAutoscalingPoliciesRequest', + '.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent'] ); request.parent = defaultValue1; @@ -848,7 +852,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAutoscalingPoliciesRequest', + '.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent'] ); request.parent = defaultValue1; @@ -904,7 +908,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAutoscalingPoliciesRequest', + '.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent'] ); request.parent = defaultValue1; @@ -939,7 +943,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAutoscalingPoliciesRequest', + '.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1007,7 +1011,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAutoscalingPoliciesRequest', + '.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1064,7 +1068,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAutoscalingPoliciesRequest', + '.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1119,7 +1123,7 @@ describe('v1.AutoscalingPolicyServiceClient', () => { new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAutoscalingPoliciesRequest', + '.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent'] ); request.parent = defaultValue1; diff --git a/test/gapic_batch_controller_v1.ts b/test/gapic_batch_controller_v1.ts index b5610269..3188b441 100644 --- a/test/gapic_batch_controller_v1.ts +++ b/test/gapic_batch_controller_v1.ts @@ -269,7 +269,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -297,7 +300,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -341,7 +347,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -366,7 +375,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -384,7 +396,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -412,7 +427,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -456,7 +474,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -484,7 +505,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBatchRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteBatchRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -502,9 +526,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBatchRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateBatchRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -533,9 +558,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBatchRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateBatchRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -586,9 +612,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBatchRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateBatchRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -616,9 +643,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateBatchRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBatchRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateBatchRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -688,9 +716,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListBatchesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBatchesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListBatchesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -720,9 +749,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListBatchesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBatchesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListBatchesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -768,9 +798,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListBatchesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBatchesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListBatchesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -798,9 +829,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListBatchesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBatchesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListBatchesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -848,9 +880,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListBatchesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBatchesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListBatchesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -895,9 +928,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListBatchesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBatchesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListBatchesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -937,9 +971,10 @@ describe('v1.BatchControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListBatchesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBatchesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListBatchesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/test/gapic_cluster_controller_v1.ts b/test/gapic_cluster_controller_v1.ts index aa841892..c7ec31b2 100644 --- a/test/gapic_cluster_controller_v1.ts +++ b/test/gapic_cluster_controller_v1.ts @@ -269,17 +269,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -307,17 +310,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -361,17 +367,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -399,17 +408,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -427,13 +439,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CreateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = generateSampleMessage( @@ -463,13 +477,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CreateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = generateSampleMessage( @@ -520,13 +536,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CreateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -554,13 +572,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CreateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CreateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CreateClusterRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -633,17 +653,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -673,17 +696,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -734,17 +760,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -772,17 +801,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -855,17 +887,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StopClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StopClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StopClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StopClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -894,17 +929,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StopClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StopClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StopClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StopClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -955,17 +993,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StopClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StopClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StopClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StopClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -993,17 +1034,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StopClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StopClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StopClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StopClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StopClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -1073,17 +1117,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StartClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StartClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StartClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StartClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -1112,17 +1159,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StartClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StartClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StartClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StartClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -1173,17 +1223,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StartClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StartClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StartClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StartClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -1211,17 +1264,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.StartClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('StartClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('StartClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('StartClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.StartClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -1291,17 +1347,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -1331,17 +1390,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -1392,17 +1454,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -1430,17 +1495,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -1513,17 +1581,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -1553,17 +1624,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -1614,17 +1688,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -1652,17 +1729,20 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DiagnoseClusterRequest', [ - 'clusterName', - ]); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DiagnoseClusterRequest', + ['clusterName'] + ); request.clusterName = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&cluster_name=${defaultValue3}`; const expectedError = new Error('expected'); @@ -1735,13 +1815,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListClustersRequest() ); - const defaultValue1 = getTypeDefaultValue('ListClustersRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListClustersRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -1771,13 +1853,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListClustersRequest() ); - const defaultValue1 = getTypeDefaultValue('ListClustersRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListClustersRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -1823,13 +1907,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListClustersRequest() ); - const defaultValue1 = getTypeDefaultValue('ListClustersRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListClustersRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -1857,13 +1943,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListClustersRequest() ); - const defaultValue1 = getTypeDefaultValue('ListClustersRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListClustersRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -1914,13 +2002,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListClustersRequest() ); - const defaultValue1 = getTypeDefaultValue('ListClustersRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListClustersRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -1968,13 +2058,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListClustersRequest() ); - const defaultValue1 = getTypeDefaultValue('ListClustersRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListClustersRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -2014,13 +2106,15 @@ describe('v1.ClusterControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListClustersRequest() ); - const defaultValue1 = getTypeDefaultValue('ListClustersRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListClustersRequest', [ - 'region', - ]); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListClustersRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); diff --git a/test/gapic_job_controller_v1.ts b/test/gapic_job_controller_v1.ts index 3756dd08..89c3bdb8 100644 --- a/test/gapic_job_controller_v1.ts +++ b/test/gapic_job_controller_v1.ts @@ -269,11 +269,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = generateSampleMessage( @@ -301,11 +305,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = generateSampleMessage( @@ -349,11 +357,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -378,11 +390,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -400,11 +416,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue('GetJobRequest', ['projectId']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -432,11 +457,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue('GetJobRequest', ['projectId']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -480,11 +514,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue('GetJobRequest', ['projectId']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedError = new Error('expected'); @@ -509,11 +552,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue('GetJobRequest', ['projectId']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('GetJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('GetJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -531,13 +583,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateJobRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -565,13 +624,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateJobRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -615,13 +681,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateJobRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedError = new Error('expected'); @@ -646,13 +719,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.UpdateJobRequest() ); - const defaultValue1 = getTypeDefaultValue('UpdateJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('UpdateJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('UpdateJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.UpdateJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -670,13 +750,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CancelJobRequest() ); - const defaultValue1 = getTypeDefaultValue('CancelJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CancelJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('CancelJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -704,13 +791,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CancelJobRequest() ); - const defaultValue1 = getTypeDefaultValue('CancelJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CancelJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('CancelJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -754,13 +848,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CancelJobRequest() ); - const defaultValue1 = getTypeDefaultValue('CancelJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CancelJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('CancelJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedError = new Error('expected'); @@ -785,13 +886,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.CancelJobRequest() ); - const defaultValue1 = getTypeDefaultValue('CancelJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('CancelJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('CancelJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.CancelJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -809,13 +917,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -843,13 +958,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedResponse = generateSampleMessage( @@ -893,13 +1015,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}&job_id=${defaultValue3}`; const expectedError = new Error('expected'); @@ -924,13 +1053,20 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('DeleteJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['region'] + ); request.region = defaultValue2; - const defaultValue3 = getTypeDefaultValue('DeleteJobRequest', ['jobId']); + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.DeleteJobRequest', + ['jobId'] + ); request.jobId = defaultValue3; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -948,11 +1084,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = generateSampleMessage( @@ -982,11 +1122,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = generateSampleMessage( @@ -1037,11 +1181,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -1069,11 +1217,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.SubmitJobRequest() ); - const defaultValue1 = getTypeDefaultValue('SubmitJobRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('SubmitJobRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.SubmitJobRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -1146,11 +1298,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListJobsRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListJobsRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -1180,11 +1336,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListJobsRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListJobsRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -1230,11 +1390,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListJobsRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListJobsRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -1259,11 +1423,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListJobsRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListJobsRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -1311,11 +1479,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListJobsRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListJobsRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); @@ -1360,11 +1532,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListJobsRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListJobsRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedResponse = [ @@ -1403,11 +1579,15 @@ describe('v1.JobControllerClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListJobsRequest', [ - 'projectId', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['projectId'] + ); request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue('ListJobsRequest', ['region']); + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.ListJobsRequest', + ['region'] + ); request.region = defaultValue2; const expectedHeaderRequestParams = `project_id=${defaultValue1}®ion=${defaultValue2}`; const expectedError = new Error('expected'); diff --git a/test/gapic_workflow_template_service_v1.ts b/test/gapic_workflow_template_service_v1.ts index e74e68a6..263c2e70 100644 --- a/test/gapic_workflow_template_service_v1.ts +++ b/test/gapic_workflow_template_service_v1.ts @@ -281,7 +281,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -314,7 +314,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -362,7 +362,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -397,7 +397,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -421,9 +421,10 @@ describe('v1.WorkflowTemplateServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkflowTemplateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -453,9 +454,10 @@ describe('v1.WorkflowTemplateServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkflowTemplateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -500,9 +502,10 @@ describe('v1.WorkflowTemplateServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkflowTemplateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -531,9 +534,10 @@ describe('v1.WorkflowTemplateServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkflowTemplateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -554,7 +558,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { ); request.template ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name'] ); request.template.name = defaultValue1; @@ -588,7 +592,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { ); request.template ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name'] ); request.template.name = defaultValue1; @@ -637,7 +641,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { ); request.template ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name'] ); request.template.name = defaultValue1; @@ -673,7 +677,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { ); request.template ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name'] ); request.template.name = defaultValue1; @@ -698,7 +702,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -731,7 +735,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -779,7 +783,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -814,7 +818,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -839,7 +843,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -873,7 +877,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -928,7 +932,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -963,7 +967,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name'] ); request.name = defaultValue1; @@ -1043,7 +1047,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateInlineWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -1079,7 +1083,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateInlineWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -1134,7 +1138,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateInlineWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -1167,7 +1171,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() ); const defaultValue1 = getTypeDefaultValue( - 'InstantiateInlineWorkflowTemplateRequest', + '.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent'] ); request.parent = defaultValue1; @@ -1246,7 +1250,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListWorkflowTemplatesRequest', + '.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1287,7 +1291,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListWorkflowTemplatesRequest', + '.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1343,7 +1347,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListWorkflowTemplatesRequest', + '.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1378,7 +1382,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListWorkflowTemplatesRequest', + '.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1446,7 +1450,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListWorkflowTemplatesRequest', + '.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1503,7 +1507,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListWorkflowTemplatesRequest', + '.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent'] ); request.parent = defaultValue1; @@ -1557,7 +1561,7 @@ describe('v1.WorkflowTemplateServiceClient', () => { new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListWorkflowTemplatesRequest', + '.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent'] ); request.parent = defaultValue1;