Skip to content

Commit

Permalink
feat(analyticsdata): update the API
Browse files Browse the repository at this point in the history
#### analyticsdata:v1alpha
The following keys were added:
- resources.properties.methods.getMetadata.description
- resources.properties.methods.getMetadata.flatPath
- resources.properties.methods.getMetadata.httpMethod
- resources.properties.methods.getMetadata.id
- resources.properties.methods.getMetadata.parameterOrder
- resources.properties.methods.getMetadata.parameters.name.description
- resources.properties.methods.getMetadata.parameters.name.location
- resources.properties.methods.getMetadata.parameters.name.pattern
- resources.properties.methods.getMetadata.parameters.name.required
- resources.properties.methods.getMetadata.parameters.name.type
- resources.properties.methods.getMetadata.path
- resources.properties.methods.getMetadata.response.$ref
- resources.properties.methods.getMetadata.scopes
- schemas.Metadata.description
- schemas.Metadata.id
- schemas.Metadata.properties.dimensions.description
- schemas.Metadata.properties.dimensions.items.$ref
- schemas.Metadata.properties.dimensions.type
- schemas.Metadata.properties.metrics.description
- schemas.Metadata.properties.metrics.items.$ref
- schemas.Metadata.properties.metrics.type
- schemas.Metadata.properties.name.description
- schemas.Metadata.properties.name.type
- schemas.Metadata.type

The following keys were changed:
- schemas.MetricHeader.properties.type.enum
- schemas.MetricHeader.properties.type.enumDescriptions
- schemas.MetricMetadata.properties.type.enum
- schemas.MetricMetadata.properties.type.enumDescriptions
  • Loading branch information
