Class CaseServiceClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @Generated("by gapic-generator-java")
    public class CaseServiceClient
    extends Object
    implements com.google.api.gax.core.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.

    • Constructor Detail

      • CaseServiceClient

        protected CaseServiceClient​(CaseServiceSettings settings)
                             throws IOException
        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.
        Throws:
        IOException
    • Method Detail

      • create

        public static final CaseServiceClient create​(CaseServiceSettings settings)
                                              throws IOException
        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.
        Throws:
        IOException
      • create

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

        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);
         }
         
        Parameters:
        name - Required. The fully qualified name of a case to be retrieved.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCase

        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);
         }
         
        Parameters:
        name - Required. The fully qualified name of a case to be retrieved.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCase

        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);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCaseCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • listCases

        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);
           }
         }
         
        Parameters:
        parent - Required. The fully qualified name of parent resource to list cases under.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listCases

        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);
           }
         }
         
        Parameters:
        parent - Required. The fully qualified name of parent resource to list cases under.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listCases

        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);
           }
         }
         
        Parameters:
        parent - Required. The fully qualified name of parent resource to list cases under.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listCases

        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);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listCasesPagedCallable

        public final com.google.api.gax.rpc.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);
           }
         }
         
      • listCasesCallable

        public final com.google.api.gax.rpc.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;
             }
           }
         }
         
      • searchCases

        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);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • searchCasesPagedCallable

        public final com.google.api.gax.rpc.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);
           }
         }
         
      • searchCasesCallable

        public final com.google.api.gax.rpc.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;
             }
           }
         }
         
      • createCase

        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:
        parent - Required. The name of the Google Cloud Resource under which the case should be created.
        case_ - Required. The case to be created.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createCase

        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:
        parent - Required. The name of the Google Cloud Resource under which the case should be created.
        case_ - Required. The case to be created.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createCase

        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:
        parent - Required. The name of the Google Cloud Resource under which the case should be created.
        case_ - Required. The case to be created.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createCase

        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);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createCaseCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • updateCase

        public final Case updateCase​(Case case_,
                                     com.google.protobuf.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:
        case_ - Required. The case object to update.
        updateMask - 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.

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateCase

        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);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateCaseCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • escalateCase

        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);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • escalateCaseCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • closeCase

        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);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • closeCaseCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • searchCaseClassifications

        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);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • searchCaseClassificationsPagedCallable

        public final com.google.api.gax.rpc.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);
           }
         }
         
      • searchCaseClassificationsCallable

        public final com.google.api.gax.rpc.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;
             }
           }
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource