@@ -557,6 +557,148 @@ public Instances instances() {
557
557
*/
558
558
public class Instances {
559
559
560
+ /**
561
+ * Initiated by Cloud Console for Oauth consent flow for Workbench Instances. Do not use this method
562
+ * directly. Design doc: go/wbi-euc:auth-dd
563
+ *
564
+ * Create a request for the method "instances.checkAuthorization".
565
+ *
566
+ * This request holds the parameters needed by the notebooks server. After setting any optional
567
+ * parameters, call the {@link CheckAuthorization#execute()} method to invoke the remote operation.
568
+ *
569
+ * @param name Required. The name of the Notebook Instance resource. Format:
570
+ * `projects/{project}/locations/{location}/instances/{instance}`
571
+ * @param content the {@link com.google.api.services.notebooks.v2.model.CheckAuthorizationRequest}
572
+ * @return the request
573
+ */
574
+ public CheckAuthorization checkAuthorization (java .lang .String name , com .google .api .services .notebooks .v2 .model .CheckAuthorizationRequest content ) throws java .io .IOException {
575
+ CheckAuthorization result = new CheckAuthorization (name , content );
576
+ initialize (result );
577
+ return result ;
578
+ }
579
+
580
+ public class CheckAuthorization extends AIPlatformNotebooksRequest <com .google .api .services .notebooks .v2 .model .CheckAuthorizationResponse > {
581
+
582
+ private static final String REST_PATH = "v2/{+name}:checkAuthorization" ;
583
+
584
+ private final java .util .regex .Pattern NAME_PATTERN =
585
+ java .util .regex .Pattern .compile ("^projects/[^/]+/locations/[^/]+/instances/[^/]+$" );
586
+
587
+ /**
588
+ * Initiated by Cloud Console for Oauth consent flow for Workbench Instances. Do not use this
589
+ * method directly. Design doc: go/wbi-euc:auth-dd
590
+ *
591
+ * Create a request for the method "instances.checkAuthorization".
592
+ *
593
+ * This request holds the parameters needed by the the notebooks server. After setting any
594
+ * optional parameters, call the {@link CheckAuthorization#execute()} method to invoke the remote
595
+ * operation. <p> {@link CheckAuthorization#initialize(com.google.api.client.googleapis.services.A
596
+ * bstractGoogleClientRequest)} must be called to initialize this instance immediately after
597
+ * invoking the constructor. </p>
598
+ *
599
+ * @param name Required. The name of the Notebook Instance resource. Format:
600
+ * `projects/{project}/locations/{location}/instances/{instance}`
601
+ * @param content the {@link com.google.api.services.notebooks.v2.model.CheckAuthorizationRequest}
602
+ * @since 1.13
603
+ */
604
+ protected CheckAuthorization (java .lang .String name , com .google .api .services .notebooks .v2 .model .CheckAuthorizationRequest content ) {
605
+ super (AIPlatformNotebooks .this , "POST" , REST_PATH , content , com .google .api .services .notebooks .v2 .model .CheckAuthorizationResponse .class );
606
+ this .name = com .google .api .client .util .Preconditions .checkNotNull (name , "Required parameter name must be specified." );
607
+ if (!getSuppressPatternChecks ()) {
608
+ com .google .api .client .util .Preconditions .checkArgument (NAME_PATTERN .matcher (name ).matches (),
609
+ "Parameter name must conform to the pattern " +
610
+ "^projects/[^/]+/locations/[^/]+/instances/[^/]+$" );
611
+ }
612
+ }
613
+
614
+ @ Override
615
+ public CheckAuthorization set$Xgafv (java .lang .String $Xgafv ) {
616
+ return (CheckAuthorization ) super .set$Xgafv ($Xgafv );
617
+ }
618
+
619
+ @ Override
620
+ public CheckAuthorization setAccessToken (java .lang .String accessToken ) {
621
+ return (CheckAuthorization ) super .setAccessToken (accessToken );
622
+ }
623
+
624
+ @ Override
625
+ public CheckAuthorization setAlt (java .lang .String alt ) {
626
+ return (CheckAuthorization ) super .setAlt (alt );
627
+ }
628
+
629
+ @ Override
630
+ public CheckAuthorization setCallback (java .lang .String callback ) {
631
+ return (CheckAuthorization ) super .setCallback (callback );
632
+ }
633
+
634
+ @ Override
635
+ public CheckAuthorization setFields (java .lang .String fields ) {
636
+ return (CheckAuthorization ) super .setFields (fields );
637
+ }
638
+
639
+ @ Override
640
+ public CheckAuthorization setKey (java .lang .String key ) {
641
+ return (CheckAuthorization ) super .setKey (key );
642
+ }
643
+
644
+ @ Override
645
+ public CheckAuthorization setOauthToken (java .lang .String oauthToken ) {
646
+ return (CheckAuthorization ) super .setOauthToken (oauthToken );
647
+ }
648
+
649
+ @ Override
650
+ public CheckAuthorization setPrettyPrint (java .lang .Boolean prettyPrint ) {
651
+ return (CheckAuthorization ) super .setPrettyPrint (prettyPrint );
652
+ }
653
+
654
+ @ Override
655
+ public CheckAuthorization setQuotaUser (java .lang .String quotaUser ) {
656
+ return (CheckAuthorization ) super .setQuotaUser (quotaUser );
657
+ }
658
+
659
+ @ Override
660
+ public CheckAuthorization setUploadType (java .lang .String uploadType ) {
661
+ return (CheckAuthorization ) super .setUploadType (uploadType );
662
+ }
663
+
664
+ @ Override
665
+ public CheckAuthorization setUploadProtocol (java .lang .String uploadProtocol ) {
666
+ return (CheckAuthorization ) super .setUploadProtocol (uploadProtocol );
667
+ }
668
+
669
+ /**
670
+ * Required. The name of the Notebook Instance resource. Format:
671
+ * `projects/{project}/locations/{location}/instances/{instance}`
672
+ */
673
+ @ com .google .api .client .util .Key
674
+ private java .lang .String name ;
675
+
676
+ /** Required. The name of the Notebook Instance resource. Format:
677
+ `projects/{project}/locations/{location}/instances/{instance}`
678
+ */
679
+ public java .lang .String getName () {
680
+ return name ;
681
+ }
682
+
683
+ /**
684
+ * Required. The name of the Notebook Instance resource. Format:
685
+ * `projects/{project}/locations/{location}/instances/{instance}`
686
+ */
687
+ public CheckAuthorization setName (java .lang .String name ) {
688
+ if (!getSuppressPatternChecks ()) {
689
+ com .google .api .client .util .Preconditions .checkArgument (NAME_PATTERN .matcher (name ).matches (),
690
+ "Parameter name must conform to the pattern " +
691
+ "^projects/[^/]+/locations/[^/]+/instances/[^/]+$" );
692
+ }
693
+ this .name = name ;
694
+ return this ;
695
+ }
696
+
697
+ @ Override
698
+ public CheckAuthorization set (String parameterName , Object value ) {
699
+ return (CheckAuthorization ) super .set (parameterName , value );
700
+ }
701
+ }
560
702
/**
561
703
* Checks whether a notebook instance is upgradable.
562
704
*
@@ -1147,6 +1289,143 @@ public Diagnose set(String parameterName, Object value) {
1147
1289
return (Diagnose ) super .set (parameterName , value );
1148
1290
}
1149
1291
}
1292
+ /**
1293
+ * Called by VM to return an EUC for the instance owner. Do not use this method directly. Design
1294
+ * doc: go/wbi-euc:dd
1295
+ *
1296
+ * Create a request for the method "instances.generateAccessToken".
1297
+ *
1298
+ * This request holds the parameters needed by the notebooks server. After setting any optional
1299
+ * parameters, call the {@link GenerateAccessToken#execute()} method to invoke the remote operation.
1300
+ *
1301
+ * @param name Required. Format: `projects/{project}/locations/{location}/instances/{instance_id}`
1302
+ * @param content the {@link com.google.api.services.notebooks.v2.model.GenerateAccessTokenRequest}
1303
+ * @return the request
1304
+ */
1305
+ public GenerateAccessToken generateAccessToken (java .lang .String name , com .google .api .services .notebooks .v2 .model .GenerateAccessTokenRequest content ) throws java .io .IOException {
1306
+ GenerateAccessToken result = new GenerateAccessToken (name , content );
1307
+ initialize (result );
1308
+ return result ;
1309
+ }
1310
+
1311
+ public class GenerateAccessToken extends AIPlatformNotebooksRequest <com .google .api .services .notebooks .v2 .model .GenerateAccessTokenResponse > {
1312
+
1313
+ private static final String REST_PATH = "v2/{+name}:generateAccessToken" ;
1314
+
1315
+ private final java .util .regex .Pattern NAME_PATTERN =
1316
+ java .util .regex .Pattern .compile ("^projects/[^/]+/locations/[^/]+/instances/[^/]+$" );
1317
+
1318
+ /**
1319
+ * Called by VM to return an EUC for the instance owner. Do not use this method directly. Design
1320
+ * doc: go/wbi-euc:dd
1321
+ *
1322
+ * Create a request for the method "instances.generateAccessToken".
1323
+ *
1324
+ * This request holds the parameters needed by the the notebooks server. After setting any
1325
+ * optional parameters, call the {@link GenerateAccessToken#execute()} method to invoke the remote
1326
+ * operation. <p> {@link GenerateAccessToken#initialize(com.google.api.client.googleapis.services.
1327
+ * AbstractGoogleClientRequest)} must be called to initialize this instance immediately after
1328
+ * invoking the constructor. </p>
1329
+ *
1330
+ * @param name Required. Format: `projects/{project}/locations/{location}/instances/{instance_id}`
1331
+ * @param content the {@link com.google.api.services.notebooks.v2.model.GenerateAccessTokenRequest}
1332
+ * @since 1.13
1333
+ */
1334
+ protected GenerateAccessToken (java .lang .String name , com .google .api .services .notebooks .v2 .model .GenerateAccessTokenRequest content ) {
1335
+ super (AIPlatformNotebooks .this , "POST" , REST_PATH , content , com .google .api .services .notebooks .v2 .model .GenerateAccessTokenResponse .class );
1336
+ this .name = com .google .api .client .util .Preconditions .checkNotNull (name , "Required parameter name must be specified." );
1337
+ if (!getSuppressPatternChecks ()) {
1338
+ com .google .api .client .util .Preconditions .checkArgument (NAME_PATTERN .matcher (name ).matches (),
1339
+ "Parameter name must conform to the pattern " +
1340
+ "^projects/[^/]+/locations/[^/]+/instances/[^/]+$" );
1341
+ }
1342
+ }
1343
+
1344
+ @ Override
1345
+ public GenerateAccessToken set$Xgafv (java .lang .String $Xgafv ) {
1346
+ return (GenerateAccessToken ) super .set$Xgafv ($Xgafv );
1347
+ }
1348
+
1349
+ @ Override
1350
+ public GenerateAccessToken setAccessToken (java .lang .String accessToken ) {
1351
+ return (GenerateAccessToken ) super .setAccessToken (accessToken );
1352
+ }
1353
+
1354
+ @ Override
1355
+ public GenerateAccessToken setAlt (java .lang .String alt ) {
1356
+ return (GenerateAccessToken ) super .setAlt (alt );
1357
+ }
1358
+
1359
+ @ Override
1360
+ public GenerateAccessToken setCallback (java .lang .String callback ) {
1361
+ return (GenerateAccessToken ) super .setCallback (callback );
1362
+ }
1363
+
1364
+ @ Override
1365
+ public GenerateAccessToken setFields (java .lang .String fields ) {
1366
+ return (GenerateAccessToken ) super .setFields (fields );
1367
+ }
1368
+
1369
+ @ Override
1370
+ public GenerateAccessToken setKey (java .lang .String key ) {
1371
+ return (GenerateAccessToken ) super .setKey (key );
1372
+ }
1373
+
1374
+ @ Override
1375
+ public GenerateAccessToken setOauthToken (java .lang .String oauthToken ) {
1376
+ return (GenerateAccessToken ) super .setOauthToken (oauthToken );
1377
+ }
1378
+
1379
+ @ Override
1380
+ public GenerateAccessToken setPrettyPrint (java .lang .Boolean prettyPrint ) {
1381
+ return (GenerateAccessToken ) super .setPrettyPrint (prettyPrint );
1382
+ }
1383
+
1384
+ @ Override
1385
+ public GenerateAccessToken setQuotaUser (java .lang .String quotaUser ) {
1386
+ return (GenerateAccessToken ) super .setQuotaUser (quotaUser );
1387
+ }
1388
+
1389
+ @ Override
1390
+ public GenerateAccessToken setUploadType (java .lang .String uploadType ) {
1391
+ return (GenerateAccessToken ) super .setUploadType (uploadType );
1392
+ }
1393
+
1394
+ @ Override
1395
+ public GenerateAccessToken setUploadProtocol (java .lang .String uploadProtocol ) {
1396
+ return (GenerateAccessToken ) super .setUploadProtocol (uploadProtocol );
1397
+ }
1398
+
1399
+ /**
1400
+ * Required. Format: `projects/{project}/locations/{location}/instances/{instance_id}`
1401
+ */
1402
+ @ com .google .api .client .util .Key
1403
+ private java .lang .String name ;
1404
+
1405
+ /** Required. Format: `projects/{project}/locations/{location}/instances/{instance_id}`
1406
+ */
1407
+ public java .lang .String getName () {
1408
+ return name ;
1409
+ }
1410
+
1411
+ /**
1412
+ * Required. Format: `projects/{project}/locations/{location}/instances/{instance_id}`
1413
+ */
1414
+ public GenerateAccessToken setName (java .lang .String name ) {
1415
+ if (!getSuppressPatternChecks ()) {
1416
+ com .google .api .client .util .Preconditions .checkArgument (NAME_PATTERN .matcher (name ).matches (),
1417
+ "Parameter name must conform to the pattern " +
1418
+ "^projects/[^/]+/locations/[^/]+/instances/[^/]+$" );
1419
+ }
1420
+ this .name = name ;
1421
+ return this ;
1422
+ }
1423
+
1424
+ @ Override
1425
+ public GenerateAccessToken set (String parameterName , Object value ) {
1426
+ return (GenerateAccessToken ) super .set (parameterName , value );
1427
+ }
1428
+ }
1150
1429
/**
1151
1430
* Gets details of a single Instance.
1152
1431
*
0 commit comments