Class DnsThreatDetectorServiceClient (0.85.0)

GitHub RepositoryProduct Reference

Service Description: The Network Security API for DNS Threat Detectors.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   DnsThreatDetectorName name =
       DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]");
   DnsThreatDetector response = dnsThreatDetectorServiceClient.getDnsThreatDetector(name);
 }
 

Note: close() needs to be called on the DnsThreatDetectorServiceClient 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

ListDnsThreatDetectors

Lists DnsThreatDetectors in a given project and location.

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

  • listDnsThreatDetectors(ListDnsThreatDetectorsRequest request)

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

  • listDnsThreatDetectors(LocationName parent)

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

  • listDnsThreatDetectorsPagedCallable()

  • listDnsThreatDetectorsCallable()

GetDnsThreatDetector

Gets the details of a single DnsThreatDetector.

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

  • getDnsThreatDetector(GetDnsThreatDetectorRequest request)

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

  • getDnsThreatDetector(DnsThreatDetectorName name)

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

  • getDnsThreatDetectorCallable()

CreateDnsThreatDetector

Creates a new DnsThreatDetector in a given project and location.

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

  • createDnsThreatDetector(CreateDnsThreatDetectorRequest request)

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

  • createDnsThreatDetector(LocationName parent, DnsThreatDetector dnsThreatDetector, String dnsThreatDetectorId)

  • createDnsThreatDetector(String parent, DnsThreatDetector dnsThreatDetector, String dnsThreatDetectorId)

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

  • createDnsThreatDetectorCallable()

UpdateDnsThreatDetector

Updates a single DnsThreatDetector.

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

  • updateDnsThreatDetector(UpdateDnsThreatDetectorRequest request)

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

  • updateDnsThreatDetector(DnsThreatDetector dnsThreatDetector, 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.

  • updateDnsThreatDetectorCallable()

DeleteDnsThreatDetector

Deletes a single DnsThreatDetector.

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

  • deleteDnsThreatDetector(DeleteDnsThreatDetectorRequest request)

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

  • deleteDnsThreatDetector(DnsThreatDetectorName name)

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

  • deleteDnsThreatDetectorCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

SetIamPolicy

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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

  • setIamPolicy(SetIamPolicyRequest request)

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

  • setIamPolicyCallable()

GetIamPolicy

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

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

  • getIamPolicy(GetIamPolicyRequest request)

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

  • getIamPolicyCallable()

TestIamPermissions

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

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

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

  • testIamPermissions(TestIamPermissionsRequest request)

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

  • testIamPermissionsCallable()

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of DnsThreatDetectorServiceSettings 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
 DnsThreatDetectorServiceSettings dnsThreatDetectorServiceSettings =
     DnsThreatDetectorServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create(dnsThreatDetectorServiceSettings);
 

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
 DnsThreatDetectorServiceSettings dnsThreatDetectorServiceSettings =
     DnsThreatDetectorServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create(dnsThreatDetectorServiceSettings);
 

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
 DnsThreatDetectorServiceSettings dnsThreatDetectorServiceSettings =
     DnsThreatDetectorServiceSettings.newHttpJsonBuilder().build();
 DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create(dnsThreatDetectorServiceSettings);
 

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

Inheritance

java.lang.Object > DnsThreatDetectorServiceClient

Static Methods

create()

public static final DnsThreatDetectorServiceClient create()

Constructs an instance of DnsThreatDetectorServiceClient with default settings.

Returns
Type Description
DnsThreatDetectorServiceClient
Exceptions
Type Description
IOException

create(DnsThreatDetectorServiceSettings settings)

public static final DnsThreatDetectorServiceClient create(DnsThreatDetectorServiceSettings settings)

Constructs an instance of DnsThreatDetectorServiceClient, 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 DnsThreatDetectorServiceSettings
Returns
Type Description
DnsThreatDetectorServiceClient
Exceptions
Type Description
IOException

create(DnsThreatDetectorServiceStub stub)

public static final DnsThreatDetectorServiceClient create(DnsThreatDetectorServiceStub stub)

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

Parameter
Name Description
stub DnsThreatDetectorServiceStub
Returns
Type Description
DnsThreatDetectorServiceClient

Constructors

DnsThreatDetectorServiceClient(DnsThreatDetectorServiceSettings settings)

protected DnsThreatDetectorServiceClient(DnsThreatDetectorServiceSettings settings)

Constructs an instance of DnsThreatDetectorServiceClient, 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 DnsThreatDetectorServiceSettings

DnsThreatDetectorServiceClient(DnsThreatDetectorServiceStub stub)

protected DnsThreatDetectorServiceClient(DnsThreatDetectorServiceStub stub)
Parameter
Name Description
stub DnsThreatDetectorServiceStub

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

createDnsThreatDetector(CreateDnsThreatDetectorRequest request)

public final DnsThreatDetector createDnsThreatDetector(CreateDnsThreatDetectorRequest request)

Creates a new DnsThreatDetector in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   CreateDnsThreatDetectorRequest request =
       CreateDnsThreatDetectorRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDnsThreatDetectorId("dnsThreatDetectorId-1579667324")
           .setDnsThreatDetector(DnsThreatDetector.newBuilder().build())
           .build();
   DnsThreatDetector response = dnsThreatDetectorServiceClient.createDnsThreatDetector(request);
 }
 
