diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto index 1ec409c3ca8..ba0aa334128 100644 --- a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto +++ b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto @@ -201,6 +201,9 @@ message Filter { // A filter for between two values. BetweenFilter between_filter = 5; + + // A filter for empty values such as "(not set)" and "" values. + EmptyFilter empty_filter = 6; } } @@ -341,6 +344,9 @@ message BetweenFilter { NumericValue to_value = 2; } +// Filter for empty values. +message EmptyFilter {} + // To represent a number. message NumericValue { // One of a numeric value @@ -554,6 +560,16 @@ message ResponseMetaData { // Demographics and // Interests](https://support.google.com/analytics/answer/2799357). optional bool subject_to_thresholding = 8; + + // If this report's results are + // [sampled](https://support.google.com/analytics/answer/13331292), this + // describes the percentage of events used in this report. One + // `samplingMetadatas` is populated for each date range. Each + // `samplingMetadatas` corresponds to a date range in the order that date + // ranges were specified in the request. + // + // However if the results are not sampled, this field will not be defined. + repeated SamplingMetadata sampling_metadatas = 9; } // Describes a dimension column in the report. Dimensions requested in a report @@ -1472,8 +1488,8 @@ message FunnelResponseMetadata { // [sampled](https://support.google.com/analytics/answer/13331292), this // describes what percentage of events were used in this funnel report. One // `samplingMetadatas` is populated for each date range. Each - // `samplingMetadatas` corresponds to a date range in order that date ranges - // were specified in the request. + // `samplingMetadatas` corresponds to a date range in the order that date + // ranges were specified in the request. // // However if the results are not sampled, this field will not be defined. repeated SamplingMetadata sampling_metadatas = 1; diff --git a/packages/google-analytics-data/protos/protos.d.ts b/packages/google-analytics-data/protos/protos.d.ts index 9f0b74c14e6..429c6f86046 100644 --- a/packages/google-analytics-data/protos/protos.d.ts +++ b/packages/google-analytics-data/protos/protos.d.ts @@ -9518,6 +9518,9 @@ export namespace google { /** Filter betweenFilter */ betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + + /** Filter emptyFilter */ + emptyFilter?: (google.analytics.data.v1alpha.IEmptyFilter|null); } /** Represents a Filter. */ @@ -9544,8 +9547,11 @@ export namespace google { /** Filter betweenFilter. */ public betweenFilter?: (google.analytics.data.v1alpha.IBetweenFilter|null); + /** Filter emptyFilter. */ + public emptyFilter?: (google.analytics.data.v1alpha.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. @@ -10396,6 +10402,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.v1alpha.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.v1alpha.IEmptyFilter): google.analytics.data.v1alpha.EmptyFilter; + + /** + * Encodes the specified EmptyFilter message. Does not implicitly {@link google.analytics.data.v1alpha.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.v1alpha.IEmptyFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmptyFilter message, length delimited. Does not implicitly {@link google.analytics.data.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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 a NumericValue. */ interface INumericValue { @@ -10957,6 +11054,9 @@ export namespace google { /** ResponseMetaData subjectToThresholding */ subjectToThresholding?: (boolean|null); + + /** ResponseMetaData samplingMetadatas */ + samplingMetadatas?: (google.analytics.data.v1alpha.ISamplingMetadata[]|null); } /** Represents a ResponseMetaData. */ @@ -10986,6 +11086,9 @@ export namespace google { /** ResponseMetaData subjectToThresholding. */ public subjectToThresholding?: (boolean|null); + /** ResponseMetaData samplingMetadatas. */ + public samplingMetadatas: google.analytics.data.v1alpha.ISamplingMetadata[]; + /** ResponseMetaData _schemaRestrictionResponse. */ public _schemaRestrictionResponse?: "schemaRestrictionResponse"; diff --git a/packages/google-analytics-data/protos/protos.js b/packages/google-analytics-data/protos/protos.js index 701c7aa24d2..b69993f40a9 100644 --- a/packages/google-analytics-data/protos/protos.js +++ b/packages/google-analytics-data/protos/protos.js @@ -25420,6 +25420,7 @@ * @property {google.analytics.data.v1alpha.IInListFilter|null} [inListFilter] Filter inListFilter * @property {google.analytics.data.v1alpha.INumericFilter|null} [numericFilter] Filter numericFilter * @property {google.analytics.data.v1alpha.IBetweenFilter|null} [betweenFilter] Filter betweenFilter + * @property {google.analytics.data.v1alpha.IEmptyFilter|null} [emptyFilter] Filter emptyFilter */ /** @@ -25477,17 +25478,25 @@ */ Filter.prototype.betweenFilter = null; + /** + * Filter emptyFilter. + * @member {google.analytics.data.v1alpha.IEmptyFilter|null|undefined} emptyFilter + * @memberof google.analytics.data.v1alpha.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.v1alpha.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) }); @@ -25525,6 +25534,8 @@ $root.google.analytics.data.v1alpha.NumericFilter.encode(message.numericFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.betweenFilter != null && Object.hasOwnProperty.call(message, "betweenFilter")) $root.google.analytics.data.v1alpha.BetweenFilter.encode(message.betweenFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.emptyFilter != null && Object.hasOwnProperty.call(message, "emptyFilter")) + $root.google.analytics.data.v1alpha.EmptyFilter.encode(message.emptyFilter, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -25579,6 +25590,10 @@ message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.decode(reader, reader.uint32()); break; } + case 6: { + message.emptyFilter = $root.google.analytics.data.v1alpha.EmptyFilter.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25656,6 +25671,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.v1alpha.EmptyFilter.verify(message.emptyFilter); + if (error) + return "emptyFilter." + error; + } + } return null; }; @@ -25693,6 +25718,11 @@ throw TypeError(".google.analytics.data.v1alpha.Filter.betweenFilter: object expected"); message.betweenFilter = $root.google.analytics.data.v1alpha.BetweenFilter.fromObject(object.betweenFilter); } + if (object.emptyFilter != null) { + if (typeof object.emptyFilter !== "object") + throw TypeError(".google.analytics.data.v1alpha.Filter.emptyFilter: object expected"); + message.emptyFilter = $root.google.analytics.data.v1alpha.EmptyFilter.fromObject(object.emptyFilter); + } return message; }; @@ -25733,6 +25763,11 @@ if (options.oneofs) object.oneFilter = "betweenFilter"; } + if (message.emptyFilter != null && message.hasOwnProperty("emptyFilter")) { + object.emptyFilter = $root.google.analytics.data.v1alpha.EmptyFilter.toObject(message.emptyFilter, options); + if (options.oneofs) + object.oneFilter = "emptyFilter"; + } return object; }; @@ -27619,6 +27654,181 @@ return BetweenFilter; })(); + v1alpha.EmptyFilter = (function() { + + /** + * Properties of an EmptyFilter. + * @memberof google.analytics.data.v1alpha + * @interface IEmptyFilter + */ + + /** + * Constructs a new EmptyFilter. + * @memberof google.analytics.data.v1alpha + * @classdesc Represents an EmptyFilter. + * @implements IEmptyFilter + * @constructor + * @param {google.analytics.data.v1alpha.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.v1alpha.EmptyFilter + * @static + * @param {google.analytics.data.v1alpha.IEmptyFilter=} [properties] Properties to set + * @returns {google.analytics.data.v1alpha.EmptyFilter} EmptyFilter instance + */ + EmptyFilter.create = function create(properties) { + return new EmptyFilter(properties); + }; + + /** + * Encodes the specified EmptyFilter message. Does not implicitly {@link google.analytics.data.v1alpha.EmptyFilter.verify|verify} messages. + * @function encode + * @memberof google.analytics.data.v1alpha.EmptyFilter + * @static + * @param {google.analytics.data.v1alpha.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.v1alpha.EmptyFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.analytics.data.v1alpha.EmptyFilter + * @static + * @param {google.analytics.data.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.EmptyFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.analytics.data.v1alpha.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.v1alpha.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.v1alpha.EmptyFilter + * @static + * @param {Object.} object Plain object + * @returns {google.analytics.data.v1alpha.EmptyFilter} EmptyFilter + */ + EmptyFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.analytics.data.v1alpha.EmptyFilter) + return object; + return new $root.google.analytics.data.v1alpha.EmptyFilter(); + }; + + /** + * Creates a plain object from an EmptyFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.analytics.data.v1alpha.EmptyFilter + * @static + * @param {google.analytics.data.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.EmptyFilter"; + }; + + return EmptyFilter; + })(); + v1alpha.NumericValue = (function() { /** @@ -28928,6 +29138,7 @@ * @property {string|null} [timeZone] ResponseMetaData timeZone * @property {string|null} [emptyReason] ResponseMetaData emptyReason * @property {boolean|null} [subjectToThresholding] ResponseMetaData subjectToThresholding + * @property {Array.|null} [samplingMetadatas] ResponseMetaData samplingMetadatas */ /** @@ -28939,6 +29150,7 @@ * @param {google.analytics.data.v1alpha.IResponseMetaData=} [properties] Properties to set */ function ResponseMetaData(properties) { + this.samplingMetadatas = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28993,6 +29205,14 @@ */ ResponseMetaData.prototype.subjectToThresholding = null; + /** + * ResponseMetaData samplingMetadatas. + * @member {Array.} samplingMetadatas + * @memberof google.analytics.data.v1alpha.ResponseMetaData + * @instance + */ + ResponseMetaData.prototype.samplingMetadatas = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -29087,6 +29307,9 @@ writer.uint32(/* id 7, wireType 2 =*/58).string(message.emptyReason); if (message.subjectToThresholding != null && Object.hasOwnProperty.call(message, "subjectToThresholding")) writer.uint32(/* id 8, wireType 0 =*/64).bool(message.subjectToThresholding); + if (message.samplingMetadatas != null && message.samplingMetadatas.length) + for (var i = 0; i < message.samplingMetadatas.length; ++i) + $root.google.analytics.data.v1alpha.SamplingMetadata.encode(message.samplingMetadatas[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -29145,6 +29368,12 @@ message.subjectToThresholding = reader.bool(); break; } + case 9: { + if (!(message.samplingMetadatas && message.samplingMetadatas.length)) + message.samplingMetadatas = []; + message.samplingMetadatas.push($root.google.analytics.data.v1alpha.SamplingMetadata.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -29212,6 +29441,15 @@ if (typeof message.subjectToThresholding !== "boolean") return "subjectToThresholding: boolean expected"; } + if (message.samplingMetadatas != null && message.hasOwnProperty("samplingMetadatas")) { + if (!Array.isArray(message.samplingMetadatas)) + return "samplingMetadatas: array expected"; + for (var i = 0; i < message.samplingMetadatas.length; ++i) { + var error = $root.google.analytics.data.v1alpha.SamplingMetadata.verify(message.samplingMetadatas[i]); + if (error) + return "samplingMetadatas." + error; + } + } return null; }; @@ -29242,6 +29480,16 @@ message.emptyReason = String(object.emptyReason); if (object.subjectToThresholding != null) message.subjectToThresholding = Boolean(object.subjectToThresholding); + if (object.samplingMetadatas) { + if (!Array.isArray(object.samplingMetadatas)) + throw TypeError(".google.analytics.data.v1alpha.ResponseMetaData.samplingMetadatas: array expected"); + message.samplingMetadatas = []; + for (var i = 0; i < object.samplingMetadatas.length; ++i) { + if (typeof object.samplingMetadatas[i] !== "object") + throw TypeError(".google.analytics.data.v1alpha.ResponseMetaData.samplingMetadatas: object expected"); + message.samplingMetadatas[i] = $root.google.analytics.data.v1alpha.SamplingMetadata.fromObject(object.samplingMetadatas[i]); + } + } return message; }; @@ -29258,6 +29506,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.samplingMetadatas = []; if (options.defaults) object.dataLossFromOtherRow = false; if (message.dataLossFromOtherRow != null && message.hasOwnProperty("dataLossFromOtherRow")) @@ -29287,6 +29537,11 @@ if (options.oneofs) object._subjectToThresholding = "subjectToThresholding"; } + if (message.samplingMetadatas && message.samplingMetadatas.length) { + object.samplingMetadatas = []; + for (var j = 0; j < message.samplingMetadatas.length; ++j) + object.samplingMetadatas[j] = $root.google.analytics.data.v1alpha.SamplingMetadata.toObject(message.samplingMetadatas[j], options); + } return object; }; diff --git a/packages/google-analytics-data/protos/protos.json b/packages/google-analytics-data/protos/protos.json index 6ca40148e35..d44d39e103f 100644 --- a/packages/google-analytics-data/protos/protos.json +++ b/packages/google-analytics-data/protos/protos.json @@ -2878,7 +2878,8 @@ "stringFilter", "inListFilter", "numericFilter", - "betweenFilter" + "betweenFilter", + "emptyFilter" ] } }, @@ -2902,6 +2903,10 @@ "betweenFilter": { "type": "BetweenFilter", "id": 5 + }, + "emptyFilter": { + "type": "EmptyFilter", + "id": 6 } } }, @@ -3039,6 +3044,9 @@ } } }, + "EmptyFilter": { + "fields": {} + }, "NumericValue": { "oneofs": { "oneValue": { @@ -3193,6 +3201,11 @@ "options": { "proto3_optional": true } + }, + "samplingMetadatas": { + "rule": "repeated", + "type": "SamplingMetadata", + "id": 9 } }, "nested": {