@googleapis/siteverification 2.0.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.
package/v1.ts ADDED
@@ -0,0 +1,1213 @@
1
+ // Copyright 2020 Google LLC
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+ /* eslint-disable @typescript-eslint/no-unused-vars */
16
+ /* eslint-disable @typescript-eslint/no-empty-interface */
17
+ /* eslint-disable @typescript-eslint/no-namespace */
18
+ /* eslint-disable no-irregular-whitespace */
19
+
20
+ import {
21
+ OAuth2Client,
22
+ JWT,
23
+ Compute,
24
+ UserRefreshClient,
25
+ BaseExternalAccountClient,
26
+ GaxiosPromise,
27
+ GoogleConfigurable,
28
+ createAPIRequest,
29
+ MethodOptions,
30
+ StreamMethodOptions,
31
+ GlobalOptions,
32
+ GoogleAuth,
33
+ BodyResponseCallback,
34
+ APIRequestContext,
35
+ } from 'googleapis-common';
36
+ import {Readable} from 'stream';
37
+
38
+ export namespace siteVerification_v1 {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'v1';
41
+ }
42
+
43
+ interface StandardParameters {
44
+ /**
45
+ * Auth client or API Key for the request
46
+ */
47
+ auth?:
48
+ | string
49
+ | OAuth2Client
50
+ | JWT
51
+ | Compute
52
+ | UserRefreshClient
53
+ | BaseExternalAccountClient
54
+ | GoogleAuth;
55
+
56
+ /**
57
+ * Data format for the response.
58
+ */
59
+ alt?: string;
60
+ /**
61
+ * Selector specifying which fields to include in a partial response.
62
+ */
63
+ fields?: string;
64
+ /**
65
+ * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
66
+ */
67
+ key?: string;
68
+ /**
69
+ * OAuth 2.0 token for the current user.
70
+ */
71
+ oauth_token?: string;
72
+ /**
73
+ * Returns response with indentations and line breaks.
74
+ */
75
+ prettyPrint?: boolean;
76
+ /**
77
+ * An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
78
+ */
79
+ quotaUser?: string;
80
+ /**
81
+ * Deprecated. Please use quotaUser instead.
82
+ */
83
+ userIp?: string;
84
+ }
85
+
86
+ /**
87
+ * Google Site Verification API
88
+ *
89
+ * Verifies ownership of websites or domains with Google.
90
+ *
91
+ * @example
92
+ * ```js
93
+ * const {google} = require('googleapis');
94
+ * const siteVerification = google.siteVerification('v1');
95
+ * ```
96
+ */
97
+ export class Siteverification {
98
+ context: APIRequestContext;
99
+ webResource: Resource$Webresource;
100
+
101
+ constructor(options: GlobalOptions, google?: GoogleConfigurable) {
102
+ this.context = {
103
+ _options: options || {},
104
+ google,
105
+ };
106
+
107
+ this.webResource = new Resource$Webresource(this.context);
108
+ }
109
+ }
110
+
111
+ export interface Schema$SiteVerificationWebResourceGettokenRequest {
112
+ /**
113
+ * The site for which a verification token will be generated.
114
+ */
115
+ site?: {identifier?: string; type?: string} | null;
116
+ /**
117
+ * The verification method that will be used to verify this site. For sites, 'FILE' or 'META' methods may be used. For domains, only 'DNS' may be used.
118
+ */
119
+ verificationMethod?: string | null;
120
+ }
121
+ export interface Schema$SiteVerificationWebResourceGettokenResponse {
122
+ /**
123
+ * The verification method to use in conjunction with this token. For FILE, the token should be placed in the top-level directory of the site, stored inside a file of the same name. For META, the token should be placed in the HEAD tag of the default page that is loaded for the site. For DNS, the token should be placed in a TXT record of the domain.
124
+ */
125
+ method?: string | null;
126
+ /**
127
+ * The verification token. The token must be placed appropriately in order for verification to succeed.
128
+ */
129
+ token?: string | null;
130
+ }
131
+ export interface Schema$SiteVerificationWebResourceListResponse {
132
+ /**
133
+ * The list of sites that are owned by the authenticated user.
134
+ */
135
+ items?: Schema$SiteVerificationWebResourceResource[];
136
+ }
137
+ export interface Schema$SiteVerificationWebResourceResource {
138
+ /**
139
+ * The string used to identify this site. This value should be used in the "id" portion of the REST URL for the Get, Update, and Delete operations.
140
+ */
141
+ id?: string | null;
142
+ /**
143
+ * The email addresses of all verified owners.
144
+ */
145
+ owners?: string[] | null;
146
+ /**
147
+ * The address and type of a site that is verified or will be verified.
148
+ */
149
+ site?: {identifier?: string; type?: string} | null;
150
+ }
151
+
152
+ export class Resource$Webresource {
153
+ context: APIRequestContext;
154
+ constructor(context: APIRequestContext) {
155
+ this.context = context;
156
+ }
157
+
158
+ /**
159
+ * Relinquish ownership of a website or domain.
160
+ * @example
161
+ * ```js
162
+ * // Before running the sample:
163
+ * // - Enable the API at:
164
+ * // https://console.developers.google.com/apis/api/siteVerification.googleapis.com
165
+ * // - Login into gcloud by running:
166
+ * // `$ gcloud auth application-default login`
167
+ * // - Install the npm module by running:
168
+ * // `$ npm install googleapis`
169
+ *
170
+ * const {google} = require('googleapis');
171
+ * const siteVerification = google.siteVerification('v1');
172
+ *
173
+ * async function main() {
174
+ * const auth = new google.auth.GoogleAuth({
175
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
176
+ * scopes: ['https://www.googleapis.com/auth/siteverification'],
177
+ * });
178
+ *
179
+ * // Acquire an auth client, and bind it to all future calls
180
+ * const authClient = await auth.getClient();
181
+ * google.options({auth: authClient});
182
+ *
183
+ * // Do the magic
184
+ * const res = await siteVerification.webResource.delete({
185
+ * // The id of a verified site or domain.
186
+ * id: 'placeholder-value',
187
+ * });
188
+ * console.log(res.data);
189
+ * }
190
+ *
191
+ * main().catch(e => {
192
+ * console.error(e);
193
+ * throw e;
194
+ * });
195
+ *
196
+ * ```
197
+ *
198
+ * @param params - Parameters for request
199
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
200
+ * @param callback - Optional callback that handles the response.
201
+ * @returns A promise if used with async/await, or void if used with a callback.
202
+ */
203
+ delete(
204
+ params: Params$Resource$Webresource$Delete,
205
+ options: StreamMethodOptions
206
+ ): GaxiosPromise<Readable>;
207
+ delete(
208
+ params?: Params$Resource$Webresource$Delete,
209
+ options?: MethodOptions
210
+ ): GaxiosPromise<void>;
211
+ delete(
212
+ params: Params$Resource$Webresource$Delete,
213
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
214
+ callback: BodyResponseCallback<Readable>
215
+ ): void;
216
+ delete(
217
+ params: Params$Resource$Webresource$Delete,
218
+ options: MethodOptions | BodyResponseCallback<void>,
219
+ callback: BodyResponseCallback<void>
220
+ ): void;
221
+ delete(
222
+ params: Params$Resource$Webresource$Delete,
223
+ callback: BodyResponseCallback<void>
224
+ ): void;
225
+ delete(callback: BodyResponseCallback<void>): void;
226
+ delete(
227
+ paramsOrCallback?:
228
+ | Params$Resource$Webresource$Delete
229
+ | BodyResponseCallback<void>
230
+ | BodyResponseCallback<Readable>,
231
+ optionsOrCallback?:
232
+ | MethodOptions
233
+ | StreamMethodOptions
234
+ | BodyResponseCallback<void>
235
+ | BodyResponseCallback<Readable>,
236
+ callback?: BodyResponseCallback<void> | BodyResponseCallback<Readable>
237
+ ): void | GaxiosPromise<void> | GaxiosPromise<Readable> {
238
+ let params = (paramsOrCallback ||
239
+ {}) as Params$Resource$Webresource$Delete;
240
+ let options = (optionsOrCallback || {}) as MethodOptions;
241
+
242
+ if (typeof paramsOrCallback === 'function') {
243
+ callback = paramsOrCallback;
244
+ params = {} as Params$Resource$Webresource$Delete;
245
+ options = {};
246
+ }
247
+
248
+ if (typeof optionsOrCallback === 'function') {
249
+ callback = optionsOrCallback;
250
+ options = {};
251
+ }
252
+
253
+ const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
254
+ const parameters = {
255
+ options: Object.assign(
256
+ {
257
+ url: (rootUrl + '/siteVerification/v1/webResource/{id}').replace(
258
+ /([^:]\/)\/+/g,
259
+ '$1'
260
+ ),
261
+ method: 'DELETE',
262
+ },
263
+ options
264
+ ),
265
+ params,
266
+ requiredParams: ['id'],
267
+ pathParams: ['id'],
268
+ context: this.context,
269
+ };
270
+ if (callback) {
271
+ createAPIRequest<void>(
272
+ parameters,
273
+ callback as BodyResponseCallback<unknown>
274
+ );
275
+ } else {
276
+ return createAPIRequest<void>(parameters);
277
+ }
278
+ }
279
+
280
+ /**
281
+ * Get the most current data for a website or domain.
282
+ * @example
283
+ * ```js
284
+ * // Before running the sample:
285
+ * // - Enable the API at:
286
+ * // https://console.developers.google.com/apis/api/siteVerification.googleapis.com
287
+ * // - Login into gcloud by running:
288
+ * // `$ gcloud auth application-default login`
289
+ * // - Install the npm module by running:
290
+ * // `$ npm install googleapis`
291
+ *
292
+ * const {google} = require('googleapis');
293
+ * const siteVerification = google.siteVerification('v1');
294
+ *
295
+ * async function main() {
296
+ * const auth = new google.auth.GoogleAuth({
297
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
298
+ * scopes: ['https://www.googleapis.com/auth/siteverification'],
299
+ * });
300
+ *
301
+ * // Acquire an auth client, and bind it to all future calls
302
+ * const authClient = await auth.getClient();
303
+ * google.options({auth: authClient});
304
+ *
305
+ * // Do the magic
306
+ * const res = await siteVerification.webResource.get({
307
+ * // The id of a verified site or domain.
308
+ * id: 'placeholder-value',
309
+ * });
310
+ * console.log(res.data);
311
+ *
312
+ * // Example response
313
+ * // {
314
+ * // "id": "my_id",
315
+ * // "owners": [],
316
+ * // "site": {}
317
+ * // }
318
+ * }
319
+ *
320
+ * main().catch(e => {
321
+ * console.error(e);
322
+ * throw e;
323
+ * });
324
+ *
325
+ * ```
326
+ *
327
+ * @param params - Parameters for request
328
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
329
+ * @param callback - Optional callback that handles the response.
330
+ * @returns A promise if used with async/await, or void if used with a callback.
331
+ */
332
+ get(
333
+ params: Params$Resource$Webresource$Get,
334
+ options: StreamMethodOptions
335
+ ): GaxiosPromise<Readable>;
336
+ get(
337
+ params?: Params$Resource$Webresource$Get,
338
+ options?: MethodOptions
339
+ ): GaxiosPromise<Schema$SiteVerificationWebResourceResource>;
340
+ get(
341
+ params: Params$Resource$Webresource$Get,
342
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
343
+ callback: BodyResponseCallback<Readable>
344
+ ): void;
345
+ get(
346
+ params: Params$Resource$Webresource$Get,
347
+ options:
348
+ | MethodOptions
349
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>,
350
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
351
+ ): void;
352
+ get(
353
+ params: Params$Resource$Webresource$Get,
354
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
355
+ ): void;
356
+ get(
357
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
358
+ ): void;
359
+ get(
360
+ paramsOrCallback?:
361
+ | Params$Resource$Webresource$Get
362
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
363
+ | BodyResponseCallback<Readable>,
364
+ optionsOrCallback?:
365
+ | MethodOptions
366
+ | StreamMethodOptions
367
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
368
+ | BodyResponseCallback<Readable>,
369
+ callback?:
370
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
371
+ | BodyResponseCallback<Readable>
372
+ ):
373
+ | void
374
+ | GaxiosPromise<Schema$SiteVerificationWebResourceResource>
375
+ | GaxiosPromise<Readable> {
376
+ let params = (paramsOrCallback || {}) as Params$Resource$Webresource$Get;
377
+ let options = (optionsOrCallback || {}) as MethodOptions;
378
+
379
+ if (typeof paramsOrCallback === 'function') {
380
+ callback = paramsOrCallback;
381
+ params = {} as Params$Resource$Webresource$Get;
382
+ options = {};
383
+ }
384
+
385
+ if (typeof optionsOrCallback === 'function') {
386
+ callback = optionsOrCallback;
387
+ options = {};
388
+ }
389
+
390
+ const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
391
+ const parameters = {
392
+ options: Object.assign(
393
+ {
394
+ url: (rootUrl + '/siteVerification/v1/webResource/{id}').replace(
395
+ /([^:]\/)\/+/g,
396
+ '$1'
397
+ ),
398
+ method: 'GET',
399
+ },
400
+ options
401
+ ),
402
+ params,
403
+ requiredParams: ['id'],
404
+ pathParams: ['id'],
405
+ context: this.context,
406
+ };
407
+ if (callback) {
408
+ createAPIRequest<Schema$SiteVerificationWebResourceResource>(
409
+ parameters,
410
+ callback as BodyResponseCallback<unknown>
411
+ );
412
+ } else {
413
+ return createAPIRequest<Schema$SiteVerificationWebResourceResource>(
414
+ parameters
415
+ );
416
+ }
417
+ }
418
+
419
+ /**
420
+ * Get a verification token for placing on a website or domain.
421
+ * @example
422
+ * ```js
423
+ * // Before running the sample:
424
+ * // - Enable the API at:
425
+ * // https://console.developers.google.com/apis/api/siteVerification.googleapis.com
426
+ * // - Login into gcloud by running:
427
+ * // `$ gcloud auth application-default login`
428
+ * // - Install the npm module by running:
429
+ * // `$ npm install googleapis`
430
+ *
431
+ * const {google} = require('googleapis');
432
+ * const siteVerification = google.siteVerification('v1');
433
+ *
434
+ * async function main() {
435
+ * const auth = new google.auth.GoogleAuth({
436
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
437
+ * scopes: [
438
+ * 'https://www.googleapis.com/auth/siteverification',
439
+ * 'https://www.googleapis.com/auth/siteverification.verify_only',
440
+ * ],
441
+ * });
442
+ *
443
+ * // Acquire an auth client, and bind it to all future calls
444
+ * const authClient = await auth.getClient();
445
+ * google.options({auth: authClient});
446
+ *
447
+ * // Do the magic
448
+ * const res = await siteVerification.webResource.getToken({
449
+ * // Request body metadata
450
+ * requestBody: {
451
+ * // request body parameters
452
+ * // {
453
+ * // "site": {},
454
+ * // "verificationMethod": "my_verificationMethod"
455
+ * // }
456
+ * },
457
+ * });
458
+ * console.log(res.data);
459
+ *
460
+ * // Example response
461
+ * // {
462
+ * // "method": "my_method",
463
+ * // "token": "my_token"
464
+ * // }
465
+ * }
466
+ *
467
+ * main().catch(e => {
468
+ * console.error(e);
469
+ * throw e;
470
+ * });
471
+ *
472
+ * ```
473
+ *
474
+ * @param params - Parameters for request
475
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
476
+ * @param callback - Optional callback that handles the response.
477
+ * @returns A promise if used with async/await, or void if used with a callback.
478
+ */
479
+ getToken(
480
+ params: Params$Resource$Webresource$Gettoken,
481
+ options: StreamMethodOptions
482
+ ): GaxiosPromise<Readable>;
483
+ getToken(
484
+ params?: Params$Resource$Webresource$Gettoken,
485
+ options?: MethodOptions
486
+ ): GaxiosPromise<Schema$SiteVerificationWebResourceGettokenResponse>;
487
+ getToken(
488
+ params: Params$Resource$Webresource$Gettoken,
489
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
490
+ callback: BodyResponseCallback<Readable>
491
+ ): void;
492
+ getToken(
493
+ params: Params$Resource$Webresource$Gettoken,
494
+ options:
495
+ | MethodOptions
496
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceGettokenResponse>,
497
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceGettokenResponse>
498
+ ): void;
499
+ getToken(
500
+ params: Params$Resource$Webresource$Gettoken,
501
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceGettokenResponse>
502
+ ): void;
503
+ getToken(
504
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceGettokenResponse>
505
+ ): void;
506
+ getToken(
507
+ paramsOrCallback?:
508
+ | Params$Resource$Webresource$Gettoken
509
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceGettokenResponse>
510
+ | BodyResponseCallback<Readable>,
511
+ optionsOrCallback?:
512
+ | MethodOptions
513
+ | StreamMethodOptions
514
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceGettokenResponse>
515
+ | BodyResponseCallback<Readable>,
516
+ callback?:
517
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceGettokenResponse>
518
+ | BodyResponseCallback<Readable>
519
+ ):
520
+ | void
521
+ | GaxiosPromise<Schema$SiteVerificationWebResourceGettokenResponse>
522
+ | GaxiosPromise<Readable> {
523
+ let params = (paramsOrCallback ||
524
+ {}) as Params$Resource$Webresource$Gettoken;
525
+ let options = (optionsOrCallback || {}) as MethodOptions;
526
+
527
+ if (typeof paramsOrCallback === 'function') {
528
+ callback = paramsOrCallback;
529
+ params = {} as Params$Resource$Webresource$Gettoken;
530
+ options = {};
531
+ }
532
+
533
+ if (typeof optionsOrCallback === 'function') {
534
+ callback = optionsOrCallback;
535
+ options = {};
536
+ }
537
+
538
+ const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
539
+ const parameters = {
540
+ options: Object.assign(
541
+ {
542
+ url: (rootUrl + '/siteVerification/v1/token').replace(
543
+ /([^:]\/)\/+/g,
544
+ '$1'
545
+ ),
546
+ method: 'POST',
547
+ },
548
+ options
549
+ ),
550
+ params,
551
+ requiredParams: [],
552
+ pathParams: [],
553
+ context: this.context,
554
+ };
555
+ if (callback) {
556
+ createAPIRequest<Schema$SiteVerificationWebResourceGettokenResponse>(
557
+ parameters,
558
+ callback as BodyResponseCallback<unknown>
559
+ );
560
+ } else {
561
+ return createAPIRequest<Schema$SiteVerificationWebResourceGettokenResponse>(
562
+ parameters
563
+ );
564
+ }
565
+ }
566
+
567
+ /**
568
+ * Attempt verification of a website or domain.
569
+ * @example
570
+ * ```js
571
+ * // Before running the sample:
572
+ * // - Enable the API at:
573
+ * // https://console.developers.google.com/apis/api/siteVerification.googleapis.com
574
+ * // - Login into gcloud by running:
575
+ * // `$ gcloud auth application-default login`
576
+ * // - Install the npm module by running:
577
+ * // `$ npm install googleapis`
578
+ *
579
+ * const {google} = require('googleapis');
580
+ * const siteVerification = google.siteVerification('v1');
581
+ *
582
+ * async function main() {
583
+ * const auth = new google.auth.GoogleAuth({
584
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
585
+ * scopes: [
586
+ * 'https://www.googleapis.com/auth/siteverification',
587
+ * 'https://www.googleapis.com/auth/siteverification.verify_only',
588
+ * ],
589
+ * });
590
+ *
591
+ * // Acquire an auth client, and bind it to all future calls
592
+ * const authClient = await auth.getClient();
593
+ * google.options({auth: authClient});
594
+ *
595
+ * // Do the magic
596
+ * const res = await siteVerification.webResource.insert({
597
+ * // The method to use for verifying a site or domain.
598
+ * verificationMethod: 'placeholder-value',
599
+ *
600
+ * // Request body metadata
601
+ * requestBody: {
602
+ * // request body parameters
603
+ * // {
604
+ * // "id": "my_id",
605
+ * // "owners": [],
606
+ * // "site": {}
607
+ * // }
608
+ * },
609
+ * });
610
+ * console.log(res.data);
611
+ *
612
+ * // Example response
613
+ * // {
614
+ * // "id": "my_id",
615
+ * // "owners": [],
616
+ * // "site": {}
617
+ * // }
618
+ * }
619
+ *
620
+ * main().catch(e => {
621
+ * console.error(e);
622
+ * throw e;
623
+ * });
624
+ *
625
+ * ```
626
+ *
627
+ * @param params - Parameters for request
628
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
629
+ * @param callback - Optional callback that handles the response.
630
+ * @returns A promise if used with async/await, or void if used with a callback.
631
+ */
632
+ insert(
633
+ params: Params$Resource$Webresource$Insert,
634
+ options: StreamMethodOptions
635
+ ): GaxiosPromise<Readable>;
636
+ insert(
637
+ params?: Params$Resource$Webresource$Insert,
638
+ options?: MethodOptions
639
+ ): GaxiosPromise<Schema$SiteVerificationWebResourceResource>;
640
+ insert(
641
+ params: Params$Resource$Webresource$Insert,
642
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
643
+ callback: BodyResponseCallback<Readable>
644
+ ): void;
645
+ insert(
646
+ params: Params$Resource$Webresource$Insert,
647
+ options:
648
+ | MethodOptions
649
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>,
650
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
651
+ ): void;
652
+ insert(
653
+ params: Params$Resource$Webresource$Insert,
654
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
655
+ ): void;
656
+ insert(
657
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
658
+ ): void;
659
+ insert(
660
+ paramsOrCallback?:
661
+ | Params$Resource$Webresource$Insert
662
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
663
+ | BodyResponseCallback<Readable>,
664
+ optionsOrCallback?:
665
+ | MethodOptions
666
+ | StreamMethodOptions
667
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
668
+ | BodyResponseCallback<Readable>,
669
+ callback?:
670
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
671
+ | BodyResponseCallback<Readable>
672
+ ):
673
+ | void
674
+ | GaxiosPromise<Schema$SiteVerificationWebResourceResource>
675
+ | GaxiosPromise<Readable> {
676
+ let params = (paramsOrCallback ||
677
+ {}) as Params$Resource$Webresource$Insert;
678
+ let options = (optionsOrCallback || {}) as MethodOptions;
679
+
680
+ if (typeof paramsOrCallback === 'function') {
681
+ callback = paramsOrCallback;
682
+ params = {} as Params$Resource$Webresource$Insert;
683
+ options = {};
684
+ }
685
+
686
+ if (typeof optionsOrCallback === 'function') {
687
+ callback = optionsOrCallback;
688
+ options = {};
689
+ }
690
+
691
+ const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
692
+ const parameters = {
693
+ options: Object.assign(
694
+ {
695
+ url: (rootUrl + '/siteVerification/v1/webResource').replace(
696
+ /([^:]\/)\/+/g,
697
+ '$1'
698
+ ),
699
+ method: 'POST',
700
+ },
701
+ options
702
+ ),
703
+ params,
704
+ requiredParams: ['verificationMethod'],
705
+ pathParams: [],
706
+ context: this.context,
707
+ };
708
+ if (callback) {
709
+ createAPIRequest<Schema$SiteVerificationWebResourceResource>(
710
+ parameters,
711
+ callback as BodyResponseCallback<unknown>
712
+ );
713
+ } else {
714
+ return createAPIRequest<Schema$SiteVerificationWebResourceResource>(
715
+ parameters
716
+ );
717
+ }
718
+ }
719
+
720
+ /**
721
+ * Get the list of your verified websites and domains.
722
+ * @example
723
+ * ```js
724
+ * // Before running the sample:
725
+ * // - Enable the API at:
726
+ * // https://console.developers.google.com/apis/api/siteVerification.googleapis.com
727
+ * // - Login into gcloud by running:
728
+ * // `$ gcloud auth application-default login`
729
+ * // - Install the npm module by running:
730
+ * // `$ npm install googleapis`
731
+ *
732
+ * const {google} = require('googleapis');
733
+ * const siteVerification = google.siteVerification('v1');
734
+ *
735
+ * async function main() {
736
+ * const auth = new google.auth.GoogleAuth({
737
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
738
+ * scopes: ['https://www.googleapis.com/auth/siteverification'],
739
+ * });
740
+ *
741
+ * // Acquire an auth client, and bind it to all future calls
742
+ * const authClient = await auth.getClient();
743
+ * google.options({auth: authClient});
744
+ *
745
+ * // Do the magic
746
+ * const res = await siteVerification.webResource.list({});
747
+ * console.log(res.data);
748
+ *
749
+ * // Example response
750
+ * // {
751
+ * // "items": []
752
+ * // }
753
+ * }
754
+ *
755
+ * main().catch(e => {
756
+ * console.error(e);
757
+ * throw e;
758
+ * });
759
+ *
760
+ * ```
761
+ *
762
+ * @param params - Parameters for request
763
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
764
+ * @param callback - Optional callback that handles the response.
765
+ * @returns A promise if used with async/await, or void if used with a callback.
766
+ */
767
+ list(
768
+ params: Params$Resource$Webresource$List,
769
+ options: StreamMethodOptions
770
+ ): GaxiosPromise<Readable>;
771
+ list(
772
+ params?: Params$Resource$Webresource$List,
773
+ options?: MethodOptions
774
+ ): GaxiosPromise<Schema$SiteVerificationWebResourceListResponse>;
775
+ list(
776
+ params: Params$Resource$Webresource$List,
777
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
778
+ callback: BodyResponseCallback<Readable>
779
+ ): void;
780
+ list(
781
+ params: Params$Resource$Webresource$List,
782
+ options:
783
+ | MethodOptions
784
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceListResponse>,
785
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceListResponse>
786
+ ): void;
787
+ list(
788
+ params: Params$Resource$Webresource$List,
789
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceListResponse>
790
+ ): void;
791
+ list(
792
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceListResponse>
793
+ ): void;
794
+ list(
795
+ paramsOrCallback?:
796
+ | Params$Resource$Webresource$List
797
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceListResponse>
798
+ | BodyResponseCallback<Readable>,
799
+ optionsOrCallback?:
800
+ | MethodOptions
801
+ | StreamMethodOptions
802
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceListResponse>
803
+ | BodyResponseCallback<Readable>,
804
+ callback?:
805
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceListResponse>
806
+ | BodyResponseCallback<Readable>
807
+ ):
808
+ | void
809
+ | GaxiosPromise<Schema$SiteVerificationWebResourceListResponse>
810
+ | GaxiosPromise<Readable> {
811
+ let params = (paramsOrCallback || {}) as Params$Resource$Webresource$List;
812
+ let options = (optionsOrCallback || {}) as MethodOptions;
813
+
814
+ if (typeof paramsOrCallback === 'function') {
815
+ callback = paramsOrCallback;
816
+ params = {} as Params$Resource$Webresource$List;
817
+ options = {};
818
+ }
819
+
820
+ if (typeof optionsOrCallback === 'function') {
821
+ callback = optionsOrCallback;
822
+ options = {};
823
+ }
824
+
825
+ const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
826
+ const parameters = {
827
+ options: Object.assign(
828
+ {
829
+ url: (rootUrl + '/siteVerification/v1/webResource').replace(
830
+ /([^:]\/)\/+/g,
831
+ '$1'
832
+ ),
833
+ method: 'GET',
834
+ },
835
+ options
836
+ ),
837
+ params,
838
+ requiredParams: [],
839
+ pathParams: [],
840
+ context: this.context,
841
+ };
842
+ if (callback) {
843
+ createAPIRequest<Schema$SiteVerificationWebResourceListResponse>(
844
+ parameters,
845
+ callback as BodyResponseCallback<unknown>
846
+ );
847
+ } else {
848
+ return createAPIRequest<Schema$SiteVerificationWebResourceListResponse>(
849
+ parameters
850
+ );
851
+ }
852
+ }
853
+
854
+ /**
855
+ * Modify the list of owners for your website or domain. This method supports patch semantics.
856
+ * @example
857
+ * ```js
858
+ * // Before running the sample:
859
+ * // - Enable the API at:
860
+ * // https://console.developers.google.com/apis/api/siteVerification.googleapis.com
861
+ * // - Login into gcloud by running:
862
+ * // `$ gcloud auth application-default login`
863
+ * // - Install the npm module by running:
864
+ * // `$ npm install googleapis`
865
+ *
866
+ * const {google} = require('googleapis');
867
+ * const siteVerification = google.siteVerification('v1');
868
+ *
869
+ * async function main() {
870
+ * const auth = new google.auth.GoogleAuth({
871
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
872
+ * scopes: ['https://www.googleapis.com/auth/siteverification'],
873
+ * });
874
+ *
875
+ * // Acquire an auth client, and bind it to all future calls
876
+ * const authClient = await auth.getClient();
877
+ * google.options({auth: authClient});
878
+ *
879
+ * // Do the magic
880
+ * const res = await siteVerification.webResource.patch({
881
+ * // The id of a verified site or domain.
882
+ * id: 'placeholder-value',
883
+ *
884
+ * // Request body metadata
885
+ * requestBody: {
886
+ * // request body parameters
887
+ * // {
888
+ * // "id": "my_id",
889
+ * // "owners": [],
890
+ * // "site": {}
891
+ * // }
892
+ * },
893
+ * });
894
+ * console.log(res.data);
895
+ *
896
+ * // Example response
897
+ * // {
898
+ * // "id": "my_id",
899
+ * // "owners": [],
900
+ * // "site": {}
901
+ * // }
902
+ * }
903
+ *
904
+ * main().catch(e => {
905
+ * console.error(e);
906
+ * throw e;
907
+ * });
908
+ *
909
+ * ```
910
+ *
911
+ * @param params - Parameters for request
912
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
913
+ * @param callback - Optional callback that handles the response.
914
+ * @returns A promise if used with async/await, or void if used with a callback.
915
+ */
916
+ patch(
917
+ params: Params$Resource$Webresource$Patch,
918
+ options: StreamMethodOptions
919
+ ): GaxiosPromise<Readable>;
920
+ patch(
921
+ params?: Params$Resource$Webresource$Patch,
922
+ options?: MethodOptions
923
+ ): GaxiosPromise<Schema$SiteVerificationWebResourceResource>;
924
+ patch(
925
+ params: Params$Resource$Webresource$Patch,
926
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
927
+ callback: BodyResponseCallback<Readable>
928
+ ): void;
929
+ patch(
930
+ params: Params$Resource$Webresource$Patch,
931
+ options:
932
+ | MethodOptions
933
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>,
934
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
935
+ ): void;
936
+ patch(
937
+ params: Params$Resource$Webresource$Patch,
938
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
939
+ ): void;
940
+ patch(
941
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
942
+ ): void;
943
+ patch(
944
+ paramsOrCallback?:
945
+ | Params$Resource$Webresource$Patch
946
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
947
+ | BodyResponseCallback<Readable>,
948
+ optionsOrCallback?:
949
+ | MethodOptions
950
+ | StreamMethodOptions
951
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
952
+ | BodyResponseCallback<Readable>,
953
+ callback?:
954
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
955
+ | BodyResponseCallback<Readable>
956
+ ):
957
+ | void
958
+ | GaxiosPromise<Schema$SiteVerificationWebResourceResource>
959
+ | GaxiosPromise<Readable> {
960
+ let params = (paramsOrCallback ||
961
+ {}) as Params$Resource$Webresource$Patch;
962
+ let options = (optionsOrCallback || {}) as MethodOptions;
963
+
964
+ if (typeof paramsOrCallback === 'function') {
965
+ callback = paramsOrCallback;
966
+ params = {} as Params$Resource$Webresource$Patch;
967
+ options = {};
968
+ }
969
+
970
+ if (typeof optionsOrCallback === 'function') {
971
+ callback = optionsOrCallback;
972
+ options = {};
973
+ }
974
+
975
+ const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
976
+ const parameters = {
977
+ options: Object.assign(
978
+ {
979
+ url: (rootUrl + '/siteVerification/v1/webResource/{id}').replace(
980
+ /([^:]\/)\/+/g,
981
+ '$1'
982
+ ),
983
+ method: 'PATCH',
984
+ },
985
+ options
986
+ ),
987
+ params,
988
+ requiredParams: ['id'],
989
+ pathParams: ['id'],
990
+ context: this.context,
991
+ };
992
+ if (callback) {
993
+ createAPIRequest<Schema$SiteVerificationWebResourceResource>(
994
+ parameters,
995
+ callback as BodyResponseCallback<unknown>
996
+ );
997
+ } else {
998
+ return createAPIRequest<Schema$SiteVerificationWebResourceResource>(
999
+ parameters
1000
+ );
1001
+ }
1002
+ }
1003
+
1004
+ /**
1005
+ * Modify the list of owners for your website or domain.
1006
+ * @example
1007
+ * ```js
1008
+ * // Before running the sample:
1009
+ * // - Enable the API at:
1010
+ * // https://console.developers.google.com/apis/api/siteVerification.googleapis.com
1011
+ * // - Login into gcloud by running:
1012
+ * // `$ gcloud auth application-default login`
1013
+ * // - Install the npm module by running:
1014
+ * // `$ npm install googleapis`
1015
+ *
1016
+ * const {google} = require('googleapis');
1017
+ * const siteVerification = google.siteVerification('v1');
1018
+ *
1019
+ * async function main() {
1020
+ * const auth = new google.auth.GoogleAuth({
1021
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1022
+ * scopes: ['https://www.googleapis.com/auth/siteverification'],
1023
+ * });
1024
+ *
1025
+ * // Acquire an auth client, and bind it to all future calls
1026
+ * const authClient = await auth.getClient();
1027
+ * google.options({auth: authClient});
1028
+ *
1029
+ * // Do the magic
1030
+ * const res = await siteVerification.webResource.update({
1031
+ * // The id of a verified site or domain.
1032
+ * id: 'placeholder-value',
1033
+ *
1034
+ * // Request body metadata
1035
+ * requestBody: {
1036
+ * // request body parameters
1037
+ * // {
1038
+ * // "id": "my_id",
1039
+ * // "owners": [],
1040
+ * // "site": {}
1041
+ * // }
1042
+ * },
1043
+ * });
1044
+ * console.log(res.data);
1045
+ *
1046
+ * // Example response
1047
+ * // {
1048
+ * // "id": "my_id",
1049
+ * // "owners": [],
1050
+ * // "site": {}
1051
+ * // }
1052
+ * }
1053
+ *
1054
+ * main().catch(e => {
1055
+ * console.error(e);
1056
+ * throw e;
1057
+ * });
1058
+ *
1059
+ * ```
1060
+ *
1061
+ * @param params - Parameters for request
1062
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1063
+ * @param callback - Optional callback that handles the response.
1064
+ * @returns A promise if used with async/await, or void if used with a callback.
1065
+ */
1066
+ update(
1067
+ params: Params$Resource$Webresource$Update,
1068
+ options: StreamMethodOptions
1069
+ ): GaxiosPromise<Readable>;
1070
+ update(
1071
+ params?: Params$Resource$Webresource$Update,
1072
+ options?: MethodOptions
1073
+ ): GaxiosPromise<Schema$SiteVerificationWebResourceResource>;
1074
+ update(
1075
+ params: Params$Resource$Webresource$Update,
1076
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1077
+ callback: BodyResponseCallback<Readable>
1078
+ ): void;
1079
+ update(
1080
+ params: Params$Resource$Webresource$Update,
1081
+ options:
1082
+ | MethodOptions
1083
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>,
1084
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
1085
+ ): void;
1086
+ update(
1087
+ params: Params$Resource$Webresource$Update,
1088
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
1089
+ ): void;
1090
+ update(
1091
+ callback: BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
1092
+ ): void;
1093
+ update(
1094
+ paramsOrCallback?:
1095
+ | Params$Resource$Webresource$Update
1096
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
1097
+ | BodyResponseCallback<Readable>,
1098
+ optionsOrCallback?:
1099
+ | MethodOptions
1100
+ | StreamMethodOptions
1101
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
1102
+ | BodyResponseCallback<Readable>,
1103
+ callback?:
1104
+ | BodyResponseCallback<Schema$SiteVerificationWebResourceResource>
1105
+ | BodyResponseCallback<Readable>
1106
+ ):
1107
+ | void
1108
+ | GaxiosPromise<Schema$SiteVerificationWebResourceResource>
1109
+ | GaxiosPromise<Readable> {
1110
+ let params = (paramsOrCallback ||
1111
+ {}) as Params$Resource$Webresource$Update;
1112
+ let options = (optionsOrCallback || {}) as MethodOptions;
1113
+
1114
+ if (typeof paramsOrCallback === 'function') {
1115
+ callback = paramsOrCallback;
1116
+ params = {} as Params$Resource$Webresource$Update;
1117
+ options = {};
1118
+ }
1119
+
1120
+ if (typeof optionsOrCallback === 'function') {
1121
+ callback = optionsOrCallback;
1122
+ options = {};
1123
+ }
1124
+
1125
+ const rootUrl = options.rootUrl || 'https://www.googleapis.com/';
1126
+ const parameters = {
1127
+ options: Object.assign(
1128
+ {
1129
+ url: (rootUrl + '/siteVerification/v1/webResource/{id}').replace(
1130
+ /([^:]\/)\/+/g,
1131
+ '$1'
1132
+ ),
1133
+ method: 'PUT',
1134
+ },
1135
+ options
1136
+ ),
1137
+ params,
1138
+ requiredParams: ['id'],
1139
+ pathParams: ['id'],
1140
+ context: this.context,
1141
+ };
1142
+ if (callback) {
1143
+ createAPIRequest<Schema$SiteVerificationWebResourceResource>(
1144
+ parameters,
1145
+ callback as BodyResponseCallback<unknown>
1146
+ );
1147
+ } else {
1148
+ return createAPIRequest<Schema$SiteVerificationWebResourceResource>(
1149
+ parameters
1150
+ );
1151
+ }
1152
+ }
1153
+ }
1154
+
1155
+ export interface Params$Resource$Webresource$Delete
1156
+ extends StandardParameters {
1157
+ /**
1158
+ * The id of a verified site or domain.
1159
+ */
1160
+ id?: string;
1161
+ }
1162
+ export interface Params$Resource$Webresource$Get extends StandardParameters {
1163
+ /**
1164
+ * The id of a verified site or domain.
1165
+ */
1166
+ id?: string;
1167
+ }
1168
+ export interface Params$Resource$Webresource$Gettoken
1169
+ extends StandardParameters {
1170
+ /**
1171
+ * Request body metadata
1172
+ */
1173
+ requestBody?: Schema$SiteVerificationWebResourceGettokenRequest;
1174
+ }
1175
+ export interface Params$Resource$Webresource$Insert
1176
+ extends StandardParameters {
1177
+ /**
1178
+ * The method to use for verifying a site or domain.
1179
+ */
1180
+ verificationMethod?: string;
1181
+
1182
+ /**
1183
+ * Request body metadata
1184
+ */
1185
+ requestBody?: Schema$SiteVerificationWebResourceResource;
1186
+ }
1187
+ export interface Params$Resource$Webresource$List
1188
+ extends StandardParameters {}
1189
+ export interface Params$Resource$Webresource$Patch
1190
+ extends StandardParameters {
1191
+ /**
1192
+ * The id of a verified site or domain.
1193
+ */
1194
+ id?: string;
1195
+
1196
+ /**
1197
+ * Request body metadata
1198
+ */
1199
+ requestBody?: Schema$SiteVerificationWebResourceResource;
1200
+ }
1201
+ export interface Params$Resource$Webresource$Update
1202
+ extends StandardParameters {
1203
+ /**
1204
+ * The id of a verified site or domain.
1205
+ */
1206
+ id?: string;
1207
+
1208
+ /**
1209
+ * Request body metadata
1210
+ */
1211
+ requestBody?: Schema$SiteVerificationWebResourceResource;
1212
+ }
1213
+ }