Parameter
Name Description
request CreateDnsThreatDetectorRequest

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

Returns
Type Description
DnsThreatDetector

createDnsThreatDetector(LocationName parent, DnsThreatDetector dnsThreatDetector, String dnsThreatDetectorId)

public final DnsThreatDetector createDnsThreatDetector(LocationName parent, DnsThreatDetector dnsThreatDetector, String dnsThreatDetectorId)

Creates a new DnsThreatDetector in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DnsThreatDetector dnsThreatDetector = DnsThreatDetector.newBuilder().build();
   String dnsThreatDetectorId = "dnsThreatDetectorId-1579667324";
   DnsThreatDetector response =
       dnsThreatDetectorServiceClient.createDnsThreatDetector(
           parent, dnsThreatDetector, dnsThreatDetectorId);
 }
 
Parameters
Name Description
parent LocationName

Required. The value for the parent of the DnsThreatDetector resource.

dnsThreatDetector DnsThreatDetector

Required. The DnsThreatDetector resource to create.

dnsThreatDetectorId String

Optional. The ID of the requesting DnsThreatDetector object. If this field is not supplied, the service generates an identifier.

Returns
Type Description
DnsThreatDetector

createDnsThreatDetector(String parent, DnsThreatDetector dnsThreatDetector, String dnsThreatDetectorId)

public final DnsThreatDetector createDnsThreatDetector(String parent, DnsThreatDetector dnsThreatDetector, String dnsThreatDetectorId)

Creates a new DnsThreatDetector in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   DnsThreatDetector dnsThreatDetector = DnsThreatDetector.newBuilder().build();
   String dnsThreatDetectorId = "dnsThreatDetectorId-1579667324";
   DnsThreatDetector response =
       dnsThreatDetectorServiceClient.createDnsThreatDetector(
           parent, dnsThreatDetector, dnsThreatDetectorId);
 }
 
Parameters
Name Description
parent String

Required. The value for the parent of the DnsThreatDetector resource.

dnsThreatDetector DnsThreatDetector

Required. The DnsThreatDetector resource to create.

dnsThreatDetectorId String

Optional. The ID of the requesting DnsThreatDetector object. If this field is not supplied, the service generates an identifier.

Returns
Type Description
DnsThreatDetector

createDnsThreatDetectorCallable()

public final UnaryCallable<CreateDnsThreatDetectorRequest,DnsThreatDetector> createDnsThreatDetectorCallable()

Creates a new DnsThreatDetector in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   CreateDnsThreatDetectorRequest request =
       CreateDnsThreatDetectorRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDnsThreatDetectorId("dnsThreatDetectorId-1579667324")
           .setDnsThreatDetector(DnsThreatDetector.newBuilder().build())
           .build();
   ApiFuture<DnsThreatDetector> future =
       dnsThreatDetectorServiceClient.createDnsThreatDetectorCallable().futureCall(request);
   // Do something.
   DnsThreatDetector response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateDnsThreatDetectorRequest,DnsThreatDetector>

deleteDnsThreatDetector(DeleteDnsThreatDetectorRequest request)

public final void deleteDnsThreatDetector(DeleteDnsThreatDetectorRequest request)

Deletes a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   DeleteDnsThreatDetectorRequest request =
       DeleteDnsThreatDetectorRequest.newBuilder()
           .setName(
               DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]")
                   .toString())
           .build();
   dnsThreatDetectorServiceClient.deleteDnsThreatDetector(request);
 }
 
Parameter
Name Description
request DeleteDnsThreatDetectorRequest

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

deleteDnsThreatDetector(DnsThreatDetectorName name)

public final void deleteDnsThreatDetector(DnsThreatDetectorName name)

Deletes a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   DnsThreatDetectorName name =
       DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]");
   dnsThreatDetectorServiceClient.deleteDnsThreatDetector(name);
 }
 
