From 88bd2db2f6ddc0b0f8bc1f9d3da19db3766d4de3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Fri, 2 Feb 2024 01:30:33 +0000 Subject: [PATCH] feat(analyticsadmin): update the API #### analyticsadmin:v1alpha The following keys were added: - resources.properties.resources.calculatedMetrics.methods.create.description - resources.properties.resources.calculatedMetrics.methods.create.flatPath - resources.properties.resources.calculatedMetrics.methods.create.httpMethod - resources.properties.resources.calculatedMetrics.methods.create.id - resources.properties.resources.calculatedMetrics.methods.create.parameterOrder - resources.properties.resources.calculatedMetrics.methods.create.parameters.calculatedMetricId.description - resources.properties.resources.calculatedMetrics.methods.create.parameters.calculatedMetricId.location - resources.properties.resources.calculatedMetrics.methods.create.parameters.calculatedMetricId.type - resources.properties.resources.calculatedMetrics.methods.create.parameters.parent.description - resources.properties.resources.calculatedMetrics.methods.create.parameters.parent.location - resources.properties.resources.calculatedMetrics.methods.create.parameters.parent.pattern - resources.properties.resources.calculatedMetrics.methods.create.parameters.parent.required - resources.properties.resources.calculatedMetrics.methods.create.parameters.parent.type - resources.properties.resources.calculatedMetrics.methods.create.path - resources.properties.resources.calculatedMetrics.methods.create.request.$ref - resources.properties.resources.calculatedMetrics.methods.create.response.$ref - resources.properties.resources.calculatedMetrics.methods.create.scopes - resources.properties.resources.calculatedMetrics.methods.delete.description - resources.properties.resources.calculatedMetrics.methods.delete.flatPath - resources.properties.resources.calculatedMetrics.methods.delete.httpMethod - resources.properties.resources.calculatedMetrics.methods.delete.id - resources.properties.resources.calculatedMetrics.methods.delete.parameterOrder - resources.properties.resources.calculatedMetrics.methods.delete.parameters.name.description - resources.properties.resources.calculatedMetrics.methods.delete.parameters.name.location - resources.properties.resources.calculatedMetrics.methods.delete.parameters.name.pattern - resources.properties.resources.calculatedMetrics.methods.delete.parameters.name.required - resources.properties.resources.calculatedMetrics.methods.delete.parameters.name.type - resources.properties.resources.calculatedMetrics.methods.delete.path - resources.properties.resources.calculatedMetrics.methods.delete.response.$ref - resources.properties.resources.calculatedMetrics.methods.delete.scopes - resources.properties.resources.calculatedMetrics.methods.get.description - resources.properties.resources.calculatedMetrics.methods.get.flatPath - resources.properties.resources.calculatedMetrics.methods.get.httpMethod - resources.properties.resources.calculatedMetrics.methods.get.id - resources.properties.resources.calculatedMetrics.methods.get.parameterOrder - resources.properties.resources.calculatedMetrics.methods.get.parameters.name.description - resources.properties.resources.calculatedMetrics.methods.get.parameters.name.location - resources.properties.resources.calculatedMetrics.methods.get.parameters.name.pattern - resources.properties.resources.calculatedMetrics.methods.get.parameters.name.required - resources.properties.resources.calculatedMetrics.methods.get.parameters.name.type - resources.properties.resources.calculatedMetrics.methods.get.path - resources.properties.resources.calculatedMetrics.methods.get.response.$ref - resources.properties.resources.calculatedMetrics.methods.get.scopes - resources.properties.resources.calculatedMetrics.methods.list.description - resources.properties.resources.calculatedMetrics.methods.list.flatPath - resources.properties.resources.calculatedMetrics.methods.list.httpMethod - resources.properties.resources.calculatedMetrics.methods.list.id - resources.properties.resources.calculatedMetrics.methods.list.parameterOrder - resources.properties.resources.calculatedMetrics.methods.list.parameters.pageSize.description - resources.properties.resources.calculatedMetrics.methods.list.parameters.pageSize.format - resources.properties.resources.calculatedMetrics.methods.list.parameters.pageSize.location - resources.properties.resources.calculatedMetrics.methods.list.parameters.pageSize.type - resources.properties.resources.calculatedMetrics.methods.list.parameters.pageToken.description - resources.properties.resources.calculatedMetrics.methods.list.parameters.pageToken.location - resources.properties.resources.calculatedMetrics.methods.list.parameters.pageToken.type - resources.properties.resources.calculatedMetrics.methods.list.parameters.parent.description - resources.properties.resources.calculatedMetrics.methods.list.parameters.parent.location - resources.properties.resources.calculatedMetrics.methods.list.parameters.parent.pattern - resources.properties.resources.calculatedMetrics.methods.list.parameters.parent.required - resources.properties.resources.calculatedMetrics.methods.list.parameters.parent.type - resources.properties.resources.calculatedMetrics.methods.list.path - resources.properties.resources.calculatedMetrics.methods.list.response.$ref - resources.properties.resources.calculatedMetrics.methods.list.scopes - resources.properties.resources.calculatedMetrics.methods.patch.description - resources.properties.resources.calculatedMetrics.methods.patch.flatPath - resources.properties.resources.calculatedMetrics.methods.patch.httpMethod - resources.properties.resources.calculatedMetrics.methods.patch.id - resources.properties.resources.calculatedMetrics.methods.patch.parameterOrder - resources.properties.resources.calculatedMetrics.methods.patch.parameters.name.description - resources.properties.resources.calculatedMetrics.methods.patch.parameters.name.location - resources.properties.resources.calculatedMetrics.methods.patch.parameters.name.pattern - resources.properties.resources.calculatedMetrics.methods.patch.parameters.name.required - resources.properties.resources.calculatedMetrics.methods.patch.parameters.name.type - resources.properties.resources.calculatedMetrics.methods.patch.parameters.updateMask.description - resources.properties.resources.calculatedMetrics.methods.patch.parameters.updateMask.format - resources.properties.resources.calculatedMetrics.methods.patch.parameters.updateMask.location - resources.properties.resources.calculatedMetrics.methods.patch.parameters.updateMask.type - resources.properties.resources.calculatedMetrics.methods.patch.path - resources.properties.resources.calculatedMetrics.methods.patch.request.$ref - resources.properties.resources.calculatedMetrics.methods.patch.response.$ref - resources.properties.resources.calculatedMetrics.methods.patch.scopes - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.id - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.calculatedMetricId.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.calculatedMetricId.readOnly - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.calculatedMetricId.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.description.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.description.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.displayName.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.displayName.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.formula.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.formula.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.invalidMetricReference.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.invalidMetricReference.readOnly - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.invalidMetricReference.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.metricUnit.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.metricUnit.enum - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.metricUnit.enumDescriptions - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.metricUnit.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.name.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.name.readOnly - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.name.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.restrictedMetricType.description - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.restrictedMetricType.items.enum - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.restrictedMetricType.items.enumDescriptions - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.restrictedMetricType.items.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.restrictedMetricType.readOnly - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.properties.restrictedMetricType.type - schemas.GoogleAnalyticsAdminV1alphaCalculatedMetric.type - schemas.GoogleAnalyticsAdminV1alphaChangeHistoryChangeChangeHistoryResource.properties.calculatedMetric.$ref - schemas.GoogleAnalyticsAdminV1alphaChangeHistoryChangeChangeHistoryResource.properties.calculatedMetric.description - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.description - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.id - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.properties.calculatedMetrics.description - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.properties.calculatedMetrics.items.$ref - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.properties.calculatedMetrics.type - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.properties.nextPageToken.description - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.properties.nextPageToken.type - schemas.GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse.type The following keys were changed: - resources.accounts.methods.searchChangeHistoryEvents.parameters.account.description - schemas.GoogleAnalyticsAdminV1alphaConversionEventDefaultConversionValue.properties.currencyCode.description - schemas.GoogleAnalyticsAdminV1alphaSearchChangeHistoryEventsRequest.properties.property.description - schemas.GoogleAnalyticsAdminV1alphaSearchChangeHistoryEventsRequest.properties.resourceType.items.enum - schemas.GoogleAnalyticsAdminV1alphaSearchChangeHistoryEventsRequest.properties.resourceType.items.enumDescriptions #### analyticsadmin:v1beta The following keys were changed: - resources.accounts.methods.searchChangeHistoryEvents.parameters.account.description - schemas.GoogleAnalyticsAdminV1betaConversionEventDefaultConversionValue.properties.currencyCode.description - schemas.GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsRequest.properties.property.description --- discovery/analyticsadmin-v1alpha.json | 277 +++++++++++- discovery/analyticsadmin-v1beta.json | 8 +- src/apis/analyticsadmin/v1alpha.ts | 603 +++++++++++++++++++++++++- src/apis/analyticsadmin/v1beta.ts | 6 +- 4 files changed, 878 insertions(+), 16 deletions(-) diff --git a/discovery/analyticsadmin-v1alpha.json b/discovery/analyticsadmin-v1alpha.json index c22c41c214..8450320c3e 100644 --- a/discovery/analyticsadmin-v1alpha.json +++ b/discovery/analyticsadmin-v1alpha.json @@ -349,7 +349,7 @@ ], "parameters": { "account": { - "description": "Required. The account resource for which to return change history resources.", + "description": "Required. The account resource for which to return change history resources. Format: accounts/{account} Example: \"accounts/100\"", "location": "path", "pattern": "^accounts/[^/]+$", "required": true, @@ -1775,6 +1775,165 @@ } } }, + "calculatedMetrics": { + "methods": { + "create": { + "description": "Creates a CalculatedMetric.", + "flatPath": "v1alpha/properties/{propertiesId}/calculatedMetrics", + "httpMethod": "POST", + "id": "analyticsadmin.properties.calculatedMetrics.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "calculatedMetricId": { + "description": "Required. The ID to use for the calculated metric which will become the final component of the calculated metric's resource name. This value should be 1-80 characters and valid characters are /[a-zA-Z0-9_]/, no spaces allowed. calculated_metric_id must be unique between all calculated metrics under a property. The calculated_metric_id is used when referencing this calculated metric from external APIs, for example, \"calcMetric:{calculated_metric_id}\".", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Format: properties/{property_id} Example: properties/1234", + "location": "path", + "pattern": "^properties/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/calculatedMetrics", + "request": { + "$ref": "GoogleAnalyticsAdminV1alphaCalculatedMetric" + }, + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaCalculatedMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "delete": { + "description": "Deletes a CalculatedMetric on a property.", + "flatPath": "v1alpha/properties/{propertiesId}/calculatedMetrics/{calculatedMetricsId}", + "httpMethod": "DELETE", + "id": "analyticsadmin.properties.calculatedMetrics.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the CalculatedMetric to delete. Format: properties/{property_id}/calculatedMetrics/{calculated_metric_id} Example: properties/1234/calculatedMetrics/Metric01", + "location": "path", + "pattern": "^properties/[^/]+/calculatedMetrics/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "description": "Lookup for a single CalculatedMetric.", + "flatPath": "v1alpha/properties/{propertiesId}/calculatedMetrics/{calculatedMetricsId}", + "httpMethod": "GET", + "id": "analyticsadmin.properties.calculatedMetrics.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the CalculatedMetric to get. Format: properties/{property_id}/calculatedMetrics/{calculated_metric_id} Example: properties/1234/calculatedMetrics/Metric01", + "location": "path", + "pattern": "^properties/[^/]+/calculatedMetrics/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaCalculatedMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "list": { + "description": "Lists CalculatedMetrics on a property.", + "flatPath": "v1alpha/properties/{propertiesId}/calculatedMetrics", + "httpMethod": "GET", + "id": "analyticsadmin.properties.calculatedMetrics.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of resources to return. If unspecified, at most 50 resources will be returned. The maximum value is 200 (higher values will be coerced to the maximum).", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListCalculatedMetrics` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCalculatedMetrics` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Example format: properties/1234", + "location": "path", + "pattern": "^properties/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/calculatedMetrics", + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "description": "Updates a CalculatedMetric on a property.", + "flatPath": "v1alpha/properties/{propertiesId}/calculatedMetrics/{calculatedMetricsId}", + "httpMethod": "PATCH", + "id": "analyticsadmin.properties.calculatedMetrics.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Output only. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'", + "location": "path", + "pattern": "^properties/[^/]+/calculatedMetrics/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string \"*\" to match all fields.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "request": { + "$ref": "GoogleAnalyticsAdminV1alphaCalculatedMetric" + }, + "response": { + "$ref": "GoogleAnalyticsAdminV1alphaCalculatedMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, "channelGroups": { "methods": { "create": { @@ -4298,7 +4457,7 @@ } } }, - "revision": "20231212", + "revision": "20240131", "rootUrl": "https://analyticsadmin.googleapis.com/", "schemas": { "GoogleAnalyticsAdminV1alphaAccessBetweenFilter": { @@ -5444,6 +5603,88 @@ }, "type": "object" }, + "GoogleAnalyticsAdminV1alphaCalculatedMetric": { + "description": "A definition for a calculated metric.", + "id": "GoogleAnalyticsAdminV1alphaCalculatedMetric", + "properties": { + "calculatedMetricId": { + "description": "Output only. The ID to use for the calculated metric. In the UI, this is referred to as the \"API name.\" The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, \"calcMetric:{calculated_metric_id}\".", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Optional. Description for this calculated metric. Max length of 4096 characters.", + "type": "string" + }, + "displayName": { + "description": "Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.", + "type": "string" + }, + "formula": { + "description": "Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: \"( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0\"", + "type": "string" + }, + "invalidMetricReference": { + "description": "Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results.", + "readOnly": true, + "type": "boolean" + }, + "metricUnit": { + "description": "Required. The type for the calculated metric's value.", + "enum": [ + "METRIC_UNIT_UNSPECIFIED", + "STANDARD", + "CURRENCY", + "FEET", + "MILES", + "METERS", + "KILOMETERS", + "MILLISECONDS", + "SECONDS", + "MINUTES", + "HOURS" + ], + "enumDescriptions": [ + "MetricUnit unspecified or missing.", + "This metric uses default units.", + "This metric measures a currency.", + "This metric measures feet.", + "This metric measures miles.", + "This metric measures meters.", + "This metric measures kilometers.", + "This metric measures milliseconds.", + "This metric measures seconds.", + "This metric measures minutes.", + "This metric measures hours." + ], + "type": "string" + }, + "name": { + "description": "Output only. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'", + "readOnly": true, + "type": "string" + }, + "restrictedMetricType": { + "description": "Output only. Types of restricted data that this metric contains.", + "items": { + "enum": [ + "RESTRICTED_METRIC_TYPE_UNSPECIFIED", + "COST_DATA", + "REVENUE_DATA" + ], + "enumDescriptions": [ + "Type unknown or unspecified.", + "Metric reports cost data.", + "Metric reports revenue data." + ], + "type": "string" + }, + "readOnly": true, + "type": "array" + } + }, + "type": "object" + }, "GoogleAnalyticsAdminV1alphaCancelDisplayVideo360AdvertiserLinkProposalRequest": { "description": "Request message for CancelDisplayVideo360AdvertiserLinkProposal RPC.", "id": "GoogleAnalyticsAdminV1alphaCancelDisplayVideo360AdvertiserLinkProposalRequest", @@ -5509,6 +5750,10 @@ "$ref": "GoogleAnalyticsAdminV1alphaBigQueryLink", "description": "A snapshot of a BigQuery link resource in change history." }, + "calculatedMetric": { + "$ref": "GoogleAnalyticsAdminV1alphaCalculatedMetric", + "description": "A snapshot of a CalculatedMetric resource in change history." + }, "channelGroup": { "$ref": "GoogleAnalyticsAdminV1alphaChannelGroup", "description": "A snapshot of a ChannelGroup resource in change history." @@ -5840,7 +6085,7 @@ "id": "GoogleAnalyticsAdminV1alphaConversionEventDefaultConversionValue", "properties": { "currencyCode": { - "description": "When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more.", + "description": "When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more information.", "type": "string" }, "value": { @@ -7019,6 +7264,24 @@ }, "type": "object" }, + "GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse": { + "description": "Response message for ListCalculatedMetrics RPC.", + "id": "GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse", + "properties": { + "calculatedMetrics": { + "description": "List of CalculatedMetrics.", + "items": { + "$ref": "GoogleAnalyticsAdminV1alphaCalculatedMetric" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, "GoogleAnalyticsAdminV1alphaListChannelGroupsResponse": { "description": "Response message for ListChannelGroups RPC.", "id": "GoogleAnalyticsAdminV1alphaListChannelGroupsResponse", @@ -7925,7 +8188,7 @@ "type": "string" }, "property": { - "description": "Optional. Resource name for a child property. If set, only return changes made to this property or its child resources.", + "description": "Optional. Resource name for a child property. If set, only return changes made to this property or its child resources. Format: properties/{propertyId} Example: \"properties/100\"", "type": "string" }, "resourceType": { @@ -7955,7 +8218,8 @@ "SKADNETWORK_CONVERSION_VALUE_SCHEMA", "ADSENSE_LINK", "AUDIENCE", - "EVENT_CREATE_RULE" + "EVENT_CREATE_RULE", + "CALCULATED_METRIC" ], "enumDescriptions": [ "Resource type unknown or not specified.", @@ -7981,7 +8245,8 @@ "SKAdNetworkConversionValueSchema resource", "AdSenseLink resource", "Audience resource", - "EventCreateRule resource" + "EventCreateRule resource", + "CalculatedMetric resource" ], "type": "string" }, diff --git a/discovery/analyticsadmin-v1beta.json b/discovery/analyticsadmin-v1beta.json index 4009d441c7..c65bb32658 100644 --- a/discovery/analyticsadmin-v1beta.json +++ b/discovery/analyticsadmin-v1beta.json @@ -343,7 +343,7 @@ ], "parameters": { "account": { - "description": "Required. The account resource for which to return change history resources.", + "description": "Required. The account resource for which to return change history resources. Format: accounts/{account} Example: \"accounts/100\"", "location": "path", "pattern": "^accounts/[^/]+$", "required": true, @@ -1628,7 +1628,7 @@ } } }, - "revision": "20231212", + "revision": "20240131", "rootUrl": "https://analyticsadmin.googleapis.com/", "schemas": { "GoogleAnalyticsAdminV1betaAccessBetweenFilter": { @@ -2267,7 +2267,7 @@ "id": "GoogleAnalyticsAdminV1betaConversionEventDefaultConversionValue", "properties": { "currencyCode": { - "description": "When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more.", + "description": "When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more information.", "type": "string" }, "value": { @@ -3230,7 +3230,7 @@ "type": "string" }, "property": { - "description": "Optional. Resource name for a child property. If set, only return changes made to this property or its child resources.", + "description": "Optional. Resource name for a child property. If set, only return changes made to this property or its child resources. Format: properties/{propertyId} Example: \"properties/100\"", "type": "string" }, "resourceType": { diff --git a/src/apis/analyticsadmin/v1alpha.ts b/src/apis/analyticsadmin/v1alpha.ts index 9c014e641c..188385cc34 100644 --- a/src/apis/analyticsadmin/v1alpha.ts +++ b/src/apis/analyticsadmin/v1alpha.ts @@ -901,6 +901,43 @@ export namespace analyticsadmin_v1alpha { */ streamingExportEnabled?: boolean | null; } + /** + * A definition for a calculated metric. + */ + export interface Schema$GoogleAnalyticsAdminV1alphaCalculatedMetric { + /** + * Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id\}". + */ + calculatedMetricId?: string | null; + /** + * Optional. Description for this calculated metric. Max length of 4096 characters. + */ + description?: string | null; + /** + * Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters. + */ + displayName?: string | null; + /** + * Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0" + */ + formula?: string | null; + /** + * Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results. + */ + invalidMetricReference?: boolean | null; + /** + * Required. The type for the calculated metric's value. + */ + metricUnit?: string | null; + /** + * Output only. Resource name for this CalculatedMetric. Format: 'properties/{property_id\}/calculatedMetrics/{calculated_metric_id\}' + */ + name?: string | null; + /** + * Output only. Types of restricted data that this metric contains. + */ + restrictedMetricType?: string[] | null; + } /** * Request message for CancelDisplayVideo360AdvertiserLinkProposal RPC. */ @@ -950,6 +987,10 @@ export namespace analyticsadmin_v1alpha { * A snapshot of a BigQuery link resource in change history. */ bigqueryLink?: Schema$GoogleAnalyticsAdminV1alphaBigQueryLink; + /** + * A snapshot of a CalculatedMetric resource in change history. + */ + calculatedMetric?: Schema$GoogleAnalyticsAdminV1alphaCalculatedMetric; /** * A snapshot of a ChannelGroup resource in change history. */ @@ -1201,7 +1242,7 @@ export namespace analyticsadmin_v1alpha { */ export interface Schema$GoogleAnalyticsAdminV1alphaConversionEventDefaultConversionValue { /** - * When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more. + * When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more information. */ currencyCode?: string | null; /** @@ -2037,6 +2078,19 @@ export namespace analyticsadmin_v1alpha { */ nextPageToken?: string | null; } + /** + * Response message for ListCalculatedMetrics RPC. + */ + export interface Schema$GoogleAnalyticsAdminV1alphaListCalculatedMetricsResponse { + /** + * List of CalculatedMetrics. + */ + calculatedMetrics?: Schema$GoogleAnalyticsAdminV1alphaCalculatedMetric[]; + /** + * A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. + */ + nextPageToken?: string | null; + } /** * Response message for ListChannelGroups RPC. */ @@ -2606,7 +2660,7 @@ export namespace analyticsadmin_v1alpha { */ pageToken?: string | null; /** - * Optional. Resource name for a child property. If set, only return changes made to this property or its child resources. + * Optional. Resource name for a child property. If set, only return changes made to this property or its child resources. Format: properties/{propertyId\} Example: "properties/100" */ property?: string | null; /** @@ -3602,7 +3656,7 @@ export namespace analyticsadmin_v1alpha { export interface Params$Resource$Accounts$Searchchangehistoryevents extends StandardParameters { /** - * Required. The account resource for which to return change history resources. + * Required. The account resource for which to return change history resources. Format: accounts/{account\} Example: "accounts/100" */ account?: string; @@ -4692,6 +4746,7 @@ export namespace analyticsadmin_v1alpha { adSenseLinks: Resource$Properties$Adsenselinks; audiences: Resource$Properties$Audiences; bigQueryLinks: Resource$Properties$Bigquerylinks; + calculatedMetrics: Resource$Properties$Calculatedmetrics; channelGroups: Resource$Properties$Channelgroups; conversionEvents: Resource$Properties$Conversionevents; customDimensions: Resource$Properties$Customdimensions; @@ -4713,6 +4768,9 @@ export namespace analyticsadmin_v1alpha { this.adSenseLinks = new Resource$Properties$Adsenselinks(this.context); this.audiences = new Resource$Properties$Audiences(this.context); this.bigQueryLinks = new Resource$Properties$Bigquerylinks(this.context); + this.calculatedMetrics = new Resource$Properties$Calculatedmetrics( + this.context + ); this.channelGroups = new Resource$Properties$Channelgroups(this.context); this.conversionEvents = new Resource$Properties$Conversionevents( this.context @@ -9094,6 +9152,545 @@ export namespace analyticsadmin_v1alpha { parent?: string; } + export class Resource$Properties$Calculatedmetrics { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * Creates a CalculatedMetric. + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + create( + params: Params$Resource$Properties$Calculatedmetrics$Create, + options: StreamMethodOptions + ): GaxiosPromise; + create( + params?: Params$Resource$Properties$Calculatedmetrics$Create, + options?: MethodOptions + ): GaxiosPromise; + create( + params: Params$Resource$Properties$Calculatedmetrics$Create, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Properties$Calculatedmetrics$Create, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Properties$Calculatedmetrics$Create, + callback: BodyResponseCallback + ): void; + create( + callback: BodyResponseCallback + ): void; + create( + paramsOrCallback?: + | Params$Resource$Properties$Calculatedmetrics$Create + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Properties$Calculatedmetrics$Create; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Properties$Calculatedmetrics$Create; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://analyticsadmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/calculatedMetrics').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest( + parameters + ); + } + } + + /** + * Deletes a CalculatedMetric on a property. + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + delete( + params: Params$Resource$Properties$Calculatedmetrics$Delete, + options: StreamMethodOptions + ): GaxiosPromise; + delete( + params?: Params$Resource$Properties$Calculatedmetrics$Delete, + options?: MethodOptions + ): GaxiosPromise; + delete( + params: Params$Resource$Properties$Calculatedmetrics$Delete, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Properties$Calculatedmetrics$Delete, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Properties$Calculatedmetrics$Delete, + callback: BodyResponseCallback + ): void; + delete(callback: BodyResponseCallback): void; + delete( + paramsOrCallback?: + | Params$Resource$Properties$Calculatedmetrics$Delete + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Properties$Calculatedmetrics$Delete; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Properties$Calculatedmetrics$Delete; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://analyticsadmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Lookup for a single CalculatedMetric. + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + get( + params: Params$Resource$Properties$Calculatedmetrics$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Properties$Calculatedmetrics$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Properties$Calculatedmetrics$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Properties$Calculatedmetrics$Get, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Properties$Calculatedmetrics$Get, + callback: BodyResponseCallback + ): void; + get( + callback: BodyResponseCallback + ): void; + get( + paramsOrCallback?: + | Params$Resource$Properties$Calculatedmetrics$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Properties$Calculatedmetrics$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Properties$Calculatedmetrics$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://analyticsadmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest( + parameters + ); + } + } + + /** + * Lists CalculatedMetrics on a property. + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + list( + params: Params$Resource$Properties$Calculatedmetrics$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Properties$Calculatedmetrics$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Properties$Calculatedmetrics$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Properties$Calculatedmetrics$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Properties$Calculatedmetrics$List, + callback: BodyResponseCallback + ): void; + list( + callback: BodyResponseCallback + ): void; + list( + paramsOrCallback?: + | Params$Resource$Properties$Calculatedmetrics$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Properties$Calculatedmetrics$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Properties$Calculatedmetrics$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://analyticsadmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/calculatedMetrics').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest( + parameters + ); + } + } + + /** + * Updates a CalculatedMetric on a property. + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + patch( + params: Params$Resource$Properties$Calculatedmetrics$Patch, + options: StreamMethodOptions + ): GaxiosPromise; + patch( + params?: Params$Resource$Properties$Calculatedmetrics$Patch, + options?: MethodOptions + ): GaxiosPromise; + patch( + params: Params$Resource$Properties$Calculatedmetrics$Patch, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Properties$Calculatedmetrics$Patch, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Properties$Calculatedmetrics$Patch, + callback: BodyResponseCallback + ): void; + patch( + callback: BodyResponseCallback + ): void; + patch( + paramsOrCallback?: + | Params$Resource$Properties$Calculatedmetrics$Patch + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Properties$Calculatedmetrics$Patch; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Properties$Calculatedmetrics$Patch; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://analyticsadmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest( + parameters + ); + } + } + } + + export interface Params$Resource$Properties$Calculatedmetrics$Create + extends StandardParameters { + /** + * Required. The ID to use for the calculated metric which will become the final component of the calculated metric's resource name. This value should be 1-80 characters and valid characters are /[a-zA-Z0-9_]/, no spaces allowed. calculated_metric_id must be unique between all calculated metrics under a property. The calculated_metric_id is used when referencing this calculated metric from external APIs, for example, "calcMetric:{calculated_metric_id\}". + */ + calculatedMetricId?: string; + /** + * Required. Format: properties/{property_id\} Example: properties/1234 + */ + parent?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$GoogleAnalyticsAdminV1alphaCalculatedMetric; + } + export interface Params$Resource$Properties$Calculatedmetrics$Delete + extends StandardParameters { + /** + * Required. The name of the CalculatedMetric to delete. Format: properties/{property_id\}/calculatedMetrics/{calculated_metric_id\} Example: properties/1234/calculatedMetrics/Metric01 + */ + name?: string; + } + export interface Params$Resource$Properties$Calculatedmetrics$Get + extends StandardParameters { + /** + * Required. The name of the CalculatedMetric to get. Format: properties/{property_id\}/calculatedMetrics/{calculated_metric_id\} Example: properties/1234/calculatedMetrics/Metric01 + */ + name?: string; + } + export interface Params$Resource$Properties$Calculatedmetrics$List + extends StandardParameters { + /** + * Optional. The maximum number of resources to return. If unspecified, at most 50 resources will be returned. The maximum value is 200 (higher values will be coerced to the maximum). + */ + pageSize?: number; + /** + * Optional. A page token, received from a previous `ListCalculatedMetrics` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCalculatedMetrics` must match the call that provided the page token. + */ + pageToken?: string; + /** + * Required. Example format: properties/1234 + */ + parent?: string; + } + export interface Params$Resource$Properties$Calculatedmetrics$Patch + extends StandardParameters { + /** + * Output only. Resource name for this CalculatedMetric. Format: 'properties/{property_id\}/calculatedMetrics/{calculated_metric_id\}' + */ + name?: string; + /** + * Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields. + */ + updateMask?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$GoogleAnalyticsAdminV1alphaCalculatedMetric; + } + export class Resource$Properties$Channelgroups { context: APIRequestContext; constructor(context: APIRequestContext) { diff --git a/src/apis/analyticsadmin/v1beta.ts b/src/apis/analyticsadmin/v1beta.ts index 793b71946c..8cd6070d60 100644 --- a/src/apis/analyticsadmin/v1beta.ts +++ b/src/apis/analyticsadmin/v1beta.ts @@ -592,7 +592,7 @@ export namespace analyticsadmin_v1beta { */ export interface Schema$GoogleAnalyticsAdminV1betaConversionEventDefaultConversionValue { /** - * When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more. + * When a conversion event for this event_name has no set currency, this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more information. */ currencyCode?: string | null; /** @@ -1205,7 +1205,7 @@ export namespace analyticsadmin_v1beta { */ pageToken?: string | null; /** - * Optional. Resource name for a child property. If set, only return changes made to this property or its child resources. + * Optional. Resource name for a child property. If set, only return changes made to this property or its child resources. Format: properties/{propertyId\} Example: "properties/100" */ property?: string | null; /** @@ -2058,7 +2058,7 @@ export namespace analyticsadmin_v1beta { export interface Params$Resource$Accounts$Searchchangehistoryevents extends StandardParameters { /** - * Required. The account resource for which to return change history resources. + * Required. The account resource for which to return change history resources. Format: accounts/{account\} Example: "accounts/100" */ account?: string;