@googleapis/searchconsole 1.0.5 → 3.0.1

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/build/v1.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
2
+ import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
3
3
  import { Readable } from 'stream';
4
4
  export declare namespace searchconsole_v1 {
5
5
  export interface Options extends GlobalOptions {
@@ -569,14 +569,81 @@ export declare namespace searchconsole_v1 {
569
569
  constructor(context: APIRequestContext);
570
570
  /**
571
571
  * 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.
572
+ * @example
573
+ * ```js
574
+ * // Before running the sample:
575
+ * // - Enable the API at:
576
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
577
+ * // - Login into gcloud by running:
578
+ * // ```sh
579
+ * // $ gcloud auth application-default login
580
+ * // ```
581
+ * // - Install the npm module by running:
582
+ * // ```sh
583
+ * // $ npm install googleapis
584
+ * // ```
585
+ *
586
+ * const {google} = require('googleapis');
587
+ * const searchconsole = google.searchconsole('v1');
588
+ *
589
+ * async function main() {
590
+ * const auth = new google.auth.GoogleAuth({
591
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
592
+ * scopes: [
593
+ * 'https://www.googleapis.com/auth/webmasters',
594
+ * 'https://www.googleapis.com/auth/webmasters.readonly',
595
+ * ],
596
+ * });
597
+ *
598
+ * // Acquire an auth client, and bind it to all future calls
599
+ * const authClient = await auth.getClient();
600
+ * google.options({auth: authClient});
601
+ *
602
+ * // Do the magic
603
+ * const res = await webmasters.searchanalytics.query({
604
+ * // The site's URL, including protocol. For example: `http://www.example.com/`.
605
+ * siteUrl: 'placeholder-value',
606
+ *
607
+ * // Request body metadata
608
+ * requestBody: {
609
+ * // request body parameters
610
+ * // {
611
+ * // "aggregationType": "my_aggregationType",
612
+ * // "dataState": "my_dataState",
613
+ * // "dimensionFilterGroups": [],
614
+ * // "dimensions": [],
615
+ * // "endDate": "my_endDate",
616
+ * // "rowLimit": 0,
617
+ * // "searchType": "my_searchType",
618
+ * // "startDate": "my_startDate",
619
+ * // "startRow": 0,
620
+ * // "type": "my_type"
621
+ * // }
622
+ * },
623
+ * });
624
+ * console.log(res.data);
625
+ *
626
+ * // Example response
627
+ * // {
628
+ * // "responseAggregationType": "my_responseAggregationType",
629
+ * // "rows": []
630
+ * // }
631
+ * }
632
+ *
633
+ * main().catch(e => {
634
+ * console.error(e);
635
+ * throw e;
636
+ * });
637
+ *
638
+ * ```
572
639
  *
573
640
  * @param params - Parameters for request
574
641
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
575
642
  * @param callback - Optional callback that handles the response.
576
643
  * @returns A promise if used with async/await, or void if used with a callback.
577
644
  */
578
- query(params: Params$Resource$Searchanalytics$Query, options: StreamMethodOptions): GaxiosPromise<Readable>;
579
- query(params?: Params$Resource$Searchanalytics$Query, options?: MethodOptions): GaxiosPromise<Schema$SearchAnalyticsQueryResponse>;
645
+ query(params: Params$Resource$Searchanalytics$Query, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
646
+ query(params?: Params$Resource$Searchanalytics$Query, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$SearchAnalyticsQueryResponse>>;
580
647
  query(params: Params$Resource$Searchanalytics$Query, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
581
648
  query(params: Params$Resource$Searchanalytics$Query, options: MethodOptions | BodyResponseCallback<Schema$SearchAnalyticsQueryResponse>, callback: BodyResponseCallback<Schema$SearchAnalyticsQueryResponse>): void;
582
649
  query(params: Params$Resource$Searchanalytics$Query, callback: BodyResponseCallback<Schema$SearchAnalyticsQueryResponse>): void;
@@ -597,56 +664,252 @@ export declare namespace searchconsole_v1 {
597
664
  constructor(context: APIRequestContext);
598
665
  /**
599
666
  * 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.
667
+ * @example
668
+ * ```js
669
+ * // Before running the sample:
670
+ * // - Enable the API at:
671
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
672
+ * // - Login into gcloud by running:
673
+ * // ```sh
674
+ * // $ gcloud auth application-default login
675
+ * // ```
676
+ * // - Install the npm module by running:
677
+ * // ```sh
678
+ * // $ npm install googleapis
679
+ * // ```
680
+ *
681
+ * const {google} = require('googleapis');
682
+ * const searchconsole = google.searchconsole('v1');
683
+ *
684
+ * async function main() {
685
+ * const auth = new google.auth.GoogleAuth({
686
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
687
+ * scopes: ['https://www.googleapis.com/auth/webmasters'],
688
+ * });
689
+ *
690
+ * // Acquire an auth client, and bind it to all future calls
691
+ * const authClient = await auth.getClient();
692
+ * google.options({auth: authClient});
693
+ *
694
+ * // Do the magic
695
+ * const res = await webmasters.sitemaps.delete({
696
+ * // The URL of the actual sitemap. For example: `http://www.example.com/sitemap.xml`.
697
+ * feedpath: 'placeholder-value',
698
+ * // The site's URL, including protocol. For example: `http://www.example.com/`.
699
+ * siteUrl: 'placeholder-value',
700
+ * });
701
+ * console.log(res.data);
702
+ * }
703
+ *
704
+ * main().catch(e => {
705
+ * console.error(e);
706
+ * throw e;
707
+ * });
708
+ *
709
+ * ```
600
710
  *
601
711
  * @param params - Parameters for request
602
712
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
603
713
  * @param callback - Optional callback that handles the response.
604
714
  * @returns A promise if used with async/await, or void if used with a callback.
605
715
  */
606
- delete(params: Params$Resource$Sitemaps$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
607
- delete(params?: Params$Resource$Sitemaps$Delete, options?: MethodOptions): GaxiosPromise<void>;
716
+ delete(params: Params$Resource$Sitemaps$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
717
+ delete(params?: Params$Resource$Sitemaps$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<void>>;
608
718
  delete(params: Params$Resource$Sitemaps$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
609
719
  delete(params: Params$Resource$Sitemaps$Delete, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void>): void;
610
720
  delete(params: Params$Resource$Sitemaps$Delete, callback: BodyResponseCallback<void>): void;
611
721
  delete(callback: BodyResponseCallback<void>): void;
612
722
  /**
613
723
  * Retrieves information about a specific sitemap.
724
+ * @example
725
+ * ```js
726
+ * // Before running the sample:
727
+ * // - Enable the API at:
728
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
729
+ * // - Login into gcloud by running:
730
+ * // ```sh
731
+ * // $ gcloud auth application-default login
732
+ * // ```
733
+ * // - Install the npm module by running:
734
+ * // ```sh
735
+ * // $ npm install googleapis
736
+ * // ```
737
+ *
738
+ * const {google} = require('googleapis');
739
+ * const searchconsole = google.searchconsole('v1');
740
+ *
741
+ * async function main() {
742
+ * const auth = new google.auth.GoogleAuth({
743
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
744
+ * scopes: [
745
+ * 'https://www.googleapis.com/auth/webmasters',
746
+ * 'https://www.googleapis.com/auth/webmasters.readonly',
747
+ * ],
748
+ * });
749
+ *
750
+ * // Acquire an auth client, and bind it to all future calls
751
+ * const authClient = await auth.getClient();
752
+ * google.options({auth: authClient});
753
+ *
754
+ * // Do the magic
755
+ * const res = await webmasters.sitemaps.get({
756
+ * // The URL of the actual sitemap. For example: `http://www.example.com/sitemap.xml`.
757
+ * feedpath: 'placeholder-value',
758
+ * // The site's URL, including protocol. For example: `http://www.example.com/`.
759
+ * siteUrl: 'placeholder-value',
760
+ * });
761
+ * console.log(res.data);
762
+ *
763
+ * // Example response
764
+ * // {
765
+ * // "contents": [],
766
+ * // "errors": "my_errors",
767
+ * // "isPending": false,
768
+ * // "isSitemapsIndex": false,
769
+ * // "lastDownloaded": "my_lastDownloaded",
770
+ * // "lastSubmitted": "my_lastSubmitted",
771
+ * // "path": "my_path",
772
+ * // "type": "my_type",
773
+ * // "warnings": "my_warnings"
774
+ * // }
775
+ * }
776
+ *
777
+ * main().catch(e => {
778
+ * console.error(e);
779
+ * throw e;
780
+ * });
781
+ *
782
+ * ```
614
783
  *
615
784
  * @param params - Parameters for request
616
785
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
617
786
  * @param callback - Optional callback that handles the response.
618
787
  * @returns A promise if used with async/await, or void if used with a callback.
619
788
  */
620
- get(params: Params$Resource$Sitemaps$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
621
- get(params?: Params$Resource$Sitemaps$Get, options?: MethodOptions): GaxiosPromise<Schema$WmxSitemap>;
789
+ get(params: Params$Resource$Sitemaps$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
790
+ get(params?: Params$Resource$Sitemaps$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$WmxSitemap>>;
622
791
  get(params: Params$Resource$Sitemaps$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
623
792
  get(params: Params$Resource$Sitemaps$Get, options: MethodOptions | BodyResponseCallback<Schema$WmxSitemap>, callback: BodyResponseCallback<Schema$WmxSitemap>): void;
624
793
  get(params: Params$Resource$Sitemaps$Get, callback: BodyResponseCallback<Schema$WmxSitemap>): void;
625
794
  get(callback: BodyResponseCallback<Schema$WmxSitemap>): void;
626
795
  /**
627
796
  * 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).
797
+ * @example
798
+ * ```js
799
+ * // Before running the sample:
800
+ * // - Enable the API at:
801
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
802
+ * // - Login into gcloud by running:
803
+ * // ```sh
804
+ * // $ gcloud auth application-default login
805
+ * // ```
806
+ * // - Install the npm module by running:
807
+ * // ```sh
808
+ * // $ npm install googleapis
809
+ * // ```
810
+ *
811
+ * const {google} = require('googleapis');
812
+ * const searchconsole = google.searchconsole('v1');
813
+ *
814
+ * async function main() {
815
+ * const auth = new google.auth.GoogleAuth({
816
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
817
+ * scopes: [
818
+ * 'https://www.googleapis.com/auth/webmasters',
819
+ * 'https://www.googleapis.com/auth/webmasters.readonly',
820
+ * ],
821
+ * });
822
+ *
823
+ * // Acquire an auth client, and bind it to all future calls
824
+ * const authClient = await auth.getClient();
825
+ * google.options({auth: authClient});
826
+ *
827
+ * // Do the magic
828
+ * const res = await webmasters.sitemaps.list({
829
+ * // A URL of a site's sitemap index. For example: `http://www.example.com/sitemapindex.xml`.
830
+ * sitemapIndex: 'placeholder-value',
831
+ * // The site's URL, including protocol. For example: `http://www.example.com/`.
832
+ * siteUrl: 'placeholder-value',
833
+ * });
834
+ * console.log(res.data);
835
+ *
836
+ * // Example response
837
+ * // {
838
+ * // "sitemap": []
839
+ * // }
840
+ * }
841
+ *
842
+ * main().catch(e => {
843
+ * console.error(e);
844
+ * throw e;
845
+ * });
846
+ *
847
+ * ```
628
848
  *
629
849
  * @param params - Parameters for request
630
850
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
631
851
  * @param callback - Optional callback that handles the response.
632
852
  * @returns A promise if used with async/await, or void if used with a callback.
633
853
  */
634
- list(params: Params$Resource$Sitemaps$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
635
- list(params?: Params$Resource$Sitemaps$List, options?: MethodOptions): GaxiosPromise<Schema$SitemapsListResponse>;
854
+ list(params: Params$Resource$Sitemaps$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
855
+ list(params?: Params$Resource$Sitemaps$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$SitemapsListResponse>>;
636
856
  list(params: Params$Resource$Sitemaps$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
637
857
  list(params: Params$Resource$Sitemaps$List, options: MethodOptions | BodyResponseCallback<Schema$SitemapsListResponse>, callback: BodyResponseCallback<Schema$SitemapsListResponse>): void;
638
858
  list(params: Params$Resource$Sitemaps$List, callback: BodyResponseCallback<Schema$SitemapsListResponse>): void;
639
859
  list(callback: BodyResponseCallback<Schema$SitemapsListResponse>): void;
640
860
  /**
641
861
  * Submits a sitemap for a site.
862
+ * @example
863
+ * ```js
864
+ * // Before running the sample:
865
+ * // - Enable the API at:
866
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
867
+ * // - Login into gcloud by running:
868
+ * // ```sh
869
+ * // $ gcloud auth application-default login
870
+ * // ```
871
+ * // - Install the npm module by running:
872
+ * // ```sh
873
+ * // $ npm install googleapis
874
+ * // ```
875
+ *
876
+ * const {google} = require('googleapis');
877
+ * const searchconsole = google.searchconsole('v1');
878
+ *
879
+ * async function main() {
880
+ * const auth = new google.auth.GoogleAuth({
881
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
882
+ * scopes: ['https://www.googleapis.com/auth/webmasters'],
883
+ * });
884
+ *
885
+ * // Acquire an auth client, and bind it to all future calls
886
+ * const authClient = await auth.getClient();
887
+ * google.options({auth: authClient});
888
+ *
889
+ * // Do the magic
890
+ * const res = await webmasters.sitemaps.submit({
891
+ * // The URL of the actual sitemap. For example: `http://www.example.com/sitemap.xml`.
892
+ * feedpath: 'placeholder-value',
893
+ * // The site's URL, including protocol. For example: `http://www.example.com/`.
894
+ * siteUrl: 'placeholder-value',
895
+ * });
896
+ * console.log(res.data);
897
+ * }
898
+ *
899
+ * main().catch(e => {
900
+ * console.error(e);
901
+ * throw e;
902
+ * });
903
+ *
904
+ * ```
642
905
  *
643
906
  * @param params - Parameters for request
644
907
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
645
908
  * @param callback - Optional callback that handles the response.
646
909
  * @returns A promise if used with async/await, or void if used with a callback.
647
910
  */
648
- submit(params: Params$Resource$Sitemaps$Submit, options: StreamMethodOptions): GaxiosPromise<Readable>;
649
- submit(params?: Params$Resource$Sitemaps$Submit, options?: MethodOptions): GaxiosPromise<void>;
911
+ submit(params: Params$Resource$Sitemaps$Submit, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
912
+ submit(params?: Params$Resource$Sitemaps$Submit, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<void>>;
650
913
  submit(params: Params$Resource$Sitemaps$Submit, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
651
914
  submit(params: Params$Resource$Sitemaps$Submit, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void>): void;
652
915
  submit(params: Params$Resource$Sitemaps$Submit, callback: BodyResponseCallback<void>): void;
@@ -697,56 +960,234 @@ export declare namespace searchconsole_v1 {
697
960
  constructor(context: APIRequestContext);
698
961
  /**
699
962
  * Adds a site to the set of the user's sites in Search Console.
963
+ * @example
964
+ * ```js
965
+ * // Before running the sample:
966
+ * // - Enable the API at:
967
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
968
+ * // - Login into gcloud by running:
969
+ * // ```sh
970
+ * // $ gcloud auth application-default login
971
+ * // ```
972
+ * // - Install the npm module by running:
973
+ * // ```sh
974
+ * // $ npm install googleapis
975
+ * // ```
976
+ *
977
+ * const {google} = require('googleapis');
978
+ * const searchconsole = google.searchconsole('v1');
979
+ *
980
+ * async function main() {
981
+ * const auth = new google.auth.GoogleAuth({
982
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
983
+ * scopes: ['https://www.googleapis.com/auth/webmasters'],
984
+ * });
985
+ *
986
+ * // Acquire an auth client, and bind it to all future calls
987
+ * const authClient = await auth.getClient();
988
+ * google.options({auth: authClient});
989
+ *
990
+ * // Do the magic
991
+ * const res = await webmasters.sites.add({
992
+ * // The URL of the site to add.
993
+ * siteUrl: 'placeholder-value',
994
+ * });
995
+ * console.log(res.data);
996
+ * }
997
+ *
998
+ * main().catch(e => {
999
+ * console.error(e);
1000
+ * throw e;
1001
+ * });
1002
+ *
1003
+ * ```
700
1004
  *
701
1005
  * @param params - Parameters for request
702
1006
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
703
1007
  * @param callback - Optional callback that handles the response.
704
1008
  * @returns A promise if used with async/await, or void if used with a callback.
705
1009
  */
706
- add(params: Params$Resource$Sites$Add, options: StreamMethodOptions): GaxiosPromise<Readable>;
707
- add(params?: Params$Resource$Sites$Add, options?: MethodOptions): GaxiosPromise<void>;
1010
+ add(params: Params$Resource$Sites$Add, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1011
+ add(params?: Params$Resource$Sites$Add, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<void>>;
708
1012
  add(params: Params$Resource$Sites$Add, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
709
1013
  add(params: Params$Resource$Sites$Add, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void>): void;
710
1014
  add(params: Params$Resource$Sites$Add, callback: BodyResponseCallback<void>): void;
711
1015
  add(callback: BodyResponseCallback<void>): void;
712
1016
  /**
713
1017
  * Removes a site from the set of the user's Search Console sites.
1018
+ * @example
1019
+ * ```js
1020
+ * // Before running the sample:
1021
+ * // - Enable the API at:
1022
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
1023
+ * // - Login into gcloud by running:
1024
+ * // ```sh
1025
+ * // $ gcloud auth application-default login
1026
+ * // ```
1027
+ * // - Install the npm module by running:
1028
+ * // ```sh
1029
+ * // $ npm install googleapis
1030
+ * // ```
1031
+ *
1032
+ * const {google} = require('googleapis');
1033
+ * const searchconsole = google.searchconsole('v1');
1034
+ *
1035
+ * async function main() {
1036
+ * const auth = new google.auth.GoogleAuth({
1037
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1038
+ * scopes: ['https://www.googleapis.com/auth/webmasters'],
1039
+ * });
1040
+ *
1041
+ * // Acquire an auth client, and bind it to all future calls
1042
+ * const authClient = await auth.getClient();
1043
+ * google.options({auth: authClient});
1044
+ *
1045
+ * // Do the magic
1046
+ * const res = await webmasters.sites.delete({
1047
+ * // The URI of the property as defined in Search Console. **Examples:** `http://www.example.com/` or `sc-domain:example.com`.
1048
+ * siteUrl: 'placeholder-value',
1049
+ * });
1050
+ * console.log(res.data);
1051
+ * }
1052
+ *
1053
+ * main().catch(e => {
1054
+ * console.error(e);
1055
+ * throw e;
1056
+ * });
1057
+ *
1058
+ * ```
714
1059
  *
715
1060
  * @param params - Parameters for request
716
1061
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
717
1062
  * @param callback - Optional callback that handles the response.
718
1063
  * @returns A promise if used with async/await, or void if used with a callback.
719
1064
  */
720
- delete(params: Params$Resource$Sites$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
721
- delete(params?: Params$Resource$Sites$Delete, options?: MethodOptions): GaxiosPromise<void>;
1065
+ delete(params: Params$Resource$Sites$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1066
+ delete(params?: Params$Resource$Sites$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<void>>;
722
1067
  delete(params: Params$Resource$Sites$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
723
1068
  delete(params: Params$Resource$Sites$Delete, options: MethodOptions | BodyResponseCallback<void>, callback: BodyResponseCallback<void>): void;
724
1069
  delete(params: Params$Resource$Sites$Delete, callback: BodyResponseCallback<void>): void;
725
1070
  delete(callback: BodyResponseCallback<void>): void;
726
1071
  /**
727
1072
  * Retrieves information about specific site.
1073
+ * @example
1074
+ * ```js
1075
+ * // Before running the sample:
1076
+ * // - Enable the API at:
1077
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
1078
+ * // - Login into gcloud by running:
1079
+ * // ```sh
1080
+ * // $ gcloud auth application-default login
1081
+ * // ```
1082
+ * // - Install the npm module by running:
1083
+ * // ```sh
1084
+ * // $ npm install googleapis
1085
+ * // ```
1086
+ *
1087
+ * const {google} = require('googleapis');
1088
+ * const searchconsole = google.searchconsole('v1');
1089
+ *
1090
+ * async function main() {
1091
+ * const auth = new google.auth.GoogleAuth({
1092
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1093
+ * scopes: [
1094
+ * 'https://www.googleapis.com/auth/webmasters',
1095
+ * 'https://www.googleapis.com/auth/webmasters.readonly',
1096
+ * ],
1097
+ * });
1098
+ *
1099
+ * // Acquire an auth client, and bind it to all future calls
1100
+ * const authClient = await auth.getClient();
1101
+ * google.options({auth: authClient});
1102
+ *
1103
+ * // Do the magic
1104
+ * const res = await webmasters.sites.get({
1105
+ * // The URI of the property as defined in Search Console. **Examples:** `http://www.example.com/` or `sc-domain:example.com`.
1106
+ * siteUrl: 'placeholder-value',
1107
+ * });
1108
+ * console.log(res.data);
1109
+ *
1110
+ * // Example response
1111
+ * // {
1112
+ * // "permissionLevel": "my_permissionLevel",
1113
+ * // "siteUrl": "my_siteUrl"
1114
+ * // }
1115
+ * }
1116
+ *
1117
+ * main().catch(e => {
1118
+ * console.error(e);
1119
+ * throw e;
1120
+ * });
1121
+ *
1122
+ * ```
728
1123
  *
729
1124
  * @param params - Parameters for request
730
1125
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
731
1126
  * @param callback - Optional callback that handles the response.
732
1127
  * @returns A promise if used with async/await, or void if used with a callback.
733
1128
  */
734
- get(params: Params$Resource$Sites$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
735
- get(params?: Params$Resource$Sites$Get, options?: MethodOptions): GaxiosPromise<Schema$WmxSite>;
1129
+ get(params: Params$Resource$Sites$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1130
+ get(params?: Params$Resource$Sites$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$WmxSite>>;
736
1131
  get(params: Params$Resource$Sites$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
737
1132
  get(params: Params$Resource$Sites$Get, options: MethodOptions | BodyResponseCallback<Schema$WmxSite>, callback: BodyResponseCallback<Schema$WmxSite>): void;
738
1133
  get(params: Params$Resource$Sites$Get, callback: BodyResponseCallback<Schema$WmxSite>): void;
739
1134
  get(callback: BodyResponseCallback<Schema$WmxSite>): void;
740
1135
  /**
741
1136
  * Lists the user's Search Console sites.
1137
+ * @example
1138
+ * ```js
1139
+ * // Before running the sample:
1140
+ * // - Enable the API at:
1141
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
1142
+ * // - Login into gcloud by running:
1143
+ * // ```sh
1144
+ * // $ gcloud auth application-default login
1145
+ * // ```
1146
+ * // - Install the npm module by running:
1147
+ * // ```sh
1148
+ * // $ npm install googleapis
1149
+ * // ```
1150
+ *
1151
+ * const {google} = require('googleapis');
1152
+ * const searchconsole = google.searchconsole('v1');
1153
+ *
1154
+ * async function main() {
1155
+ * const auth = new google.auth.GoogleAuth({
1156
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1157
+ * scopes: [
1158
+ * 'https://www.googleapis.com/auth/webmasters',
1159
+ * 'https://www.googleapis.com/auth/webmasters.readonly',
1160
+ * ],
1161
+ * });
1162
+ *
1163
+ * // Acquire an auth client, and bind it to all future calls
1164
+ * const authClient = await auth.getClient();
1165
+ * google.options({auth: authClient});
1166
+ *
1167
+ * // Do the magic
1168
+ * const res = await webmasters.sites.list({});
1169
+ * console.log(res.data);
1170
+ *
1171
+ * // Example response
1172
+ * // {
1173
+ * // "siteEntry": []
1174
+ * // }
1175
+ * }
1176
+ *
1177
+ * main().catch(e => {
1178
+ * console.error(e);
1179
+ * throw e;
1180
+ * });
1181
+ *
1182
+ * ```
742
1183
  *
743
1184
  * @param params - Parameters for request
744
1185
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
745
1186
  * @param callback - Optional callback that handles the response.
746
1187
  * @returns A promise if used with async/await, or void if used with a callback.
747
1188
  */
748
- list(params: Params$Resource$Sites$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
749
- list(params?: Params$Resource$Sites$List, options?: MethodOptions): GaxiosPromise<Schema$SitesListResponse>;
1189
+ list(params: Params$Resource$Sites$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1190
+ list(params?: Params$Resource$Sites$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$SitesListResponse>>;
750
1191
  list(params: Params$Resource$Sites$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
751
1192
  list(params: Params$Resource$Sites$List, options: MethodOptions | BodyResponseCallback<Schema$SitesListResponse>, callback: BodyResponseCallback<Schema$SitesListResponse>): void;
752
1193
  list(params: Params$Resource$Sites$List, callback: BodyResponseCallback<Schema$SitesListResponse>): void;
@@ -782,14 +1223,70 @@ export declare namespace searchconsole_v1 {
782
1223
  constructor(context: APIRequestContext);
783
1224
  /**
784
1225
  * Index inspection.
1226
+ * @example
1227
+ * ```js
1228
+ * // Before running the sample:
1229
+ * // - Enable the API at:
1230
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
1231
+ * // - Login into gcloud by running:
1232
+ * // ```sh
1233
+ * // $ gcloud auth application-default login
1234
+ * // ```
1235
+ * // - Install the npm module by running:
1236
+ * // ```sh
1237
+ * // $ npm install googleapis
1238
+ * // ```
1239
+ *
1240
+ * const {google} = require('googleapis');
1241
+ * const searchconsole = google.searchconsole('v1');
1242
+ *
1243
+ * async function main() {
1244
+ * const auth = new google.auth.GoogleAuth({
1245
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1246
+ * scopes: [
1247
+ * 'https://www.googleapis.com/auth/webmasters',
1248
+ * 'https://www.googleapis.com/auth/webmasters.readonly',
1249
+ * ],
1250
+ * });
1251
+ *
1252
+ * // Acquire an auth client, and bind it to all future calls
1253
+ * const authClient = await auth.getClient();
1254
+ * google.options({auth: authClient});
1255
+ *
1256
+ * // Do the magic
1257
+ * const res = await searchconsole.urlInspection.index.inspect({
1258
+ * // Request body metadata
1259
+ * requestBody: {
1260
+ * // request body parameters
1261
+ * // {
1262
+ * // "inspectionUrl": "my_inspectionUrl",
1263
+ * // "languageCode": "my_languageCode",
1264
+ * // "siteUrl": "my_siteUrl"
1265
+ * // }
1266
+ * },
1267
+ * });
1268
+ * console.log(res.data);
1269
+ *
1270
+ * // Example response
1271
+ * // {
1272
+ * // "inspectionResult": {}
1273
+ * // }
1274
+ * }
1275
+ *
1276
+ * main().catch(e => {
1277
+ * console.error(e);
1278
+ * throw e;
1279
+ * });
1280
+ *
1281
+ * ```
785
1282
  *
786
1283
  * @param params - Parameters for request
787
1284
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
788
1285
  * @param callback - Optional callback that handles the response.
789
1286
  * @returns A promise if used with async/await, or void if used with a callback.
790
1287
  */
791
- inspect(params: Params$Resource$Urlinspection$Index$Inspect, options: StreamMethodOptions): GaxiosPromise<Readable>;
792
- inspect(params?: Params$Resource$Urlinspection$Index$Inspect, options?: MethodOptions): GaxiosPromise<Schema$InspectUrlIndexResponse>;
1288
+ inspect(params: Params$Resource$Urlinspection$Index$Inspect, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1289
+ inspect(params?: Params$Resource$Urlinspection$Index$Inspect, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$InspectUrlIndexResponse>>;
793
1290
  inspect(params: Params$Resource$Urlinspection$Index$Inspect, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
794
1291
  inspect(params: Params$Resource$Urlinspection$Index$Inspect, options: MethodOptions | BodyResponseCallback<Schema$InspectUrlIndexResponse>, callback: BodyResponseCallback<Schema$InspectUrlIndexResponse>): void;
795
1292
  inspect(params: Params$Resource$Urlinspection$Index$Inspect, callback: BodyResponseCallback<Schema$InspectUrlIndexResponse>): void;
@@ -811,14 +1308,70 @@ export declare namespace searchconsole_v1 {
811
1308
  constructor(context: APIRequestContext);
812
1309
  /**
813
1310
  * Runs Mobile-Friendly Test for a given URL.
1311
+ * @example
1312
+ * ```js
1313
+ * // Before running the sample:
1314
+ * // - Enable the API at:
1315
+ * // https://console.developers.google.com/apis/api/searchconsole.googleapis.com
1316
+ * // - Login into gcloud by running:
1317
+ * // ```sh
1318
+ * // $ gcloud auth application-default login
1319
+ * // ```
1320
+ * // - Install the npm module by running:
1321
+ * // ```sh
1322
+ * // $ npm install googleapis
1323
+ * // ```
1324
+ *
1325
+ * const {google} = require('googleapis');
1326
+ * const searchconsole = google.searchconsole('v1');
1327
+ *
1328
+ * async function main() {
1329
+ * const auth = new google.auth.GoogleAuth({
1330
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1331
+ * scopes: [],
1332
+ * });
1333
+ *
1334
+ * // Acquire an auth client, and bind it to all future calls
1335
+ * const authClient = await auth.getClient();
1336
+ * google.options({auth: authClient});
1337
+ *
1338
+ * // Do the magic
1339
+ * const res = await searchconsole.urlTestingTools.mobileFriendlyTest.run({
1340
+ * // Request body metadata
1341
+ * requestBody: {
1342
+ * // request body parameters
1343
+ * // {
1344
+ * // "requestScreenshot": false,
1345
+ * // "url": "my_url"
1346
+ * // }
1347
+ * },
1348
+ * });
1349
+ * console.log(res.data);
1350
+ *
1351
+ * // Example response
1352
+ * // {
1353
+ * // "mobileFriendliness": "my_mobileFriendliness",
1354
+ * // "mobileFriendlyIssues": [],
1355
+ * // "resourceIssues": [],
1356
+ * // "screenshot": {},
1357
+ * // "testStatus": {}
1358
+ * // }
1359
+ * }
1360
+ *
1361
+ * main().catch(e => {
1362
+ * console.error(e);
1363
+ * throw e;
1364
+ * });
1365
+ *
1366
+ * ```
814
1367
  *
815
1368
  * @param params - Parameters for request
816
1369
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
817
1370
  * @param callback - Optional callback that handles the response.
818
1371
  * @returns A promise if used with async/await, or void if used with a callback.
819
1372
  */
820
- run(params: Params$Resource$Urltestingtools$Mobilefriendlytest$Run, options: StreamMethodOptions): GaxiosPromise<Readable>;
821
- run(params?: Params$Resource$Urltestingtools$Mobilefriendlytest$Run, options?: MethodOptions): GaxiosPromise<Schema$RunMobileFriendlyTestResponse>;
1373
+ run(params: Params$Resource$Urltestingtools$Mobilefriendlytest$Run, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
1374
+ run(params?: Params$Resource$Urltestingtools$Mobilefriendlytest$Run, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$RunMobileFriendlyTestResponse>>;
822
1375
  run(params: Params$Resource$Urltestingtools$Mobilefriendlytest$Run, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
823
1376
  run(params: Params$Resource$Urltestingtools$Mobilefriendlytest$Run, options: MethodOptions | BodyResponseCallback<Schema$RunMobileFriendlyTestResponse>, callback: BodyResponseCallback<Schema$RunMobileFriendlyTestResponse>): void;
824
1377
  run(params: Params$Resource$Urltestingtools$Mobilefriendlytest$Run, callback: BodyResponseCallback<Schema$RunMobileFriendlyTestResponse>): void;