2.93.0 (latest) 2.92.0 2.91.0 2.89.0 2.86.0 2.85.0 2.83.0 2.81.0 2.80.0 2.79.0 2.78.0 2.76.0 2.74.0 2.73.0 2.72.0 2.71.0 2.70.0 2.68.0 2.66.0 2.65.0 2.62.0 2.61.0 2.60.0 2.58.0 2.57.0 2.56.0 2.55.0 2.54.0 2.53.0 2.52.0 2.51.0 2.50.0 2.49.0 2.47.0 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.8 2.0.9

    public interface Dns extends Service<DnsOptions>

An interface for the Google Cloud DNS service.
See Also: [Google Cloud DNS](https://cloud.google.com/dns/docs)

## Implements

com.google.cloud.Service\<com.google.cloud.dns.DnsOptions\>

## Methods

### applyChangeRequest(String zoneName, ChangeRequestInfo changeRequest, Dns.ChangeRequestOption\[\] options)

    public abstract ChangeRequest applyChangeRequest(String zoneName, ChangeRequestInfo changeRequest, Dns.ChangeRequestOption[] options)

Submits a change request for the specified zone. The returned object contains the following
read-only fields supplied by the server: id, start time and status. time, id, and list of name
servers. The fields to be returned can be selected by [ChangeRequestOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ChangeRequestOption)s.
See Also: [Cloud DNS Changes: create](https://cloud.google.com/dns/api/v1/changes/create)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `zoneName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `changeRequest` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.ChangeRequestInfo` |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ChangeRequestOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.ChangeRequest` | the new [ChangeRequest](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.ChangeRequest) |

### batch()

    public abstract DnsBatch batch()

Creates a new empty batch for grouping multiple service calls in one underlying RPC call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.DnsBatch` |   |

### create(ZoneInfo zoneInfo, Dns.ZoneOption\[\] options)

    public abstract Zone create(ZoneInfo zoneInfo, Dns.ZoneOption[] options)

Creates a new zone.

Returns [Zone](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Zone) object representing the new zone's information. In addition to the
name, dns name and description (supplied by the user within the `zoneInfo` parameter),
the returned object can include the following read-only fields supplied by the server: creation
time, id, and list of name servers. The returned fields can be optionally restricted by
specifying [ZoneOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ZoneOption)s.
See Also: [Cloud DNS Managed Zones: create](https://cloud.google.com/dns/api/v1/managedZones/create)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `zoneInfo` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.ZoneInfo` |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ZoneOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Zone` |   |

### delete(String zoneName)

    public abstract boolean delete(String zoneName)

Deletes an existing zone identified by name. Returns `true` if the zone was successfully
deleted and `false` otherwise.
See Also: [Cloud DNS Managed Zones: delete](https://cloud.google.com/dns/api/v1/managedZones/delete)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `zoneName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | `true` if zone was found and deleted and `false` otherwise |

### getChangeRequest(String zoneName, String changeRequestId, Dns.ChangeRequestOption\[\] options)

    public abstract ChangeRequest getChangeRequest(String zoneName, String changeRequestId, Dns.ChangeRequestOption[] options)

Retrieves updated information about a change request previously submitted for a zone identified
by ID. Returns `null` if the request cannot be found and throws an exception if the zone
does not exist. The fields to be returned using can be specified using [ChangeRequestOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ChangeRequestOption)s.
See Also: [Cloud DNS Chages: get](https://cloud.google.com/dns/api/v1/changes/get)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `zoneName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `changeRequestId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ChangeRequestOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.ChangeRequest` |   |

### getProject(Dns.ProjectOption\[\] fields)

    public abstract ProjectInfo getProject(Dns.ProjectOption[] fields)

Retrieves the information about the current project. The returned fields can be optionally
restricted by specifying [ProjectOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ProjectOption)s.
See Also: [Cloud DNS Projects: get](https://cloud.google.com/dns/api/v1/projects/get)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fields` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ProjectOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.ProjectInfo` |   |

### getZone(String zoneName, Dns.ZoneOption\[\] options)

    public abstract Zone getZone(String zoneName, Dns.ZoneOption[] options)

Returns the zone by the specified zone name. Returns `null` if the zone is not found. The
returned fields can be optionally restricted by specifying [ZoneOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ZoneOption)s.
See Also: [Cloud DNS Managed Zones: get](https://cloud.google.com/dns/api/v1/managedZones/get)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `zoneName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ZoneOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Zone` |   |

### listChangeRequests(String zoneName, Dns.ChangeRequestListOption\[\] options)

    public abstract Page<ChangeRequest> listChangeRequests(String zoneName, Dns.ChangeRequestListOption[] options)

Lists the change requests for the zone identified by name that were submitted to the service.

The sorting order for changes (based on when they were received by the server), fields to be
returned, page size and page token can be specified using [ChangeRequestListOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ChangeRequestListOption)s.
See Also: [Cloud DNS Chages: list](https://cloud.google.com/dns/api/v1/changes/list)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `zoneName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ChangeRequestListOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.paging.Page.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.ChangeRequest>` | A page of change requests |

### listRecordSets(String zoneName, Dns.RecordSetListOption\[\] options)

    public abstract Page<RecordSet> listRecordSets(String zoneName, Dns.RecordSetListOption[] options)

Lists the record sets in the zone identified by name.

The fields to be returned, page size and page tokens can be specified using [RecordSetListOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.RecordSetListOption)s.
See Also: [Cloud DNS ResourceRecordSets: list](https://cloud.google.com/dns/api/v1/resourceRecordSets/list)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `zoneName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.RecordSetListOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.paging.Page.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.RecordSet>` |   |

### listZones(Dns.ZoneListOption\[\] options)

    public abstract Page<Zone> listZones(Dns.ZoneListOption[] options)

Lists the zones inside the project.

This method returns zones in an unspecified order. New zones do not necessarily appear at
the end of the list. Use [ZoneListOption](https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ZoneListOption) to restrict the listing to a domain name, set
page size, and set page token.
See Also: [Cloud DNS Managed Zones: list](https://cloud.google.com/dns/api/v1/managedZones/list)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Dns.ZoneListOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.paging.Page.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-dns/latest/com.google.cloud.dns.Zone>` | a page of zones |