@maxim_mazurok/gapi.client.dns-v1beta2 0.0.20220804
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2571 -0
- package/package.json +20 -0
- package/readme.md +277 -0
- package/tests.ts +1995 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.dns-v1beta2",
|
|
3
|
+
"version": "0.0.20220804",
|
|
4
|
+
"description": "TypeScript typings for Cloud DNS API v1beta2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# TypeScript typings for Cloud DNS API v1beta2
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/dns/docs).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Cloud DNS API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.dns-v1beta2 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://dns.googleapis.com/$discovery/rest?version=v1beta2', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.dns
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('dns', 'v1beta2', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.dns
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
50
|
+
|
|
51
|
+
// View your data across Google Cloud services and see the email address of your Google Account
|
|
52
|
+
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
|
53
|
+
|
|
54
|
+
// View your DNS records hosted by Google Cloud DNS
|
|
55
|
+
'https://www.googleapis.com/auth/ndev.clouddns.readonly',
|
|
56
|
+
|
|
57
|
+
// View and manage your DNS records hosted by Google Cloud DNS
|
|
58
|
+
'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
|
|
59
|
+
],
|
|
60
|
+
immediate = true;
|
|
61
|
+
// ...
|
|
62
|
+
|
|
63
|
+
gapi.auth.authorize(
|
|
64
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
65
|
+
authResult => {
|
|
66
|
+
if (authResult && !authResult.error) {
|
|
67
|
+
/* handle successful authorization */
|
|
68
|
+
} else {
|
|
69
|
+
/* handle authorization error */
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
After that you can use Cloud DNS API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
Atomically updates the ResourceRecordSet collection.
|
|
80
|
+
*/
|
|
81
|
+
await gapi.client.dns.changes.create({ managedZone: "managedZone", project: "project", });
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
Fetches the representation of an existing Change.
|
|
85
|
+
*/
|
|
86
|
+
await gapi.client.dns.changes.get({ changeId: "changeId", managedZone: "managedZone", project: "project", });
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
Enumerates Changes to a ResourceRecordSet collection.
|
|
90
|
+
*/
|
|
91
|
+
await gapi.client.dns.changes.list({ managedZone: "managedZone", project: "project", });
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
Fetches the representation of an existing DnsKey.
|
|
95
|
+
*/
|
|
96
|
+
await gapi.client.dns.dnsKeys.get({ dnsKeyId: "dnsKeyId", managedZone: "managedZone", project: "project", });
|
|
97
|
+
|
|
98
|
+
/*
|
|
99
|
+
Enumerates DnsKeys to a ResourceRecordSet collection.
|
|
100
|
+
*/
|
|
101
|
+
await gapi.client.dns.dnsKeys.list({ managedZone: "managedZone", project: "project", });
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
Fetches the representation of an existing Operation.
|
|
105
|
+
*/
|
|
106
|
+
await gapi.client.dns.managedZoneOperations.get({ managedZone: "managedZone", operation: "operation", project: "project", });
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
Enumerates Operations for the given ManagedZone.
|
|
110
|
+
*/
|
|
111
|
+
await gapi.client.dns.managedZoneOperations.list({ managedZone: "managedZone", project: "project", });
|
|
112
|
+
|
|
113
|
+
/*
|
|
114
|
+
Creates a new ManagedZone.
|
|
115
|
+
*/
|
|
116
|
+
await gapi.client.dns.managedZones.create({ project: "project", });
|
|
117
|
+
|
|
118
|
+
/*
|
|
119
|
+
Deletes a previously created ManagedZone.
|
|
120
|
+
*/
|
|
121
|
+
await gapi.client.dns.managedZones.delete({ managedZone: "managedZone", project: "project", });
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
Fetches the representation of an existing ManagedZone.
|
|
125
|
+
*/
|
|
126
|
+
await gapi.client.dns.managedZones.get({ managedZone: "managedZone", project: "project", });
|
|
127
|
+
|
|
128
|
+
/*
|
|
129
|
+
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
|
130
|
+
*/
|
|
131
|
+
await gapi.client.dns.managedZones.getIamPolicy({ resource: "resource", });
|
|
132
|
+
|
|
133
|
+
/*
|
|
134
|
+
Enumerates ManagedZones that have been created but not yet deleted.
|
|
135
|
+
*/
|
|
136
|
+
await gapi.client.dns.managedZones.list({ project: "project", });
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
Applies a partial update to an existing ManagedZone.
|
|
140
|
+
*/
|
|
141
|
+
await gapi.client.dns.managedZones.patch({ managedZone: "managedZone", project: "project", });
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
|
|
145
|
+
*/
|
|
146
|
+
await gapi.client.dns.managedZones.setIamPolicy({ resource: "resource", });
|
|
147
|
+
|
|
148
|
+
/*
|
|
149
|
+
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return 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.
|
|
150
|
+
*/
|
|
151
|
+
await gapi.client.dns.managedZones.testIamPermissions({ resource: "resource", });
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
Updates an existing ManagedZone.
|
|
155
|
+
*/
|
|
156
|
+
await gapi.client.dns.managedZones.update({ managedZone: "managedZone", project: "project", });
|
|
157
|
+
|
|
158
|
+
/*
|
|
159
|
+
Creates a new Policy.
|
|
160
|
+
*/
|
|
161
|
+
await gapi.client.dns.policies.create({ project: "project", });
|
|
162
|
+
|
|
163
|
+
/*
|
|
164
|
+
Deletes a previously created Policy. Fails if the policy is still being referenced by a network.
|
|
165
|
+
*/
|
|
166
|
+
await gapi.client.dns.policies.delete({ policy: "policy", project: "project", });
|
|
167
|
+
|
|
168
|
+
/*
|
|
169
|
+
Fetches the representation of an existing Policy.
|
|
170
|
+
*/
|
|
171
|
+
await gapi.client.dns.policies.get({ policy: "policy", project: "project", });
|
|
172
|
+
|
|
173
|
+
/*
|
|
174
|
+
Enumerates all Policies associated with a project.
|
|
175
|
+
*/
|
|
176
|
+
await gapi.client.dns.policies.list({ project: "project", });
|
|
177
|
+
|
|
178
|
+
/*
|
|
179
|
+
Applies a partial update to an existing Policy.
|
|
180
|
+
*/
|
|
181
|
+
await gapi.client.dns.policies.patch({ policy: "policy", project: "project", });
|
|
182
|
+
|
|
183
|
+
/*
|
|
184
|
+
Updates an existing Policy.
|
|
185
|
+
*/
|
|
186
|
+
await gapi.client.dns.policies.update({ policy: "policy", project: "project", });
|
|
187
|
+
|
|
188
|
+
/*
|
|
189
|
+
Fetches the representation of an existing Project.
|
|
190
|
+
*/
|
|
191
|
+
await gapi.client.dns.projects.get({ project: "project", });
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
Creates a new ResourceRecordSet.
|
|
195
|
+
*/
|
|
196
|
+
await gapi.client.dns.resourceRecordSets.create({ managedZone: "managedZone", project: "project", });
|
|
197
|
+
|
|
198
|
+
/*
|
|
199
|
+
Deletes a previously created ResourceRecordSet.
|
|
200
|
+
*/
|
|
201
|
+
await gapi.client.dns.resourceRecordSets.delete({ managedZone: "managedZone", name: "name", project: "project", type: "type", });
|
|
202
|
+
|
|
203
|
+
/*
|
|
204
|
+
Fetches the representation of an existing ResourceRecordSet.
|
|
205
|
+
*/
|
|
206
|
+
await gapi.client.dns.resourceRecordSets.get({ managedZone: "managedZone", name: "name", project: "project", type: "type", });
|
|
207
|
+
|
|
208
|
+
/*
|
|
209
|
+
Enumerates ResourceRecordSets that you have created but not yet deleted.
|
|
210
|
+
*/
|
|
211
|
+
await gapi.client.dns.resourceRecordSets.list({ managedZone: "managedZone", project: "project", });
|
|
212
|
+
|
|
213
|
+
/*
|
|
214
|
+
Applies a partial update to an existing ResourceRecordSet.
|
|
215
|
+
*/
|
|
216
|
+
await gapi.client.dns.resourceRecordSets.patch({ managedZone: "managedZone", name: "name", project: "project", type: "type", });
|
|
217
|
+
|
|
218
|
+
/*
|
|
219
|
+
Creates a new Response Policy
|
|
220
|
+
*/
|
|
221
|
+
await gapi.client.dns.responsePolicies.create({ project: "project", });
|
|
222
|
+
|
|
223
|
+
/*
|
|
224
|
+
Deletes a previously created Response Policy. Fails if the response policy is non-empty or still being referenced by a network.
|
|
225
|
+
*/
|
|
226
|
+
await gapi.client.dns.responsePolicies.delete({ project: "project", responsePolicy: "responsePolicy", });
|
|
227
|
+
|
|
228
|
+
/*
|
|
229
|
+
Fetches the representation of an existing Response Policy.
|
|
230
|
+
*/
|
|
231
|
+
await gapi.client.dns.responsePolicies.get({ project: "project", responsePolicy: "responsePolicy", });
|
|
232
|
+
|
|
233
|
+
/*
|
|
234
|
+
Enumerates all Response Policies associated with a project.
|
|
235
|
+
*/
|
|
236
|
+
await gapi.client.dns.responsePolicies.list({ project: "project", });
|
|
237
|
+
|
|
238
|
+
/*
|
|
239
|
+
Applies a partial update to an existing Response Policy.
|
|
240
|
+
*/
|
|
241
|
+
await gapi.client.dns.responsePolicies.patch({ project: "project", responsePolicy: "responsePolicy", });
|
|
242
|
+
|
|
243
|
+
/*
|
|
244
|
+
Updates an existing Response Policy.
|
|
245
|
+
*/
|
|
246
|
+
await gapi.client.dns.responsePolicies.update({ project: "project", responsePolicy: "responsePolicy", });
|
|
247
|
+
|
|
248
|
+
/*
|
|
249
|
+
Creates a new Response Policy Rule.
|
|
250
|
+
*/
|
|
251
|
+
await gapi.client.dns.responsePolicyRules.create({ project: "project", responsePolicy: "responsePolicy", });
|
|
252
|
+
|
|
253
|
+
/*
|
|
254
|
+
Deletes a previously created Response Policy Rule.
|
|
255
|
+
*/
|
|
256
|
+
await gapi.client.dns.responsePolicyRules.delete({ project: "project", responsePolicy: "responsePolicy", responsePolicyRule: "responsePolicyRule", });
|
|
257
|
+
|
|
258
|
+
/*
|
|
259
|
+
Fetches the representation of an existing Response Policy Rule.
|
|
260
|
+
*/
|
|
261
|
+
await gapi.client.dns.responsePolicyRules.get({ project: "project", responsePolicy: "responsePolicy", responsePolicyRule: "responsePolicyRule", });
|
|
262
|
+
|
|
263
|
+
/*
|
|
264
|
+
Enumerates all Response Policy Rules associated with a project.
|
|
265
|
+
*/
|
|
266
|
+
await gapi.client.dns.responsePolicyRules.list({ project: "project", responsePolicy: "responsePolicy", });
|
|
267
|
+
|
|
268
|
+
/*
|
|
269
|
+
Applies a partial update to an existing Response Policy Rule.
|
|
270
|
+
*/
|
|
271
|
+
await gapi.client.dns.responsePolicyRules.patch({ project: "project", responsePolicy: "responsePolicy", responsePolicyRule: "responsePolicyRule", });
|
|
272
|
+
|
|
273
|
+
/*
|
|
274
|
+
Updates an existing Response Policy Rule.
|
|
275
|
+
*/
|
|
276
|
+
await gapi.client.dns.responsePolicyRules.update({ project: "project", responsePolicy: "responsePolicy", responsePolicyRule: "responsePolicyRule", });
|
|
277
|
+
```
|