@@ -1113,6 +1113,194 @@ public Authorize set(String parameterName, Object value) {
11131113 return (Authorize ) super .set (parameterName , value );
11141114 }
11151115 }
1116+ /**
1117+ * Generates an access token for the user's environment.
1118+ *
1119+ * Create a request for the method "environments.generateAccessToken".
1120+ *
1121+ * This request holds the parameters needed by the cloudshell server. After setting any optional
1122+ * parameters, call the {@link GenerateAccessToken#execute()} method to invoke the remote operation.
1123+ *
1124+ * @param environment Required. The environment to generate the access token for.
1125+ * @return the request
1126+ */
1127+ public GenerateAccessToken generateAccessToken (java .lang .String environment ) throws java .io .IOException {
1128+ GenerateAccessToken result = new GenerateAccessToken (environment );
1129+ initialize (result );
1130+ return result ;
1131+ }
1132+
1133+ public class GenerateAccessToken extends CloudShellRequest <com .google .api .services .cloudshell .v1 .model .GenerateAccessTokenResponse > {
1134+
1135+ private static final String REST_PATH = "v1/{+environment}:generateAccessToken" ;
1136+
1137+ private final java .util .regex .Pattern ENVIRONMENT_PATTERN =
1138+ java .util .regex .Pattern .compile ("^users/[^/]+/environments/[^/]+$" );
1139+
1140+ /**
1141+ * Generates an access token for the user's environment.
1142+ *
1143+ * Create a request for the method "environments.generateAccessToken".
1144+ *
1145+ * This request holds the parameters needed by the the cloudshell server. After setting any
1146+ * optional parameters, call the {@link GenerateAccessToken#execute()} method to invoke the remote
1147+ * operation. <p> {@link GenerateAccessToken#initialize(com.google.api.client.googleapis.services.
1148+ * AbstractGoogleClientRequest)} must be called to initialize this instance immediately after
1149+ * invoking the constructor. </p>
1150+ *
1151+ * @param environment Required. The environment to generate the access token for.
1152+ * @since 1.13
1153+ */
1154+ protected GenerateAccessToken (java .lang .String environment ) {
1155+ super (CloudShell .this , "GET" , REST_PATH , null , com .google .api .services .cloudshell .v1 .model .GenerateAccessTokenResponse .class );
1156+ this .environment = com .google .api .client .util .Preconditions .checkNotNull (environment , "Required parameter environment must be specified." );
1157+ if (!getSuppressPatternChecks ()) {
1158+ com .google .api .client .util .Preconditions .checkArgument (ENVIRONMENT_PATTERN .matcher (environment ).matches (),
1159+ "Parameter environment must conform to the pattern " +
1160+ "^users/[^/]+/environments/[^/]+$" );
1161+ }
1162+ }
1163+
1164+ @ Override
1165+ public com .google .api .client .http .HttpResponse executeUsingHead () throws java .io .IOException {
1166+ return super .executeUsingHead ();
1167+ }
1168+
1169+ @ Override
1170+ public com .google .api .client .http .HttpRequest buildHttpRequestUsingHead () throws java .io .IOException {
1171+ return super .buildHttpRequestUsingHead ();
1172+ }
1173+
1174+ @ Override
1175+ public GenerateAccessToken set$Xgafv (java .lang .String $Xgafv ) {
1176+ return (GenerateAccessToken ) super .set$Xgafv ($Xgafv );
1177+ }
1178+
1179+ @ Override
1180+ public GenerateAccessToken setAccessToken (java .lang .String accessToken ) {
1181+ return (GenerateAccessToken ) super .setAccessToken (accessToken );
1182+ }
1183+
1184+ @ Override
1185+ public GenerateAccessToken setAlt (java .lang .String alt ) {
1186+ return (GenerateAccessToken ) super .setAlt (alt );
1187+ }
1188+
1189+ @ Override
1190+ public GenerateAccessToken setCallback (java .lang .String callback ) {
1191+ return (GenerateAccessToken ) super .setCallback (callback );
1192+ }
1193+
1194+ @ Override
1195+ public GenerateAccessToken setFields (java .lang .String fields ) {
1196+ return (GenerateAccessToken ) super .setFields (fields );
1197+ }
1198+
1199+ @ Override
1200+ public GenerateAccessToken setKey (java .lang .String key ) {
1201+ return (GenerateAccessToken ) super .setKey (key );
1202+ }
1203+
1204+ @ Override
1205+ public GenerateAccessToken setOauthToken (java .lang .String oauthToken ) {
1206+ return (GenerateAccessToken ) super .setOauthToken (oauthToken );
1207+ }
1208+
1209+ @ Override
1210+ public GenerateAccessToken setPrettyPrint (java .lang .Boolean prettyPrint ) {
1211+ return (GenerateAccessToken ) super .setPrettyPrint (prettyPrint );
1212+ }
1213+
1214+ @ Override
1215+ public GenerateAccessToken setQuotaUser (java .lang .String quotaUser ) {
1216+ return (GenerateAccessToken ) super .setQuotaUser (quotaUser );
1217+ }
1218+
1219+ @ Override
1220+ public GenerateAccessToken setUploadType (java .lang .String uploadType ) {
1221+ return (GenerateAccessToken ) super .setUploadType (uploadType );
1222+ }
1223+
1224+ @ Override
1225+ public GenerateAccessToken setUploadProtocol (java .lang .String uploadProtocol ) {
1226+ return (GenerateAccessToken ) super .setUploadProtocol (uploadProtocol );
1227+ }
1228+
1229+ /** Required. The environment to generate the access token for. */
1230+ @ com .google .api .client .util .Key
1231+ private java .lang .String environment ;
1232+
1233+ /** Required. The environment to generate the access token for.
1234+ */
1235+ public java .lang .String getEnvironment () {
1236+ return environment ;
1237+ }
1238+
1239+ /** Required. The environment to generate the access token for. */
1240+ public GenerateAccessToken setEnvironment (java .lang .String environment ) {
1241+ if (!getSuppressPatternChecks ()) {
1242+ com .google .api .client .util .Preconditions .checkArgument (ENVIRONMENT_PATTERN .matcher (environment ).matches (),
1243+ "Parameter environment must conform to the pattern " +
1244+ "^users/[^/]+/environments/[^/]+$" );
1245+ }
1246+ this .environment = environment ;
1247+ return this ;
1248+ }
1249+
1250+ /**
1251+ * Desired expiration time of the access token. This value must be at most 24 hours in the
1252+ * future. If a value is not specified, the token's expiration time will be set to a default
1253+ * value of 1 hour in the future.
1254+ */
1255+ @ com .google .api .client .util .Key
1256+ private String expireTime ;
1257+
1258+ /** Desired expiration time of the access token. This value must be at most 24 hours in the future. If
1259+ a value is not specified, the token's expiration time will be set to a default value of 1 hour in
1260+ the future.
1261+ */
1262+ public String getExpireTime () {
1263+ return expireTime ;
1264+ }
1265+
1266+ /**
1267+ * Desired expiration time of the access token. This value must be at most 24 hours in the
1268+ * future. If a value is not specified, the token's expiration time will be set to a default
1269+ * value of 1 hour in the future.
1270+ */
1271+ public GenerateAccessToken setExpireTime (String expireTime ) {
1272+ this .expireTime = expireTime ;
1273+ return this ;
1274+ }
1275+
1276+ /**
1277+ * Desired lifetime duration of the access token. This value must be at most 24 hours. If a
1278+ * value is not specified, the token's lifetime will be set to a default value of 1 hour.
1279+ */
1280+ @ com .google .api .client .util .Key
1281+ private String ttl ;
1282+
1283+ /** Desired lifetime duration of the access token. This value must be at most 24 hours. If a value is
1284+ not specified, the token's lifetime will be set to a default value of 1 hour.
1285+ */
1286+ public String getTtl () {
1287+ return ttl ;
1288+ }
1289+
1290+ /**
1291+ * Desired lifetime duration of the access token. This value must be at most 24 hours. If a
1292+ * value is not specified, the token's lifetime will be set to a default value of 1 hour.
1293+ */
1294+ public GenerateAccessToken setTtl (String ttl ) {
1295+ this .ttl = ttl ;
1296+ return this ;
1297+ }
1298+
1299+ @ Override
1300+ public GenerateAccessToken set (String parameterName , Object value ) {
1301+ return (GenerateAccessToken ) super .set (parameterName , value );
1302+ }
1303+ }
11161304 /**
11171305 * Gets an environment. Returns NOT_FOUND if the environment does not exist.
11181306 *
0 commit comments