Class CaseServiceClient (0.3.0)

public class CaseServiceClient implements BackgroundResource

Service Description: A service to manage Google Cloud support cases.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   CaseName name = CaseName.ofProjectCaseName("[PROJECT]", "[CASE]");
   Case response = caseServiceClient.getCase(name);
 }
 

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

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

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 CaseServiceSettings 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
 CaseServiceSettings caseServiceSettings =
     CaseServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CaseServiceClient caseServiceClient = CaseServiceClient.create(caseServiceSettings);
 

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
 CaseServiceSettings caseServiceSettings =
     CaseServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CaseServiceClient caseServiceClient = CaseServiceClient.create(caseServiceSettings);
 

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
 CaseServiceSettings caseServiceSettings = CaseServiceSettings.newHttpJsonBuilder().build();
 CaseServiceClient caseServiceClient = CaseServiceClient.create(caseServiceSettings);
 

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

Inheritance

java.lang.Object > CaseServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final CaseServiceClient create()

Constructs an instance of CaseServiceClient with default settings.

Returns
TypeDescription
CaseServiceClient
Exceptions
TypeDescription
IOException

create(CaseServiceSettings settings)

public static final CaseServiceClient create(CaseServiceSettings settings)

Constructs an instance of CaseServiceClient, 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
settingsCaseServiceSettings
Returns
TypeDescription
CaseServiceClient
Exceptions
TypeDescription
IOException

create(CaseServiceStub stub)

public static final CaseServiceClient create(CaseServiceStub stub)

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

Parameter
NameDescription
stubCaseServiceStub
Returns
TypeDescription
CaseServiceClient

Constructors

CaseServiceClient(CaseServiceSettings settings)

protected CaseServiceClient(CaseServiceSettings settings)

Constructs an instance of CaseServiceClient, 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
settingsCaseServiceSettings

CaseServiceClient(CaseServiceStub stub)

protected CaseServiceClient(CaseServiceStub stub)
Parameter
NameDescription
stubCaseServiceStub

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()

closeCase(CloseCaseRequest request)

public final Case closeCase(CloseCaseRequest request)

Close the specified case.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   CloseCaseRequest request =
       CloseCaseRequest.newBuilder()
           .setName(CaseName.ofProjectCaseName("[PROJECT]", "[CASE]").toString())
           .build();
   Case response = caseServiceClient.closeCase(request);
 }
 
Parameter
NameDescription
requestCloseCaseRequest

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

Returns
TypeDescription
Case

closeCaseCallable()

public final UnaryCallable<CloseCaseRequest,Case> closeCaseCallable()

Close the specified case.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   CloseCaseRequest request =
       CloseCaseRequest.newBuilder()
           .setName(CaseName.ofProjectCaseName("[PROJECT]", "[CASE]").toString())
           .build();
   ApiFuture<Case> future = caseServiceClient.closeCaseCallable().futureCall(request);
   // Do something.
   Case response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CloseCaseRequest,Case>

createCase(CreateCaseRequest request)

public final Case createCase(CreateCaseRequest request)

Create a new case and associate it with the given Google Cloud Resource. The case object must have the following fields set: display_name, description, classification, and priority.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   CreateCaseRequest request =
       CreateCaseRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setCase(Case.newBuilder().build())
           .build();
   Case response = caseServiceClient.createCase(request);
 }
 
Parameter
NameDescription
requestCreateCaseRequest

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

Returns
TypeDescription
Case

createCase(OrganizationName parent, Case case_)

public final Case createCase(OrganizationName parent, Case case_)

Create a new case and associate it with the given Google Cloud Resource. The case object must have the following fields set: display_name, description, classification, and priority.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   Case case_ = Case.newBuilder().build();
   Case response = caseServiceClient.createCase(parent, case_);
 }
 
Parameters
NameDescription
parentOrganizationName

Required. The name of the Google Cloud Resource under which the case should be created.

case_Case

Required. The case to be created.

Returns
TypeDescription
Case

createCase(ProjectName parent, Case case_)

public final Case createCase(ProjectName parent, Case case_)

