google-apis-webmasters_v3 0.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.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-webmasters_v3.rb +15 -0
- data/lib/google/apis/webmasters_v3.rb +39 -0
- data/lib/google/apis/webmasters_v3/classes.rb +412 -0
- data/lib/google/apis/webmasters_v3/gem_version.rb +28 -0
- data/lib/google/apis/webmasters_v3/representations.rb +191 -0
- data/lib/google/apis/webmasters_v3/service.rb +379 -0
- metadata +76 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Apis
|
17
|
+
module WebmastersV3
|
18
|
+
# Version of the google-apis-webmasters_v3 gem
|
19
|
+
GEM_VERSION = "0.1.0"
|
20
|
+
|
21
|
+
# Version of the code generator used to generate this client
|
22
|
+
GENERATOR_VERSION = "0.1.1"
|
23
|
+
|
24
|
+
# Revision of the discovery document this client was generated from
|
25
|
+
REVISION = "20190428"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,191 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module WebmastersV3
|
24
|
+
|
25
|
+
class ApiDataRow
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
31
|
+
class ApiDimensionFilter
|
32
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
33
|
+
|
34
|
+
include Google::Apis::Core::JsonObjectSupport
|
35
|
+
end
|
36
|
+
|
37
|
+
class ApiDimensionFilterGroup
|
38
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
|
+
|
40
|
+
include Google::Apis::Core::JsonObjectSupport
|
41
|
+
end
|
42
|
+
|
43
|
+
class SearchAnalyticsQueryRequest
|
44
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
|
+
|
46
|
+
include Google::Apis::Core::JsonObjectSupport
|
47
|
+
end
|
48
|
+
|
49
|
+
class SearchAnalyticsQueryResponse
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class ListSitemapsResponse
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class ListSitesResponse
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class WmxSite
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class WmxSitemap
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class WmxSitemapContent
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class ApiDataRow
|
86
|
+
# @private
|
87
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
88
|
+
property :clicks, as: 'clicks'
|
89
|
+
property :ctr, as: 'ctr'
|
90
|
+
property :impressions, as: 'impressions'
|
91
|
+
collection :keys, as: 'keys'
|
92
|
+
property :position, as: 'position'
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
class ApiDimensionFilter
|
97
|
+
# @private
|
98
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
99
|
+
property :dimension, as: 'dimension'
|
100
|
+
property :expression, as: 'expression'
|
101
|
+
property :operator, as: 'operator'
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
class ApiDimensionFilterGroup
|
106
|
+
# @private
|
107
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
108
|
+
collection :filters, as: 'filters', class: Google::Apis::WebmastersV3::ApiDimensionFilter, decorator: Google::Apis::WebmastersV3::ApiDimensionFilter::Representation
|
109
|
+
|
110
|
+
property :group_type, as: 'groupType'
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
class SearchAnalyticsQueryRequest
|
115
|
+
# @private
|
116
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
117
|
+
property :aggregation_type, as: 'aggregationType'
|
118
|
+
property :data_state, as: 'dataState'
|
119
|
+
collection :dimension_filter_groups, as: 'dimensionFilterGroups', class: Google::Apis::WebmastersV3::ApiDimensionFilterGroup, decorator: Google::Apis::WebmastersV3::ApiDimensionFilterGroup::Representation
|
120
|
+
|
121
|
+
collection :dimensions, as: 'dimensions'
|
122
|
+
property :end_date, as: 'endDate'
|
123
|
+
property :row_limit, as: 'rowLimit'
|
124
|
+
property :search_type, as: 'searchType'
|
125
|
+
property :start_date, as: 'startDate'
|
126
|
+
property :start_row, as: 'startRow'
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
class SearchAnalyticsQueryResponse
|
131
|
+
# @private
|
132
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
133
|
+
property :response_aggregation_type, as: 'responseAggregationType'
|
134
|
+
collection :rows, as: 'rows', class: Google::Apis::WebmastersV3::ApiDataRow, decorator: Google::Apis::WebmastersV3::ApiDataRow::Representation
|
135
|
+
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
class ListSitemapsResponse
|
140
|
+
# @private
|
141
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
142
|
+
collection :sitemap, as: 'sitemap', class: Google::Apis::WebmastersV3::WmxSitemap, decorator: Google::Apis::WebmastersV3::WmxSitemap::Representation
|
143
|
+
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
class ListSitesResponse
|
148
|
+
# @private
|
149
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
150
|
+
collection :site_entry, as: 'siteEntry', class: Google::Apis::WebmastersV3::WmxSite, decorator: Google::Apis::WebmastersV3::WmxSite::Representation
|
151
|
+
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
class WmxSite
|
156
|
+
# @private
|
157
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
158
|
+
property :permission_level, as: 'permissionLevel'
|
159
|
+
property :site_url, as: 'siteUrl'
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
class WmxSitemap
|
164
|
+
# @private
|
165
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
166
|
+
collection :contents, as: 'contents', class: Google::Apis::WebmastersV3::WmxSitemapContent, decorator: Google::Apis::WebmastersV3::WmxSitemapContent::Representation
|
167
|
+
|
168
|
+
property :errors, :numeric_string => true, as: 'errors'
|
169
|
+
property :is_pending, as: 'isPending'
|
170
|
+
property :is_sitemaps_index, as: 'isSitemapsIndex'
|
171
|
+
property :last_downloaded, as: 'lastDownloaded', type: DateTime
|
172
|
+
|
173
|
+
property :last_submitted, as: 'lastSubmitted', type: DateTime
|
174
|
+
|
175
|
+
property :path, as: 'path'
|
176
|
+
property :type, as: 'type'
|
177
|
+
property :warnings, :numeric_string => true, as: 'warnings'
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
class WmxSitemapContent
|
182
|
+
# @private
|
183
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
184
|
+
property :indexed, :numeric_string => true, as: 'indexed'
|
185
|
+
property :submitted, :numeric_string => true, as: 'submitted'
|
186
|
+
property :type, as: 'type'
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
@@ -0,0 +1,379 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/core/base_service'
|
16
|
+
require 'google/apis/core/json_representation'
|
17
|
+
require 'google/apis/core/hashable'
|
18
|
+
require 'google/apis/errors'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
module WebmastersV3
|
23
|
+
# Search Console API
|
24
|
+
#
|
25
|
+
# View Google Search Console data for your verified sites.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/webmasters_v3'
|
29
|
+
#
|
30
|
+
# Webmasters = Google::Apis::WebmastersV3 # Alias the module
|
31
|
+
# service = Webmasters::WebmastersService.new
|
32
|
+
#
|
33
|
+
# @see https://developers.google.com/webmaster-tools/
|
34
|
+
class WebmastersService < Google::Apis::Core::BaseService
|
35
|
+
# @return [String]
|
36
|
+
# API key. Your API key identifies your project and provides you with API access,
|
37
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
38
|
+
attr_accessor :key
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
42
|
+
# characters.
|
43
|
+
attr_accessor :quota_user
|
44
|
+
|
45
|
+
# @return [String]
|
46
|
+
# Deprecated. Please use quotaUser instead.
|
47
|
+
attr_accessor :user_ip
|
48
|
+
|
49
|
+
def initialize
|
50
|
+
super('https://www.googleapis.com/', 'webmasters/v3/',
|
51
|
+
client_name: 'google-apis-webmasters_v3',
|
52
|
+
client_version: Google::Apis::WebmastersV3::GEM_VERSION)
|
53
|
+
@batch_path = 'batch/webmasters/v3'
|
54
|
+
end
|
55
|
+
|
56
|
+
# Query your data with filters and parameters that you define. Returns zero or
|
57
|
+
# more rows grouped by the row keys that you define. You must define a date
|
58
|
+
# range of one or more days.
|
59
|
+
# When date is one of the group by values, any days without data are omitted
|
60
|
+
# from the result list. If you need to know which days have data, issue a broad
|
61
|
+
# date range query grouped by date for any metric, and see which day rows are
|
62
|
+
# returned.
|
63
|
+
# @param [String] site_url
|
64
|
+
# The site's URL, including protocol. For example: http://www.example.com/
|
65
|
+
# @param [Google::Apis::WebmastersV3::SearchAnalyticsQueryRequest] search_analytics_query_request_object
|
66
|
+
# @param [String] fields
|
67
|
+
# Selector specifying which fields to include in a partial response.
|
68
|
+
# @param [String] quota_user
|
69
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
70
|
+
# characters.
|
71
|
+
# @param [String] user_ip
|
72
|
+
# Deprecated. Please use quotaUser instead.
|
73
|
+
# @param [Google::Apis::RequestOptions] options
|
74
|
+
# Request-specific options
|
75
|
+
#
|
76
|
+
# @yield [result, err] Result & error if block supplied
|
77
|
+
# @yieldparam result [Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse] parsed result object
|
78
|
+
# @yieldparam err [StandardError] error object if request failed
|
79
|
+
#
|
80
|
+
# @return [Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse]
|
81
|
+
#
|
82
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
83
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
84
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
85
|
+
def query_search_analytics(site_url, search_analytics_query_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
86
|
+
command = make_simple_command(:post, 'sites/{siteUrl}/searchAnalytics/query', options)
|
87
|
+
command.request_representation = Google::Apis::WebmastersV3::SearchAnalyticsQueryRequest::Representation
|
88
|
+
command.request_object = search_analytics_query_request_object
|
89
|
+
command.response_representation = Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse::Representation
|
90
|
+
command.response_class = Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse
|
91
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
92
|
+
command.query['fields'] = fields unless fields.nil?
|
93
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
94
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
95
|
+
execute_or_queue_command(command, &block)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Deletes a sitemap from this site.
|
99
|
+
# @param [String] site_url
|
100
|
+
# The site's URL, including protocol. For example: http://www.example.com/
|
101
|
+
# @param [String] feedpath
|
102
|
+
# The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml
|
103
|
+
# @param [String] fields
|
104
|
+
# Selector specifying which fields to include in a partial response.
|
105
|
+
# @param [String] quota_user
|
106
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
107
|
+
# characters.
|
108
|
+
# @param [String] user_ip
|
109
|
+
# Deprecated. Please use quotaUser instead.
|
110
|
+
# @param [Google::Apis::RequestOptions] options
|
111
|
+
# Request-specific options
|
112
|
+
#
|
113
|
+
# @yield [result, err] Result & error if block supplied
|
114
|
+
# @yieldparam result [NilClass] No result returned for this method
|
115
|
+
# @yieldparam err [StandardError] error object if request failed
|
116
|
+
#
|
117
|
+
# @return [void]
|
118
|
+
#
|
119
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
120
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
121
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
122
|
+
def delete_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
123
|
+
command = make_simple_command(:delete, 'sites/{siteUrl}/sitemaps/{feedpath}', options)
|
124
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
125
|
+
command.params['feedpath'] = feedpath unless feedpath.nil?
|
126
|
+
command.query['fields'] = fields unless fields.nil?
|
127
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
128
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
129
|
+
execute_or_queue_command(command, &block)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Retrieves information about a specific sitemap.
|
133
|
+
# @param [String] site_url
|
134
|
+
# The site's URL, including protocol. For example: http://www.example.com/
|
135
|
+
# @param [String] feedpath
|
136
|
+
# The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml
|
137
|
+
# @param [String] fields
|
138
|
+
# Selector specifying which fields to include in a partial response.
|
139
|
+
# @param [String] quota_user
|
140
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
141
|
+
# characters.
|
142
|
+
# @param [String] user_ip
|
143
|
+
# Deprecated. Please use quotaUser instead.
|
144
|
+
# @param [Google::Apis::RequestOptions] options
|
145
|
+
# Request-specific options
|
146
|
+
#
|
147
|
+
# @yield [result, err] Result & error if block supplied
|
148
|
+
# @yieldparam result [Google::Apis::WebmastersV3::WmxSitemap] parsed result object
|
149
|
+
# @yieldparam err [StandardError] error object if request failed
|
150
|
+
#
|
151
|
+
# @return [Google::Apis::WebmastersV3::WmxSitemap]
|
152
|
+
#
|
153
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
154
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
155
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
156
|
+
def get_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
157
|
+
command = make_simple_command(:get, 'sites/{siteUrl}/sitemaps/{feedpath}', options)
|
158
|
+
command.response_representation = Google::Apis::WebmastersV3::WmxSitemap::Representation
|
159
|
+
command.response_class = Google::Apis::WebmastersV3::WmxSitemap
|
160
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
161
|
+
command.params['feedpath'] = feedpath unless feedpath.nil?
|
162
|
+
command.query['fields'] = fields unless fields.nil?
|
163
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
164
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
165
|
+
execute_or_queue_command(command, &block)
|
166
|
+
end
|
167
|
+
|
168
|
+
# Lists the sitemaps-entries submitted for this site, or included in the sitemap
|
169
|
+
# index file (if sitemapIndex is specified in the request).
|
170
|
+
# @param [String] site_url
|
171
|
+
# The site's URL, including protocol. For example: http://www.example.com/
|
172
|
+
# @param [String] sitemap_index
|
173
|
+
# A URL of a site's sitemap index. For example: http://www.example.com/
|
174
|
+
# sitemapindex.xml
|
175
|
+
# @param [String] fields
|
176
|
+
# Selector specifying which fields to include in a partial response.
|
177
|
+
# @param [String] quota_user
|
178
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
179
|
+
# characters.
|
180
|
+
# @param [String] user_ip
|
181
|
+
# Deprecated. Please use quotaUser instead.
|
182
|
+
# @param [Google::Apis::RequestOptions] options
|
183
|
+
# Request-specific options
|
184
|
+
#
|
185
|
+
# @yield [result, err] Result & error if block supplied
|
186
|
+
# @yieldparam result [Google::Apis::WebmastersV3::ListSitemapsResponse] parsed result object
|
187
|
+
# @yieldparam err [StandardError] error object if request failed
|
188
|
+
#
|
189
|
+
# @return [Google::Apis::WebmastersV3::ListSitemapsResponse]
|
190
|
+
#
|
191
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
192
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
193
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
194
|
+
def list_sitemaps(site_url, sitemap_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
195
|
+
command = make_simple_command(:get, 'sites/{siteUrl}/sitemaps', options)
|
196
|
+
command.response_representation = Google::Apis::WebmastersV3::ListSitemapsResponse::Representation
|
197
|
+
command.response_class = Google::Apis::WebmastersV3::ListSitemapsResponse
|
198
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
199
|
+
command.query['sitemapIndex'] = sitemap_index unless sitemap_index.nil?
|
200
|
+
command.query['fields'] = fields unless fields.nil?
|
201
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
202
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
203
|
+
execute_or_queue_command(command, &block)
|
204
|
+
end
|
205
|
+
|
206
|
+
# Submits a sitemap for a site.
|
207
|
+
# @param [String] site_url
|
208
|
+
# The site's URL, including protocol. For example: http://www.example.com/
|
209
|
+
# @param [String] feedpath
|
210
|
+
# The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml
|
211
|
+
# @param [String] fields
|
212
|
+
# Selector specifying which fields to include in a partial response.
|
213
|
+
# @param [String] quota_user
|
214
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
215
|
+
# characters.
|
216
|
+
# @param [String] user_ip
|
217
|
+
# Deprecated. Please use quotaUser instead.
|
218
|
+
# @param [Google::Apis::RequestOptions] options
|
219
|
+
# Request-specific options
|
220
|
+
#
|
221
|
+
# @yield [result, err] Result & error if block supplied
|
222
|
+
# @yieldparam result [NilClass] No result returned for this method
|
223
|
+
# @yieldparam err [StandardError] error object if request failed
|
224
|
+
#
|
225
|
+
# @return [void]
|
226
|
+
#
|
227
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
228
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
229
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
230
|
+
def submit_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
231
|
+
command = make_simple_command(:put, 'sites/{siteUrl}/sitemaps/{feedpath}', options)
|
232
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
233
|
+
command.params['feedpath'] = feedpath unless feedpath.nil?
|
234
|
+
command.query['fields'] = fields unless fields.nil?
|
235
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
236
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
237
|
+
execute_or_queue_command(command, &block)
|
238
|
+
end
|
239
|
+
|
240
|
+
# Adds a site to the set of the user's sites in Search Console.
|
241
|
+
# @param [String] site_url
|
242
|
+
# The URL of the site to add.
|
243
|
+
# @param [String] fields
|
244
|
+
# Selector specifying which fields to include in a partial response.
|
245
|
+
# @param [String] quota_user
|
246
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
247
|
+
# characters.
|
248
|
+
# @param [String] user_ip
|
249
|
+
# Deprecated. Please use quotaUser instead.
|
250
|
+
# @param [Google::Apis::RequestOptions] options
|
251
|
+
# Request-specific options
|
252
|
+
#
|
253
|
+
# @yield [result, err] Result & error if block supplied
|
254
|
+
# @yieldparam result [NilClass] No result returned for this method
|
255
|
+
# @yieldparam err [StandardError] error object if request failed
|
256
|
+
#
|
257
|
+
# @return [void]
|
258
|
+
#
|
259
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
260
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
261
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
262
|
+
def add_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
263
|
+
command = make_simple_command(:put, 'sites/{siteUrl}', options)
|
264
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
265
|
+
command.query['fields'] = fields unless fields.nil?
|
266
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
267
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
268
|
+
execute_or_queue_command(command, &block)
|
269
|
+
end
|
270
|
+
|
271
|
+
# Removes a site from the set of the user's Search Console sites.
|
272
|
+
# @param [String] site_url
|
273
|
+
# The URI of the property as defined in Search Console. Examples: http://www.
|
274
|
+
# example.com/ or android-app://com.example/ Note: for property-sets, use the
|
275
|
+
# URI that starts with sc-set: which is used in Search Console URLs.
|
276
|
+
# @param [String] fields
|
277
|
+
# Selector specifying which fields to include in a partial response.
|
278
|
+
# @param [String] quota_user
|
279
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
280
|
+
# characters.
|
281
|
+
# @param [String] user_ip
|
282
|
+
# Deprecated. Please use quotaUser instead.
|
283
|
+
# @param [Google::Apis::RequestOptions] options
|
284
|
+
# Request-specific options
|
285
|
+
#
|
286
|
+
# @yield [result, err] Result & error if block supplied
|
287
|
+
# @yieldparam result [NilClass] No result returned for this method
|
288
|
+
# @yieldparam err [StandardError] error object if request failed
|
289
|
+
#
|
290
|
+
# @return [void]
|
291
|
+
#
|
292
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
293
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
294
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
295
|
+
def delete_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
296
|
+
command = make_simple_command(:delete, 'sites/{siteUrl}', options)
|
297
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
298
|
+
command.query['fields'] = fields unless fields.nil?
|
299
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
300
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
301
|
+
execute_or_queue_command(command, &block)
|
302
|
+
end
|
303
|
+
|
304
|
+
# Retrieves information about specific site.
|
305
|
+
# @param [String] site_url
|
306
|
+
# The URI of the property as defined in Search Console. Examples: http://www.
|
307
|
+
# example.com/ or android-app://com.example/ Note: for property-sets, use the
|
308
|
+
# URI that starts with sc-set: which is used in Search Console URLs.
|
309
|
+
# @param [String] fields
|
310
|
+
# Selector specifying which fields to include in a partial response.
|
311
|
+
# @param [String] quota_user
|
312
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
313
|
+
# characters.
|
314
|
+
# @param [String] user_ip
|
315
|
+
# Deprecated. Please use quotaUser instead.
|
316
|
+
# @param [Google::Apis::RequestOptions] options
|
317
|
+
# Request-specific options
|
318
|
+
#
|
319
|
+
# @yield [result, err] Result & error if block supplied
|
320
|
+
# @yieldparam result [Google::Apis::WebmastersV3::WmxSite] parsed result object
|
321
|
+
# @yieldparam err [StandardError] error object if request failed
|
322
|
+
#
|
323
|
+
# @return [Google::Apis::WebmastersV3::WmxSite]
|
324
|
+
#
|
325
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
326
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
327
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
328
|
+
def get_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
329
|
+
command = make_simple_command(:get, 'sites/{siteUrl}', options)
|
330
|
+
command.response_representation = Google::Apis::WebmastersV3::WmxSite::Representation
|
331
|
+
command.response_class = Google::Apis::WebmastersV3::WmxSite
|
332
|
+
command.params['siteUrl'] = site_url unless site_url.nil?
|
333
|
+
command.query['fields'] = fields unless fields.nil?
|
334
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
335
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
336
|
+
execute_or_queue_command(command, &block)
|
337
|
+
end
|
338
|
+
|
339
|
+
# Lists the user's Search Console sites.
|
340
|
+
# @param [String] fields
|
341
|
+
# Selector specifying which fields to include in a partial response.
|
342
|
+
# @param [String] quota_user
|
343
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
344
|
+
# characters.
|
345
|
+
# @param [String] user_ip
|
346
|
+
# Deprecated. Please use quotaUser instead.
|
347
|
+
# @param [Google::Apis::RequestOptions] options
|
348
|
+
# Request-specific options
|
349
|
+
#
|
350
|
+
# @yield [result, err] Result & error if block supplied
|
351
|
+
# @yieldparam result [Google::Apis::WebmastersV3::ListSitesResponse] parsed result object
|
352
|
+
# @yieldparam err [StandardError] error object if request failed
|
353
|
+
#
|
354
|
+
# @return [Google::Apis::WebmastersV3::ListSitesResponse]
|
355
|
+
#
|
356
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
357
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
358
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
359
|
+
def list_sites(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
360
|
+
command = make_simple_command(:get, 'sites', options)
|
361
|
+
command.response_representation = Google::Apis::WebmastersV3::ListSitesResponse::Representation
|
362
|
+
command.response_class = Google::Apis::WebmastersV3::ListSitesResponse
|
363
|
+
command.query['fields'] = fields unless fields.nil?
|
364
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
365
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
366
|
+
execute_or_queue_command(command, &block)
|
367
|
+
end
|
368
|
+
|
369
|
+
protected
|
370
|
+
|
371
|
+
def apply_command_defaults(command)
|
372
|
+
command.query['key'] = key unless key.nil?
|
373
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
374
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|