@@ -477,17 +477,18 @@ export class ServicesClient {
477
477
options . otherArgs = options . otherArgs || { } ;
478
478
options . otherArgs . headers = options . otherArgs . headers || { } ;
479
479
const routingParameter = { } ;
480
- if (
481
- typeof request . name !== 'undefined' &&
482
- RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?' ) . test (
483
- request . name !
484
- )
485
- ) {
486
- Object . assign ( routingParameter , {
487
- location : request . name ! . match ( RegExp ( '(?<location>[^/]+)' ) ) ! [ 0 ] ,
488
- } ) ;
480
+ {
481
+ const fieldValue = request . name ;
482
+ if ( fieldValue !== undefined && fieldValue !== null ) {
483
+ const match = fieldValue
484
+ . toString ( )
485
+ . match ( RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?' ) ) ;
486
+ if ( match ) {
487
+ const parameterValue = match . groups ?. [ 'location' ] ?? fieldValue ;
488
+ Object . assign ( routingParameter , { location : parameterValue } ) ;
489
+ }
490
+ }
489
491
}
490
-
491
492
options . otherArgs . headers [ 'x-goog-request-params' ] =
492
493
gax . routingHeader . fromParams ( routingParameter ) ;
493
494
this . initialize ( ) ;
@@ -875,17 +876,18 @@ export class ServicesClient {
875
876
options . otherArgs = options . otherArgs || { } ;
876
877
options . otherArgs . headers = options . otherArgs . headers || { } ;
877
878
const routingParameter = { } ;
878
- if (
879
- typeof request . parent !== 'undefined' &&
880
- RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) . test (
881
- request . parent !
882
- )
883
- ) {
884
- Object . assign ( routingParameter , {
885
- location : request . parent ! . match ( RegExp ( '(?<location>[^/]+)' ) ) ! [ 0 ] ,
886
- } ) ;
879
+ {
880
+ const fieldValue = request . parent ;
881
+ if ( fieldValue !== undefined && fieldValue !== null ) {
882
+ const match = fieldValue
883
+ . toString ( )
884
+ . match ( RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) ) ;
885
+ if ( match ) {
886
+ const parameterValue = match . groups ?. [ 'location' ] ?? fieldValue ;
887
+ Object . assign ( routingParameter , { location : parameterValue } ) ;
888
+ }
889
+ }
887
890
}
888
-
889
891
options . otherArgs . headers [ 'x-goog-request-params' ] =
890
892
gax . routingHeader . fromParams ( routingParameter ) ;
891
893
this . initialize ( ) ;
@@ -1029,19 +1031,18 @@ export class ServicesClient {
1029
1031
options . otherArgs = options . otherArgs || { } ;
1030
1032
options . otherArgs . headers = options . otherArgs . headers || { } ;
1031
1033
const routingParameter = { } ;
1032
- if (
1033
- typeof request . service ?. name !== 'undefined' &&
1034
- RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?' ) . test (
1035
- request . service ?. name !
1036
- )
1037
- ) {
1038
- Object . assign ( routingParameter , {
1039
- location : request . service ?. name ! . match (
1040
- RegExp ( '(?< location>[^/]+)' )
1041
- ) ! [ 0 ] ,
1042
- } ) ;
1034
+ {
1035
+ const fieldValue = request . service ?. name ;
1036
+ if ( fieldValue !== undefined && fieldValue !== null ) {
1037
+ const match = fieldValue
1038
+ . toString ( )
1039
+ . match ( RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?' ) ) ;
1040
+ if ( match ) {
1041
+ const parameterValue = match . groups ?. [ 'location' ] ?? fieldValue ;
1042
+ Object . assign ( routingParameter , { location : parameterValue } ) ;
1043
+ }
1044
+ }
1043
1045
}
1044
-
1045
1046
options . otherArgs . headers [ 'x-goog-request-params' ] =
1046
1047
gax . routingHeader . fromParams ( routingParameter ) ;
1047
1048
this . initialize ( ) ;
@@ -1187,17 +1188,18 @@ export class ServicesClient {
1187
1188
options . otherArgs = options . otherArgs || { } ;
1188
1189
options . otherArgs . headers = options . otherArgs . headers || { } ;
1189
1190
const routingParameter = { } ;
1190
- if (
1191
- typeof request . name !== 'undefined' &&
1192
- RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?' ) . test (
1193
- request . name !
1194
- )
1195
- ) {
1196
- Object . assign ( routingParameter , {
1197
- location : request . name ! . match ( RegExp ( '(?<location>[^/]+)' ) ) ! [ 0 ] ,
1198
- } ) ;
1191
+ {
1192
+ const fieldValue = request . name ;
1193
+ if ( fieldValue !== undefined && fieldValue !== null ) {
1194
+ const match = fieldValue
1195
+ . toString ( )
1196
+ . match ( RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?' ) ) ;
1197
+ if ( match ) {
1198
+ const parameterValue = match . groups ?. [ 'location' ] ?? fieldValue ;
1199
+ Object . assign ( routingParameter , { location : parameterValue } ) ;
1200
+ }
1201
+ }
1199
1202
}
1200
-
1201
1203
options . otherArgs . headers [ 'x-goog-request-params' ] =
1202
1204
gax . routingHeader . fromParams ( routingParameter ) ;
1203
1205
this . initialize ( ) ;
@@ -1326,17 +1328,18 @@ export class ServicesClient {
1326
1328
options . otherArgs = options . otherArgs || { } ;
1327
1329
options . otherArgs . headers = options . otherArgs . headers || { } ;
1328
1330
const routingParameter = { } ;
1329
- if (
1330
- typeof request . parent !== 'undefined' &&
1331
- RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) . test (
1332
- request . parent !
1333
- )
1334
- ) {
1335
- Object . assign ( routingParameter , {
1336
- location : request . parent ! . match ( RegExp ( '(?<location>[^/]+)' ) ) ! [ 0 ] ,
1337
- } ) ;
1331
+ {
1332
+ const fieldValue = request . parent ;
1333
+ if ( fieldValue !== undefined && fieldValue !== null ) {
1334
+ const match = fieldValue
1335
+ . toString ( )
1336
+ . match ( RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) ) ;
1337
+ if ( match ) {
1338
+ const parameterValue = match . groups ?. [ 'location' ] ?? fieldValue ;
1339
+ Object . assign ( routingParameter , { location : parameterValue } ) ;
1340
+ }
1341
+ }
1338
1342
}
1339
-
1340
1343
options . otherArgs . headers [ 'x-goog-request-params' ] =
1341
1344
gax . routingHeader . fromParams ( routingParameter ) ;
1342
1345
this . initialize ( ) ;
@@ -1379,17 +1382,18 @@ export class ServicesClient {
1379
1382
options . otherArgs = options . otherArgs || { } ;
1380
1383
options . otherArgs . headers = options . otherArgs . headers || { } ;
1381
1384
const routingParameter = { } ;
1382
- if (
1383
- typeof request . parent !== 'undefined' &&
1384
- RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) . test (
1385
- request . parent !
1386
- )
1387
- ) {
1388
- Object . assign ( routingParameter , {
1389
- location : request . parent ! . match ( RegExp ( '(?<location>[^/]+)' ) ) ! [ 0 ] ,
1390
- } ) ;
1385
+ {
1386
+ const fieldValue = request . parent ;
1387
+ if ( fieldValue !== undefined && fieldValue !== null ) {
1388
+ const match = fieldValue
1389
+ . toString ( )
1390
+ . match ( RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) ) ;
1391
+ if ( match ) {
1392
+ const parameterValue = match . groups ?. [ 'location' ] ?? fieldValue ;
1393
+ Object . assign ( routingParameter , { location : parameterValue } ) ;
1394
+ }
1395
+ }
1391
1396
}
1392
-
1393
1397
options . otherArgs . headers [ 'x-goog-request-params' ] =
1394
1398
gax . routingHeader . fromParams ( routingParameter ) ;
1395
1399
const defaultCallSettings = this . _defaults [ 'listServices' ] ;
@@ -1441,17 +1445,18 @@ export class ServicesClient {
1441
1445
options . otherArgs = options . otherArgs || { } ;
1442
1446
options . otherArgs . headers = options . otherArgs . headers || { } ;
1443
1447
const routingParameter = { } ;
1444
- if (
1445
- typeof request . parent !== 'undefined' &&
1446
- RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) . test (
1447
- request . parent !
1448
- )
1449
- ) {
1450
- Object . assign ( routingParameter , {
1451
- location : request . parent ! . match ( RegExp ( '(?<location>[^/]+)' ) ) ! [ 0 ] ,
1452
- } ) ;
1448
+ {
1449
+ const fieldValue = request . parent ;
1450
+ if ( fieldValue !== undefined && fieldValue !== null ) {
1451
+ const match = fieldValue
1452
+ . toString ( )
1453
+ . match ( RegExp ( 'projects/[^/]+/locations/(?<location>[^/]+)' ) ) ;
1454
+ if ( match ) {
1455
+ const parameterValue = match . groups ?. [ 'location' ] ?? fieldValue ;
1456
+ Object . assign ( routingParameter , { location : parameterValue } ) ;
1457
+ }
1458
+ }
1453
1459
}
1454
-
1455
1460
options . otherArgs . headers [ 'x-goog-request-params' ] =
1456
1461
gax . routingHeader . fromParams ( routingParameter ) ;
1457
1462
const defaultCallSettings = this . _defaults [ 'listServices' ] ;
0 commit comments