Skip to content

Commit 1743452

Browse files
feat: [asset] add tag key id support (#5206)
* feat: add tag key id support docs: add tagKeyIds example for ResourceSearchResult.tags PiperOrigin-RevId: 619997195 Source-Link: googleapis/googleapis@a585563 Source-Link: googleapis/googleapis-gen@086562a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFzc2V0Ly5Pd2xCb3QueWFtbCIsImgiOiIwODY1NjJhMTRkMDM2NjAxY2FjM2Q0MjUxMThiMGIyYTI4ZWQyYTQ5In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f0d3adf commit 1743452

14 files changed

Lines changed: 284 additions & 25 deletions

packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ message Tag {
309309
// TagKey namespaced name, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}.
310310
optional string tag_key = 1;
311311

312+
// TagKey ID, in the format of tagKeys/{TAG_KEY_ID}.
313+
optional string tag_key_id = 2;
314+
312315
// TagValue namespaced name, in the format of
313316
// {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}.
314317
optional string tag_value = 3;
@@ -639,6 +642,7 @@ message ResourceSearchResult {
639642
// - `tagKeys:"123456789/env*"`
640643
// - `tagKeys="123456789/env"`
641644
// - `tagKeys:"env"`
645+
// - `tagKeyIds="tagKeys/123"`
642646
// - `tagValues:"env"`
643647
// - `tagValues:"env/prod"`
644648
// - `tagValues:"123456789/env/prod*"`
@@ -660,6 +664,7 @@ message ResourceSearchResult {
660664
// - `effectiveTagKeys:"123456789/env*"`
661665
// - `effectiveTagKeys="123456789/env"`
662666
// - `effectiveTagKeys:"env"`
667+
// - `effectiveTagKeyIds="tagKeys/123"`
663668
// - `effectiveTagValues:"env"`
664669
// - `effectiveTagValues:"env/prod"`
665670
// - `effectiveTagValues:"123456789/env/prod*"`

packages/google-cloud-asset/protos/protos.d.ts

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-asset/protos/protos.js

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-asset/protos/protos.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-asset/src/v1/asset_service_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,15 @@ export class AssetServiceClient {
122122
'Please set either universe_domain or universeDomain, but not both.'
123123
);
124124
}
125+
const universeDomainEnvVar =
126+
typeof process === 'object' && typeof process.env === 'object'
127+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
128+
: undefined;
125129
this._universeDomain =
126-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
130+
opts?.universeDomain ??
131+
opts?.universe_domain ??
132+
universeDomainEnvVar ??
133+
'googleapis.com';
127134
this._servicePath = 'cloudasset.' + this._universeDomain;
128135
const servicePath =
129136
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -175,7 +182,7 @@ export class AssetServiceClient {
175182

176183
// Determine the client header string.
177184
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
178-
if (typeof process !== 'undefined' && 'versions' in process) {
185+
if (typeof process === 'object' && 'versions' in process) {
179186
clientHeader.push(`gl-node/${process.versions.node}`);
180187
} else {
181188
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -434,7 +441,7 @@ export class AssetServiceClient {
434441
*/
435442
static get servicePath() {
436443
if (
437-
typeof process !== undefined &&
444+
typeof process === 'object' &&
438445
typeof process.emitWarning === 'function'
439446
) {
440447
process.emitWarning(
@@ -452,7 +459,7 @@ export class AssetServiceClient {
452459
*/
453460
static get apiEndpoint() {
454461
if (
455-
typeof process !== undefined &&
462+
typeof process === 'object' &&
456463
typeof process.emitWarning === 'function'
457464
) {
458465
process.emitWarning(

packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,15 @@ export class AssetServiceClient {
118118
'Please set either universe_domain or universeDomain, but not both.'
119119
);
120120
}
121+
const universeDomainEnvVar =
122+
typeof process === 'object' && typeof process.env === 'object'
123+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
124+
: undefined;
121125
this._universeDomain =
122-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
126+
opts?.universeDomain ??
127+
opts?.universe_domain ??
128+
universeDomainEnvVar ??
129+
'googleapis.com';
123130
this._servicePath = 'cloudasset.' + this._universeDomain;
124131
const servicePath =
125132
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -171,7 +178,7 @@ export class AssetServiceClient {
171178

172179
// Determine the client header string.
173180
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
174-
if (typeof process !== 'undefined' && 'versions' in process) {
181+
if (typeof process === 'object' && 'versions' in process) {
175182
clientHeader.push(`gl-node/${process.versions.node}`);
176183
} else {
177184
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -292,7 +299,7 @@ export class AssetServiceClient {
292299
*/
293300
static get servicePath() {
294301
if (
295-
typeof process !== undefined &&
302+
typeof process === 'object' &&
296303
typeof process.emitWarning === 'function'
297304
) {
298305
process.emitWarning(
@@ -310,7 +317,7 @@ export class AssetServiceClient {
310317
*/
311318
static get apiEndpoint() {
312319
if (
313-
typeof process !== undefined &&
320+
typeof process === 'object' &&
314321
typeof process.emitWarning === 'function'
315322
) {
316323
process.emitWarning(

packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,15 @@ export class AssetServiceClient {
117117
'Please set either universe_domain or universeDomain, but not both.'
118118
);
119119
}
120+
const universeDomainEnvVar =
121+
typeof process === 'object' && typeof process.env === 'object'
122+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
123+
: undefined;
120124
this._universeDomain =
121-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
125+
opts?.universeDomain ??
126+
opts?.universe_domain ??
127+
universeDomainEnvVar ??
128+
'googleapis.com';
122129
this._servicePath = 'cloudasset.' + this._universeDomain;
123130
const servicePath =
124131
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -170,7 +177,7 @@ export class AssetServiceClient {
170177

171178
// Determine the client header string.
172179
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
173-
if (typeof process !== 'undefined' && 'versions' in process) {
180+
if (typeof process === 'object' && 'versions' in process) {
174181
clientHeader.push(`gl-node/${process.versions.node}`);
175182
} else {
176183
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -302,7 +309,7 @@ export class AssetServiceClient {
302309
*/
303310
static get servicePath() {
304311
if (
305-
typeof process !== undefined &&
312+
typeof process === 'object' &&
306313
typeof process.emitWarning === 'function'
307314
) {
308315
process.emitWarning(
@@ -320,7 +327,7 @@ export class AssetServiceClient {
320327
*/
321328
static get apiEndpoint() {
322329
if (
323-
typeof process !== undefined &&
330+
typeof process === 'object' &&
324331
typeof process.emitWarning === 'function'
325332
) {
326333
process.emitWarning(

packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,15 @@ export class AssetServiceClient {
119119
'Please set either universe_domain or universeDomain, but not both.'
120120
);
121121
}
122+
const universeDomainEnvVar =
123+
typeof process === 'object' && typeof process.env === 'object'
124+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
125+
: undefined;
122126
this._universeDomain =
123-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
127+
opts?.universeDomain ??
128+
opts?.universe_domain ??
129+
universeDomainEnvVar ??
130+
'googleapis.com';
124131
this._servicePath = 'cloudasset.' + this._universeDomain;
125132
const servicePath =
126133
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -172,7 +179,7 @@ export class AssetServiceClient {
172179

173180
// Determine the client header string.
174181
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
175-
if (typeof process !== 'undefined' && 'versions' in process) {
182+
if (typeof process === 'object' && 'versions' in process) {
176183
clientHeader.push(`gl-node/${process.versions.node}`);
177184
} else {
178185
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -300,7 +307,7 @@ export class AssetServiceClient {
300307
*/
301308
static get servicePath() {
302309
if (
303-
typeof process !== undefined &&
310+
typeof process === 'object' &&
304311
typeof process.emitWarning === 'function'
305312
) {
306313
process.emitWarning(
@@ -318,7 +325,7 @@ export class AssetServiceClient {
318325
*/
319326
static get apiEndpoint() {
320327
if (
321-
typeof process !== undefined &&
328+
typeof process === 'object' &&
322329
typeof process.emitWarning === 'function'
323330
) {
324331
process.emitWarning(

packages/google-cloud-asset/src/v1p7beta1/asset_service_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,15 @@ export class AssetServiceClient {
120120
'Please set either universe_domain or universeDomain, but not both.'
121121
);
122122
}
123+
const universeDomainEnvVar =
124+
typeof process === 'object' && typeof process.env === 'object'
125+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
126+
: undefined;
123127
this._universeDomain =
124-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
128+
opts?.universeDomain ??
129+
opts?.universe_domain ??
130+
universeDomainEnvVar ??
131+
'googleapis.com';
125132
this._servicePath = 'cloudasset.' + this._universeDomain;
126133
const servicePath =
127134
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -173,7 +180,7 @@ export class AssetServiceClient {
173180

174181
// Determine the client header string.
175182
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
176-
if (typeof process !== 'undefined' && 'versions' in process) {
183+
if (typeof process === 'object' && 'versions' in process) {
177184
clientHeader.push(`gl-node/${process.versions.node}`);
178185
} else {
179186
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -325,7 +332,7 @@ export class AssetServiceClient {
325332
*/
326333
static get servicePath() {
327334
if (
328-
typeof process !== undefined &&
335+
typeof process === 'object' &&
329336
typeof process.emitWarning === 'function'
330337
) {
331338
process.emitWarning(
@@ -343,7 +350,7 @@ export class AssetServiceClient {
343350
*/
344351
static get apiEndpoint() {
345352
if (
346-
typeof process !== undefined &&
353+
typeof process === 'object' &&
347354
typeof process.emitWarning === 'function'
348355
) {
349356
process.emitWarning(

0 commit comments

Comments
 (0)