# Network Security V1beta1 API - Class Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client (v0.17.0)

0.17.0 (latest) 0.16.0 0.15.0 0.14.0 0.13.1 0.12.0 0.11.0 0.10.1 0.9.0 0.8.1 0.7.2 0.6.0 0.5.1 0.4.0 0.3.0 0.2.0 0.1.2 Reference documentation and code samples for the Network Security V1beta1 API class Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.

REST client for the DnsThreatDetectorService service.


<br />

The Network Security API for DNS Threat Detectors.

## Inherits

- Object

## Includes

- [Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the DnsThreatDetectorService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client-Configuration "Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all DnsThreatDetectorService clients
::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the DnsThreatDetectorService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client#Google__Cloud__NetworkSecurity__V1beta1__DnsThreatDetectorService__Rest__Client_configure_class_ "Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client-Configuration "Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client-Configuration))

### #create_dns_threat_detector

    def create_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
    def create_dns_threat_detector(parent: nil, dns_threat_detector_id: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Creates a new DnsThreatDetector in a given project and location.
**Overloads**

    def create_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Pass arguments to `create_dns_threat_detector` via a request object, either of type [CreateDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-CreateDnsThreatDetectorRequest "Google::Cloud::NetworkSecurity::V1beta1::CreateDnsThreatDetectorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::NetworkSecurity::V1beta1::CreateDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-CreateDnsThreatDetectorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_dns_threat_detector(parent: nil, dns_threat_detector_id: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Pass arguments to `create_dns_threat_detector` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The value for the parent of the DnsThreatDetector resource.
- **dns_threat_detector_id** (::String) --- Optional. The ID of the requesting DnsThreatDetector object. If this field is not supplied, the service generates an identifier.
- **dns_threat_detector** ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector), ::Hash) --- Required. The `DnsThreatDetector` resource to create.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::CreateDnsThreatDetectorRequest.new

# Call the create_dns_threat_detector method.
result = client.create_dns_threat_detector request

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector.
p result
```

### #delete_dns_threat_detector

    def delete_dns_threat_detector(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_dns_threat_detector(name: nil) -> ::Google::Protobuf::Empty

Deletes a single DnsThreatDetector.
**Overloads**

    def delete_dns_threat_detector(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_dns_threat_detector` via a request object, either of type [Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DeleteDnsThreatDetectorRequest "Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DeleteDnsThreatDetectorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_dns_threat_detector(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_dns_threat_detector` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Name of the DnsThreatDetector resource.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest.new

# Call the delete_dns_threat_detector method.
result = client.delete_dns_threat_detector request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_dns_threat_detector

    def get_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
    def get_dns_threat_detector(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Gets the details of a single DnsThreatDetector.
**Overloads**

    def get_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Pass arguments to `get_dns_threat_detector` via a request object, either of type [GetDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-GetDnsThreatDetectorRequest "Google::Cloud::NetworkSecurity::V1beta1::GetDnsThreatDetectorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::NetworkSecurity::V1beta1::GetDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-GetDnsThreatDetectorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_dns_threat_detector(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Pass arguments to `get_dns_threat_detector` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Name of the DnsThreatDetector resource.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::GetDnsThreatDetectorRequest.new

# Call the get_dns_threat_detector method.
result = client.get_dns_threat_detector request

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector.
p result
```

### #iam_policy_client

    def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Rest::Client

Get the associated client for mix-in of the IAMPolicy.
**Returns**

- (Google::Iam::V1::IAMPolicy::Rest::Client)

### #initialize

    def initialize() { |config| ... } -> Client

Create a new DnsThreatDetectorService REST client object.
**Yields**

- (config) --- Configure the DnsThreatDetectorService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_dns_threat_detectors

    def list_dns_threat_detectors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>
    def list_dns_threat_detectors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>

Lists DnsThreatDetectors in a given project and location.
**Overloads**

    def list_dns_threat_detectors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>

Pass arguments to `list_dns_threat_detectors` via a request object, either of type [ListDnsThreatDetectorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-ListDnsThreatDetectorsRequest "Google::Cloud::NetworkSecurity::V1beta1::ListDnsThreatDetectorsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::NetworkSecurity::V1beta1::ListDnsThreatDetectorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-ListDnsThreatDetectorsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_dns_threat_detectors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>

Pass arguments to `list_dns_threat_detectors` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent value for `ListDnsThreatDetectorsRequest`.
- **page_size** (::Integer) --- Optional. The requested page size. The server may return fewer items than requested. If unspecified, the server picks an appropriate default.
- **page_token** (::String) --- Optional. A page token received from a previous `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the subsequent page.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::ListDnsThreatDetectorsRequest.new

# Call the list_dns_threat_detectors method.
result = client.list_dns_threat_detectors request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_dns_threat_detector

    def update_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
    def update_dns_threat_detector(update_mask: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Updates a single DnsThreatDetector.
**Overloads**

    def update_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Pass arguments to `update_dns_threat_detector` via a request object, either of type [UpdateDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-UpdateDnsThreatDetectorRequest "Google::Cloud::NetworkSecurity::V1beta1::UpdateDnsThreatDetectorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::NetworkSecurity::V1beta1::UpdateDnsThreatDetectorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-UpdateDnsThreatDetectorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_dns_threat_detector(update_mask: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Pass arguments to `update_dns_threat_detector` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Protobuf-FieldMask), ::Hash) --- 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.
- **dns_threat_detector** ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector), ::Hash) --- Required. The DnsThreatDetector resource being updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetector))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::UpdateDnsThreatDetectorRequest.new

# Call the update_dns_threat_detector method.
result = client.update_dns_threat_detector request

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector.
p result
```