@googleapis/searchconsole 2.0.1 → 3.1.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/CHANGELOG.md +32 -0
- package/build/v1.d.ts +559 -0
- package/build/v1.js.map +1 -1
- package/package.json +1 -1
- package/v1.ts +559 -0
package/v1.ts
CHANGED
|
@@ -327,6 +327,10 @@ export namespace searchconsole_v1 {
|
|
|
327
327
|
*/
|
|
328
328
|
name?: string | null;
|
|
329
329
|
}
|
|
330
|
+
export interface Schema$Metadata {
|
|
331
|
+
firstIncompleteDate?: string | null;
|
|
332
|
+
firstIncompleteHour?: string | null;
|
|
333
|
+
}
|
|
330
334
|
/**
|
|
331
335
|
* Mobile-friendly issue.
|
|
332
336
|
*/
|
|
@@ -485,6 +489,7 @@ export namespace searchconsole_v1 {
|
|
|
485
489
|
* A list of rows, one per result, grouped by key. Metrics in each row are aggregated for all data grouped by that key either by page or property, as specified by the aggregation type parameter.
|
|
486
490
|
*/
|
|
487
491
|
export interface Schema$SearchAnalyticsQueryResponse {
|
|
492
|
+
metadata?: Schema$Metadata;
|
|
488
493
|
/**
|
|
489
494
|
* How the results were aggregated.
|
|
490
495
|
*/
|
|
@@ -630,6 +635,74 @@ export namespace searchconsole_v1 {
|
|
|
630
635
|
|
|
631
636
|
/**
|
|
632
637
|
* Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.
|
|
638
|
+
* @example
|
|
639
|
+
* ```js
|
|
640
|
+
* // Before running the sample:
|
|
641
|
+
* // - Enable the API at:
|
|
642
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
643
|
+
* // - Login into gcloud by running:
|
|
644
|
+
* // ```sh
|
|
645
|
+
* // $ gcloud auth application-default login
|
|
646
|
+
* // ```
|
|
647
|
+
* // - Install the npm module by running:
|
|
648
|
+
* // ```sh
|
|
649
|
+
* // $ npm install googleapis
|
|
650
|
+
* // ```
|
|
651
|
+
*
|
|
652
|
+
* const {google} = require('googleapis');
|
|
653
|
+
* const searchconsole = google.searchconsole('v1');
|
|
654
|
+
*
|
|
655
|
+
* async function main() {
|
|
656
|
+
* const auth = new google.auth.GoogleAuth({
|
|
657
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
658
|
+
* scopes: [
|
|
659
|
+
* 'https://www.googleapis.com/auth/webmasters',
|
|
660
|
+
* 'https://www.googleapis.com/auth/webmasters.readonly',
|
|
661
|
+
* ],
|
|
662
|
+
* });
|
|
663
|
+
*
|
|
664
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
665
|
+
* const authClient = await auth.getClient();
|
|
666
|
+
* google.options({auth: authClient});
|
|
667
|
+
*
|
|
668
|
+
* // Do the magic
|
|
669
|
+
* const res = await webmasters.searchanalytics.query({
|
|
670
|
+
* // The site's URL, including protocol. For example: `http://www.example.com/`.
|
|
671
|
+
* siteUrl: 'placeholder-value',
|
|
672
|
+
*
|
|
673
|
+
* // Request body metadata
|
|
674
|
+
* requestBody: {
|
|
675
|
+
* // request body parameters
|
|
676
|
+
* // {
|
|
677
|
+
* // "aggregationType": "my_aggregationType",
|
|
678
|
+
* // "dataState": "my_dataState",
|
|
679
|
+
* // "dimensionFilterGroups": [],
|
|
680
|
+
* // "dimensions": [],
|
|
681
|
+
* // "endDate": "my_endDate",
|
|
682
|
+
* // "rowLimit": 0,
|
|
683
|
+
* // "searchType": "my_searchType",
|
|
684
|
+
* // "startDate": "my_startDate",
|
|
685
|
+
* // "startRow": 0,
|
|
686
|
+
* // "type": "my_type"
|
|
687
|
+
* // }
|
|
688
|
+
* },
|
|
689
|
+
* });
|
|
690
|
+
* console.log(res.data);
|
|
691
|
+
*
|
|
692
|
+
* // Example response
|
|
693
|
+
* // {
|
|
694
|
+
* // "metadata": {},
|
|
695
|
+
* // "responseAggregationType": "my_responseAggregationType",
|
|
696
|
+
* // "rows": []
|
|
697
|
+
* // }
|
|
698
|
+
* }
|
|
699
|
+
*
|
|
700
|
+
* main().catch(e => {
|
|
701
|
+
* console.error(e);
|
|
702
|
+
* throw e;
|
|
703
|
+
* });
|
|
704
|
+
*
|
|
705
|
+
* ```
|
|
633
706
|
*
|
|
634
707
|
* @param params - Parameters for request
|
|
635
708
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -747,6 +820,49 @@ export namespace searchconsole_v1 {
|
|
|
747
820
|
|
|
748
821
|
/**
|
|
749
822
|
* Deletes a sitemap from the Sitemaps report. Does not stop Google from crawling this sitemap or the URLs that were previously crawled in the deleted sitemap.
|
|
823
|
+
* @example
|
|
824
|
+
* ```js
|
|
825
|
+
* // Before running the sample:
|
|
826
|
+
* // - Enable the API at:
|
|
827
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
828
|
+
* // - Login into gcloud by running:
|
|
829
|
+
* // ```sh
|
|
830
|
+
* // $ gcloud auth application-default login
|
|
831
|
+
* // ```
|
|
832
|
+
* // - Install the npm module by running:
|
|
833
|
+
* // ```sh
|
|
834
|
+
* // $ npm install googleapis
|
|
835
|
+
* // ```
|
|
836
|
+
*
|
|
837
|
+
* const {google} = require('googleapis');
|
|
838
|
+
* const searchconsole = google.searchconsole('v1');
|
|
839
|
+
*
|
|
840
|
+
* async function main() {
|
|
841
|
+
* const auth = new google.auth.GoogleAuth({
|
|
842
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
843
|
+
* scopes: ['https://www.googleapis.com/auth/webmasters'],
|
|
844
|
+
* });
|
|
845
|
+
*
|
|
846
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
847
|
+
* const authClient = await auth.getClient();
|
|
848
|
+
* google.options({auth: authClient});
|
|
849
|
+
*
|
|
850
|
+
* // Do the magic
|
|
851
|
+
* const res = await webmasters.sitemaps.delete({
|
|
852
|
+
* // The URL of the actual sitemap. For example: `http://www.example.com/sitemap.xml`.
|
|
853
|
+
* feedpath: 'placeholder-value',
|
|
854
|
+
* // The site's URL, including protocol. For example: `http://www.example.com/`.
|
|
855
|
+
* siteUrl: 'placeholder-value',
|
|
856
|
+
* });
|
|
857
|
+
* console.log(res.data);
|
|
858
|
+
* }
|
|
859
|
+
*
|
|
860
|
+
* main().catch(e => {
|
|
861
|
+
* console.error(e);
|
|
862
|
+
* throw e;
|
|
863
|
+
* });
|
|
864
|
+
*
|
|
865
|
+
* ```
|
|
750
866
|
*
|
|
751
867
|
* @param params - Parameters for request
|
|
752
868
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -835,6 +951,65 @@ export namespace searchconsole_v1 {
|
|
|
835
951
|
|
|
836
952
|
/**
|
|
837
953
|
* Retrieves information about a specific sitemap.
|
|
954
|
+
* @example
|
|
955
|
+
* ```js
|
|
956
|
+
* // Before running the sample:
|
|
957
|
+
* // - Enable the API at:
|
|
958
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
959
|
+
* // - Login into gcloud by running:
|
|
960
|
+
* // ```sh
|
|
961
|
+
* // $ gcloud auth application-default login
|
|
962
|
+
* // ```
|
|
963
|
+
* // - Install the npm module by running:
|
|
964
|
+
* // ```sh
|
|
965
|
+
* // $ npm install googleapis
|
|
966
|
+
* // ```
|
|
967
|
+
*
|
|
968
|
+
* const {google} = require('googleapis');
|
|
969
|
+
* const searchconsole = google.searchconsole('v1');
|
|
970
|
+
*
|
|
971
|
+
* async function main() {
|
|
972
|
+
* const auth = new google.auth.GoogleAuth({
|
|
973
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
974
|
+
* scopes: [
|
|
975
|
+
* 'https://www.googleapis.com/auth/webmasters',
|
|
976
|
+
* 'https://www.googleapis.com/auth/webmasters.readonly',
|
|
977
|
+
* ],
|
|
978
|
+
* });
|
|
979
|
+
*
|
|
980
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
981
|
+
* const authClient = await auth.getClient();
|
|
982
|
+
* google.options({auth: authClient});
|
|
983
|
+
*
|
|
984
|
+
* // Do the magic
|
|
985
|
+
* const res = await webmasters.sitemaps.get({
|
|
986
|
+
* // The URL of the actual sitemap. For example: `http://www.example.com/sitemap.xml`.
|
|
987
|
+
* feedpath: 'placeholder-value',
|
|
988
|
+
* // The site's URL, including protocol. For example: `http://www.example.com/`.
|
|
989
|
+
* siteUrl: 'placeholder-value',
|
|
990
|
+
* });
|
|
991
|
+
* console.log(res.data);
|
|
992
|
+
*
|
|
993
|
+
* // Example response
|
|
994
|
+
* // {
|
|
995
|
+
* // "contents": [],
|
|
996
|
+
* // "errors": "my_errors",
|
|
997
|
+
* // "isPending": false,
|
|
998
|
+
* // "isSitemapsIndex": false,
|
|
999
|
+
* // "lastDownloaded": "my_lastDownloaded",
|
|
1000
|
+
* // "lastSubmitted": "my_lastSubmitted",
|
|
1001
|
+
* // "path": "my_path",
|
|
1002
|
+
* // "type": "my_type",
|
|
1003
|
+
* // "warnings": "my_warnings"
|
|
1004
|
+
* // }
|
|
1005
|
+
* }
|
|
1006
|
+
*
|
|
1007
|
+
* main().catch(e => {
|
|
1008
|
+
* console.error(e);
|
|
1009
|
+
* throw e;
|
|
1010
|
+
* });
|
|
1011
|
+
*
|
|
1012
|
+
* ```
|
|
838
1013
|
*
|
|
839
1014
|
* @param params - Parameters for request
|
|
840
1015
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -925,6 +1100,57 @@ export namespace searchconsole_v1 {
|
|
|
925
1100
|
|
|
926
1101
|
/**
|
|
927
1102
|
* Lists the [sitemaps-entries](/webmaster-tools/v3/sitemaps) submitted for this site, or included in the sitemap index file (if `sitemapIndex` is specified in the request).
|
|
1103
|
+
* @example
|
|
1104
|
+
* ```js
|
|
1105
|
+
* // Before running the sample:
|
|
1106
|
+
* // - Enable the API at:
|
|
1107
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
1108
|
+
* // - Login into gcloud by running:
|
|
1109
|
+
* // ```sh
|
|
1110
|
+
* // $ gcloud auth application-default login
|
|
1111
|
+
* // ```
|
|
1112
|
+
* // - Install the npm module by running:
|
|
1113
|
+
* // ```sh
|
|
1114
|
+
* // $ npm install googleapis
|
|
1115
|
+
* // ```
|
|
1116
|
+
*
|
|
1117
|
+
* const {google} = require('googleapis');
|
|
1118
|
+
* const searchconsole = google.searchconsole('v1');
|
|
1119
|
+
*
|
|
1120
|
+
* async function main() {
|
|
1121
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1122
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1123
|
+
* scopes: [
|
|
1124
|
+
* 'https://www.googleapis.com/auth/webmasters',
|
|
1125
|
+
* 'https://www.googleapis.com/auth/webmasters.readonly',
|
|
1126
|
+
* ],
|
|
1127
|
+
* });
|
|
1128
|
+
*
|
|
1129
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1130
|
+
* const authClient = await auth.getClient();
|
|
1131
|
+
* google.options({auth: authClient});
|
|
1132
|
+
*
|
|
1133
|
+
* // Do the magic
|
|
1134
|
+
* const res = await webmasters.sitemaps.list({
|
|
1135
|
+
* // A URL of a site's sitemap index. For example: `http://www.example.com/sitemapindex.xml`.
|
|
1136
|
+
* sitemapIndex: 'placeholder-value',
|
|
1137
|
+
* // The site's URL, including protocol. For example: `http://www.example.com/`.
|
|
1138
|
+
* siteUrl: 'placeholder-value',
|
|
1139
|
+
* });
|
|
1140
|
+
* console.log(res.data);
|
|
1141
|
+
*
|
|
1142
|
+
* // Example response
|
|
1143
|
+
* // {
|
|
1144
|
+
* // "sitemap": []
|
|
1145
|
+
* // }
|
|
1146
|
+
* }
|
|
1147
|
+
*
|
|
1148
|
+
* main().catch(e => {
|
|
1149
|
+
* console.error(e);
|
|
1150
|
+
* throw e;
|
|
1151
|
+
* });
|
|
1152
|
+
*
|
|
1153
|
+
* ```
|
|
928
1154
|
*
|
|
929
1155
|
* @param params - Parameters for request
|
|
930
1156
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1018,6 +1244,49 @@ export namespace searchconsole_v1 {
|
|
|
1018
1244
|
|
|
1019
1245
|
/**
|
|
1020
1246
|
* Submits a sitemap for a site.
|
|
1247
|
+
* @example
|
|
1248
|
+
* ```js
|
|
1249
|
+
* // Before running the sample:
|
|
1250
|
+
* // - Enable the API at:
|
|
1251
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
1252
|
+
* // - Login into gcloud by running:
|
|
1253
|
+
* // ```sh
|
|
1254
|
+
* // $ gcloud auth application-default login
|
|
1255
|
+
* // ```
|
|
1256
|
+
* // - Install the npm module by running:
|
|
1257
|
+
* // ```sh
|
|
1258
|
+
* // $ npm install googleapis
|
|
1259
|
+
* // ```
|
|
1260
|
+
*
|
|
1261
|
+
* const {google} = require('googleapis');
|
|
1262
|
+
* const searchconsole = google.searchconsole('v1');
|
|
1263
|
+
*
|
|
1264
|
+
* async function main() {
|
|
1265
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1266
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1267
|
+
* scopes: ['https://www.googleapis.com/auth/webmasters'],
|
|
1268
|
+
* });
|
|
1269
|
+
*
|
|
1270
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1271
|
+
* const authClient = await auth.getClient();
|
|
1272
|
+
* google.options({auth: authClient});
|
|
1273
|
+
*
|
|
1274
|
+
* // Do the magic
|
|
1275
|
+
* const res = await webmasters.sitemaps.submit({
|
|
1276
|
+
* // The URL of the actual sitemap. For example: `http://www.example.com/sitemap.xml`.
|
|
1277
|
+
* feedpath: 'placeholder-value',
|
|
1278
|
+
* // The site's URL, including protocol. For example: `http://www.example.com/`.
|
|
1279
|
+
* siteUrl: 'placeholder-value',
|
|
1280
|
+
* });
|
|
1281
|
+
* console.log(res.data);
|
|
1282
|
+
* }
|
|
1283
|
+
*
|
|
1284
|
+
* main().catch(e => {
|
|
1285
|
+
* console.error(e);
|
|
1286
|
+
* throw e;
|
|
1287
|
+
* });
|
|
1288
|
+
*
|
|
1289
|
+
* ```
|
|
1021
1290
|
*
|
|
1022
1291
|
* @param params - Parameters for request
|
|
1023
1292
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1154,6 +1423,47 @@ export namespace searchconsole_v1 {
|
|
|
1154
1423
|
|
|
1155
1424
|
/**
|
|
1156
1425
|
* Adds a site to the set of the user's sites in Search Console.
|
|
1426
|
+
* @example
|
|
1427
|
+
* ```js
|
|
1428
|
+
* // Before running the sample:
|
|
1429
|
+
* // - Enable the API at:
|
|
1430
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
1431
|
+
* // - Login into gcloud by running:
|
|
1432
|
+
* // ```sh
|
|
1433
|
+
* // $ gcloud auth application-default login
|
|
1434
|
+
* // ```
|
|
1435
|
+
* // - Install the npm module by running:
|
|
1436
|
+
* // ```sh
|
|
1437
|
+
* // $ npm install googleapis
|
|
1438
|
+
* // ```
|
|
1439
|
+
*
|
|
1440
|
+
* const {google} = require('googleapis');
|
|
1441
|
+
* const searchconsole = google.searchconsole('v1');
|
|
1442
|
+
*
|
|
1443
|
+
* async function main() {
|
|
1444
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1445
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1446
|
+
* scopes: ['https://www.googleapis.com/auth/webmasters'],
|
|
1447
|
+
* });
|
|
1448
|
+
*
|
|
1449
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1450
|
+
* const authClient = await auth.getClient();
|
|
1451
|
+
* google.options({auth: authClient});
|
|
1452
|
+
*
|
|
1453
|
+
* // Do the magic
|
|
1454
|
+
* const res = await webmasters.sites.add({
|
|
1455
|
+
* // The URL of the site to add.
|
|
1456
|
+
* siteUrl: 'placeholder-value',
|
|
1457
|
+
* });
|
|
1458
|
+
* console.log(res.data);
|
|
1459
|
+
* }
|
|
1460
|
+
*
|
|
1461
|
+
* main().catch(e => {
|
|
1462
|
+
* console.error(e);
|
|
1463
|
+
* throw e;
|
|
1464
|
+
* });
|
|
1465
|
+
*
|
|
1466
|
+
* ```
|
|
1157
1467
|
*
|
|
1158
1468
|
* @param params - Parameters for request
|
|
1159
1469
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1243,6 +1553,47 @@ export namespace searchconsole_v1 {
|
|
|
1243
1553
|
|
|
1244
1554
|
/**
|
|
1245
1555
|
* Removes a site from the set of the user's Search Console sites.
|
|
1556
|
+
* @example
|
|
1557
|
+
* ```js
|
|
1558
|
+
* // Before running the sample:
|
|
1559
|
+
* // - Enable the API at:
|
|
1560
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
1561
|
+
* // - Login into gcloud by running:
|
|
1562
|
+
* // ```sh
|
|
1563
|
+
* // $ gcloud auth application-default login
|
|
1564
|
+
* // ```
|
|
1565
|
+
* // - Install the npm module by running:
|
|
1566
|
+
* // ```sh
|
|
1567
|
+
* // $ npm install googleapis
|
|
1568
|
+
* // ```
|
|
1569
|
+
*
|
|
1570
|
+
* const {google} = require('googleapis');
|
|
1571
|
+
* const searchconsole = google.searchconsole('v1');
|
|
1572
|
+
*
|
|
1573
|
+
* async function main() {
|
|
1574
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1575
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1576
|
+
* scopes: ['https://www.googleapis.com/auth/webmasters'],
|
|
1577
|
+
* });
|
|
1578
|
+
*
|
|
1579
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1580
|
+
* const authClient = await auth.getClient();
|
|
1581
|
+
* google.options({auth: authClient});
|
|
1582
|
+
*
|
|
1583
|
+
* // Do the magic
|
|
1584
|
+
* const res = await webmasters.sites.delete({
|
|
1585
|
+
* // The URI of the property as defined in Search Console. **Examples:** `http://www.example.com/` or `sc-domain:example.com`.
|
|
1586
|
+
* siteUrl: 'placeholder-value',
|
|
1587
|
+
* });
|
|
1588
|
+
* console.log(res.data);
|
|
1589
|
+
* }
|
|
1590
|
+
*
|
|
1591
|
+
* main().catch(e => {
|
|
1592
|
+
* console.error(e);
|
|
1593
|
+
* throw e;
|
|
1594
|
+
* });
|
|
1595
|
+
*
|
|
1596
|
+
* ```
|
|
1246
1597
|
*
|
|
1247
1598
|
* @param params - Parameters for request
|
|
1248
1599
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1332,6 +1683,56 @@ export namespace searchconsole_v1 {
|
|
|
1332
1683
|
|
|
1333
1684
|
/**
|
|
1334
1685
|
* Retrieves information about specific site.
|
|
1686
|
+
* @example
|
|
1687
|
+
* ```js
|
|
1688
|
+
* // Before running the sample:
|
|
1689
|
+
* // - Enable the API at:
|
|
1690
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
1691
|
+
* // - Login into gcloud by running:
|
|
1692
|
+
* // ```sh
|
|
1693
|
+
* // $ gcloud auth application-default login
|
|
1694
|
+
* // ```
|
|
1695
|
+
* // - Install the npm module by running:
|
|
1696
|
+
* // ```sh
|
|
1697
|
+
* // $ npm install googleapis
|
|
1698
|
+
* // ```
|
|
1699
|
+
*
|
|
1700
|
+
* const {google} = require('googleapis');
|
|
1701
|
+
* const searchconsole = google.searchconsole('v1');
|
|
1702
|
+
*
|
|
1703
|
+
* async function main() {
|
|
1704
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1705
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1706
|
+
* scopes: [
|
|
1707
|
+
* 'https://www.googleapis.com/auth/webmasters',
|
|
1708
|
+
* 'https://www.googleapis.com/auth/webmasters.readonly',
|
|
1709
|
+
* ],
|
|
1710
|
+
* });
|
|
1711
|
+
*
|
|
1712
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1713
|
+
* const authClient = await auth.getClient();
|
|
1714
|
+
* google.options({auth: authClient});
|
|
1715
|
+
*
|
|
1716
|
+
* // Do the magic
|
|
1717
|
+
* const res = await webmasters.sites.get({
|
|
1718
|
+
* // The URI of the property as defined in Search Console. **Examples:** `http://www.example.com/` or `sc-domain:example.com`.
|
|
1719
|
+
* siteUrl: 'placeholder-value',
|
|
1720
|
+
* });
|
|
1721
|
+
* console.log(res.data);
|
|
1722
|
+
*
|
|
1723
|
+
* // Example response
|
|
1724
|
+
* // {
|
|
1725
|
+
* // "permissionLevel": "my_permissionLevel",
|
|
1726
|
+
* // "siteUrl": "my_siteUrl"
|
|
1727
|
+
* // }
|
|
1728
|
+
* }
|
|
1729
|
+
*
|
|
1730
|
+
* main().catch(e => {
|
|
1731
|
+
* console.error(e);
|
|
1732
|
+
* throw e;
|
|
1733
|
+
* });
|
|
1734
|
+
*
|
|
1735
|
+
* ```
|
|
1335
1736
|
*
|
|
1336
1737
|
* @param params - Parameters for request
|
|
1337
1738
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1423,6 +1824,52 @@ export namespace searchconsole_v1 {
|
|
|
1423
1824
|
|
|
1424
1825
|
/**
|
|
1425
1826
|
* Lists the user's Search Console sites.
|
|
1827
|
+
* @example
|
|
1828
|
+
* ```js
|
|
1829
|
+
* // Before running the sample:
|
|
1830
|
+
* // - Enable the API at:
|
|
1831
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
1832
|
+
* // - Login into gcloud by running:
|
|
1833
|
+
* // ```sh
|
|
1834
|
+
* // $ gcloud auth application-default login
|
|
1835
|
+
* // ```
|
|
1836
|
+
* // - Install the npm module by running:
|
|
1837
|
+
* // ```sh
|
|
1838
|
+
* // $ npm install googleapis
|
|
1839
|
+
* // ```
|
|
1840
|
+
*
|
|
1841
|
+
* const {google} = require('googleapis');
|
|
1842
|
+
* const searchconsole = google.searchconsole('v1');
|
|
1843
|
+
*
|
|
1844
|
+
* async function main() {
|
|
1845
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1846
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1847
|
+
* scopes: [
|
|
1848
|
+
* 'https://www.googleapis.com/auth/webmasters',
|
|
1849
|
+
* 'https://www.googleapis.com/auth/webmasters.readonly',
|
|
1850
|
+
* ],
|
|
1851
|
+
* });
|
|
1852
|
+
*
|
|
1853
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1854
|
+
* const authClient = await auth.getClient();
|
|
1855
|
+
* google.options({auth: authClient});
|
|
1856
|
+
*
|
|
1857
|
+
* // Do the magic
|
|
1858
|
+
* const res = await webmasters.sites.list({});
|
|
1859
|
+
* console.log(res.data);
|
|
1860
|
+
*
|
|
1861
|
+
* // Example response
|
|
1862
|
+
* // {
|
|
1863
|
+
* // "siteEntry": []
|
|
1864
|
+
* // }
|
|
1865
|
+
* }
|
|
1866
|
+
*
|
|
1867
|
+
* main().catch(e => {
|
|
1868
|
+
* console.error(e);
|
|
1869
|
+
* throw e;
|
|
1870
|
+
* });
|
|
1871
|
+
*
|
|
1872
|
+
* ```
|
|
1426
1873
|
*
|
|
1427
1874
|
* @param params - Parameters for request
|
|
1428
1875
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1550,6 +1997,62 @@ export namespace searchconsole_v1 {
|
|
|
1550
1997
|
|
|
1551
1998
|
/**
|
|
1552
1999
|
* Index inspection.
|
|
2000
|
+
* @example
|
|
2001
|
+
* ```js
|
|
2002
|
+
* // Before running the sample:
|
|
2003
|
+
* // - Enable the API at:
|
|
2004
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
2005
|
+
* // - Login into gcloud by running:
|
|
2006
|
+
* // ```sh
|
|
2007
|
+
* // $ gcloud auth application-default login
|
|
2008
|
+
* // ```
|
|
2009
|
+
* // - Install the npm module by running:
|
|
2010
|
+
* // ```sh
|
|
2011
|
+
* // $ npm install googleapis
|
|
2012
|
+
* // ```
|
|
2013
|
+
*
|
|
2014
|
+
* const {google} = require('googleapis');
|
|
2015
|
+
* const searchconsole = google.searchconsole('v1');
|
|
2016
|
+
*
|
|
2017
|
+
* async function main() {
|
|
2018
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2019
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2020
|
+
* scopes: [
|
|
2021
|
+
* 'https://www.googleapis.com/auth/webmasters',
|
|
2022
|
+
* 'https://www.googleapis.com/auth/webmasters.readonly',
|
|
2023
|
+
* ],
|
|
2024
|
+
* });
|
|
2025
|
+
*
|
|
2026
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2027
|
+
* const authClient = await auth.getClient();
|
|
2028
|
+
* google.options({auth: authClient});
|
|
2029
|
+
*
|
|
2030
|
+
* // Do the magic
|
|
2031
|
+
* const res = await searchconsole.urlInspection.index.inspect({
|
|
2032
|
+
* // Request body metadata
|
|
2033
|
+
* requestBody: {
|
|
2034
|
+
* // request body parameters
|
|
2035
|
+
* // {
|
|
2036
|
+
* // "inspectionUrl": "my_inspectionUrl",
|
|
2037
|
+
* // "languageCode": "my_languageCode",
|
|
2038
|
+
* // "siteUrl": "my_siteUrl"
|
|
2039
|
+
* // }
|
|
2040
|
+
* },
|
|
2041
|
+
* });
|
|
2042
|
+
* console.log(res.data);
|
|
2043
|
+
*
|
|
2044
|
+
* // Example response
|
|
2045
|
+
* // {
|
|
2046
|
+
* // "inspectionResult": {}
|
|
2047
|
+
* // }
|
|
2048
|
+
* }
|
|
2049
|
+
*
|
|
2050
|
+
* main().catch(e => {
|
|
2051
|
+
* console.error(e);
|
|
2052
|
+
* throw e;
|
|
2053
|
+
* });
|
|
2054
|
+
*
|
|
2055
|
+
* ```
|
|
1553
2056
|
*
|
|
1554
2057
|
* @param params - Parameters for request
|
|
1555
2058
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1672,6 +2175,62 @@ export namespace searchconsole_v1 {
|
|
|
1672
2175
|
|
|
1673
2176
|
/**
|
|
1674
2177
|
* Runs Mobile-Friendly Test for a given URL.
|
|
2178
|
+
* @example
|
|
2179
|
+
* ```js
|
|
2180
|
+
* // Before running the sample:
|
|
2181
|
+
* // - Enable the API at:
|
|
2182
|
+
* // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
|
|
2183
|
+
* // - Login into gcloud by running:
|
|
2184
|
+
* // ```sh
|
|
2185
|
+
* // $ gcloud auth application-default login
|
|
2186
|
+
* // ```
|
|
2187
|
+
* // - Install the npm module by running:
|
|
2188
|
+
* // ```sh
|
|
2189
|
+
* // $ npm install googleapis
|
|
2190
|
+
* // ```
|
|
2191
|
+
*
|
|
2192
|
+
* const {google} = require('googleapis');
|
|
2193
|
+
* const searchconsole = google.searchconsole('v1');
|
|
2194
|
+
*
|
|
2195
|
+
* async function main() {
|
|
2196
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2197
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2198
|
+
* scopes: [],
|
|
2199
|
+
* });
|
|
2200
|
+
*
|
|
2201
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2202
|
+
* const authClient = await auth.getClient();
|
|
2203
|
+
* google.options({auth: authClient});
|
|
2204
|
+
*
|
|
2205
|
+
* // Do the magic
|
|
2206
|
+
* const res = await searchconsole.urlTestingTools.mobileFriendlyTest.run({
|
|
2207
|
+
* // Request body metadata
|
|
2208
|
+
* requestBody: {
|
|
2209
|
+
* // request body parameters
|
|
2210
|
+
* // {
|
|
2211
|
+
* // "requestScreenshot": false,
|
|
2212
|
+
* // "url": "my_url"
|
|
2213
|
+
* // }
|
|
2214
|
+
* },
|
|
2215
|
+
* });
|
|
2216
|
+
* console.log(res.data);
|
|
2217
|
+
*
|
|
2218
|
+
* // Example response
|
|
2219
|
+
* // {
|
|
2220
|
+
* // "mobileFriendliness": "my_mobileFriendliness",
|
|
2221
|
+
* // "mobileFriendlyIssues": [],
|
|
2222
|
+
* // "resourceIssues": [],
|
|
2223
|
+
* // "screenshot": {},
|
|
2224
|
+
* // "testStatus": {}
|
|
2225
|
+
* // }
|
|
2226
|
+
* }
|
|
2227
|
+
*
|
|
2228
|
+
* main().catch(e => {
|
|
2229
|
+
* console.error(e);
|
|
2230
|
+
* throw e;
|
|
2231
|
+
* });
|
|
2232
|
+
*
|
|
2233
|
+
* ```
|
|
1675
2234
|
*
|
|
1676
2235
|
* @param params - Parameters for request
|
|
1677
2236
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|