Create a new case and associate it with the given Google Cloud Resource. The case object must have the following fields set: display_name, description, classification, and priority.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   Case case_ = Case.newBuilder().build();
   Case response = caseServiceClient.createCase(parent, case_);
 }
 
Parameters
NameDescription
parentProjectName

Required. The name of the Google Cloud Resource under which the case should be created.

case_Case

Required. The case to be created.

Returns
TypeDescription
Case

createCase(String parent, Case case_)

public final Case createCase(String parent, Case case_)

Create a new case and associate it with the given Google Cloud Resource. The case object must have the following fields set: display_name, description, classification, and priority.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   Case case_ = Case.newBuilder().build();
   Case response = caseServiceClient.createCase(parent, case_);
 }
 
Parameters
NameDescription
parentString

Required. The name of the Google Cloud Resource under which the case should be created.

case_Case

Required. The case to be created.

Returns
TypeDescription
Case

createCaseCallable()

public final UnaryCallable<CreateCaseRequest,Case> createCaseCallable()

Create a new case and associate it with the given Google Cloud Resource. The case object must have the following fields set: display_name, description, classification, and priority.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   CreateCaseRequest request =
       CreateCaseRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setCase(Case.newBuilder().build())
           .build();
   ApiFuture<Case> future = caseServiceClient.createCaseCallable().futureCall(request);
   // Do something.
   Case response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateCaseRequest,Case>

escalateCase(EscalateCaseRequest request)

public final Case escalateCase(EscalateCaseRequest request)

Escalate a case. Escalating a case will initiate the Google Cloud Support escalation management process.

This operation is only available to certain Customer Care tiers. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which tiers are able to perform escalations.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   EscalateCaseRequest request =
       EscalateCaseRequest.newBuilder()
           .setName(CaseName.ofProjectCaseName("[PROJECT]", "[CASE]").toString())
           .setEscalation(Escalation.newBuilder().build())
           .build();
   Case response = caseServiceClient.escalateCase(request);
 }
 
Parameter
NameDescription
requestEscalateCaseRequest

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

Returns
TypeDescription
Case

escalateCaseCallable()

public final UnaryCallable<EscalateCaseRequest,Case> escalateCaseCallable()

Escalate a case. Escalating a case will initiate the Google Cloud Support escalation management process.

This operation is only available to certain Customer Care tiers. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which tiers are able to perform escalations.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   EscalateCaseRequest request =
       EscalateCaseRequest.newBuilder()
           .setName(CaseName.ofProjectCaseName("[PROJECT]", "[CASE]").toString())
           .setEscalation(Escalation.newBuilder().build())
           .build();
   ApiFuture<Case> future = caseServiceClient.escalateCaseCallable().futureCall(request);
   // Do something.
   Case response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<EscalateCaseRequest,Case>

getCase(CaseName name)

public final Case getCase(CaseName name)

Retrieve the specified case.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   CaseName name = CaseName.ofProjectCaseName("[PROJECT]", "[CASE]");
   Case response = caseServiceClient.getCase(name);
 }
 
Parameter
NameDescription
nameCaseName

Required. The fully qualified name of a case to be retrieved.

Returns
TypeDescription
Case

getCase(GetCaseRequest request)

public final Case getCase(GetCaseRequest request)

Retrieve the specified case.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   GetCaseRequest request =
       GetCaseRequest.newBuilder()
           .setName(CaseName.ofProjectCaseName("[PROJECT]", "[CASE]").toString())
           .build();
   Case response = caseServiceClient.getCase(request);
 }
 
Parameter
NameDescription
requestGetCaseRequest

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

Returns
TypeDescription
Case

getCase(String name)

public final Case getCase(String name)

Retrieve the specified case.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   String name = CaseName.ofOrganizationCaseName("[ORGANIZATION]", "[CASE]").toString();
   Case response = caseServiceClient.getCase(name);
 }
 
Parameter
NameDescription
nameString

Required. The fully qualified name of a case to be retrieved.

Returns
TypeDescription
Case

getCaseCallable()