yoshi-automation authored and sofisl committed Oct 9, 2020
1 parent 06817be commit 04fc2c3
Show file tree
Hide file tree
Showing 2 changed files with 260 additions and 5 deletions.
97 changes: 92 additions & 5 deletions discovery/analyticsdata-v1alpha.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,36 @@
},
"protocol": "rest",
"resources": {
"properties": {
"methods": {
"getMetadata": {
"description": "Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics App + Web 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`.",
"flatPath": "v1alpha/properties/{propertiesId}/metadata",
"httpMethod": "GET",
"id": "analyticsdata.properties.getMetadata",
"parameterOrder": [
"name"
],
"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 App + Web Property identifier. Example: properties/1234/metadata",
"location": "path",
"pattern": "^properties/[^/]+/metadata$",
"required": true,
"type": "string"
}
},
"path": "v1alpha/{+name}",
"response": {
"$ref": "Metadata"
},
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
}
}
},
"v1alpha": {
"methods": {
"batchRunPivotReports": {
Expand Down Expand Up @@ -205,7 +235,7 @@
}
}
},
"revision": "20201002",
"revision": "20201006",
"rootUrl": "https://analyticsdata.googleapis.com/",
"schemas": {
"BatchRunPivotReportsRequest": {
Expand Down Expand Up @@ -626,6 +656,31 @@
},
"type": "object"
},
"Metadata": {
"description": "The dimensions and metrics currently accepted in reporting methods.",
"id": "Metadata",
"properties": {
"dimensions": {
"description": "The dimensions descriptions.",
"items": {
"$ref": "DimensionMetadata"
},
"type": "array"
},
"metrics": {
"description": "The metric descriptions.",
"items": {
"$ref": "MetricMetadata"
},
"type": "array"
},
"name": {
"description": "Resource name of this metadata.",
"type": "string"
}
},
"type": "object"
},
"Metric": {
"description": "The quantitative measurements of a report. For example, the metric eventCount is the total number of events. Requests are allowed up to 10 metrics.",
"id": "Metric",
Expand Down Expand Up @@ -660,14 +715,30 @@
"TYPE_INTEGER",
"TYPE_FLOAT",
"TYPE_SECONDS",
"TYPE_CURRENCY"
"TYPE_MILLISECONDS",
"TYPE_MINUTES",
"TYPE_HOURS",
"TYPE_STANDARD",
"TYPE_CURRENCY",
"TYPE_FEET",
"TYPE_MILES",
"TYPE_METERS",
"TYPE_KILOMETERS"
],
"enumDescriptions": [
"Unspecified type.",
"Integer type.",
"Floating point type.",
"A duration of seconds; a special floating point type.",
"An amount of money; a special floating point type."
"A duration in milliseconds; a special floating point type.",
"A duration in minutes; a special floating point type.",
"A duration in hours; a special floating point type.",
"A custom metric of standard type; a special floating point type.",
"An amount of money; a special floating point type.",
"A length in feet; a special floating point type.",
"A length in miles; a special floating point type.",
"A length in meters; a special floating point type.",
"A length in kilometers; a special floating point type."
],
"type": "string"
}
Expand Down Expand Up @@ -704,14 +775,30 @@
"TYPE_INTEGER",
"TYPE_FLOAT",
"TYPE_SECONDS",
"TYPE_CURRENCY"
"TYPE_MILLISECONDS",
"TYPE_MINUTES",
"TYPE_HOURS",
"TYPE_STANDARD",
"TYPE_CURRENCY",
"TYPE_FEET",
"TYPE_MILES",
"TYPE_METERS",
"TYPE_KILOMETERS"
],
"enumDescriptions": [
"Unspecified type.",
"Integer type.",
"Floating point type.",
"A duration of seconds; a special floating point type.",
"An amount of money; a special floating point type."
"A duration in milliseconds; a special floating point type.",
"A duration in minutes; a special floating point type.",
"A duration in hours; a special floating point type.",
"A custom metric of standard type; a special floating point type.",
"An amount of money; a special floating point type.",
"A length in feet; a special floating point type.",
"A length in miles; a special floating point type.",
"A length in meters; a special floating point type.",
"A length in kilometers; a special floating point type."
],
"type": "string"
},
Expand Down
168 changes: 168 additions & 0 deletions src/apis/analyticsdata/v1alpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export namespace analyticsdata_v1alpha {
*/
export class Analyticsdata {
context: APIRequestContext;
properties: Resource$Properties;
v1alpha: Resource$V1alpha;

constructor(options: GlobalOptions, google?: GoogleConfigurable) {
Expand All @@ -123,6 +124,7 @@ export namespace analyticsdata_v1alpha {
google,
};

this.properties = new Resource$Properties(this.context);
this.v1alpha = new Resource$V1alpha(this.context);
}
}
Expand Down Expand Up @@ -446,6 +448,23 @@ export namespace analyticsdata_v1alpha {
*/
values?: string[] | null;
}
/**
* The dimensions and metrics currently accepted in reporting methods.
*/
export interface Schema$Metadata {
/**
* The dimensions descriptions.
*/
dimensions?: Schema$DimensionMetadata[];
/**
* The metric descriptions.
*/
metrics?: Schema$MetricMetadata[];
/**
* Resource name of this metadata.
*/
name?: string | null;
}
/**
* The quantitative measurements of a report. For example, the metric eventCount is the total number of events. Requests are allowed up to 10 metrics.
*/
Expand Down Expand Up @@ -914,6 +933,155 @@ export namespace analyticsdata_v1alpha {
metrics?: Schema$MetricMetadata[];
}

export class Resource$Properties {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}

/**
* analyticsdata.properties.getMetadata
* @desc Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics App + Web 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`.
* @example
* // 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.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 App + Web Property identifier. Example: properties/1234/metadata
* name: 'properties/my-propertie/metadata',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "dimensions": [],
* // "metrics": [],
* // "name": "my_name"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* @alias analyticsdata.properties.getMetadata
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.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 App + Web Property identifier. Example: properties/1234/metadata
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getMetadata(
params: Params$Resource$Properties$Getmetadata,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
getMetadata(
params?: Params$Resource$Properties$Getmetadata,
options?: MethodOptions
): GaxiosPromise<Schema$Metadata>;
getMetadata(
params: Params$Resource$Properties$Getmetadata,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
getMetadata(
params: Params$Resource$Properties$Getmetadata,
options: MethodOptions | BodyResponseCallback<Schema$Metadata>,
callback: BodyResponseCallback<Schema$Metadata>
): void;
getMetadata(
params: Params$Resource$Properties$Getmetadata,
callback: BodyResponseCallback<Schema$Metadata>
): void;
getMetadata(callback: BodyResponseCallback<Schema$Metadata>): void;
getMetadata(
paramsOrCallback?:
| Params$Resource$Properties$Getmetadata
| BodyResponseCallback<Schema$Metadata>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Metadata>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Metadata>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Metadata> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Properties$Getmetadata;
let options = (optionsOrCallback || {}) as MethodOptions;

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

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

const rootUrl =
options.rootUrl || 'https://analyticsdata.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<Schema$Metadata>(
parameters,
callback as BodyResponseCallback<{} | void>
);
} else {
return createAPIRequest<Schema$Metadata>(parameters);
}
}
}

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 App + Web Property identifier. Example: properties/1234/metadata
*/
name?: string;
}

export class Resource$V1alpha {
context: APIRequestContext;
constructor(context: APIRequestContext) {
Expand Down

0 comments on commit 04fc2c3

Please sign in to comment.