Skip to content

Commit

Permalink
feat(analyticsdata)!: update the API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This release has breaking changes.
#### analyticsdata:v1alpha
The following keys were deleted:
- resources.v1alpha.methods.getUniversalMetadata.description
- resources.v1alpha.methods.getUniversalMetadata.flatPath
- resources.v1alpha.methods.getUniversalMetadata.httpMethod
- resources.v1alpha.methods.getUniversalMetadata.id
- resources.v1alpha.methods.getUniversalMetadata.parameterOrder
- resources.v1alpha.methods.getUniversalMetadata.path
- resources.v1alpha.methods.getUniversalMetadata.response.$ref
- resources.v1alpha.methods.getUniversalMetadata.scopes
- schemas.UniversalMetadata.description
- schemas.UniversalMetadata.id
- schemas.UniversalMetadata.properties.dimensions.description
- schemas.UniversalMetadata.properties.dimensions.items.$ref
- schemas.UniversalMetadata.properties.dimensions.type
- schemas.UniversalMetadata.properties.metrics.description
- schemas.UniversalMetadata.properties.metrics.items.$ref
- schemas.UniversalMetadata.properties.metrics.type
- schemas.UniversalMetadata.type

The following keys were changed:
- resources.properties.methods.getMetadata.parameters.name.description
- schemas.DateRange.description
  • Loading branch information
yoshi-automation authored and sofisl committed Nov 11, 2020
1 parent 5a0b97a commit 14c3fb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 194 deletions.
43 changes: 3 additions & 40 deletions discovery/analyticsdata-v1alpha.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
],
"parameters": {
"name": {
"description": "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 your Property ID](https://developers.google.com/analytics/trusted-testing/analytics-data/property-id). Example: properties/1234/metadata",
"description": "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 your Property ID](https://developers.google.com/analytics/trusted-testing/analytics-data/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics.",
"location": "path",
"pattern": "^properties/[^/]+/metadata$",
"required": true,
Expand Down Expand Up @@ -207,22 +207,6 @@
"https://www.googleapis.com/auth/analytics.readonly"
]
},
"getUniversalMetadata": {
"description": "Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. Dimensions and metrics will be mostly added over time, but renames and deletions may occur. This method returns Universal Metadata. Universal Metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.",
"flatPath": "v1alpha/universalMetadata",
"httpMethod": "GET",
"id": "analyticsdata.getUniversalMetadata",
"parameterOrder": [],
"parameters": {},
"path": "v1alpha/universalMetadata",
"response": {
"$ref": "UniversalMetadata"
},
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
},
"runPivotReport": {
"description": "Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.",
"flatPath": "v1alpha:runPivotReport",
Expand Down Expand Up @@ -264,7 +248,7 @@
}
}
},
"revision": "20201030",
"revision": "20201107",
"rootUrl": "https://analyticsdata.googleapis.com/",
"schemas": {
"BatchRunPivotReportsRequest": {
Expand Down Expand Up @@ -461,7 +445,7 @@
"type": "object"
},
"DateRange": {
"description": "A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges, and the union of the ranges can cover up to 1 year.",
"description": "A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges.",
"id": "DateRange",
"properties": {
"endDate": {
Expand Down Expand Up @@ -1550,27 +1534,6 @@
}
},
"type": "object"
},
"UniversalMetadata": {
"description": "The dimensions and metrics currently accepted in reporting methods.",
"id": "UniversalMetadata",
"properties": {
"dimensions": {
"description": "The dimensions descriptions.",
"items": {
"$ref": "DimensionMetadata"
},
"type": "array"
},
"metrics": {
"description": "The metric descriptions.",
"items": {
"$ref": "MetricMetadata"
},
"type": "array"
}
},
"type": "object"
}
},
"servicePath": "",
Expand Down
157 changes: 3 additions & 154 deletions src/apis/analyticsdata/v1alpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export namespace analyticsdata_v1alpha {
dimensionNames?: string[] | null;
}
/**
* A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges, and the union of the ranges can cover up to 1 year.
* A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges.
*/
export interface Schema$DateRange {
/**
Expand Down Expand Up @@ -989,19 +989,6 @@ export namespace analyticsdata_v1alpha {
*/
value?: string | null;
}
/**
* The dimensions and metrics currently accepted in reporting methods.
*/
export interface Schema$UniversalMetadata {
/**
* The dimensions descriptions.
*/
dimensions?: Schema$DimensionMetadata[];
/**
* The metric descriptions.
*/
metrics?: Schema$MetricMetadata[];
}