public final UnaryCallable<GetCaseRequest,Case> getCaseCallable()

Retrieve the specified case.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   GetCaseRequest request =
       GetCaseRequest.newBuilder()
           .setName(CaseName.ofProjectCaseName("[PROJECT]", "[CASE]").toString())
           .build();
   ApiFuture<Case> future = caseServiceClient.getCaseCallable().futureCall(request);
   // Do something.
   Case response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetCaseRequest,Case>

getSettings()

public final CaseServiceSettings getSettings()
Returns
TypeDescription
CaseServiceSettings

getStub()

public CaseServiceStub getStub()
Returns
TypeDescription
CaseServiceStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listCases(ListCasesRequest request)

public final CaseServiceClient.ListCasesPagedResponse listCases(ListCasesRequest request)

Retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   ListCasesRequest request =
       ListCasesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Case element : caseServiceClient.listCases(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListCasesRequest

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

Returns
TypeDescription
CaseServiceClient.ListCasesPagedResponse

listCases(OrganizationName parent)

public final CaseServiceClient.ListCasesPagedResponse listCases(OrganizationName parent)

Retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   for (Case element : caseServiceClient.listCases(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentOrganizationName

Required. The fully qualified name of parent resource to list cases under.

Returns
TypeDescription
CaseServiceClient.ListCasesPagedResponse

listCases(ProjectName parent)

public final CaseServiceClient.ListCasesPagedResponse listCases(ProjectName parent)

Retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (Case element : caseServiceClient.listCases(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentProjectName

Required. The fully qualified name of parent resource to list cases under.

Returns
TypeDescription
CaseServiceClient.ListCasesPagedResponse

listCases(String parent)

public final CaseServiceClient.ListCasesPagedResponse listCases(String parent)

Retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   for (Case element : caseServiceClient.listCases(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The fully qualified name of parent resource to list cases under.

Returns
TypeDescription
CaseServiceClient.ListCasesPagedResponse

listCasesCallable()

public final UnaryCallable<ListCasesRequest,ListCasesResponse> listCasesCallable()

Retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   ListCasesRequest request =
       ListCasesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListCasesResponse response = caseServiceClient.listCasesCallable().call(request);
     for (Case element : response.getCasesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListCasesRequest,ListCasesResponse>

listCasesPagedCallable()

public final UnaryCallable<ListCasesRequest,CaseServiceClient.ListCasesPagedResponse> listCasesPagedCallable()

Retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   ListCasesRequest request =
       ListCasesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Case> future = caseServiceClient.listCasesPagedCallable().futureCall(request);
   // Do something.
   for (Case element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListCasesRequest,ListCasesPagedResponse>

searchCaseClassifications(SearchCaseClassificationsRequest request)

public final CaseServiceClient.SearchCaseClassificationsPagedResponse searchCaseClassifications(SearchCaseClassificationsRequest request)

Retrieve valid classifications to be used when creating a support case. The classications are hierarchical, with each classification containing all levels of the hierarchy, separated by " > ". For example "Technical Issue > Compute > Compute Engine".

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   SearchCaseClassificationsRequest request =
       SearchCaseClassificationsRequest.newBuilder()
           .setQuery("query107944136")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (CaseClassification element :
       caseServiceClient.searchCaseClassifications(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestSearchCaseClassificationsRequest

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

Returns
TypeDescription
CaseServiceClient.SearchCaseClassificationsPagedResponse

searchCaseClassificationsCallable()

public final UnaryCallable<SearchCaseClassificationsRequest,SearchCaseClassificationsResponse> searchCaseClassificationsCallable()

Retrieve valid classifications to be used when creating a support case. The classications are hierarchical, with each classification containing all levels of the hierarchy, separated by " > ". For example "Technical Issue > Compute > Compute Engine".

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   SearchCaseClassificationsRequest request =
       SearchCaseClassificationsRequest.newBuilder()
           .setQuery("query107944136")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     SearchCaseClassificationsResponse response =
         caseServiceClient.searchCaseClassificationsCallable().call(request);
     for (CaseClassification element : response.getCaseClassificationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<SearchCaseClassificationsRequest,SearchCaseClassificationsResponse>

searchCaseClassificationsPagedCallable()

public final UnaryCallable<SearchCaseClassificationsRequest,CaseServiceClient.SearchCaseClassificationsPagedResponse> searchCaseClassificationsPagedCallable()

Retrieve valid classifications to be used when creating a support case. The classications are hierarchical, with each classification containing all levels of the hierarchy, separated by " > ". For example "Technical Issue > Compute > Compute Engine".

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   SearchCaseClassificationsRequest request =
       SearchCaseClassificationsRequest.newBuilder()
           .setQuery("query107944136")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<CaseClassification> future =
       caseServiceClient.searchCaseClassificationsPagedCallable().futureCall(request);
   // Do something.
   for (CaseClassification element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<SearchCaseClassificationsRequest,SearchCaseClassificationsPagedResponse>

searchCases(SearchCasesRequest request)

public final CaseServiceClient.SearchCasesPagedResponse searchCases(SearchCasesRequest request)

Search cases using the specified query.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   SearchCasesRequest request =
       SearchCasesRequest.newBuilder()
           .setParent("parent-995424086")
           .setQuery("query107944136")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Case element : caseServiceClient.searchCases(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestSearchCasesRequest

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

Returns
TypeDescription
CaseServiceClient.SearchCasesPagedResponse

searchCasesCallable()

public final UnaryCallable<SearchCasesRequest,SearchCasesResponse> searchCasesCallable()

Search cases using the specified query.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   SearchCasesRequest request =
       SearchCasesRequest.newBuilder()
           .setParent("parent-995424086")
           .setQuery("query107944136")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     SearchCasesResponse response = caseServiceClient.searchCasesCallable().call(request);
     for (Case element : response.getCasesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<SearchCasesRequest,SearchCasesResponse>

searchCasesPagedCallable()

public final UnaryCallable<SearchCasesRequest,CaseServiceClient.SearchCasesPagedResponse> searchCasesPagedCallable()

Search cases using the specified query.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   SearchCasesRequest request =
       SearchCasesRequest.newBuilder()
           .setParent("parent-995424086")
           .setQuery("query107944136")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Case> future = caseServiceClient.searchCasesPagedCallable().futureCall(request);
   // Do something.
   for (Case element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<SearchCasesRequest,SearchCasesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateCase(Case case_, FieldMask updateMask)

public final Case updateCase(Case case_, FieldMask updateMask)

Update the specified case. Only a subset of fields can be updated.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   Case case_ = Case.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Case response = caseServiceClient.updateCase(case_, updateMask);
 }
 
Parameters
NameDescription
case_Case

Required. The case object to update.

updateMaskFieldMask

A list of attributes of the case object that should be updated as part of this request. Supported values are priority, display_name, and subscriber_email_addresses. If no fields are specified, all supported fields are updated.

WARNING: If you do not provide a field mask, then you might accidentally clear some fields. For example, if you leave the field mask empty and do not provide a value for subscriber_email_addresses, then subscriber_email_addresses is updated to empty.

Returns
TypeDescription
Case

updateCase(UpdateCaseRequest request)

public final Case updateCase(UpdateCaseRequest request)

Update the specified case. Only a subset of fields can be updated.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   UpdateCaseRequest request =
       UpdateCaseRequest.newBuilder()
           .setCase(Case.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Case response = caseServiceClient.updateCase(request);
 }
 
Parameter
NameDescription
requestUpdateCaseRequest

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

Returns
TypeDescription
Case

updateCaseCallable()

public final UnaryCallable<UpdateCaseRequest,Case> updateCaseCallable()

Update the specified case. Only a subset of fields can be updated.

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 (CaseServiceClient caseServiceClient = CaseServiceClient.create()) {
   UpdateCaseRequest request =
       UpdateCaseRequest.newBuilder()
           .setCase(Case.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Case> future = caseServiceClient.updateCaseCallable().futureCall(request);
   // Do something.
   Case response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateCaseRequest,Case>