Parameter
Name Description
name DnsThreatDetectorName

Required. Name of the DnsThreatDetector resource.

deleteDnsThreatDetector(String name)

public final void deleteDnsThreatDetector(String name)

Deletes a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   String name =
       DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]").toString();
   dnsThreatDetectorServiceClient.deleteDnsThreatDetector(name);
 }
 
Parameter
Name Description
name String

Required. Name of the DnsThreatDetector resource.

deleteDnsThreatDetectorCallable()

public final UnaryCallable<DeleteDnsThreatDetectorRequest,Empty> deleteDnsThreatDetectorCallable()

Deletes a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   DeleteDnsThreatDetectorRequest request =
       DeleteDnsThreatDetectorRequest.newBuilder()
           .setName(
               DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       dnsThreatDetectorServiceClient.deleteDnsThreatDetectorCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteDnsThreatDetectorRequest,Empty>

getDnsThreatDetector(DnsThreatDetectorName name)

public final DnsThreatDetector getDnsThreatDetector(DnsThreatDetectorName name)

Gets the details of a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   DnsThreatDetectorName name =
       DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]");
   DnsThreatDetector response = dnsThreatDetectorServiceClient.getDnsThreatDetector(name);
 }
 
Parameter
Name Description
name DnsThreatDetectorName

Required. Name of the DnsThreatDetector resource.

Returns
Type Description
DnsThreatDetector

getDnsThreatDetector(GetDnsThreatDetectorRequest request)

public final DnsThreatDetector getDnsThreatDetector(GetDnsThreatDetectorRequest request)

Gets the details of a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   GetDnsThreatDetectorRequest request =
       GetDnsThreatDetectorRequest.newBuilder()
           .setName(
               DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]")
                   .toString())
           .build();
   DnsThreatDetector response = dnsThreatDetectorServiceClient.getDnsThreatDetector(request);
 }
 
Parameter
Name Description
request GetDnsThreatDetectorRequest

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

Returns
Type Description
DnsThreatDetector

getDnsThreatDetector(String name)

public final DnsThreatDetector getDnsThreatDetector(String name)

Gets the details of a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   String name =
       DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]").toString();
   DnsThreatDetector response = dnsThreatDetectorServiceClient.getDnsThreatDetector(name);
 }
 
Parameter
Name Description
name String

Required. Name of the DnsThreatDetector resource.

Returns
Type Description
DnsThreatDetector

getDnsThreatDetectorCallable()

public final UnaryCallable<GetDnsThreatDetectorRequest,DnsThreatDetector> getDnsThreatDetectorCallable()

Gets the details of a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   GetDnsThreatDetectorRequest request =
       GetDnsThreatDetectorRequest.newBuilder()
           .setName(
               DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]")
                   .toString())
           .build();
   ApiFuture<DnsThreatDetector> future =
       dnsThreatDetectorServiceClient.getDnsThreatDetectorCallable().futureCall(request);
   // Do something.
   DnsThreatDetector response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDnsThreatDetectorRequest,DnsThreatDetector>

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

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

Sample code:


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

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

Returns
Type Description
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

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

Sample code:


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

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = dnsThreatDetectorServiceClient.getLocation(request);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

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

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future =
       dnsThreatDetectorServiceClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getSettings()

public final DnsThreatDetectorServiceSettings getSettings()
Returns
Type Description
DnsThreatDetectorServiceSettings

getStub()

public DnsThreatDetectorServiceStub getStub()
Returns
Type Description
DnsThreatDetectorServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listDnsThreatDetectors(ListDnsThreatDetectorsRequest request)

public final DnsThreatDetectorServiceClient.ListDnsThreatDetectorsPagedResponse listDnsThreatDetectors(ListDnsThreatDetectorsRequest request)

