@origincloud/dns 0.0.0-stage → 0.15.0

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.
@@ -0,0 +1,122 @@
1
+ import { type CallOptions, type Client, type Empty, type Service } from "@origincloud/core";
2
+ /**
3
+ * Calls VpcAttachmentService.
4
+ *
5
+ * VPC attachments: the VPCs a private zone answers in. Each attachment
6
+ * makes the zone's names resolve from every instance in one VPC, in every
7
+ * zone the VPC spans, and from no other VPC. A private zone attaches only
8
+ * to VPCs of its own project, and a VPC holds at most one attached zone of
9
+ * a name. An attachment's id is the VPC's id, so a client that knows the
10
+ * zone and the VPC names the attachment without listing. Deleting a VPC
11
+ * deletes its attachments. Attaching a public zone is refused: it answers on
12
+ * the internet, in every VPC alike.
13
+ */
14
+ export declare class VpcAttachmentClient {
15
+ /**
16
+ * The endpoint the client sends its calls to, which also serves the
17
+ * operations its methods answer with.
18
+ */
19
+ readonly service: Service;
20
+ /** A client of VpcAttachmentService that sends its calls through `client`. */
21
+ constructor(client: Client);
22
+ /** Returns a VPC attachment. */
23
+ getVpcAttachment(request: GetVpcAttachmentRequest, options?: CallOptions): Promise<VpcAttachment>;
24
+ /**
25
+ * Lists a private zone's VPC attachments, oldest first. With `-` for the
26
+ * zone, lists every zone's in the project, which with `vpc` finds the
27
+ * zones attached to a VPC.
28
+ */
29
+ listVpcAttachments(request: ListVpcAttachmentsRequest, options?: CallOptions): Promise<ListVpcAttachmentsResponse>;
30
+ /**
31
+ * Iterates over everything listVpcAttachments lists from the request's page on,
32
+ * fetching the next page as the loop reaches it. A page that fails ends
33
+ * the iteration with its error.
34
+ */
35
+ allVpcAttachments(request: ListVpcAttachmentsRequest, options?: CallOptions): AsyncGenerator<VpcAttachment, void, undefined>;
36
+ /**
37
+ * Attaches a private zone to a VPC of the zone's project. Refused with
38
+ * `BAD_REQUEST` for a public zone, or for a VPC that isn't in the zone's
39
+ * project, with the same words whichever project it is in. Refused with
40
+ * `CONFLICT` when the VPC holds an attached zone of the same name. A VPC
41
+ * created moments ago may be refused with `SERVICE_UNAVAILABLE`,
42
+ * retryable. The VPC's instances resolve the zone's names once the VPC's
43
+ * hosts serve the zone.
44
+ */
45
+ createVpcAttachment(request: CreateVpcAttachmentRequest, options?: CallOptions): Promise<VpcAttachment>;
46
+ /**
47
+ * Detaches a private zone from a VPC. The VPC's instances stop resolving
48
+ * the zone's names once the VPC's hosts drop the zone.
49
+ */
50
+ deleteVpcAttachment(request: DeleteVpcAttachmentRequest, options?: CallOptions): Promise<Empty>;
51
+ }
52
+ /** A VPC a private zone answers in. */
53
+ export interface VpcAttachment {
54
+ /** The attachment's resource name. Its last segment is the VPC's id. */
55
+ name?: string;
56
+ /**
57
+ * The attachment's URN, the identifier access policies and the audit log
58
+ * use.
59
+ */
60
+ urn?: string;
61
+ /** The VPC the zone answers in, in the zone's project. */
62
+ vpc?: string;
63
+ /** When the zone was attached. */
64
+ createTime?: string;
65
+ }
66
+ /** The request for GetVpcAttachment. */
67
+ export interface GetVpcAttachmentRequest {
68
+ /** The attachment to return. */
69
+ name?: string;
70
+ }
71
+ /** The request for ListVpcAttachments. */
72
+ export interface ListVpcAttachmentsRequest {
73
+ /**
74
+ * The private zone whose attachments to list,
75
+ * `projects/{project}/hostedZones/{hosted_zone}`, or `-` for the zone to
76
+ * list every zone's in the project.
77
+ */
78
+ parent?: string;
79
+ /**
80
+ * The most attachments to return; the server clamps it, and 0 means its
81
+ * default.
82
+ */
83
+ pageSize?: number;
84
+ /** A previous response's `nextPageToken`, for the page after it. */
85
+ pageToken?: string;
86
+ /** Only the attachments to this VPC; every VPC's when left empty. */
87
+ vpc?: string;
88
+ }
89
+ /** The response for ListVpcAttachments. */
90
+ export interface ListVpcAttachmentsResponse {
91
+ /** The attachments on this page. */
92
+ vpcAttachments?: VpcAttachment[];
93
+ /** The token for the next page; empty on the last one. */
94
+ nextPageToken?: string;
95
+ }
96
+ /** The request for CreateVpcAttachment. */
97
+ export interface CreateVpcAttachmentRequest {
98
+ /**
99
+ * The private zone to attach,
100
+ * `projects/{project}/hostedZones/{hosted_zone}`.
101
+ */
102
+ parent?: string;
103
+ /** The attachment to create: its `vpc`. */
104
+ vpcAttachment?: VpcAttachment;
105
+ /**
106
+ * A UUID; a repeat with the same id within a day returns the attachment
107
+ * the first request created, as it is now, instead of being refused as a
108
+ * conflict.
109
+ */
110
+ requestId?: string;
111
+ }
112
+ /** The request for DeleteVpcAttachment. */
113
+ export interface DeleteVpcAttachmentRequest {
114
+ /** The attachment to delete. */
115
+ name?: string;
116
+ /**
117
+ * A UUID; a repeat with the same id within a day succeeds as the first
118
+ * did, instead of answering `NOT_FOUND`.
119
+ */
120
+ requestId?: string;
121
+ }
122
+ //# sourceMappingURL=vpc_attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vpc_attachment.d.ts","sourceRoot":"","sources":["../../src/v1beta1/vpc_attachment.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,OAAO,EAIb,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,qBAAa,mBAAmB;IAC9B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,8EAA8E;gBAClE,MAAM,EAAE,MAAM;IAI1B,gCAAgC;IAC1B,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAavG;;;;OAIG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAaxH;;;;OAIG;IACI,iBAAiB,CAAC,OAAO,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,SAAS,CAAC;IASnI;;;;;;;;O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I,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,101 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/dns/v1beta1/vpc_attachment.proto
3
+ import { newRequestId, pathValue, query, } from "@origincloud/core";
4
+ /**
5
+ * Calls VpcAttachmentService.
6
+ *
7
+ * VPC attachments: the VPCs a private zone answers in. Each attachment
8
+ * makes the zone's names resolve from every instance in one VPC, in every
9
+ * zone the VPC spans, and from no other VPC. A private zone attaches only
10
+ * to VPCs of its own project, and a VPC holds at most one attached zone of
11
+ * a name. An attachment's id is the VPC's id, so a client that knows the
12
+ * zone and the VPC names the attachment without listing. Deleting a VPC
13
+ * deletes its attachments. Attaching a public zone is refused: it answers on
14
+ * the internet, in every VPC alike.
15
+ */
16
+ export class VpcAttachmentClient {
17
+ /**
18
+ * The endpoint the client sends its calls to, which also serves the
19
+ * operations its methods answer with.
20
+ */
21
+ service;
22
+ /** A client of VpcAttachmentService that sends its calls through `client`. */
23
+ constructor(client) {
24
+ this.service = client.service("dns", false);
25
+ }
26
+ /** Returns a VPC attachment. */
27
+ async getVpcAttachment(request, options) {
28
+ const p0 = pathValue("name", request.name, "projects/*/hostedZones/*/vpcAttachments/*");
29
+ return this.service.call({
30
+ method: "GET",
31
+ path: `/v1beta1/${p0}`,
32
+ query: query(request, ["name"]),
33
+ idempotent: true,
34
+ }, options);
35
+ }
36
+ /**
37
+ * Lists a private zone's VPC attachments, oldest first. With `-` for the
38
+ * zone, lists every zone's in the project, which with `vpc` finds the
39
+ * zones attached to a VPC.
40
+ */
41
+ async listVpcAttachments(request, options) {
42
+ const p0 = pathValue("parent", request.parent, "projects/*/hostedZones/*");
43
+ return this.service.call({
44
+ method: "GET",
45
+ path: `/v1beta1/${p0}/vpcAttachments`,
46
+ query: query(request, ["parent"]),
47
+ idempotent: true,
48
+ }, options);
49
+ }
50
+ /**
51
+ * Iterates over everything listVpcAttachments lists from the request's page on,
52
+ * fetching the next page as the loop reaches it. A page that fails ends
53
+ * the iteration with its error.
54
+ */
55
+ async *allVpcAttachments(request, options) {
56
+ for (let page = request;;) {
57
+ const response = await this.listVpcAttachments(page, options);
58
+ yield* response.vpcAttachments ?? [];
59
+ if (!response.nextPageToken)
60
+ return;
61
+ page = { ...page, pageToken: response.nextPageToken };
62
+ }
63
+ }
64
+ /**
65
+ * Attaches a private zone to a VPC of the zone's project. Refused with
66
+ * `BAD_REQUEST` for a public zone, or for a VPC that isn't in the zone's
67
+ * project, with the same words whichever project it is in. Refused with
68
+ * `CONFLICT` when the VPC holds an attached zone of the same name. A VPC
69
+ * created moments ago may be refused with `SERVICE_UNAVAILABLE`,
70
+ * retryable. The VPC's instances resolve the zone's names once the VPC's
71
+ * hosts serve the zone.
72
+ */
73
+ async createVpcAttachment(request, options) {
74
+ if (!request.requestId)
75
+ request = { ...request, requestId: newRequestId() };
76
+ const p0 = pathValue("parent", request.parent, "projects/*/hostedZones/*");
77
+ return this.service.call({
78
+ method: "POST",
79
+ path: `/v1beta1/${p0}/vpcAttachments`,
80
+ body: request.vpcAttachment,
81
+ query: query(request, ["parent", "vpcAttachment"]),
82
+ idempotent: true,
83
+ }, options);
84
+ }
85
+ /**
86
+ * Detaches a private zone from a VPC. The VPC's instances stop resolving
87
+ * the zone's names once the VPC's hosts drop the zone.
88
+ */
89
+ async deleteVpcAttachment(request, options) {
90
+ if (!request.requestId)
91
+ request = { ...request, requestId: newRequestId() };
92
+ const p0 = pathValue("name", request.name, "projects/*/hostedZones/*/vpcAttachments/*");
93
+ return this.service.call({
94
+ method: "DELETE",
95
+ path: `/v1beta1/${p0}`,
96
+ query: query(request, ["name"]),
97
+ idempotent: true,
98
+ }, options);
99
+ }
100
+ }
101
+ //# sourceMappingURL=vpc_attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vpc_attachment.js","sourceRoot":"","sources":["../../src/v1beta1/vpc_attachment.ts"],"names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,QAAQ;YAChB,IAAI,EAAE,YAAY,EAAE,EAAE;YACtB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;YAC/B,UAAU,EAAE,IAAI;SACjB,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@origincloud/dns",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.15.0",
4
+ "description": "Origin Cloud's DNS service: hosted zones, their record sets, and private zones' VPC attachments.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://github.com/origincloudhq/sdk-typescript#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/origincloudhq/sdk-typescript.git",
10
+ "directory": "packages/dns"
11
+ },
12
+ "bugs": "https://github.com/origincloudhq/sdk-typescript/issues",
13
+ "keywords": [
14
+ "origincloud",
15
+ "origin-cloud",
16
+ "sdk",
17
+ "dns"
18
+ ],
19
+ "type": "module",
20
+ "sideEffects": false,
21
+ "engines": {
22
+ "node": ">=20"
23
+ },
24
+ "exports": {
25
+ "./*": {
26
+ "types": "./dist/*/index.d.ts",
27
+ "default": "./dist/*/index.js"
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "src",
34
+ "!dist/**/*.tsbuildinfo"
35
+ ],
36
+ "peerDependencies": {
37
+ "@origincloud/core": "^0.15.0"
38
+ },
39
+ "devDependencies": {
40
+ "@origincloud/core": "^0.15.0"
41
+ }
42
+ }
@@ -0,0 +1,395 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/dns/v1beta1/hosted_zone.proto
3
+
4
+ import {
5
+ type CallOptions,
6
+ type Client,
7
+ type Empty,
8
+ type Service,
9
+ newRequestId,
10
+ pathValue,
11
+ query,
12
+ } from "@origincloud/core";
13
+
14
+ /**
15
+ * Calls HostedZoneService.
16
+ *
17
+ * Hosted zones: the domains a project's records are answered for.
18
+ *
19
+ * A public zone holds its name only once it proves control of it: until
20
+ * then it is `PENDING_VERIFICATION`, and any number of zones of any
21
+ * project may be pending for the same name. It proves control with a TXT
22
+ * record at `_origin-challenge.{dns_name}` holding the zone's token,
23
+ * answered by the name's current DNS. The first zone of a name to verify
24
+ * becomes `ACTIVE`, holds the name, and is answered from the platform's
25
+ * name servers once the name is delegated to them; the others stay
26
+ * pending. A zone that doesn't verify within its window is deleted with
27
+ * its record sets. The platform checks pending zones on its own, more
28
+ * rarely the longer they stay pending; `VerifyHostedZone` checks one now.
29
+ *
30
+ * An active public zone is checked again every day. It keeps its name
31
+ * while the name is delegated to the platform's name servers, or while the
32
+ * token still answers at the name's other name servers. After several
33
+ * checks in a row find the name delegated elsewhere without the token, it
34
+ * is `SUSPENDED`: no longer answered, its record sets kept, and its name
35
+ * free for another zone to verify. Verifying it again while its name is
36
+ * free makes it active again.
37
+ *
38
+ * A private zone is active from the start, and answers in the VPCs it is
39
+ * attached to.
40
+ */
41
+ export class HostedZoneClient {
42
+ /**
43
+ * The endpoint the client sends its calls to, which also serves the
44
+ * operations its methods answer with.
45
+ */
46
+ readonly service: Service;
47
+
48
+ /** A client of HostedZoneService that sends its calls through `client`. */
49
+ constructor(client: Client) {
50
+ this.service = client.service("dns", false);
51
+ }
52
+
53
+ /** Returns a hosted zone. */
54
+ async getHostedZone(request: GetHostedZoneRequest, options?: CallOptions): Promise<HostedZone> {
55
+ const p0 = pathValue("name", request.name, "projects/*/hostedZones/*");
56
+ return this.service.call<HostedZone>(
57
+ {
58
+ method: "GET",
59
+ path: `/v1beta1/${p0}`,
60
+ query: query(request, ["name"]),
61
+ idempotent: true,
62
+ },
63
+ options,
64
+ );
65
+ }
66
+
67
+ /** Lists a project's hosted zones, oldest first. */
68
+ async listHostedZones(request: ListHostedZonesRequest, options?: CallOptions): Promise<ListHostedZonesResponse> {
69
+ const p0 = pathValue("parent", request.parent, "projects/*");
70
+ return this.service.call<ListHostedZonesResponse>(
71
+ {
72
+ method: "GET",
73
+ path: `/v1beta1/${p0}/hostedZones`,
74
+ query: query(request, ["parent"]),
75
+ idempotent: true,
76
+ },
77
+ options,
78
+ );
79
+ }
80
+
81
+ /**
82
+ * Iterates over everything listHostedZones lists from the request's page on,
83
+ * fetching the next page as the loop reaches it. A page that fails ends
84
+ * the iteration with its error.
85
+ */
86
+ async *allHostedZones(request: ListHostedZonesRequest, options?: CallOptions): AsyncGenerator<HostedZone, void, undefined> {
87
+ for (let page = request; ; ) {
88
+ const response = await this.listHostedZones(page, options);
89
+ yield* response.hostedZones ?? [];
90
+ if (!response.nextPageToken) return;
91
+ page = { ...page, pageToken: response.nextPageToken };
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Creates a hosted zone, empty. A public zone starts
97
+ * `PENDING_VERIFICATION`, with the token to publish in `challenge`; a
98
+ * private zone starts `ACTIVE`. Refused with `BAD_REQUEST` for a name the
99
+ * platform keeps for itself, or once the project's or organization's
100
+ * quota of zones is used up, and with `PAYMENT_METHOD_REQUIRED` while the
101
+ * project has no valid billing.
102
+ */
103
+ async createHostedZone(request: CreateHostedZoneRequest, options?: CallOptions): Promise<HostedZone> {
104
+ if (!request.requestId) request = { ...request, requestId: newRequestId() };
105
+ const p0 = pathValue("parent", request.parent, "projects/*");
106
+ return this.service.call<HostedZone>(
107
+ {
108
+ method: "POST",
109
+ path: `/v1beta1/${p0}/hostedZones`,
110
+ body: request.hostedZone,
111
+ query: query(request, ["parent", "hostedZone"]),
112
+ idempotent: true,
113
+ },
114
+ options,
115
+ );
116
+ }
117
+
118
+ /** Changes a hosted zone's tags. */
119
+ async updateHostedZone(request: UpdateHostedZoneRequest, options?: CallOptions): Promise<HostedZone> {
120
+ if (!request.requestId) request = { ...request, requestId: newRequestId() };
121
+ const p0 = pathValue("hostedZone.name", request.hostedZone?.name, "projects/*/hostedZones/*");
122
+ return this.service.call<HostedZone>(
123
+ {
124
+ method: "PATCH",
125
+ path: `/v1beta1/${p0}`,
126
+ body: request.hostedZone,
127
+ query: query(request, ["hostedZone.name", "hostedZone"]),
128
+ idempotent: true,
129
+ },
130
+ options,
131
+ );
132
+ }
133
+
134
+ /**
135
+ * Deletes a hosted zone. Refused with `CONFLICT` while it holds record
136
+ * sets or, for a private zone, VPC attachments: delete them first.
137
+ */
138
+ async deleteHostedZone(request: DeleteHostedZoneRequest, options?: CallOptions): Promise<Empty> {
139
+ if (!request.requestId) request = { ...request, requestId: newRequestId() };
140
+ const p0 = pathValue("name", request.name, "projects/*/hostedZones/*");
141
+ return this.service.call<Empty>(
142
+ {
143
+ method: "DELETE",
144
+ path: `/v1beta1/${p0}`,
145
+ query: query(request, ["name"]),
146
+ idempotent: true,
147
+ },
148
+ options,
149
+ );
150
+ }
151
+
152
+ /**
153
+ * Checks a public zone's challenge now, instead of waiting for the
154
+ * platform's next check, and returns the zone as it is then, with the
155
+ * check's outcome in `challenge.lastCheck`. A pending zone whose token
156
+ * answers becomes `ACTIVE`, and so does a suspended one while its name is
157
+ * free; otherwise the zone stays as it was. A call within 30 seconds of
158
+ * the zone's last check answers with that check's outcome and asks the
159
+ * name's DNS nothing. Refused with `NOT_FOUND` once a pending zone's
160
+ * window has ended, which deleted it, and with `SERVICE_UNAVAILABLE`,
161
+ * retryable, when the name's DNS didn't answer in time or too many checks
162
+ * are under way. A private zone has no challenge, and is refused with
163
+ * `BAD_REQUEST`. Checking an active zone changes nothing, so a client may
164
+ * repeat the call.
165
+ */
166
+ async verifyHostedZone(request: VerifyHostedZoneRequest, options?: CallOptions): Promise<HostedZone> {
167
+ const p0 = pathValue("name", request.name, "projects/*/hostedZones/*");
168
+ return this.service.call<HostedZone>(
169
+ {
170
+ method: "POST",
171
+ path: `/v1beta1/${p0}:verify`,
172
+ body: request,
173
+ },
174
+ options,
175
+ );
176
+ }
177
+ }
178
+
179
+ /** A domain a project's records are answered for. */
180
+ export interface HostedZone {
181
+ /** The zone's resource name. */
182
+ name?: string;
183
+ /** The zone's URN, the identifier access policies and the audit log use. */
184
+ urn?: string;
185
+ /**
186
+ * The domain, such as `example.com`, without the final dot; answered in
187
+ * lowercase. A public zone's has at least two labels and at most 235
188
+ * characters, so its challenge name fits. A private zone's may have one
189
+ * label, but isn't `internal` or a name below it, which answer each
190
+ * instance's own name. Neither is one of the platform's own domains or a
191
+ * name below one.
192
+ */
193
+ dnsName?: string;
194
+ /** Where the zone is answered. */
195
+ visibility?: HostedZone_Visibility;
196
+ /** Whether the zone is answered. */
197
+ state?: HostedZone_State;
198
+ /**
199
+ * The name servers to delegate a public zone to at its registrar, as NS
200
+ * records of its name. Fixed when the zone is created. Empty for a
201
+ * private zone.
202
+ */
203
+ nameServers?: string[];
204
+ /**
205
+ * How a public zone proves control of its name, and how it went. Unset
206
+ * for a private zone.
207
+ */
208
+ challenge?: OwnershipChallenge;
209
+ /** When the zone was created. */
210
+ createTime?: string;
211
+ /**
212
+ * The principal that created the zone, such as `user:<id>` or
213
+ * `service_account:<id>`.
214
+ */
215
+ creator?: string;
216
+ /**
217
+ * Labels of your own, at most 50. The `origin:name` tag is the name the
218
+ * console shows.
219
+ */
220
+ tags?: Record<string, string>;
221
+ }
222
+
223
+ /** Where a zone is answered. */
224
+ export const HostedZone_Visibility = {
225
+ /** Not set. */
226
+ VISIBILITY_UNSPECIFIED: "VISIBILITY_UNSPECIFIED",
227
+ /** On the internet, from the platform's name servers. */
228
+ PUBLIC: "PUBLIC",
229
+ /** Only inside the VPCs it is attached to. */
230
+ PRIVATE: "PRIVATE",
231
+ } as const;
232
+
233
+ /** Where a zone is answered. */
234
+ export type HostedZone_Visibility = (typeof HostedZone_Visibility)[keyof typeof HostedZone_Visibility];
235
+
236
+ /** Whether a zone is answered. */
237
+ export const HostedZone_State = {
238
+ /** Not set. */
239
+ STATE_UNSPECIFIED: "STATE_UNSPECIFIED",
240
+ /**
241
+ * A public zone that hasn't proved control of its name yet: not
242
+ * answered, and holding no name.
243
+ */
244
+ PENDING_VERIFICATION: "PENDING_VERIFICATION",
245
+ /** Answered. A public zone in this state holds its name. */
246
+ ACTIVE: "ACTIVE",
247
+ /**
248
+ * A public zone that lost control of its name: not answered, its
249
+ * record sets kept, its name free for another zone.
250
+ */
251
+ SUSPENDED: "SUSPENDED",
252
+ } as const;
253
+
254
+ /** Whether a zone is answered. */
255
+ export type HostedZone_State = (typeof HostedZone_State)[keyof typeof HostedZone_State];
256
+
257
+ /**
258
+ * A public zone's proof of control of its name: a TXT record named
259
+ * `dnsName` whose value is `token`, answered by the name's current DNS.
260
+ */
261
+ export interface OwnershipChallenge {
262
+ /**
263
+ * The name of the TXT record to create where the zone's name is hosted
264
+ * now: `_origin-challenge.` followed by the zone's `dnsName`.
265
+ */
266
+ dnsName?: string;
267
+ /** The value the TXT record holds. */
268
+ token?: string;
269
+ /**
270
+ * When a pending zone that hasn't verified is deleted; unset once it
271
+ * verified.
272
+ */
273
+ expireTime?: string;
274
+ /** When the zone verified; unset while it is pending. */
275
+ verifyTime?: string;
276
+ /** When the zone was suspended; unset unless it is `SUSPENDED`. */
277
+ suspendTime?: string;
278
+ /** Why the zone was suspended; unset unless it is `SUSPENDED`. */
279
+ suspensionReason?: OwnershipChallenge_SuspensionReason;
280
+ /**
281
+ * What the check `VerifyHostedZone` made found. Set only in that
282
+ * method's response.
283
+ */
284
+ lastCheck?: OwnershipChallenge_CheckOutcome;
285
+ }
286
+
287
+ /** Why a zone was suspended. */
288
+ export const OwnershipChallenge_SuspensionReason = {
289
+ /** Not set. */
290
+ SUSPENSION_REASON_UNSPECIFIED: "SUSPENSION_REASON_UNSPECIFIED",
291
+ /**
292
+ * Several daily checks in a row found the name delegated to other name
293
+ * servers, without the zone's token.
294
+ */
295
+ CHALLENGE_LOST: "CHALLENGE_LOST",
296
+ } as const;
297
+
298
+ /** Why a zone was suspended. */
299
+ export type OwnershipChallenge_SuspensionReason = (typeof OwnershipChallenge_SuspensionReason)[keyof typeof OwnershipChallenge_SuspensionReason];
300
+
301
+ /** What a check of the challenge found. */
302
+ export const OwnershipChallenge_CheckOutcome = {
303
+ /** Not set. */
304
+ CHECK_OUTCOME_UNSPECIFIED: "CHECK_OUTCOME_UNSPECIFIED",
305
+ /** The token answers, and the zone holds its name: it is `ACTIVE`. */
306
+ OK: "OK",
307
+ /**
308
+ * The token doesn't answer at the TXT record's name, or the name's DNS
309
+ * can't be asked.
310
+ */
311
+ NOT_FOUND: "NOT_FOUND",
312
+ /** The token answers, but another zone holds the name. */
313
+ NAME_HELD: "NAME_HELD",
314
+ } as const;
315
+
316
+ /** What a check of the challenge found. */
317
+ export type OwnershipChallenge_CheckOutcome = (typeof OwnershipChallenge_CheckOutcome)[keyof typeof OwnershipChallenge_CheckOutcome];
318
+
319
+ /** The request for GetHostedZone. */
320
+ export interface GetHostedZoneRequest {
321
+ /** The zone to return. */
322
+ name?: string;
323
+ }
324
+
325
+ /** The request for ListHostedZones. */
326
+ export interface ListHostedZonesRequest {
327
+ /** The project whose zones to list, `projects/{project}`. */
328
+ parent?: string;
329
+ /**
330
+ * The most zones to return; the server clamps it, and 0 means its
331
+ * default.
332
+ */
333
+ pageSize?: number;
334
+ /** A previous response's `nextPageToken`, for the page after it. */
335
+ pageToken?: string;
336
+ /**
337
+ * Only the zones of this domain, written as `dnsName` is; every zone
338
+ * when left empty.
339
+ */
340
+ dnsName?: string;
341
+ }
342
+
343
+ /** The response for ListHostedZones. */
344
+ export interface ListHostedZonesResponse {
345
+ /** The zones on this page. */
346
+ hostedZones?: HostedZone[];
347
+ /** The token for the next page; empty on the last one. */
348
+ nextPageToken?: string;
349
+ }
350
+
351
+ /** The request for CreateHostedZone. */
352
+ export interface CreateHostedZoneRequest {
353
+ /** The project to create the zone in, `projects/{project}`. */
354
+ parent?: string;
355
+ /**
356
+ * The zone to create: its `dnsName`, `visibility` and optionally its
357
+ * `tags`.
358
+ */
359
+ hostedZone?: HostedZone;
360
+ /**
361
+ * A UUID; a repeat with the same id within a day returns the zone the
362
+ * first request created, as it is now, instead of creating a second one.
363
+ */
364
+ requestId?: string;
365
+ }
366
+
367
+ /** The request for UpdateHostedZone. */
368
+ export interface UpdateHostedZoneRequest {
369
+ /** The zone, by its name, with the fields to change. */
370
+ hostedZone?: HostedZone;
371
+ /** The fields to change: `tags`, or `*`. */
372
+ updateMask?: string;
373
+ /**
374
+ * A UUID; a repeat with the same id within a day returns the zone as it
375
+ * is now, instead of changing it again.
376
+ */
377
+ requestId?: string;
378
+ }
379
+
380
+ /** The request for DeleteHostedZone. */
381
+ export interface DeleteHostedZoneRequest {
382
+ /** The zone to delete. */
383
+ name?: string;
384
+ /**
385
+ * A UUID; a repeat with the same id within a day succeeds as the first
386
+ * did, instead of answering `NOT_FOUND`.
387
+ */
388
+ requestId?: string;
389
+ }
390
+
391
+ /** The request for VerifyHostedZone. */
392
+ export interface VerifyHostedZoneRequest {
393
+ /** The public zone to verify. */
394
+ name?: string;
395
+ }
@@ -0,0 +1,5 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+
3
+ export * from "./hosted_zone.js";
4
+ export * from "./record_set.js";
5
+ export * from "./vpc_attachment.js";