export class Resource$Properties {
context: APIRequestContext;
Expand Down Expand Up @@ -1039,7 +1026,7 @@ export namespace analyticsdata_v1alpha {
*
* // Do the magic
* const res = await analyticsdata.properties.getMetadata({
* // 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 your Property ID](https://developers.google.com/analytics/trusted-testing/analytics-data/property-id). Example: properties/1234/metadata
* // 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 your Property ID](https://developers.google.com/analytics/trusted-testing/analytics-data/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics.
* name: 'properties/my-propertie/metadata',
* });
* console.log(res.data);
Expand Down Expand Up @@ -1307,7 +1294,7 @@ export namespace analyticsdata_v1alpha {
export interface Params$Resource$Properties$Getmetadata
extends StandardParameters {
/**
* 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 your Property ID](https://developers.google.com/analytics/trusted-testing/analytics-data/property-id). Example: properties/1234/metadata
* 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 your Property ID](https://developers.google.com/analytics/trusted-testing/analytics-data/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics.
*/
name?: string;
}
Expand Down Expand Up @@ -1624,142 +1611,6 @@ export namespace analyticsdata_v1alpha {
}
}

/**
* Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. Dimensions and metrics will be mostly added over time, but renames and deletions may occur. This method returns Universal Metadata. Universal Metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const analyticsdata = google.analyticsdata('v1alpha');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [
* 'https://www.googleapis.com/auth/analytics',
* 'https://www.googleapis.com/auth/analytics.readonly',
* ],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await analyticsdata.getUniversalMetadata({});
* console.log(res.data);
*
* // Example response
* // {
* // "dimensions": [],
* // "metrics": []
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @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.
*/
getUniversalMetadata(
params: Params$Resource$V1alpha$Getuniversalmetadata,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
getUniversalMetadata(
params?: Params$Resource$V1alpha$Getuniversalmetadata,
options?: MethodOptions
): GaxiosPromise<Schema$UniversalMetadata>;
getUniversalMetadata(
params: Params$Resource$V1alpha$Getuniversalmetadata,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
getUniversalMetadata(
params: Params$Resource$V1alpha$Getuniversalmetadata,
options: MethodOptions | BodyResponseCallback<Schema$UniversalMetadata>,
callback: BodyResponseCallback<Schema$UniversalMetadata>
): void;
getUniversalMetadata(
params: Params$Resource$V1alpha$Getuniversalmetadata,
callback: BodyResponseCallback<Schema$UniversalMetadata>
): void;
getUniversalMetadata(
callback: BodyResponseCallback<Schema$UniversalMetadata>
): void;
getUniversalMetadata(
paramsOrCallback?:
| Params$Resource$V1alpha$Getuniversalmetadata
| BodyResponseCallback<Schema$UniversalMetadata>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$UniversalMetadata>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$UniversalMetadata>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$UniversalMetadata>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$V1alpha$Getuniversalmetadata;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$V1alpha$Getuniversalmetadata;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl =
options.rootUrl || 'https://analyticsdata.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1alpha/universalMetadata').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$UniversalMetadata>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$UniversalMetadata>(parameters);
}
}

/**
* Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
* @example
Expand Down Expand Up @@ -2095,8 +1946,6 @@ export namespace analyticsdata_v1alpha {
*/
requestBody?: Schema$BatchRunReportsRequest;
}
export interface Params$Resource$V1alpha$Getuniversalmetadata
extends StandardParameters {}
export interface Params$Resource$V1alpha$Runpivotreport
extends StandardParameters {
/**
Expand Down

0 comments on commit 14c3fb7

Please sign in to comment.