Lists DnsThreatDetectors in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   ListDnsThreatDetectorsRequest request =
       ListDnsThreatDetectorsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (DnsThreatDetector element :
       dnsThreatDetectorServiceClient.listDnsThreatDetectors(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListDnsThreatDetectorsRequest

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

Returns
Type Description
DnsThreatDetectorServiceClient.ListDnsThreatDetectorsPagedResponse

listDnsThreatDetectors(LocationName parent)

public final DnsThreatDetectorServiceClient.ListDnsThreatDetectorsPagedResponse listDnsThreatDetectors(LocationName parent)

Lists DnsThreatDetectors in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (DnsThreatDetector element :
       dnsThreatDetectorServiceClient.listDnsThreatDetectors(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The parent value for ListDnsThreatDetectorsRequest.

Returns
Type Description
DnsThreatDetectorServiceClient.ListDnsThreatDetectorsPagedResponse

listDnsThreatDetectors(String parent)

public final DnsThreatDetectorServiceClient.ListDnsThreatDetectorsPagedResponse listDnsThreatDetectors(String parent)

Lists DnsThreatDetectors in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (DnsThreatDetector element :
       dnsThreatDetectorServiceClient.listDnsThreatDetectors(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent value for ListDnsThreatDetectorsRequest.

Returns
Type Description
DnsThreatDetectorServiceClient.ListDnsThreatDetectorsPagedResponse

listDnsThreatDetectorsCallable()

public final UnaryCallable<ListDnsThreatDetectorsRequest,ListDnsThreatDetectorsResponse> listDnsThreatDetectorsCallable()

Lists DnsThreatDetectors in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   ListDnsThreatDetectorsRequest request =
       ListDnsThreatDetectorsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListDnsThreatDetectorsResponse response =
         dnsThreatDetectorServiceClient.listDnsThreatDetectorsCallable().call(request);
     for (DnsThreatDetector element : response.getDnsThreatDetectorsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListDnsThreatDetectorsRequest,ListDnsThreatDetectorsResponse>

listDnsThreatDetectorsPagedCallable()

public final UnaryCallable<ListDnsThreatDetectorsRequest,DnsThreatDetectorServiceClient.ListDnsThreatDetectorsPagedResponse> listDnsThreatDetectorsPagedCallable()

Lists DnsThreatDetectors in a given project and location.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   ListDnsThreatDetectorsRequest request =
       ListDnsThreatDetectorsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<DnsThreatDetector> future =
       dnsThreatDetectorServiceClient.listDnsThreatDetectorsPagedCallable().futureCall(request);
   // Do something.
   for (DnsThreatDetector element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListDnsThreatDetectorsRequest,ListDnsThreatDetectorsPagedResponse>

listLocations(ListLocationsRequest request)

public final DnsThreatDetectorServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : dnsThreatDetectorServiceClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

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

Returns
Type Description
DnsThreatDetectorServiceClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response =
         dnsThreatDetectorServiceClient.listLocationsCallable().call(request);
     for (Location element : response.getLocationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,DnsThreatDetectorServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       dnsThreatDetectorServiceClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


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

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

Returns
Type Description
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Sample code:


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

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

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

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

Sample code:


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

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

Returns
Type Description
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

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

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

Sample code:


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

updateDnsThreatDetector(DnsThreatDetector dnsThreatDetector, FieldMask updateMask)

public final DnsThreatDetector updateDnsThreatDetector(DnsThreatDetector dnsThreatDetector, FieldMask updateMask)

Updates a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   DnsThreatDetector dnsThreatDetector = DnsThreatDetector.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   DnsThreatDetector response =
       dnsThreatDetectorServiceClient.updateDnsThreatDetector(dnsThreatDetector, updateMask);
 }
 
Parameters
Name Description
dnsThreatDetector DnsThreatDetector

Required. The DnsThreatDetector resource being updated.

updateMask FieldMask

Optional. The field mask is used to specify the fields to be overwritten in the DnsThreatDetector resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the mask is not provided then all fields present in the request will be overwritten.

Returns
Type Description
DnsThreatDetector

updateDnsThreatDetector(UpdateDnsThreatDetectorRequest request)

public final DnsThreatDetector updateDnsThreatDetector(UpdateDnsThreatDetectorRequest request)

Updates a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   UpdateDnsThreatDetectorRequest request =
       UpdateDnsThreatDetectorRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDnsThreatDetector(DnsThreatDetector.newBuilder().build())
           .build();
   DnsThreatDetector response = dnsThreatDetectorServiceClient.updateDnsThreatDetector(request);
 }
 
Parameter
Name Description
request UpdateDnsThreatDetectorRequest

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

Returns
Type Description
DnsThreatDetector

updateDnsThreatDetectorCallable()

public final UnaryCallable<UpdateDnsThreatDetectorRequest,DnsThreatDetector> updateDnsThreatDetectorCallable()

Updates a single DnsThreatDetector.

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 (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   UpdateDnsThreatDetectorRequest request =
       UpdateDnsThreatDetectorRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDnsThreatDetector(DnsThreatDetector.newBuilder().build())
           .build();
   ApiFuture<DnsThreatDetector> future =
       dnsThreatDetectorServiceClient.updateDnsThreatDetectorCallable().futureCall(request);
   // Do something.
   DnsThreatDetector response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateDnsThreatDetectorRequest,DnsThreatDetector>