# @maxim_mazurok/gapi.client.dns-v1

> TypeScript typings for Cloud DNS API v1

Latest version **0.3.20261106** (published 2026-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @maxim_mazurok/gapi.client.dns-v1
pnpm add @maxim_mazurok/gapi.client.dns-v1
yarn add @maxim_mazurok/gapi.client.dns-v1
bun add @maxim_mazurok/gapi.client.dns-v1
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.20261106 |
| Published | 2026-11-07 |
| First published | 2022-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 186 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 59 |
| Author | Maxim Mazurok |
| Maintainers | maxim_mazurok |

## Links

- npm: https://www.npmjs.com/package/@maxim_mazurok/gapi.client.dns-v1
- Repository: https://github.com/Maxim-Mazurok/google-api-typings-generator
- Homepage: https://github.com/Maxim-Mazurok/google-api-typings-generator#readme
- Issues: https://github.com/Maxim-Mazurok/google-api-typings-generator/issues
- npm.io page: https://npm.io/package/@maxim_mazurok/gapi.client.dns-v1

## Dependencies (2)

- [@types/gapi.client](https://npm.io/package/@types/gapi.client.md) *
- [@types/gapi.client.discovery-v1](https://npm.io/package/@types/gapi.client.discovery-v1.md) *

## Recent versions

- 0.3.20261106 (latest) — 2026-11-07
- 0.3.20261021 — 2026-10-30
- 0.3.20261019 — 2026-10-21
- 0.3.20261009 — 2026-10-13
- 0.3.20261002 — 2026-10-07
- 0.3.20260930 — 2026-10-05
- 0.3.20260917 — 2026-09-29
- 0.3.20260904 — 2026-09-10
- 0.3.20260819 — 2026-09-01
- 0.3.20260804 — 2026-08-12
- 0.3.20260728 — 2026-08-04
- 0.3.20260723 — 2026-07-28
- 0.3.20260714 — 2026-07-22
- 0.3.20260707 — 2026-07-14
- 0.3.20260630 — 2026-07-03
- … 148 more at https://npm.io/package/@maxim_mazurok/gapi.client.dns-v1/versions

## README

# TypeScript typings for Cloud DNS API v1

For detailed description please check [documentation](https://cloud.google.com/dns/docs).

## Installing

Install typings for Cloud DNS API:

```
npm install @types/gapi.client.dns-v1 --save-dev
```

## TypeScript 6.0+

TypeScript 6.0 changed `types` to default to `[]`. You must now explicitly list type packages in `tsconfig.json`:

```json
{
  "compilerOptions": {
    "types": ["gapi", "gapi.auth2", "gapi.client", "gapi.client.dns-v1"]
  }
}
```

## Usage

You need to initialize Google API client in your code:

```typescript
gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});
```

Then load api client wrapper:

```typescript
gapi.client.load(
  'https://dns.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.dns
  },
);
```

```typescript
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('dns', 'v1', () => {
  // now we can use:
  // gapi.client.dns
});
```

Don't forget to authenticate your client before sending any request to resources:

```typescript
// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
    'https://www.googleapis.com/auth/cloud-platform',

    // View your data across Google Cloud services and see the email address of your Google Account
    'https://www.googleapis.com/auth/cloud-platform.read-only',

    // View your DNS records hosted by Google Cloud DNS
    'https://www.googleapis.com/auth/ndev.clouddns.readonly',

    // View and manage your DNS records hosted by Google Cloud DNS
    'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  },
);
```

After that you can use Cloud DNS API resources: <!-- TODO: make this work for multiple namespaces -->

```typescript
/*
Atomically updates the ResourceRecordSet collection. Note: While `dns.changes.create` is the baseline permission required to invoke this method, additional permissions are checked depending on the specific additions or deletions contained in the payload.
*/
await gapi.client.dns.changes.create({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Fetches the representation of an existing Change.
*/
await gapi.client.dns.changes.get({
  changeId: 'changeId',
  managedZone: 'managedZone',
  project: 'project',
});

/*
Enumerates Changes to a ResourceRecordSet collection.
*/
await gapi.client.dns.changes.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Fetches the representation of an existing DnsKey.
*/
await gapi.client.dns.dnsKeys.get({
  dnsKeyId: 'dnsKeyId',
  managedZone: 'managedZone',
  project: 'project',
});

/*
Enumerates DnsKeys to a ResourceRecordSet collection.
*/
await gapi.client.dns.dnsKeys.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Gets information about a location.
*/
await gapi.client.dns.locations.get({name: 'name'});

/*
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in the ListLocationsRequest.name field: * **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project. For gRPC and client library implementations, the resource name is passed as the `name` field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
*/
await gapi.client.dns.locations.list({name: 'name'});

/*
Fetches the representation of an existing Operation.
*/
await gapi.client.dns.managedZoneOperations.get({
  managedZone: 'managedZone',
  operation: 'operation',
  project: 'project',
});

/*
Enumerates Operations for the given ManagedZone.
*/
await gapi.client.dns.managedZoneOperations.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Creates a new ManagedZone. Note: While `dns.managedZones.create` is the baseline permission required to invoke this method, additional permissions are required if the managed zone configuration references other resources.
*/
await gapi.client.dns.managedZones.create({project: 'project'});

/*
Deletes a previously created ManagedZone.
*/
await gapi.client.dns.managedZones.delete({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Fetches the representation of an existing ManagedZone.
*/
await gapi.client.dns.managedZones.get({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
*/
await gapi.client.dns.managedZones.getIamPolicy({resource: 'resource'});

/*
Enumerates ManagedZones that have been created but not yet deleted.
*/
await gapi.client.dns.managedZones.list({project: 'project'});

/*
Applies a partial update to an existing ManagedZone.
*/
await gapi.client.dns.managedZones.patch({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*/
await gapi.client.dns.managedZones.setIamPolicy({resource: 'resource'});

/*
Returns permissions that a caller has on the specified resource. If the resource does not exist, this returns an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
*/
await gapi.client.dns.managedZones.testIamPermissions({resource: 'resource'});

/*
Updates an existing ManagedZone.
*/
await gapi.client.dns.managedZones.update({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
*/
await gapi.client.dns.operations.cancel({name: 'name'});

/*
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
*/
await gapi.client.dns.operations.delete({name: 'name'});

/*
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
*/
await gapi.client.dns.operations.get({name: 'name'});

/*
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
*/
await gapi.client.dns.operations.list({name: 'name'});

/*
Creates a new Outbound Endpoint.
*/
await gapi.client.dns.outboundEndpoints.create({parent: 'parent'});

/*
Deletes a previously created Outbound Endpoint.
*/
await gapi.client.dns.outboundEndpoints.delete({name: 'name'});

/*
Fetches the representation of an existing Outbound Endpoint.
*/
await gapi.client.dns.outboundEndpoints.get({name: 'name'});

/*
Enumerates all Outbound Endpoints associated with a project.
*/
await gapi.client.dns.outboundEndpoints.list({parent: 'parent'});

/*
Updates an existing Outbound Endpoint.
*/
await gapi.client.dns.outboundEndpoints.patch({name: 'name'});

/*
Creates a new policy.
*/
await gapi.client.dns.policies.create({project: 'project'});

/*
Deletes a previously created policy. Fails if the policy is still being referenced by a network.
*/
await gapi.client.dns.policies.delete({policy: 'policy', project: 'project'});

/*
Fetches the representation of an existing policy.
*/
await gapi.client.dns.policies.get({policy: 'policy', project: 'project'});

/*
Enumerates all policies associated with a project.
*/
await gapi.client.dns.policies.list({project: 'project'});

/*
Applies a partial update to an existing policy.
*/
await gapi.client.dns.policies.patch({policy: 'policy', project: 'project'});

/*
Updates an existing policy.
*/
await gapi.client.dns.policies.update({policy: 'policy', project: 'project'});

/*
Fetches the representation of an existing Project.
*/
await gapi.client.dns.projects.get({project: 'project'});

/*
Creates a new ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.create({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Deletes a previously created ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.delete({
  managedZone: 'managedZone',
  name: 'name',
  project: 'project',
  type: 'type',
});

/*
Fetches the representation of an existing ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.get({
  managedZone: 'managedZone',
  name: 'name',
  project: 'project',
  type: 'type',
});

/*
Enumerates ResourceRecordSets that you have created but not yet deleted.
*/
await gapi.client.dns.resourceRecordSets.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Applies a partial update to an existing ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.patch({
  managedZone: 'managedZone',
  name: 'name',
  project: 'project',
  type: 'type',
});

/*
Creates a new Response Policy
*/
await gapi.client.dns.responsePolicies.create({project: 'project'});

/*
Deletes a previously created Response Policy. Fails if the response policy is non-empty or still being referenced by a network.
*/
await gapi.client.dns.responsePolicies.delete({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Fetches the representation of an existing Response Policy.
*/
await gapi.client.dns.responsePolicies.get({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Enumerates all Response Policies associated with a project.
*/
await gapi.client.dns.responsePolicies.list({project: 'project'});

/*
Applies a partial update to an existing Response Policy.
*/
await gapi.client.dns.responsePolicies.patch({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Updates an existing Response Policy.
*/
await gapi.client.dns.responsePolicies.update({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Creates a new Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.create({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Deletes a previously created Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.delete({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});

/*
Fetches the representation of an existing Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.get({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});

/*
Enumerates all Response Policy Rules associated with a project.
*/
await gapi.client.dns.responsePolicyRules.list({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Applies a partial update to an existing Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.patch({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});

/*
Updates an existing Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.update({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});
```

For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.dns-v1#Provenance:~:text=none-,Provenance,-Built%20and%20signed)

---
_Source: https://npm.io/package/@maxim_mazurok/gapi.client.dns-v1 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
