diff --git a/discovery/serviceusage-v1.json b/discovery/serviceusage-v1.json index 188ddb227e2..cfb6639a8db 100644 --- a/discovery/serviceusage-v1.json +++ b/discovery/serviceusage-v1.json @@ -426,7 +426,7 @@ } } }, - "revision": "20200606", + "revision": "20200609", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AdminQuotaPolicy": { @@ -1845,7 +1845,7 @@ "type": "object" }, "MetricDescriptor": { - "description": "Defines a metric type and its schema. Once a metric descriptor is created,\ndeleting or altering it stops data collection and makes the metric type's\nexisting data unusable.", + "description": "Defines a metric type and its schema. Once a metric descriptor is created,\ndeleting or altering it stops data collection and makes the metric type's\nexisting data unusable.\n\nThe following are specific rules for service defined Monitoring metric\ndescriptors:\n\n* `type`, `metric_kind`, `value_type`, `description`, `display_name`,\n `launch_stage` fields are all required. The `unit` field must be specified\n if the `value_type` is any of DOUBLE, INT64, DISTRIBUTION.\n* Maximum of default 500 metric descriptors per service is allowed.\n* Maximum of default 10 labels per metric descriptor is allowed.\n\nThe default maximum limit can be overridden. Please follow\nhttps://cloud.google.com/monitoring/quotas", "id": "MetricDescriptor", "properties": { "description": { @@ -1857,7 +1857,7 @@ "type": "string" }, "labels": { - "description": "The set of labels that can be used to describe a specific\ninstance of this metric type. For example, the\n`appengine.googleapis.com/http/server/response_latencies` metric\ntype has a label for the HTTP response code, `response_code`, so\nyou can look at latencies for successful responses or just\nfor responses that failed.", + "description": "The set of labels that can be used to describe a specific\ninstance of this metric type.\n\nThe label key name must follow:\n\n* Only upper and lower-case letters, digits and underscores (_) are\n allowed.\n* Label name must start with a letter or digit.\n* The maximum length of a label name is 100 characters.\n\nFor example, the\n`appengine.googleapis.com/http/server/response_latencies` metric\ntype has a label for the HTTP response code, `response_code`, so\nyou can look at latencies for successful responses or just\nfor responses that failed.", "items": { "$ref": "LabelDescriptor" }, @@ -1919,7 +1919,7 @@ "type": "string" }, "type": { - "description": "The metric type, including its DNS name prefix. The type is not\nURL-encoded. All user-defined metric types have the DNS name\n`custom.googleapis.com` or `external.googleapis.com`. Metric types should\nuse a natural hierarchical grouping. For example:\n\n \"custom.googleapis.com/invoice/paid/amount\"\n \"external.googleapis.com/prometheus/up\"\n \"appengine.googleapis.com/http/server/response_latencies\"", + "description": "The metric type, including its DNS name prefix. The type is not\nURL-encoded.\n\nAll service defined metrics must be prefixed with the service name, in the\nformat of `{service name}/{relative metric name}`, such as\n`cloudsql.googleapis.com/database/cpu/utilization`. The relative metric\nname must follow:\n\n* Only upper and lower-case letters, digits, '/' and underscores '_' are\n allowed.\n* The maximum number of characters allowed for the relative_metric_name is\n 100.\n\nAll user-defined metric types have the DNS name\n`custom.googleapis.com`, `external.googleapis.com`, or\n`logging.googleapis.com/user/`.\n\nMetric types should use a natural hierarchical grouping. For example:\n\n \"custom.googleapis.com/invoice/paid/amount\"\n \"external.googleapis.com/prometheus/up\"\n \"appengine.googleapis.com/http/server/response_latencies\"", "type": "string" }, "unit": { @@ -2027,7 +2027,7 @@ "type": "object" }, "MonitoredResourceDescriptor": { - "description": "An object that describes the schema of a MonitoredResource object using a\ntype name and a set of labels. For example, the monitored resource\ndescriptor for Google Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\nDifferent APIs can support different monitored resource types. APIs generally\nprovide a `list` method that returns the monitored resource descriptors used\nby the API.", + "description": "An object that describes the schema of a MonitoredResource object using a\ntype name and a set of labels. For example, the monitored resource\ndescriptor for Google Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\nDifferent services can support different monitored resource types.\n\nThe following are specific rules to service defined monitored resources for\nMonitoring and Logging:\n\n* The `type`, `display_name`, `description`, `labels` and `launch_stage`\n fields are all required.\n* The first label of the monitored resource descriptor must be\n `resource_container`. There are legacy monitored resource descritptors\n start with `project_id`.\n* It must include a `location` label. * Maximum of default 5 service defined monitored resource descriptors\n is allowed per service.\n* Maximum of default 10 labels per monitored resource is allowed.\n\nThe default maximum limit can be overridden. Please follow\nhttps://cloud.google.com/monitoring/quotas", "id": "MonitoredResourceDescriptor", "properties": { "description": { @@ -2039,7 +2039,7 @@ "type": "string" }, "labels": { - "description": "Required. A set of labels used to describe instances of this monitored\nresource type. For example, an individual Google Cloud SQL database is\nidentified by values for the labels `\"database_id\"` and `\"zone\"`.", + "description": "Required. A set of labels used to describe instances of this monitored\nresource type.\nThe label key name must follow:\n\n* Only upper and lower-case letters, digits and underscores (_) are\n allowed.\n* Label name must start with a letter or digit.\n* The maximum length of a label name is 100 characters.\n\nFor example, an individual Google Cloud SQL database is\nidentified by values for the labels `database_id` and `location`.", "items": { "$ref": "LabelDescriptor" }, @@ -2074,7 +2074,7 @@ "type": "string" }, "type": { - "description": "Required. The monitored resource type. For example, the type\n`\"cloudsql_database\"` represents databases in Google Cloud SQL.\nThe maximum length of this value is 256 characters.", + "description": "Note there are legacy service monitored resources not following this rule.", "type": "string" } }, diff --git a/discovery/serviceusage-v1beta1.json b/discovery/serviceusage-v1beta1.json index 37d1d810f60..0b12a465fa3 100644 --- a/discovery/serviceusage-v1beta1.json +++ b/discovery/serviceusage-v1beta1.json @@ -268,6 +268,32 @@ "https://www.googleapis.com/auth/service.management" ] }, + "generateServiceIdentity": { + "description": "Generate service identity for service.", + "flatPath": "v1beta1/{v1beta1Id}/{v1beta1Id1}/services/{servicesId}:generateServiceIdentity", + "httpMethod": "POST", + "id": "serviceusage.services.generateServiceIdentity", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Name of the consumer and service to generate an identity for.\n\nThe `GenerateServiceIdentity` methods currently only support projects.\n\nAn example name would be:\n`projects/123/services/example.googleapis.com` where `123` is the\nproject number.", + "location": "path", + "pattern": "^[^/]+/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+parent}:generateServiceIdentity", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ] + }, "get": { "description": "Returns the service configuration and enabled state for a given service.", "flatPath": "v1beta1/{v1beta1Id}/{v1beta1Id1}/services/{servicesId}", @@ -764,7 +790,7 @@ } } }, - "revision": "20200606", + "revision": "20200609", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AdminQuotaPolicy": { @@ -2276,7 +2302,7 @@ "type": "object" }, "MetricDescriptor": { - "description": "Defines a metric type and its schema. Once a metric descriptor is created,\ndeleting or altering it stops data collection and makes the metric type's\nexisting data unusable.", + "description": "Defines a metric type and its schema. Once a metric descriptor is created,\ndeleting or altering it stops data collection and makes the metric type's\nexisting data unusable.\n\nThe following are specific rules for service defined Monitoring metric\ndescriptors:\n\n* `type`, `metric_kind`, `value_type`, `description`, `display_name`,\n `launch_stage` fields are all required. The `unit` field must be specified\n if the `value_type` is any of DOUBLE, INT64, DISTRIBUTION.\n* Maximum of default 500 metric descriptors per service is allowed.\n* Maximum of default 10 labels per metric descriptor is allowed.\n\nThe default maximum limit can be overridden. Please follow\nhttps://cloud.google.com/monitoring/quotas", "id": "MetricDescriptor", "properties": { "description": { @@ -2288,7 +2314,7 @@ "type": "string" }, "labels": { - "description": "The set of labels that can be used to describe a specific\ninstance of this metric type. For example, the\n`appengine.googleapis.com/http/server/response_latencies` metric\ntype has a label for the HTTP response code, `response_code`, so\nyou can look at latencies for successful responses or just\nfor responses that failed.", + "description": "The set of labels that can be used to describe a specific\ninstance of this metric type.\n\nThe label key name must follow:\n\n* Only upper and lower-case letters, digits and underscores (_) are\n allowed.\n* Label name must start with a letter or digit.\n* The maximum length of a label name is 100 characters.\n\nFor example, the\n`appengine.googleapis.com/http/server/response_latencies` metric\ntype has a label for the HTTP response code, `response_code`, so\nyou can look at latencies for successful responses or just\nfor responses that failed.", "items": { "$ref": "LabelDescriptor" }, @@ -2350,7 +2376,7 @@ "type": "string" }, "type": { - "description": "The metric type, including its DNS name prefix. The type is not\nURL-encoded. All user-defined metric types have the DNS name\n`custom.googleapis.com` or `external.googleapis.com`. Metric types should\nuse a natural hierarchical grouping. For example:\n\n \"custom.googleapis.com/invoice/paid/amount\"\n \"external.googleapis.com/prometheus/up\"\n \"appengine.googleapis.com/http/server/response_latencies\"", + "description": "The metric type, including its DNS name prefix. The type is not\nURL-encoded.\n\nAll service defined metrics must be prefixed with the service name, in the\nformat of `{service name}/{relative metric name}`, such as\n`cloudsql.googleapis.com/database/cpu/utilization`. The relative metric\nname must follow:\n\n* Only upper and lower-case letters, digits, '/' and underscores '_' are\n allowed.\n* The maximum number of characters allowed for the relative_metric_name is\n 100.\n\nAll user-defined metric types have the DNS name\n`custom.googleapis.com`, `external.googleapis.com`, or\n`logging.googleapis.com/user/`.\n\nMetric types should use a natural hierarchical grouping. For example:\n\n \"custom.googleapis.com/invoice/paid/amount\"\n \"external.googleapis.com/prometheus/up\"\n \"appengine.googleapis.com/http/server/response_latencies\"", "type": "string" }, "unit": { @@ -2458,7 +2484,7 @@ "type": "object" }, "MonitoredResourceDescriptor": { - "description": "An object that describes the schema of a MonitoredResource object using a\ntype name and a set of labels. For example, the monitored resource\ndescriptor for Google Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\nDifferent APIs can support different monitored resource types. APIs generally\nprovide a `list` method that returns the monitored resource descriptors used\nby the API.", + "description": "An object that describes the schema of a MonitoredResource object using a\ntype name and a set of labels. For example, the monitored resource\ndescriptor for Google Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\nDifferent services can support different monitored resource types.\n\nThe following are specific rules to service defined monitored resources for\nMonitoring and Logging:\n\n* The `type`, `display_name`, `description`, `labels` and `launch_stage`\n fields are all required.\n* The first label of the monitored resource descriptor must be\n `resource_container`. There are legacy monitored resource descritptors\n start with `project_id`.\n* It must include a `location` label. * Maximum of default 5 service defined monitored resource descriptors\n is allowed per service.\n* Maximum of default 10 labels per monitored resource is allowed.\n\nThe default maximum limit can be overridden. Please follow\nhttps://cloud.google.com/monitoring/quotas", "id": "MonitoredResourceDescriptor", "properties": { "description": { @@ -2470,7 +2496,7 @@ "type": "string" }, "labels": { - "description": "Required. A set of labels used to describe instances of this monitored\nresource type. For example, an individual Google Cloud SQL database is\nidentified by values for the labels `\"database_id\"` and `\"zone\"`.", + "description": "Required. A set of labels used to describe instances of this monitored\nresource type.\nThe label key name must follow:\n\n* Only upper and lower-case letters, digits and underscores (_) are\n allowed.\n* Label name must start with a letter or digit.\n* The maximum length of a label name is 100 characters.\n\nFor example, an individual Google Cloud SQL database is\nidentified by values for the labels `database_id` and `location`.", "items": { "$ref": "LabelDescriptor" }, @@ -2505,7 +2531,7 @@ "type": "string" }, "type": { - "description": "Required. The monitored resource type. For example, the type\n`\"cloudsql_database\"` represents databases in Google Cloud SQL.\nThe maximum length of this value is 256 characters.", + "description": "Note there are legacy service monitored resources not following this rule.", "type": "string" } }, diff --git a/src/apis/serviceusage/v1.ts b/src/apis/serviceusage/v1.ts index 16d0dd7086d..51ea1a0232e 100644 --- a/src/apis/serviceusage/v1.ts +++ b/src/apis/serviceusage/v1.ts @@ -1139,7 +1139,7 @@ export namespace serviceusage_v1 { syntax?: string | null; } /** - * Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. + * Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. The following are specific rules for service defined Monitoring metric descriptors: * `type`, `metric_kind`, `value_type`, `description`, `display_name`, `launch_stage` fields are all required. The `unit` field must be specified if the `value_type` is any of DOUBLE, INT64, DISTRIBUTION. * Maximum of default 500 metric descriptors per service is allowed. * Maximum of default 10 labels per metric descriptor is allowed. The default maximum limit can be overridden. Please follow https://cloud.google.com/monitoring/quotas */ export interface Schema$MetricDescriptor { /** @@ -1151,7 +1151,7 @@ export namespace serviceusage_v1 { */ displayName?: string | null; /** - * The set of labels that can be used to describe a specific instance of this metric type. For example, the `appengine.googleapis.com/http/server/response_latencies` metric type has a label for the HTTP response code, `response_code`, so you can look at latencies for successful responses or just for responses that failed. + * The set of labels that can be used to describe a specific instance of this metric type. The label key name must follow: * Only upper and lower-case letters, digits and underscores (_) are allowed. * Label name must start with a letter or digit. * The maximum length of a label name is 100 characters. For example, the `appengine.googleapis.com/http/server/response_latencies` metric type has a label for the HTTP response code, `response_code`, so you can look at latencies for successful responses or just for responses that failed. */ labels?: Schema$LabelDescriptor[]; /** @@ -1175,7 +1175,7 @@ export namespace serviceusage_v1 { */ name?: string | null; /** - * The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name `custom.googleapis.com` or `external.googleapis.com`. Metric types should use a natural hierarchical grouping. For example: "custom.googleapis.com/invoice/paid/amount" "external.googleapis.com/prometheus/up" "appengine.googleapis.com/http/server/response_latencies" + * The metric type, including its DNS name prefix. The type is not URL-encoded. All service defined metrics must be prefixed with the service name, in the format of `{service name}/{relative metric name}`, such as `cloudsql.googleapis.com/database/cpu/utilization`. The relative metric name must follow: * Only upper and lower-case letters, digits, '/' and underscores '_' are allowed. * The maximum number of characters allowed for the relative_metric_name is 100. All user-defined metric types have the DNS name `custom.googleapis.com`, `external.googleapis.com`, or `logging.googleapis.com/user/`. Metric types should use a natural hierarchical grouping. For example: "custom.googleapis.com/invoice/paid/amount" "external.googleapis.com/prometheus/up" "appengine.googleapis.com/http/server/response_latencies" */ type?: string | null; /** @@ -1231,7 +1231,7 @@ export namespace serviceusage_v1 { root?: string | null; } /** - * An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of `"gce_instance"` and specifies the use of the labels `"instance_id"` and `"zone"` to identify particular VM instances. Different APIs can support different monitored resource types. APIs generally provide a `list` method that returns the monitored resource descriptors used by the API. + * An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of `"gce_instance"` and specifies the use of the labels `"instance_id"` and `"zone"` to identify particular VM instances. Different services can support different monitored resource types. The following are specific rules to service defined monitored resources for Monitoring and Logging: * The `type`, `display_name`, `description`, `labels` and `launch_stage` fields are all required. * The first label of the monitored resource descriptor must be `resource_container`. There are legacy monitored resource descritptors start with `project_id`. * It must include a `location` label. * Maximum of default 5 service defined monitored resource descriptors is allowed per service. * Maximum of default 10 labels per monitored resource is allowed. The default maximum limit can be overridden. Please follow https://cloud.google.com/monitoring/quotas */ export interface Schema$MonitoredResourceDescriptor { /** @@ -1243,7 +1243,7 @@ export namespace serviceusage_v1 { */ displayName?: string | null; /** - * Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels `"database_id"` and `"zone"`. + * Required. A set of labels used to describe instances of this monitored resource type. The label key name must follow: * Only upper and lower-case letters, digits and underscores (_) are allowed. * Label name must start with a letter or digit. * The maximum length of a label name is 100 characters. For example, an individual Google Cloud SQL database is identified by values for the labels `database_id` and `location`. */ labels?: Schema$LabelDescriptor[]; /** @@ -1255,7 +1255,7 @@ export namespace serviceusage_v1 { */ name?: string | null; /** - * Required. The monitored resource type. For example, the type `"cloudsql_database"` represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. + * Note there are legacy service monitored resources not following this rule. */ type?: string | null; } diff --git a/src/apis/serviceusage/v1beta1.ts b/src/apis/serviceusage/v1beta1.ts index 84b8a1dcd66..ea43fd1ce81 100644 --- a/src/apis/serviceusage/v1beta1.ts +++ b/src/apis/serviceusage/v1beta1.ts @@ -1214,7 +1214,7 @@ export namespace serviceusage_v1beta1 { syntax?: string | null; } /** - * Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. + * Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. The following are specific rules for service defined Monitoring metric descriptors: * `type`, `metric_kind`, `value_type`, `description`, `display_name`, `launch_stage` fields are all required. The `unit` field must be specified if the `value_type` is any of DOUBLE, INT64, DISTRIBUTION. * Maximum of default 500 metric descriptors per service is allowed. * Maximum of default 10 labels per metric descriptor is allowed. The default maximum limit can be overridden. Please follow https://cloud.google.com/monitoring/quotas */ export interface Schema$MetricDescriptor { /** @@ -1226,7 +1226,7 @@ export namespace serviceusage_v1beta1 { */ displayName?: string | null; /** - * The set of labels that can be used to describe a specific instance of this metric type. For example, the `appengine.googleapis.com/http/server/response_latencies` metric type has a label for the HTTP response code, `response_code`, so you can look at latencies for successful responses or just for responses that failed. + * The set of labels that can be used to describe a specific instance of this metric type. The label key name must follow: * Only upper and lower-case letters, digits and underscores (_) are allowed. * Label name must start with a letter or digit. * The maximum length of a label name is 100 characters. For example, the `appengine.googleapis.com/http/server/response_latencies` metric type has a label for the HTTP response code, `response_code`, so you can look at latencies for successful responses or just for responses that failed. */ labels?: Schema$LabelDescriptor[]; /** @@ -1250,7 +1250,7 @@ export namespace serviceusage_v1beta1 { */ name?: string | null; /** - * The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name `custom.googleapis.com` or `external.googleapis.com`. Metric types should use a natural hierarchical grouping. For example: "custom.googleapis.com/invoice/paid/amount" "external.googleapis.com/prometheus/up" "appengine.googleapis.com/http/server/response_latencies" + * The metric type, including its DNS name prefix. The type is not URL-encoded. All service defined metrics must be prefixed with the service name, in the format of `{service name}/{relative metric name}`, such as `cloudsql.googleapis.com/database/cpu/utilization`. The relative metric name must follow: * Only upper and lower-case letters, digits, '/' and underscores '_' are allowed. * The maximum number of characters allowed for the relative_metric_name is 100. All user-defined metric types have the DNS name `custom.googleapis.com`, `external.googleapis.com`, or `logging.googleapis.com/user/`. Metric types should use a natural hierarchical grouping. For example: "custom.googleapis.com/invoice/paid/amount" "external.googleapis.com/prometheus/up" "appengine.googleapis.com/http/server/response_latencies" */ type?: string | null; /** @@ -1306,7 +1306,7 @@ export namespace serviceusage_v1beta1 { root?: string | null; } /** - * An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of `"gce_instance"` and specifies the use of the labels `"instance_id"` and `"zone"` to identify particular VM instances. Different APIs can support different monitored resource types. APIs generally provide a `list` method that returns the monitored resource descriptors used by the API. + * An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of `"gce_instance"` and specifies the use of the labels `"instance_id"` and `"zone"` to identify particular VM instances. Different services can support different monitored resource types. The following are specific rules to service defined monitored resources for Monitoring and Logging: * The `type`, `display_name`, `description`, `labels` and `launch_stage` fields are all required. * The first label of the monitored resource descriptor must be `resource_container`. There are legacy monitored resource descritptors start with `project_id`. * It must include a `location` label. * Maximum of default 5 service defined monitored resource descriptors is allowed per service. * Maximum of default 10 labels per monitored resource is allowed. The default maximum limit can be overridden. Please follow https://cloud.google.com/monitoring/quotas */ export interface Schema$MonitoredResourceDescriptor { /** @@ -1318,7 +1318,7 @@ export namespace serviceusage_v1beta1 { */ displayName?: string | null; /** - * Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels `"database_id"` and `"zone"`. + * Required. A set of labels used to describe instances of this monitored resource type. The label key name must follow: * Only upper and lower-case letters, digits and underscores (_) are allowed. * Label name must start with a letter or digit. * The maximum length of a label name is 100 characters. For example, an individual Google Cloud SQL database is identified by values for the labels `database_id` and `location`. */ labels?: Schema$LabelDescriptor[]; /** @@ -1330,7 +1330,7 @@ export namespace serviceusage_v1beta1 { */ name?: string | null; /** - * Required. The monitored resource type. For example, the type `"cloudsql_database"` represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. + * Note there are legacy service monitored resources not following this rule. */ type?: string | null; } @@ -2539,6 +2539,151 @@ export namespace serviceusage_v1beta1 { } } + /** + * serviceusage.services.generateServiceIdentity + * @desc Generate service identity for service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.generateServiceIdentity({ + * // Name of the consumer and service to generate an identity for. + * // + * // The `GenerateServiceIdentity` methods currently only support projects. + * // + * // An example name would be: + * // `projects/123/services/example.googleapis.com` where `123` is the + * // project number. + * parent: '[^/]+/[^/]+/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias serviceusage.services.generateServiceIdentity + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Name of the consumer and service to generate an identity for. The `GenerateServiceIdentity` methods currently only support projects. An example name would be: `projects/123/services/example.googleapis.com` where `123` is the project number. + * @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 + */ + generateServiceIdentity( + params: Params$Resource$Services$Generateserviceidentity, + options: StreamMethodOptions + ): GaxiosPromise; + generateServiceIdentity( + params?: Params$Resource$Services$Generateserviceidentity, + options?: MethodOptions + ): GaxiosPromise; + generateServiceIdentity( + params: Params$Resource$Services$Generateserviceidentity, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + generateServiceIdentity( + params: Params$Resource$Services$Generateserviceidentity, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + generateServiceIdentity( + params: Params$Resource$Services$Generateserviceidentity, + callback: BodyResponseCallback + ): void; + generateServiceIdentity( + callback: BodyResponseCallback + ): void; + generateServiceIdentity( + paramsOrCallback?: + | Params$Resource$Services$Generateserviceidentity + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Services$Generateserviceidentity; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Services$Generateserviceidentity; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/v1beta1/{+parent}:generateServiceIdentity' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + /** * serviceusage.services.get * @desc Returns the service configuration and enabled state for a given service. @@ -2867,6 +3012,13 @@ export namespace serviceusage_v1beta1 { */ requestBody?: Schema$EnableServiceRequest; } + export interface Params$Resource$Services$Generateserviceidentity + extends StandardParameters { + /** + * Name of the consumer and service to generate an identity for. The `GenerateServiceIdentity` methods currently only support projects. An example name would be: `projects/123/services/example.googleapis.com` where `123` is the project number. + */ + parent?: string; + } export interface Params$Resource$Services$Get extends StandardParameters { /** * Name of the consumer and service to get the `ConsumerState` for. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number (not project ID).