Class CaseServiceClient (0.35.0)

GitHub RepositoryProduct Reference

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

Methods
Method Description Method Variants

GetCase

Retrieve the specified case.

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

  • getCase(GetCaseRequest request)

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

  • getCase(CaseName name)

  • getCase(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.

  • getCaseCallable()

ListCases

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.

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

  • listCases(ListCasesRequest request)

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

  • listCases(OrganizationName parent)

  • listCases(ProjectName parent)

  • listCases(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.

  • listCasesPagedCallable()

  • listCasesCallable()

SearchCases

Search cases using the specified query.

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

  • searchCases(SearchCasesRequest request)

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

  • searchCasesPagedCallable()

  • searchCasesCallable()

CreateCase

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.

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

  • createCase(CreateCaseRequest request)

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

  • createCase(OrganizationName parent, Case case_)

  • createCase(ProjectName parent, Case case_)

  • createCase(String parent, Case case_)

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

  • createCaseCallable()

UpdateCase

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

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

  • updateCase(UpdateCaseRequest request)

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

  • updateCase(Case case_, FieldMask updateMask)

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

  • updateCaseCallable()

EscalateCase

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.

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

  • escalateCase(EscalateCaseRequest request)

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

  • escalateCaseCallable()

CloseCase

Close the specified case.

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

  • closeCase(CloseCaseRequest request)

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

  • closeCaseCallable()

SearchCaseClassifications

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".

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

  • searchCaseClassifications(SearchCaseClassificationsRequest request)

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

  • searchCaseClassificationsPagedCallable()

  • searchCaseClassificationsCallable()

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

Static Methods

create()

public static final CaseServiceClient create()

Constructs an instance of CaseServiceClient with default settings.

Returns
Type Description
CaseServiceClient
Exceptions
Type Description
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
Name Description
settings CaseServiceSettings
Returns
Type Description
CaseServiceClient
Exceptions
Type Description
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
Name Description
stub CaseServiceStub
Returns
Type Description
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
Name Description
settings CaseServiceSettings

CaseServiceClient(CaseServiceStub stub)

protected CaseServiceClient(CaseServiceStub stub)
Parameter
Name Description
stub CaseServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
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
Name Description
request CloseCaseRequest

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

Returns
Type Description
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
Type Description
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
Name Description
request CreateCaseRequest

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

Returns
Type Description
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
Name Description
parent OrganizationName

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

case_ Case

Required. The case to be created.

Returns
Type Description
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
Name Description
parent ProjectName

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

case_ Case

Required. The case to be created.

Returns
Type Description
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
Name Description
parent String

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

case_ Case

Required. The case to be created.

Returns
Type Description
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
Type Description
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
Name Description
request EscalateCaseRequest

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

Returns
Type Description
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
Type Description
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
Name Description
name CaseName

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

Returns
Type Description
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
Name Description
request GetCaseRequest

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

Returns
Type Description
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
Name Description
name String

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

Returns
Type Description
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
Type Description
UnaryCallable<GetCaseRequest,Case>

getSettings()

public final CaseServiceSettings getSettings()
Returns
Type Description
CaseServiceSettings

getStub()

public CaseServiceStub getStub()
Returns
Type Description
CaseServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
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
Name Description
request ListCasesRequest

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

Returns
Type Description
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
Name Description
parent OrganizationName

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

Returns
Type Description
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
Name Description
parent ProjectName

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

Returns
Type Description
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
Name Description
parent String

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

Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
request SearchCaseClassificationsRequest

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

Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
request SearchCasesRequest

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

Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
case_ Case

Required. The case object to update.

updateMask FieldMask

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
Type Description
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
Name Description
request UpdateCaseRequest

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

Returns
Type Description
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
Type Description
UnaryCallable<UpdateCaseRequest,Case>