diff --git a/packages/google-monitoring-dashboard/.jsdoc.js b/packages/google-monitoring-dashboard/.jsdoc.js index babd5974934..c063fb7c718 100644 --- a/packages/google-monitoring-dashboard/.jsdoc.js +++ b/packages/google-monitoring-dashboard/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2022 Google LLC', + copyright: 'Copyright 2023 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/monitoring-dashboards', diff --git a/packages/google-monitoring-dashboard/.mocharc.js b/packages/google-monitoring-dashboard/.mocharc.js index cdb7b752160..49e7e228701 100644 --- a/packages/google-monitoring-dashboard/.mocharc.js +++ b/packages/google-monitoring-dashboard/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/.prettierrc.js b/packages/google-monitoring-dashboard/.prettierrc.js index d546a4ad546..1e6cec783e4 100644 --- a/packages/google-monitoring-dashboard/.prettierrc.js +++ b/packages/google-monitoring-dashboard/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboards_service.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboards_service.proto index 4e99c4f7e4d..bf6f94e785f 100644 --- a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboards_service.proto +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboards_service.proto @@ -41,8 +41,12 @@ service DashboardsService { "https://www.googleapis.com/auth/monitoring.read," "https://www.googleapis.com/auth/monitoring.write"; - // Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see [Managing dashboards by API](https://cloud.google.com/monitoring/dashboards/api-dashboard). - // This method requires the `monitoring.dashboards.create` permission on the specified project. For more information about permissions, see [Cloud Identity and Access Management](https://cloud.google.com/iam). + // Creates a new custom dashboard. For examples on how you can use this API to + // create dashboards, see [Managing dashboards by + // API](https://cloud.google.com/monitoring/dashboards/api-dashboard). This + // method requires the `monitoring.dashboards.create` permission on the + // specified project. For more information about permissions, see [Cloud + // Identity and Access Management](https://cloud.google.com/iam). rpc CreateDashboard(CreateDashboardRequest) returns (Dashboard) { option (google.api.http) = { post: "/v1/{parent=projects/*}/dashboards" diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/metrics.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/metrics.proto index b28dbdcf95c..321429b6437 100644 --- a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/metrics.proto +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/metrics.proto @@ -58,8 +58,9 @@ message TimeSeriesQuery { // [`ListTimeSeries`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) // method. message TimeSeriesFilter { - // Required. The [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - // that identifies the metric types, resources, and projects to query. + // Required. The [monitoring + // filter](https://cloud.google.com/monitoring/api/v3/filters) that identifies + // the metric types, resources, and projects to query. string filter = 1 [(google.api.field_behavior) = REQUIRED]; // By default, the raw time series data is returned. @@ -77,7 +78,8 @@ message TimeSeriesFilter { // Statistics based time series filter. // Note: This field is deprecated and completely ignored by the API. - StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true]; + StatisticalTimeSeriesFilter statistical_time_series_filter = 5 + [deprecated = true]; } } @@ -116,7 +118,8 @@ message TimeSeriesFilterRatio { // Statistics based time series filter. // Note: This field is deprecated and completely ignored by the API. - StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true]; + StatisticalTimeSeriesFilter statistical_time_series_filter = 5 + [deprecated = true]; } } diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table.proto index 8165c3a9b79..2bbcf6df308 100644 --- a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table.proto +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table.proto @@ -35,25 +35,58 @@ message TimeSeriesTable { message TableDataSet { // Required. Fields for querying time series data from the // Stackdriver metrics API. - TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED]; + TimeSeriesQuery time_series_query = 1 + [(google.api.field_behavior) = REQUIRED]; - // Optional. A template string for naming `TimeSeries` in the resulting data set. - // This should be a string with interpolations of the form `${label_name}`, - // which will resolve to the label's value i.e. + // Optional. A template string for naming `TimeSeries` in the resulting data + // set. This should be a string with interpolations of the form + // `${label_name}`, which will resolve to the label's value i.e. // "${resource.labels.project_id}." string table_template = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The lower bound on data point frequency for this data set, implemented by - // specifying the minimum alignment period to use in a time series query - // For example, if the data is published once every 10 minutes, the - // `min_alignment_period` should be at least 10 minutes. It would not + // Optional. The lower bound on data point frequency for this data set, + // implemented by specifying the minimum alignment period to use in a time + // series query For example, if the data is published once every 10 minutes, + // the `min_alignment_period` should be at least 10 minutes. It would not // make sense to fetch and align data at one minute intervals. - google.protobuf.Duration min_alignment_period = 3 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Duration min_alignment_period = 3 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. Table display options for configuring how the table is rendered. - TableDisplayOptions table_display_options = 4 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Table display options for configuring how the table is + // rendered. + TableDisplayOptions table_display_options = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Enum for metric metric_visualization + enum MetricVisualization { + // Unspecified state + METRIC_VISUALIZATION_UNSPECIFIED = 0; + + // Default text rendering + NUMBER = 1; + + // Horizontal bar rendering + BAR = 2; + } + + // The persistent settings for a table's columns. + message ColumnSettings { + // Required. The id of the column. + string column = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Whether the column should be visible on page load. + bool visible = 2 [(google.api.field_behavior) = REQUIRED]; } // Required. The data displayed in this table. repeated TableDataSet data_sets = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Store rendering strategy + MetricVisualization metric_visualization = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of the persistent column settings for the table. + repeated ColumnSettings column_settings = 4 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table_display_options.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table_display_options.proto index 468005f2f23..8e5d4b7edac 100644 --- a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table_display_options.proto +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table_display_options.proto @@ -30,8 +30,6 @@ option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; message TableDisplayOptions { // Optional. This field is unused and has been replaced by // TimeSeriesTable.column_settings - repeated string shown_columns = 1 [ - deprecated = true, - (google.api.field_behavior) = OPTIONAL - ]; + repeated string shown_columns = 1 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/xychart.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/xychart.proto index 11a26a49c3a..74958f1ffd8 100644 --- a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/xychart.proto +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/xychart.proto @@ -73,7 +73,8 @@ message XyChart { // Required. Fields for querying time series data from the // Stackdriver metrics API. - TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED]; + TimeSeriesQuery time_series_query = 1 + [(google.api.field_behavior) = REQUIRED]; // How this data should be plotted on the chart. PlotType plot_type = 2; @@ -83,12 +84,13 @@ message XyChart { // which will resolve to the label's value. string legend_template = 3; - // Optional. The lower bound on data point frequency for this data set, implemented by - // specifying the minimum alignment period to use in a time series query - // For example, if the data is published once every 10 minutes, the - // `min_alignment_period` should be at least 10 minutes. It would not + // Optional. The lower bound on data point frequency for this data set, + // implemented by specifying the minimum alignment period to use in a time + // series query For example, if the data is published once every 10 minutes, + // the `min_alignment_period` should be at least 10 minutes. It would not // make sense to fetch and align data at one minute intervals. - google.protobuf.Duration min_alignment_period = 4 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Duration min_alignment_period = 4 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The target axis to use for plotting the metric. TargetAxis target_axis = 5 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-monitoring-dashboard/protos/protos.d.ts b/packages/google-monitoring-dashboard/protos/protos.d.ts index 28e06652319..920a735c2ef 100644 --- a/packages/google-monitoring-dashboard/protos/protos.d.ts +++ b/packages/google-monitoring-dashboard/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -2848,6 +2848,12 @@ export namespace google { /** TimeSeriesTable dataSets */ dataSets?: (google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet[]|null); + + /** TimeSeriesTable metricVisualization */ + metricVisualization?: (google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization|keyof typeof google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization|null); + + /** TimeSeriesTable columnSettings */ + columnSettings?: (google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings[]|null); } /** Represents a TimeSeriesTable. */ @@ -2862,6 +2868,12 @@ export namespace google { /** TimeSeriesTable dataSets. */ public dataSets: google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet[]; + /** TimeSeriesTable metricVisualization. */ + public metricVisualization: (google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization|keyof typeof google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization); + + /** TimeSeriesTable columnSettings. */ + public columnSettings: google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings[]; + /** * Creates a new TimeSeriesTable instance using the specified properties. * @param [properties] Properties to set @@ -3056,6 +3068,116 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** MetricVisualization enum. */ + enum MetricVisualization { + METRIC_VISUALIZATION_UNSPECIFIED = 0, + NUMBER = 1, + BAR = 2 + } + + /** Properties of a ColumnSettings. */ + interface IColumnSettings { + + /** ColumnSettings column */ + column?: (string|null); + + /** ColumnSettings visible */ + visible?: (boolean|null); + } + + /** Represents a ColumnSettings. */ + class ColumnSettings implements IColumnSettings { + + /** + * Constructs a new ColumnSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings); + + /** ColumnSettings column. */ + public column: string; + + /** ColumnSettings visible. */ + public visible: boolean; + + /** + * Creates a new ColumnSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnSettings instance + */ + public static create(properties?: google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings): google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings; + + /** + * Encodes the specified ColumnSettings message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.verify|verify} messages. + * @param message ColumnSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnSettings message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.verify|verify} messages. + * @param message ColumnSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnSettings + * @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.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings; + + /** + * Decodes a ColumnSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnSettings + * @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.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings; + + /** + * Verifies a ColumnSettings 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 ColumnSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnSettings + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings; + + /** + * Creates a plain object from a ColumnSettings message. Also converts values to other types if specified. + * @param message ColumnSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a TableDisplayOptions. */ diff --git a/packages/google-monitoring-dashboard/protos/protos.js b/packages/google-monitoring-dashboard/protos/protos.js index bbe7d306577..7c5db3998af 100644 --- a/packages/google-monitoring-dashboard/protos/protos.js +++ b/packages/google-monitoring-dashboard/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -7554,6 +7554,8 @@ * @memberof google.monitoring.dashboard.v1 * @interface ITimeSeriesTable * @property {Array.|null} [dataSets] TimeSeriesTable dataSets + * @property {google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization|null} [metricVisualization] TimeSeriesTable metricVisualization + * @property {Array.|null} [columnSettings] TimeSeriesTable columnSettings */ /** @@ -7566,6 +7568,7 @@ */ function TimeSeriesTable(properties) { this.dataSets = []; + this.columnSettings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7580,6 +7583,22 @@ */ TimeSeriesTable.prototype.dataSets = $util.emptyArray; + /** + * TimeSeriesTable metricVisualization. + * @member {google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization} metricVisualization + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @instance + */ + TimeSeriesTable.prototype.metricVisualization = 0; + + /** + * TimeSeriesTable columnSettings. + * @member {Array.} columnSettings + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @instance + */ + TimeSeriesTable.prototype.columnSettings = $util.emptyArray; + /** * Creates a new TimeSeriesTable instance using the specified properties. * @function create @@ -7607,6 +7626,11 @@ if (message.dataSets != null && message.dataSets.length) for (var i = 0; i < message.dataSets.length; ++i) $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.encode(message.dataSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metricVisualization != null && Object.hasOwnProperty.call(message, "metricVisualization")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.metricVisualization); + if (message.columnSettings != null && message.columnSettings.length) + for (var i = 0; i < message.columnSettings.length; ++i) + $root.google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.encode(message.columnSettings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -7647,6 +7671,16 @@ message.dataSets.push($root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.decode(reader, reader.uint32())); break; } + case 2: { + message.metricVisualization = reader.int32(); + break; + } + case 4: { + if (!(message.columnSettings && message.columnSettings.length)) + message.columnSettings = []; + message.columnSettings.push($root.google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -7691,6 +7725,24 @@ return "dataSets." + error; } } + if (message.metricVisualization != null && message.hasOwnProperty("metricVisualization")) + switch (message.metricVisualization) { + default: + return "metricVisualization: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.columnSettings != null && message.hasOwnProperty("columnSettings")) { + if (!Array.isArray(message.columnSettings)) + return "columnSettings: array expected"; + for (var i = 0; i < message.columnSettings.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.verify(message.columnSettings[i]); + if (error) + return "columnSettings." + error; + } + } return null; }; @@ -7716,6 +7768,36 @@ message.dataSets[i] = $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.fromObject(object.dataSets[i]); } } + switch (object.metricVisualization) { + default: + if (typeof object.metricVisualization === "number") { + message.metricVisualization = object.metricVisualization; + break; + } + break; + case "METRIC_VISUALIZATION_UNSPECIFIED": + case 0: + message.metricVisualization = 0; + break; + case "NUMBER": + case 1: + message.metricVisualization = 1; + break; + case "BAR": + case 2: + message.metricVisualization = 2; + break; + } + if (object.columnSettings) { + if (!Array.isArray(object.columnSettings)) + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesTable.columnSettings: array expected"); + message.columnSettings = []; + for (var i = 0; i < object.columnSettings.length; ++i) { + if (typeof object.columnSettings[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesTable.columnSettings: object expected"); + message.columnSettings[i] = $root.google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.fromObject(object.columnSettings[i]); + } + } return message; }; @@ -7732,13 +7814,24 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.dataSets = []; + object.columnSettings = []; + } + if (options.defaults) + object.metricVisualization = options.enums === String ? "METRIC_VISUALIZATION_UNSPECIFIED" : 0; if (message.dataSets && message.dataSets.length) { object.dataSets = []; for (var j = 0; j < message.dataSets.length; ++j) object.dataSets[j] = $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.toObject(message.dataSets[j], options); } + if (message.metricVisualization != null && message.hasOwnProperty("metricVisualization")) + object.metricVisualization = options.enums === String ? $root.google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization[message.metricVisualization] === undefined ? message.metricVisualization : $root.google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization[message.metricVisualization] : message.metricVisualization; + if (message.columnSettings && message.columnSettings.length) { + object.columnSettings = []; + for (var j = 0; j < message.columnSettings.length; ++j) + object.columnSettings[j] = $root.google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.toObject(message.columnSettings[j], options); + } return object; }; @@ -8056,6 +8149,249 @@ return TableDataSet; })(); + /** + * MetricVisualization enum. + * @name google.monitoring.dashboard.v1.TimeSeriesTable.MetricVisualization + * @enum {number} + * @property {number} METRIC_VISUALIZATION_UNSPECIFIED=0 METRIC_VISUALIZATION_UNSPECIFIED value + * @property {number} NUMBER=1 NUMBER value + * @property {number} BAR=2 BAR value + */ + TimeSeriesTable.MetricVisualization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_VISUALIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMBER"] = 1; + values[valuesById[2] = "BAR"] = 2; + return values; + })(); + + TimeSeriesTable.ColumnSettings = (function() { + + /** + * Properties of a ColumnSettings. + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @interface IColumnSettings + * @property {string|null} [column] ColumnSettings column + * @property {boolean|null} [visible] ColumnSettings visible + */ + + /** + * Constructs a new ColumnSettings. + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @classdesc Represents a ColumnSettings. + * @implements IColumnSettings + * @constructor + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings=} [properties] Properties to set + */ + function ColumnSettings(properties) { + 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]]; + } + + /** + * ColumnSettings column. + * @member {string} column + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @instance + */ + ColumnSettings.prototype.column = ""; + + /** + * ColumnSettings visible. + * @member {boolean} visible + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @instance + */ + ColumnSettings.prototype.visible = false; + + /** + * Creates a new ColumnSettings instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings} ColumnSettings instance + */ + ColumnSettings.create = function create(properties) { + return new ColumnSettings(properties); + }; + + /** + * Encodes the specified ColumnSettings message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings} message ColumnSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.column != null && Object.hasOwnProperty.call(message, "column")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.column); + if (message.visible != null && Object.hasOwnProperty.call(message, "visible")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.visible); + return writer; + }; + + /** + * Encodes the specified ColumnSettings message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.IColumnSettings} message ColumnSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnSettings message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings} ColumnSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnSettings.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.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.column = reader.string(); + break; + } + case 2: { + message.visible = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings} ColumnSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnSettings message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.column != null && message.hasOwnProperty("column")) + if (!$util.isString(message.column)) + return "column: string expected"; + if (message.visible != null && message.hasOwnProperty("visible")) + if (typeof message.visible !== "boolean") + return "visible: boolean expected"; + return null; + }; + + /** + * Creates a ColumnSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings} ColumnSettings + */ + ColumnSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings) + return object; + var message = new $root.google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings(); + if (object.column != null) + message.column = String(object.column); + if (object.visible != null) + message.visible = Boolean(object.visible); + return message; + }; + + /** + * Creates a plain object from a ColumnSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings} message ColumnSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.column = ""; + object.visible = false; + } + if (message.column != null && message.hasOwnProperty("column")) + object.column = message.column; + if (message.visible != null && message.hasOwnProperty("visible")) + object.visible = message.visible; + return object; + }; + + /** + * Converts this ColumnSettings to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @instance + * @returns {Object.} JSON object + */ + ColumnSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnSettings + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TimeSeriesTable.ColumnSettings"; + }; + + return ColumnSettings; + })(); + return TimeSeriesTable; })(); diff --git a/packages/google-monitoring-dashboard/protos/protos.json b/packages/google-monitoring-dashboard/protos/protos.json index f43d298c75b..baeb4da9921 100644 --- a/packages/google-monitoring-dashboard/protos/protos.json +++ b/packages/google-monitoring-dashboard/protos/protos.json @@ -681,6 +681,21 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "metricVisualization": { + "type": "MetricVisualization", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "columnSettings": { + "rule": "repeated", + "type": "ColumnSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -715,6 +730,31 @@ } } } + }, + "MetricVisualization": { + "values": { + "METRIC_VISUALIZATION_UNSPECIFIED": 0, + "NUMBER": 1, + "BAR": 2 + } + }, + "ColumnSettings": { + "fields": { + "column": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "visible": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } } } }, diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js index 23ba816dbfb..64949d3b3e9 100644 --- a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js index 9f1b5cd2fb0..f64f97225b2 100644 --- a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js index bb5aff74bd7..8820abd1184 100644 --- a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js index e2079fc137d..1f9873de807 100644 --- a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js index 37edb0b76b7..1c241bab3ef 100644 --- a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/src/index.ts b/packages/google-monitoring-dashboard/src/index.ts index ada7f73ea2a..656b7e0add7 100644 --- a/packages/google-monitoring-dashboard/src/index.ts +++ b/packages/google-monitoring-dashboard/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/src/v1/dashboards_service_client.ts b/packages/google-monitoring-dashboard/src/v1/dashboards_service_client.ts index 09fa08ad645..db1d4dfd3ad 100644 --- a/packages/google-monitoring-dashboard/src/v1/dashboards_service_client.ts +++ b/packages/google-monitoring-dashboard/src/v1/dashboards_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -121,6 +121,9 @@ export class DashboardsServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -343,8 +346,12 @@ export class DashboardsServiceClient { // -- Service calls -- // ------------------- /** - * Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see [Managing dashboards by API](https://cloud.google.com/monitoring/dashboards/api-dashboard). - * This method requires the `monitoring.dashboards.create` permission on the specified project. For more information about permissions, see [Cloud Identity and Access Management](https://cloud.google.com/iam). + * Creates a new custom dashboard. For examples on how you can use this API to + * create dashboards, see [Managing dashboards by + * API](https://cloud.google.com/monitoring/dashboards/api-dashboard). This + * method requires the `monitoring.dashboards.create` permission on the + * specified project. For more information about permissions, see [Cloud + * Identity and Access Management](https://cloud.google.com/iam). * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-monitoring-dashboard/src/v1/index.ts b/packages/google-monitoring-dashboard/src/v1/index.ts index da11575d59a..749483a969e 100644 --- a/packages/google-monitoring-dashboard/src/v1/index.ts +++ b/packages/google-monitoring-dashboard/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.js b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.js index 7a6f8ae0e47..d2af8d89ab3 100644 --- a/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.js +++ b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.ts b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.ts index 5522c74da56..bfd0a7a4b63 100644 --- a/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.ts +++ b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/system-test/install.ts b/packages/google-monitoring-dashboard/system-test/install.ts index 6dd1eaadafa..f61fe236476 100644 --- a/packages/google-monitoring-dashboard/system-test/install.ts +++ b/packages/google-monitoring-dashboard/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-monitoring-dashboard/test/gapic_dashboards_service_v1.ts b/packages/google-monitoring-dashboard/test/gapic_dashboards_service_v1.ts index c117824f3e8..365e301363a 100644 --- a/packages/google-monitoring-dashboard/test/gapic_dashboards_service_v1.ts +++ b/packages/google-monitoring-dashboard/test/gapic_dashboards_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.