Class SessionTemplateControllerClient (4.34.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: The SessionTemplateController provides methods to manage session templates.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   SessionTemplate sessionTemplate = SessionTemplate.newBuilder().build();
   SessionTemplate response =
       sessionTemplateControllerClient.createSessionTemplate(parent, sessionTemplate);
 }
 

Note: close() needs to be called on the SessionTemplateControllerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
MethodDescriptionMethod Variants

CreateSessionTemplate

Create a session template synchronously.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createSessionTemplate(CreateSessionTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createSessionTemplate(LocationName parent, SessionTemplate sessionTemplate)

  • createSessionTemplate(String parent, SessionTemplate sessionTemplate)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createSessionTemplateCallable()

UpdateSessionTemplate

Updates the session template synchronously.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateSessionTemplate(UpdateSessionTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateSessionTemplate(SessionTemplate sessionTemplate)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateSessionTemplateCallable()

GetSessionTemplate

Gets the resource representation for a session template.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getSessionTemplate(GetSessionTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getSessionTemplate(SessionTemplateName name)

  • getSessionTemplate(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getSessionTemplateCallable()

ListSessionTemplates

Lists session templates.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listSessionTemplates(ListSessionTemplatesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listSessionTemplates(LocationName parent)

  • listSessionTemplates(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listSessionTemplatesPagedCallable()

  • listSessionTemplatesCallable()

DeleteSessionTemplate

Deletes a session template.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteSessionTemplate(DeleteSessionTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteSessionTemplate(SessionTemplateName name)

  • deleteSessionTemplate(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteSessionTemplateCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of SessionTemplateControllerSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 SessionTemplateControllerSettings sessionTemplateControllerSettings =
     SessionTemplateControllerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create(sessionTemplateControllerSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 SessionTemplateControllerSettings sessionTemplateControllerSettings =
     SessionTemplateControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
 SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create(sessionTemplateControllerSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 SessionTemplateControllerSettings sessionTemplateControllerSettings =
     SessionTemplateControllerSettings.newHttpJsonBuilder().build();
 SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create(sessionTemplateControllerSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > SessionTemplateControllerClient

Static Methods

create()

public static final SessionTemplateControllerClient create()

Constructs an instance of SessionTemplateControllerClient with default settings.

Returns
TypeDescription
SessionTemplateControllerClient
Exceptions
TypeDescription
IOException

create(SessionTemplateControllerSettings settings)

public static final SessionTemplateControllerClient create(SessionTemplateControllerSettings settings)

Constructs an instance of SessionTemplateControllerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsSessionTemplateControllerSettings
Returns
TypeDescription
SessionTemplateControllerClient
Exceptions
TypeDescription
IOException

create(SessionTemplateControllerStub stub)

public static final SessionTemplateControllerClient create(SessionTemplateControllerStub stub)

Constructs an instance of SessionTemplateControllerClient, using the given stub for making calls. This is for advanced usage - prefer using create(SessionTemplateControllerSettings).

Parameter
NameDescription
stubSessionTemplateControllerStub
Returns
TypeDescription
SessionTemplateControllerClient

Constructors

SessionTemplateControllerClient(SessionTemplateControllerSettings settings)

protected SessionTemplateControllerClient(SessionTemplateControllerSettings settings)

Constructs an instance of SessionTemplateControllerClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsSessionTemplateControllerSettings

SessionTemplateControllerClient(SessionTemplateControllerStub stub)

protected SessionTemplateControllerClient(SessionTemplateControllerStub stub)
Parameter
NameDescription
stubSessionTemplateControllerStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createSessionTemplate(CreateSessionTemplateRequest request)

public final SessionTemplate createSessionTemplate(CreateSessionTemplateRequest request)

Create a session template synchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   CreateSessionTemplateRequest request =
       CreateSessionTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setSessionTemplate(SessionTemplate.newBuilder().build())
           .build();
   SessionTemplate response = sessionTemplateControllerClient.createSessionTemplate(request);
 }
 
Parameter
NameDescription
requestCreateSessionTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
SessionTemplate

createSessionTemplate(LocationName parent, SessionTemplate sessionTemplate)

public final SessionTemplate createSessionTemplate(LocationName parent, SessionTemplate sessionTemplate)

Create a session template synchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   SessionTemplate sessionTemplate = SessionTemplate.newBuilder().build();
   SessionTemplate response =
       sessionTemplateControllerClient.createSessionTemplate(parent, sessionTemplate);
 }
 
Parameters
NameDescription
parentLocationName

Required. The parent resource where this session template will be created.

sessionTemplateSessionTemplate

Required. The session template to create.

Returns
TypeDescription
SessionTemplate

createSessionTemplate(String parent, SessionTemplate sessionTemplate)

public final SessionTemplate createSessionTemplate(String parent, SessionTemplate sessionTemplate)

Create a session template synchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   SessionTemplate sessionTemplate = SessionTemplate.newBuilder().build();
   SessionTemplate response =
       sessionTemplateControllerClient.createSessionTemplate(parent, sessionTemplate);
 }
 
Parameters
NameDescription
parentString

Required. The parent resource where this session template will be created.

sessionTemplateSessionTemplate

Required. The session template to create.

Returns
TypeDescription
SessionTemplate

createSessionTemplateCallable()

public final UnaryCallable<CreateSessionTemplateRequest,SessionTemplate> createSessionTemplateCallable()

Create a session template synchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   CreateSessionTemplateRequest request =
       CreateSessionTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setSessionTemplate(SessionTemplate.newBuilder().build())
           .build();
   ApiFuture<SessionTemplate> future =
       sessionTemplateControllerClient.createSessionTemplateCallable().futureCall(request);
   // Do something.
   SessionTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateSessionTemplateRequest,SessionTemplate>

deleteSessionTemplate(DeleteSessionTemplateRequest request)

public final void deleteSessionTemplate(DeleteSessionTemplateRequest request)

Deletes a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   DeleteSessionTemplateRequest request =
       DeleteSessionTemplateRequest.newBuilder()
           .setName(SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]").toString())
           .build();
   sessionTemplateControllerClient.deleteSessionTemplate(request);
 }
 
Parameter
NameDescription
requestDeleteSessionTemplateRequest

The request object containing all of the parameters for the API call.

deleteSessionTemplate(SessionTemplateName name)

public final void deleteSessionTemplate(SessionTemplateName name)

Deletes a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   SessionTemplateName name = SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]");
   sessionTemplateControllerClient.deleteSessionTemplate(name);
 }
 
Parameter
NameDescription
nameSessionTemplateName

Required. The name of the session template resource to delete.

deleteSessionTemplate(String name)

public final void deleteSessionTemplate(String name)

Deletes a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   String name = SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]").toString();
   sessionTemplateControllerClient.deleteSessionTemplate(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the session template resource to delete.

deleteSessionTemplateCallable()

public final UnaryCallable<DeleteSessionTemplateRequest,Empty> deleteSessionTemplateCallable()

Deletes a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   DeleteSessionTemplateRequest request =
       DeleteSessionTemplateRequest.newBuilder()
           .setName(SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]").toString())
           .build();
   ApiFuture<Empty> future =
       sessionTemplateControllerClient.deleteSessionTemplateCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteSessionTemplateRequest,Empty>

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                       "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = sessionTemplateControllerClient.getIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                       "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future =
       sessionTemplateControllerClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getSessionTemplate(GetSessionTemplateRequest request)

public final SessionTemplate getSessionTemplate(GetSessionTemplateRequest request)

Gets the resource representation for a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   GetSessionTemplateRequest request =
       GetSessionTemplateRequest.newBuilder()
           .setName(SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]").toString())
           .build();
   SessionTemplate response = sessionTemplateControllerClient.getSessionTemplate(request);
 }
 
Parameter
NameDescription
requestGetSessionTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
SessionTemplate

getSessionTemplate(SessionTemplateName name)

public final SessionTemplate getSessionTemplate(SessionTemplateName name)

Gets the resource representation for a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   SessionTemplateName name = SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]");
   SessionTemplate response = sessionTemplateControllerClient.getSessionTemplate(name);
 }
 
Parameter
NameDescription
nameSessionTemplateName

Required. The name of the session template to retrieve.

Returns
TypeDescription
SessionTemplate

getSessionTemplate(String name)

public final SessionTemplate getSessionTemplate(String name)

Gets the resource representation for a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   String name = SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]").toString();
   SessionTemplate response = sessionTemplateControllerClient.getSessionTemplate(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the session template to retrieve.

Returns
TypeDescription
SessionTemplate

getSessionTemplateCallable()

public final UnaryCallable<GetSessionTemplateRequest,SessionTemplate> getSessionTemplateCallable()

Gets the resource representation for a session template.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   GetSessionTemplateRequest request =
       GetSessionTemplateRequest.newBuilder()
           .setName(SessionTemplateName.of("[PROJECT]", "[LOCATION]", "[TEMPLATE]").toString())
           .build();
   ApiFuture<SessionTemplate> future =
       sessionTemplateControllerClient.getSessionTemplateCallable().futureCall(request);
   // Do something.
   SessionTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetSessionTemplateRequest,SessionTemplate>

getSettings()

public final SessionTemplateControllerSettings getSettings()
Returns
TypeDescription
SessionTemplateControllerSettings

getStub()

public SessionTemplateControllerStub getStub()
Returns
TypeDescription
SessionTemplateControllerStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listSessionTemplates(ListSessionTemplatesRequest request)

public final SessionTemplateControllerClient.ListSessionTemplatesPagedResponse listSessionTemplates(ListSessionTemplatesRequest request)

Lists session templates.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   ListSessionTemplatesRequest request =
       ListSessionTemplatesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (SessionTemplate element :
       sessionTemplateControllerClient.listSessionTemplates(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListSessionTemplatesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
SessionTemplateControllerClient.ListSessionTemplatesPagedResponse

listSessionTemplates(LocationName parent)

public final SessionTemplateControllerClient.ListSessionTemplatesPagedResponse listSessionTemplates(LocationName parent)

Lists session templates.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (SessionTemplate element :
       sessionTemplateControllerClient.listSessionTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The parent that owns this collection of session templates.

Returns
TypeDescription
SessionTemplateControllerClient.ListSessionTemplatesPagedResponse

listSessionTemplates(String parent)

public final SessionTemplateControllerClient.ListSessionTemplatesPagedResponse listSessionTemplates(String parent)

Lists session templates.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (SessionTemplate element :
       sessionTemplateControllerClient.listSessionTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent that owns this collection of session templates.

Returns
TypeDescription
SessionTemplateControllerClient.ListSessionTemplatesPagedResponse

listSessionTemplatesCallable()

public final UnaryCallable<ListSessionTemplatesRequest,ListSessionTemplatesResponse> listSessionTemplatesCallable()

Lists session templates.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   ListSessionTemplatesRequest request =
       ListSessionTemplatesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListSessionTemplatesResponse response =
         sessionTemplateControllerClient.listSessionTemplatesCallable().call(request);
     for (SessionTemplate element : response.getSessionTemplatesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListSessionTemplatesRequest,ListSessionTemplatesResponse>

listSessionTemplatesPagedCallable()

public final UnaryCallable<ListSessionTemplatesRequest,SessionTemplateControllerClient.ListSessionTemplatesPagedResponse> listSessionTemplatesPagedCallable()

Lists session templates.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   ListSessionTemplatesRequest request =
       ListSessionTemplatesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<SessionTemplate> future =
       sessionTemplateControllerClient.listSessionTemplatesPagedCallable().futureCall(request);
   // Do something.
   for (SessionTemplate element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListSessionTemplatesRequest,ListSessionTemplatesPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                       "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = sessionTemplateControllerClient.setIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                       "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future =
       sessionTemplateControllerClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                       "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response =
       sessionTemplateControllerClient.testIamPermissions(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               AutoscalingPolicyName.ofProjectRegionAutoscalingPolicyName(
                       "[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       sessionTemplateControllerClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateSessionTemplate(SessionTemplate sessionTemplate)

public final SessionTemplate updateSessionTemplate(SessionTemplate sessionTemplate)

Updates the session template synchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   SessionTemplate sessionTemplate = SessionTemplate.newBuilder().build();
   SessionTemplate response =
       sessionTemplateControllerClient.updateSessionTemplate(sessionTemplate);
 }
 
Parameter
NameDescription
sessionTemplateSessionTemplate

Required. The updated session template.

Returns
TypeDescription
SessionTemplate

updateSessionTemplate(UpdateSessionTemplateRequest request)

public final SessionTemplate updateSessionTemplate(UpdateSessionTemplateRequest request)

Updates the session template synchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   UpdateSessionTemplateRequest request =
       UpdateSessionTemplateRequest.newBuilder()
           .setSessionTemplate(SessionTemplate.newBuilder().build())
           .build();
   SessionTemplate response = sessionTemplateControllerClient.updateSessionTemplate(request);
 }
 
Parameter
NameDescription
requestUpdateSessionTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
SessionTemplate

updateSessionTemplateCallable()

public final UnaryCallable<UpdateSessionTemplateRequest,SessionTemplate> updateSessionTemplateCallable()

Updates the session template synchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SessionTemplateControllerClient sessionTemplateControllerClient =
     SessionTemplateControllerClient.create()) {
   UpdateSessionTemplateRequest request =
       UpdateSessionTemplateRequest.newBuilder()
           .setSessionTemplate(SessionTemplate.newBuilder().build())
           .build();
   ApiFuture<SessionTemplate> future =
       sessionTemplateControllerClient.updateSessionTemplateCallable().futureCall(request);
   // Do something.
   SessionTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateSessionTemplateRequest,SessionTemplate>