From ced80544ee74321deb881ee42dc5c2db05fbd0a4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 18:39:29 -0800 Subject: [PATCH] feat: [analytics-data] add `EmptyFilter` type to the Data API v1beta (#5831) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add `EmptyFilter` type to the Data API v1beta feat: add the `empty_filter` field to the `Filter` type docs: update documentation for the`RunReport` method docs: remove all references to 'GA4' in documentation PiperOrigin-RevId: 698517184 Source-Link: https://github.com/googleapis/googleapis/commit/3a6c7dcb9e3bc6792bb9b41939a8dd2bbd6dcaf9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/db3a50c62ddad1edcc91e3791636a4317f52dd06 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1kYXRhLy5Pd2xCb3QueWFtbCIsImgiOiJkYjNhNTBjNjJkZGFkMWVkY2M5MWUzNzkxNjM2YTQzMTdmNTJkZDA2In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../data/v1beta/analytics_data_api.proto | 48 ++-- .../google/analytics/data/v1beta/data.proto | 10 +- .../google-analytics-data/protos/protos.d.ts | 99 +++++++- .../google-analytics-data/protos/protos.js | 214 +++++++++++++++++- .../google-analytics-data/protos/protos.json | 10 +- ..._analytics_data.batch_run_pivot_reports.js | 2 +- .../beta_analytics_data.batch_run_reports.js | 2 +- ...beta_analytics_data.check_compatibility.js | 2 +- .../beta_analytics_data.get_metadata.js | 2 +- .../beta_analytics_data.run_pivot_report.js | 8 +- ...beta_analytics_data.run_realtime_report.js | 7 +- .../v1beta/beta_analytics_data.run_report.js | 12 +- ...metadata_google.analytics.data.v1beta.json | 10 +- .../src/v1beta/beta_analytics_data_client.ts | 41 ++-- 14 files changed, 402 insertions(+), 65 deletions(-) diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto b/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto index b9df319f06d..ed81f4b108c 100644 --- a/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto +++ b/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto @@ -71,7 +71,7 @@ service BetaAnalyticsData { } // Returns multiple reports in a batch. All reports must be for the same - // GA4 Property. + // Google Analytics property. rpc BatchRunReports(BatchRunReportsRequest) returns (BatchRunReportsResponse) { option (google.api.http) = { @@ -81,7 +81,7 @@ service BetaAnalyticsData { } // Returns multiple pivot reports in a batch. All reports must be for the same - // GA4 Property. + // Google Analytics property. rpc BatchRunPivotReports(BatchRunPivotReportsRequest) returns (BatchRunPivotReportsResponse) { option (google.api.http) = { @@ -92,7 +92,7 @@ service BetaAnalyticsData { // Returns metadata for dimensions and metrics available in reporting methods. // Used to explore the dimensions and metrics. In this method, a Google - // Analytics GA4 Property Identifier is specified in the request, and + // Analytics property identifier is specified in the request, and // the metadata response includes Custom dimensions and metrics as well as // Universal metadata. // @@ -256,7 +256,7 @@ service BetaAnalyticsData { // report; fields shared with the `runReport` request should be the same values // as in your `runReport` request. message CheckCompatibilityRequest { - // A Google Analytics GA4 property identifier whose events are tracked. To + // A Google Analytics property identifier whose events are tracked. To // learn more, see [where to find your Property // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). // `property` should be the same value as in your `runReport` request. @@ -318,7 +318,7 @@ message Metadata { // The request to generate a report. message RunReportRequest { - // A Google Analytics GA4 property identifier whose events are tracked. + // A Google Analytics property identifier whose events are tracked. // Specified in the URL path and not the body. To learn more, see [where to // find your Property // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -378,9 +378,13 @@ message RunReportRequest { // Aggregation of metrics. Aggregated metric values will be shown in rows // where the dimension_values are set to "RESERVED_(MetricAggregation)". + // Aggregates including both comparisons and multiple date ranges will + // be aggregated based on the date ranges. repeated MetricAggregation metric_aggregations = 9; // Specifies how rows are ordered in the response. + // Requests including both comparisons and multiple date ranges will + // have order bys applied on the comparisons. repeated OrderBy order_bys = 10; // A currency code in ISO4217 format, such as "AED", "USD", "JPY". @@ -396,15 +400,15 @@ message RunReportRequest { // removed by a filter. // // Regardless of this `keep_empty_rows` setting, only data recorded by the - // Google Analytics (GA4) property can be displayed in a report. + // Google Analytics property can be displayed in a report. // // For example if a property never logs a `purchase` event, then a query for // the `eventName` dimension and `eventCount` metric will not have a row // eventName: "purchase" and eventCount: 0. bool keep_empty_rows = 13; - // Toggles whether to return the current state of this Analytics Property's - // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + // Toggles whether to return the current state of this Google Analytics + // property's quota. Quota is returned in [PropertyQuota](#PropertyQuota). bool return_property_quota = 14; // Optional. The configuration of comparisons requested and displayed. The @@ -448,7 +452,7 @@ message RunReportResponse { // Metadata for the report. ResponseMetaData metadata = 8; - // This Analytics Property's quota state including this request. + // This Google Analytics property's quota state including this request. PropertyQuota property_quota = 9; // Identifies what kind of resource this message is. This `kind` is always the @@ -459,7 +463,7 @@ message RunReportResponse { // The request to generate a pivot report. message RunPivotReportRequest { - // A Google Analytics GA4 property identifier whose events are tracked. + // A Google Analytics property identifier whose events are tracked. // Specified in the URL path and not the body. To learn more, see [where to // find your Property // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -513,15 +517,15 @@ message RunPivotReportRequest { // removed by a filter. // // Regardless of this `keep_empty_rows` setting, only data recorded by the - // Google Analytics (GA4) property can be displayed in a report. + // Google Analytics property can be displayed in a report. // // For example if a property never logs a `purchase` event, then a query for // the `eventName` dimension and `eventCount` metric will not have a row // eventName: "purchase" and eventCount: 0. bool keep_empty_rows = 10; - // Toggles whether to return the current state of this Analytics Property's - // quota. Quota is returned in [PropertyQuota](#PropertyQuota). + // Toggles whether to return the current state of this Google Analytics + // property's quota. Quota is returned in [PropertyQuota](#PropertyQuota). bool return_property_quota = 11; // Optional. The configuration of comparisons requested and displayed. The @@ -590,7 +594,7 @@ message RunPivotReportResponse { // Metadata for the report. ResponseMetaData metadata = 6; - // This Analytics Property's quota state including this request. + // This Google Analytics property's quota state including this request. PropertyQuota property_quota = 7; // Identifies what kind of resource this message is. This `kind` is always the @@ -601,7 +605,7 @@ message RunPivotReportResponse { // The batch request containing multiple report requests. message BatchRunReportsRequest { - // A Google Analytics GA4 property identifier whose events are tracked. + // A Google Analytics property identifier whose events are tracked. // Specified in the URL path and not the body. To learn more, see [where to // find your Property // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -630,7 +634,7 @@ message BatchRunReportsResponse { // The batch request containing multiple pivot report requests. message BatchRunPivotReportsRequest { - // A Google Analytics GA4 property identifier whose events are tracked. + // A Google Analytics property identifier whose events are tracked. // Specified in the URL path and not the body. To learn more, see [where to // find your Property // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -661,7 +665,7 @@ message BatchRunPivotReportsResponse { message GetMetadataRequest { // Required. The resource name of the metadata to retrieve. This name field is // specified in the URL path and not URL parameters. Property is a numeric - // Google Analytics GA4 Property identifier. To learn more, see [where to find + // Google Analytics property identifier. To learn more, see [where to find // your Property // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). // @@ -680,7 +684,7 @@ message GetMetadataRequest { // The request to generate a realtime report. message RunRealtimeReportRequest { - // A Google Analytics GA4 property identifier whose events are tracked. + // A Google Analytics property identifier whose events are tracked. // Specified in the URL path and not the body. To learn more, see [where to // find your Property // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -719,8 +723,9 @@ message RunRealtimeReportRequest { // Specifies how rows are ordered in the response. repeated OrderBy order_bys = 8; - // Toggles whether to return the current state of this Analytics Property's - // Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). + // Toggles whether to return the current state of this Google Analytics + // property's Realtime quota. Quota is returned in + // [PropertyQuota](#PropertyQuota). bool return_property_quota = 9; // The minute ranges of event data to read. If unspecified, one minute range @@ -760,7 +765,8 @@ message RunRealtimeReportResponse { // only 50 rows. int32 row_count = 7; - // This Analytics Property's Realtime quota state including this request. + // This Google Analytics property's Realtime quota state including this + // request. PropertyQuota property_quota = 8; // Identifies what kind of resource this message is. This `kind` is always the diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto b/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto index f89b70daf3c..acf242a4b98 100644 --- a/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto +++ b/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto @@ -318,6 +318,9 @@ message Filter { NumericValue to_value = 2; } + // Filter for empty values. + message EmptyFilter {} + // The dimension name or metric name. // // In most methods, dimensions & metrics can be used for the first time in @@ -339,6 +342,9 @@ message Filter { // A filter for two values. BetweenFilter between_filter = 6; + + // A filter for empty values such as "(not set)" and "" values. + EmptyFilter empty_filter = 8; } } @@ -1048,8 +1054,8 @@ enum MetricType { TYPE_KILOMETERS = 13; } -// Categories of data that you may be restricted from viewing on certain GA4 -// properties. +// Categories of data that you may be restricted from viewing on certain +// Google Analytics properties. enum RestrictedMetricType { // Unspecified type. RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; diff --git a/packages/google-analytics-data/protos/protos.d.ts b/packages/google-analytics-data/protos/protos.d.ts index ca36df03e34..9f0b74c14e6 100644 --- a/packages/google-analytics-data/protos/protos.d.ts +++ b/packages/google-analytics-data/protos/protos.d.ts @@ -20569,6 +20569,9 @@ export namespace google { /** Filter betweenFilter */ betweenFilter?: (google.analytics.data.v1beta.Filter.IBetweenFilter|null); + + /** Filter emptyFilter */ + emptyFilter?: (google.analytics.data.v1beta.Filter.IEmptyFilter|null); } /** Represents a Filter. */ @@ -20595,8 +20598,11 @@ export namespace google { /** Filter betweenFilter. */ public betweenFilter?: (google.analytics.data.v1beta.Filter.IBetweenFilter|null); + /** Filter emptyFilter. */ + public emptyFilter?: (google.analytics.data.v1beta.Filter.IEmptyFilter|null); + /** Filter oneFilter. */ - public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"); + public oneFilter?: ("stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|"emptyFilter"); /** * Creates a new Filter instance using the specified properties. @@ -21122,6 +21128,97 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an EmptyFilter. */ + interface IEmptyFilter { + } + + /** Represents an EmptyFilter. */ + class EmptyFilter implements IEmptyFilter { + + /** + * Constructs a new EmptyFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.analytics.data.v1beta.Filter.IEmptyFilter); + + /** + * Creates a new EmptyFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns EmptyFilter instance + */ + public static create(properties?: google.analytics.data.v1beta.Filter.IEmptyFilter): google.analytics.data.v1beta.Filter.EmptyFilter; + + /** + * Encodes the specified EmptyFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.EmptyFilter.verify|verify} messages. + * @param message EmptyFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.analytics.data.v1beta.Filter.IEmptyFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmptyFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.EmptyFilter.verify|verify} messages. + * @param message EmptyFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.analytics.data.v1beta.Filter.IEmptyFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmptyFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmptyFilter + * @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.analytics.data.v1beta.Filter.EmptyFilter; + + /** + * Decodes an EmptyFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmptyFilter + * @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.analytics.data.v1beta.Filter.EmptyFilter; + + /** + * Verifies an EmptyFilter 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 an EmptyFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmptyFilter + */ + public static fromObject(object: { [k: string]: any }): google.analytics.data.v1beta.Filter.EmptyFilter; + + /** + * Creates a plain object from an EmptyFilter message. Also converts values to other types if specified. + * @param message EmptyFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.analytics.data.v1beta.Filter.EmptyFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmptyFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmptyFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OrderBy. */ diff --git a/packages/google-analytics-data/protos/protos.js b/packages/google-analytics-data/protos/protos.js index 497b2eb33c3..701c7aa24d2 100644 --- a/packages/google-analytics-data/protos/protos.js +++ b/packages/google-analytics-data/protos/protos.js @@ -54015,6 +54015,7 @@ * @property {google.analytics.data.v1beta.Filter.IInListFilter|null} [inListFilter] Filter inListFilter * @property {google.analytics.data.v1beta.Filter.INumericFilter|null} [numericFilter] Filter numericFilter * @property {google.analytics.data.v1beta.Filter.IBetweenFilter|null} [betweenFilter] Filter betweenFilter + * @property {google.analytics.data.v1beta.Filter.IEmptyFilter|null} [emptyFilter] Filter emptyFilter */ /** @@ -54072,17 +54073,25 @@ */ Filter.prototype.betweenFilter = null; + /** + * Filter emptyFilter. + * @member {google.analytics.data.v1beta.Filter.IEmptyFilter|null|undefined} emptyFilter + * @memberof google.analytics.data.v1beta.Filter + * @instance + */ + Filter.prototype.emptyFilter = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Filter oneFilter. - * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|undefined} oneFilter + * @member {"stringFilter"|"inListFilter"|"numericFilter"|"betweenFilter"|"emptyFilter"|undefined} oneFilter * @memberof google.analytics.data.v1beta.Filter * @instance */ Object.defineProperty(Filter.prototype, "oneFilter", { - get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter"]), + get: $util.oneOfGetter($oneOfFields = ["stringFilter", "inListFilter", "numericFilter", "betweenFilter", "emptyFilter"]), set: $util.oneOfSetter($oneOfFields) }); @@ -54120,6 +54129,8 @@ $root.google.analytics.data.v1beta.Filter.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) $root.google.analytics.data.v1beta.Filter.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.emptyFilter != null && Object.hasOwnProperty.call(message, "emptyFilter")) + $root.google.analytics.data.v1beta.Filter.EmptyFilter.encode(message.emptyFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -54174,6 +54185,10 @@ message.betweenFilter = $root.google.analytics.data.v1beta.Filter.BetweenFilter.decode(reader, reader.uint32()); break; } + case 8: { + message.emptyFilter = $root.google.analytics.data.v1beta.Filter.EmptyFilter.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -54251,6 +54266,16 @@ return "betweenFilter." + error; } } + if (message.emptyFilter != null && message.hasOwnProperty("emptyFilter")) { + if (properties.oneFilter === 1) + return "oneFilter: multiple values"; + properties.oneFilter = 1; + { + var error = $root.google.analytics.data.v1beta.Filter.EmptyFilter.verify(message.emptyFilter); + if (error) + return "emptyFilter." + error; + } + } return null; }; @@ -54288,6 +54313,11 @@ throw TypeError(".google.analytics.data.v1beta.Filter.betweenFilter: object expected"); message.betweenFilter = $root.google.analytics.data.v1beta.Filter.BetweenFilter.fromObject(object.betweenFilter); } + if (object.emptyFilter != null) { + if (typeof object.emptyFilter !== "object") + throw TypeError(".google.analytics.data.v1beta.Filter.emptyFilter: object expected"); + message.emptyFilter = $root.google.analytics.data.v1beta.Filter.EmptyFilter.fromObject(object.emptyFilter); + } return message; }; @@ -54328,6 +54358,11 @@ if (options.oneofs) object.oneFilter = "betweenFilter"; } + if (message.emptyFilter != null && message.hasOwnProperty("emptyFilter")) { + object.emptyFilter = $root.google.analytics.data.v1beta.Filter.EmptyFilter.toObject(message.emptyFilter, options); + if (options.oneofs) + object.oneFilter = "emptyFilter"; + } return object; }; @@ -55448,6 +55483,181 @@ return BetweenFilter; })(); + Filter.EmptyFilter = (function() { + + /** + * Properties of an EmptyFilter. + * @memberof google.analytics.data.v1beta.Filter + * @interface IEmptyFilter + */ + + /** + * Constructs a new EmptyFilter. + * @memberof google.analytics.data.v1beta.Filter + * @classdesc Represents an EmptyFilter. + * @implements IEmptyFilter + * @constructor + * @param {google.analytics.data.v1beta.Filter.IEmptyFilter=} [properties] Properties to set + */ + function EmptyFilter(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]]; + } + + /** + * Creates a new EmptyFilter instance using the specified properties. + * @function create + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IEmptyFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1beta.Filter.EmptyFilter} EmptyFilter instance + */ + EmptyFilter.create = function create(properties) { + return new EmptyFilter(properties); + }; + + /** + * Encodes the specified EmptyFilter message. Does not implicitly {@link google.analytics.data.v1beta.Filter.EmptyFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IEmptyFilter} message EmptyFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmptyFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EmptyFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1beta.Filter.EmptyFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {google.analytics.data.v1beta.Filter.IEmptyFilter} message EmptyFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmptyFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmptyFilter message from the specified reader or buffer. + * @function decode + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.analytics.data.v1beta.Filter.EmptyFilter} EmptyFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmptyFilter.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.analytics.data.v1beta.Filter.EmptyFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmptyFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1beta.Filter.EmptyFilter} EmptyFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmptyFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmptyFilter message. + * @function verify + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmptyFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an EmptyFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1beta.Filter.EmptyFilter} EmptyFilter + */ + EmptyFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1beta.Filter.EmptyFilter) + return object; + return new $root.google.analytics.data.v1beta.Filter.EmptyFilter(); + }; + + /** + * Creates a plain object from an EmptyFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {google.analytics.data.v1beta.Filter.EmptyFilter} message EmptyFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmptyFilter.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EmptyFilter to JSON. + * @function toJSON + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @instance + * @returns {Object.} JSON object + */ + EmptyFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmptyFilter + * @function getTypeUrl + * @memberof google.analytics.data.v1beta.Filter.EmptyFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmptyFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.analytics.data.v1beta.Filter.EmptyFilter"; + }; + + return EmptyFilter; + })(); + return Filter; })(); diff --git a/packages/google-analytics-data/protos/protos.json b/packages/google-analytics-data/protos/protos.json index a3c8a9b4db3..6ca40148e35 100644 --- a/packages/google-analytics-data/protos/protos.json +++ b/packages/google-analytics-data/protos/protos.json @@ -5354,7 +5354,8 @@ "stringFilter", "inListFilter", "numericFilter", - "betweenFilter" + "betweenFilter", + "emptyFilter" ] } }, @@ -5378,6 +5379,10 @@ "betweenFilter": { "type": "BetweenFilter", "id": 6 + }, + "emptyFilter": { + "type": "EmptyFilter", + "id": 8 } }, "nested": { @@ -5458,6 +5463,9 @@ "id": 2 } } + }, + "EmptyFilter": { + "fields": {} } } }, diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js index 84a2dd766df..e71a17c88ac 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js @@ -29,7 +29,7 @@ function main() { * TODO(developer): Uncomment these variables before running the sample. */ /** - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see where to * find your Property * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js index aa25fb8455d..8a009ec6141 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js @@ -29,7 +29,7 @@ function main() { * TODO(developer): Uncomment these variables before running the sample. */ /** - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see where to * find your Property * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js index 2c5d6d03950..cba673dfb11 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js @@ -29,7 +29,7 @@ function main() { * TODO(developer): Uncomment these variables before running the sample. */ /** - * A Google Analytics GA4 property identifier whose events are tracked. To + * A Google Analytics property identifier whose events are tracked. To * learn more, see where to find your Property * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). * `property` should be the same value as in your `runReport` request. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js index 9c1e0942a8d..93866891ef0 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js @@ -31,7 +31,7 @@ function main(name) { /** * Required. The resource name of the metadata to retrieve. This name field is * specified in the URL path and not URL parameters. Property is a numeric - * Google Analytics GA4 Property identifier. To learn more, see where to find + * Google Analytics property identifier. To learn more, see where to find * your Property * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). * Example: properties/1234/metadata diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js index 64d3c7c050b..669565ed943 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js @@ -29,7 +29,7 @@ function main() { * TODO(developer): Uncomment these variables before running the sample. */ /** - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see where to * find your Property * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -90,15 +90,15 @@ function main() { * returned. If true, these rows will be returned if they are not separately * removed by a filter. * Regardless of this `keep_empty_rows` setting, only data recorded by the - * Google Analytics (GA4) property can be displayed in a report. + * Google Analytics property can be displayed in a report. * For example if a property never logs a `purchase` event, then a query for * the `eventName` dimension and `eventCount` metric will not have a row * eventName: "purchase" and eventCount: 0. */ // const keepEmptyRows = true /** - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in PropertyQuota (#PropertyQuota). + * Toggles whether to return the current state of this Google Analytics + * property's quota. Quota is returned in PropertyQuota (#PropertyQuota). */ // const returnPropertyQuota = true /** diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js index 1898e96fb32..3beb0350315 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js @@ -29,7 +29,7 @@ function main() { * TODO(developer): Uncomment these variables before running the sample. */ /** - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see where to * find your Property * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -74,8 +74,9 @@ function main() { */ // const orderBys = [1,2,3,4] /** - * Toggles whether to return the current state of this Analytics Property's - * Realtime quota. Quota is returned in PropertyQuota (#PropertyQuota). + * Toggles whether to return the current state of this Google Analytics + * property's Realtime quota. Quota is returned in + * PropertyQuota (#PropertyQuota). */ // const returnPropertyQuota = true /** diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js index 359e0fc4950..b38bea7e724 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js @@ -29,7 +29,7 @@ function main() { * TODO(developer): Uncomment these variables before running the sample. */ /** - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see where to * find your Property * ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -92,10 +92,14 @@ function main() { /** * Aggregation of metrics. Aggregated metric values will be shown in rows * where the dimension_values are set to "RESERVED_(MetricAggregation)". + * Aggregates including both comparisons and multiple date ranges will + * be aggregated based on the date ranges. */ // const metricAggregations = [1,2,3,4] /** * Specifies how rows are ordered in the response. + * Requests including both comparisons and multiple date ranges will + * have order bys applied on the comparisons. */ // const orderBys = [1,2,3,4] /** @@ -113,15 +117,15 @@ function main() { * returned. If true, these rows will be returned if they are not separately * removed by a filter. * Regardless of this `keep_empty_rows` setting, only data recorded by the - * Google Analytics (GA4) property can be displayed in a report. + * Google Analytics property can be displayed in a report. * For example if a property never logs a `purchase` event, then a query for * the `eventName` dimension and `eventCount` metric will not have a row * eventName: "purchase" and eventCount: 0. */ // const keepEmptyRows = true /** - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in PropertyQuota (#PropertyQuota). + * Toggles whether to return the current state of this Google Analytics + * property's quota. Quota is returned in PropertyQuota (#PropertyQuota). */ // const returnPropertyQuota = true /** diff --git a/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json index 35903d91288..58c6208b5af 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json +++ b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 150, + "end": 154, "type": "FULL" } ], @@ -195,7 +195,7 @@ "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunReports_async", "title": "BetaAnalyticsData batchRunReports Sample", "origin": "API_DEFINITION", - "description": " Returns multiple reports in a batch. All reports must be for the same GA4 Property.", + "description": " Returns multiple reports in a batch. All reports must be for the same Google Analytics property.", "canonical": true, "file": "beta_analytics_data.batch_run_reports.js", "language": "JAVASCRIPT", @@ -239,7 +239,7 @@ "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_BatchRunPivotReports_async", "title": "BetaAnalyticsData batchRunPivotReports Sample", "origin": "API_DEFINITION", - "description": " Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property.", + "description": " Returns multiple pivot reports in a batch. All reports must be for the same Google Analytics property.", "canonical": true, "file": "beta_analytics_data.batch_run_pivot_reports.js", "language": "JAVASCRIPT", @@ -283,7 +283,7 @@ "regionTag": "analyticsdata_v1beta_generated_BetaAnalyticsData_GetMetadata_async", "title": "BetaAnalyticsData getMetadata Sample", "origin": "API_DEFINITION", - "description": " Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.", + "description": " Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics property identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.", "canonical": true, "file": "beta_analytics_data.get_metadata.js", "language": "JAVASCRIPT", @@ -330,7 +330,7 @@ "segments": [ { "start": 25, - "end": 106, + "end": 107, "type": "FULL" } ], diff --git a/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts index c8c06178ead..5180c2c1348 100644 --- a/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts +++ b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts @@ -451,7 +451,7 @@ export class BetaAnalyticsDataClient { * @param {Object} request * The request object that will be sent. * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see [where to * find your Property * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -503,8 +503,12 @@ export class BetaAnalyticsDataClient { * @param {number[]} request.metricAggregations * Aggregation of metrics. Aggregated metric values will be shown in rows * where the dimension_values are set to "RESERVED_(MetricAggregation)". + * Aggregates including both comparisons and multiple date ranges will + * be aggregated based on the date ranges. * @param {number[]} request.orderBys * Specifies how rows are ordered in the response. + * Requests including both comparisons and multiple date ranges will + * have order bys applied on the comparisons. * @param {string} request.currencyCode * A currency code in ISO4217 format, such as "AED", "USD", "JPY". * If the field is empty, the report uses the property's default currency. @@ -517,14 +521,14 @@ export class BetaAnalyticsDataClient { * removed by a filter. * * Regardless of this `keep_empty_rows` setting, only data recorded by the - * Google Analytics (GA4) property can be displayed in a report. + * Google Analytics property can be displayed in a report. * * For example if a property never logs a `purchase` event, then a query for * the `eventName` dimension and `eventCount` metric will not have a row * eventName: "purchase" and eventCount: 0. * @param {boolean} request.returnPropertyQuota - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * Toggles whether to return the current state of this Google Analytics + * property's quota. Quota is returned in [PropertyQuota](#PropertyQuota). * @param {number[]} [request.comparisons] * Optional. The configuration of comparisons requested and displayed. The * request only requires a comparisons field in order to receive a comparison @@ -616,7 +620,7 @@ export class BetaAnalyticsDataClient { * @param {Object} request * The request object that will be sent. * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see [where to * find your Property * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -661,14 +665,14 @@ export class BetaAnalyticsDataClient { * removed by a filter. * * Regardless of this `keep_empty_rows` setting, only data recorded by the - * Google Analytics (GA4) property can be displayed in a report. + * Google Analytics property can be displayed in a report. * * For example if a property never logs a `purchase` event, then a query for * the `eventName` dimension and `eventCount` metric will not have a row * eventName: "purchase" and eventCount: 0. * @param {boolean} request.returnPropertyQuota - * Toggles whether to return the current state of this Analytics Property's - * quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * Toggles whether to return the current state of this Google Analytics + * property's quota. Quota is returned in [PropertyQuota](#PropertyQuota). * @param {number[]} [request.comparisons] * Optional. The configuration of comparisons requested and displayed. The * request requires both a comparisons field and a comparisons dimension to @@ -758,12 +762,12 @@ export class BetaAnalyticsDataClient { } /** * Returns multiple reports in a batch. All reports must be for the same - * GA4 Property. + * Google Analytics property. * * @param {Object} request * The request object that will be sent. * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see [where to * find your Property * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -860,12 +864,12 @@ export class BetaAnalyticsDataClient { } /** * Returns multiple pivot reports in a batch. All reports must be for the same - * GA4 Property. + * Google Analytics property. * * @param {Object} request * The request object that will be sent. * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see [where to * find your Property * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -969,7 +973,7 @@ export class BetaAnalyticsDataClient { /** * Returns metadata for dimensions and metrics available in reporting methods. * Used to explore the dimensions and metrics. In this method, a Google - * Analytics GA4 Property Identifier is specified in the request, and + * Analytics property identifier is specified in the request, and * the metadata response includes Custom dimensions and metrics as well as * Universal metadata. * @@ -983,7 +987,7 @@ export class BetaAnalyticsDataClient { * @param {string} request.name * Required. The resource name of the metadata to retrieve. This name field is * specified in the URL path and not URL parameters. Property is a numeric - * Google Analytics GA4 Property identifier. To learn more, see [where to find + * Google Analytics property identifier. To learn more, see [where to find * your Property * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). * @@ -1089,7 +1093,7 @@ export class BetaAnalyticsDataClient { * @param {Object} request * The request object that will be sent. * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. + * A Google Analytics property identifier whose events are tracked. * Specified in the URL path and not the body. To learn more, see [where to * find your Property * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). @@ -1120,8 +1124,9 @@ export class BetaAnalyticsDataClient { * @param {number[]} request.orderBys * Specifies how rows are ordered in the response. * @param {boolean} request.returnPropertyQuota - * Toggles whether to return the current state of this Analytics Property's - * Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota). + * Toggles whether to return the current state of this Google Analytics + * property's Realtime quota. Quota is returned in + * [PropertyQuota](#PropertyQuota). * @param {number[]} request.minuteRanges * The minute ranges of event data to read. If unspecified, one minute range * for the last 30 minutes will be used. If multiple minute ranges are @@ -1226,7 +1231,7 @@ export class BetaAnalyticsDataClient { * @param {Object} request * The request object that will be sent. * @param {string} request.property - * A Google Analytics GA4 property identifier whose events are tracked. To + * A Google Analytics property identifier whose events are tracked. To * learn more, see [where to find your Property * ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). * `property` should be the same value as in your `runReport` request.