Class: Google::Apis::WebmastersV3::WebmastersService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::WebmastersV3::WebmastersService
- Defined in:
- generated/google/apis/webmasters_v3/service.rb
Overview
Search Console API
View Google Search Console data for your verified sites.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
An opaque string that represents a user for quota purposes.
-
#user_ip ⇒ String
Deprecated.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#add_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Adds a site to the set of the user's sites in Search Console.
-
#delete_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Removes a site from the set of the user's Search Console sites.
-
#delete_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Deletes a sitemap from this site.
-
#get_errors_sample(site_url, url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::UrlCrawlErrorsSample
Retrieves details about crawl errors for a site's sample URL.
-
#get_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::WmxSite
Retrieves information about specific site.
-
#get_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::WmxSitemap
Retrieves information about a specific sitemap.
-
#initialize ⇒ WebmastersService
constructor
A new instance of WebmastersService.
-
#list_errors_samples(site_url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::ListUrlCrawlErrorsSamplesResponse
Lists a site's sample URLs for the specified crawl error category and platform.
-
#list_sitemaps(site_url, sitemap_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::ListSitemapsResponse
Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request).
-
#list_sites(fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::ListSitesResponse
Lists the user's Search Console sites.
-
#mark_as_fixed(site_url, url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Marks the provided site's sample URL as fixed, and removes it from the samples list.
-
#query_errors_count(site_url, category: nil, latest_counts_only: nil, platform: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::QueryUrlCrawlErrorsCountsResponse
Retrieves a time series of the number of URL crawl errors per error category and platform.
-
#query_search_analytics(site_url, search_analytics_query_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse
Query your data with filters and parameters that you define.
-
#submit_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Submits a sitemap for a site.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ WebmastersService
Returns a new instance of WebmastersService
49 50 51 52 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 49 def initialize super('https://www.googleapis.com/', 'webmasters/v3/') @batch_path = 'batch/webmasters/v3' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
43 44 45 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 43 def quota_user @quota_user end |
#user_ip ⇒ String
Returns Deprecated. Please use quotaUser instead.
47 48 49 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 47 def user_ip @user_ip end |
Instance Method Details
#add_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Adds a site to the set of the user's sites in Search Console.
260 261 262 263 264 265 266 267 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 260 def add_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:put, 'sites/{siteUrl}', ) command.params['siteUrl'] = site_url unless site_url.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#delete_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Removes a site from the set of the user's Search Console sites.
293 294 295 296 297 298 299 300 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 293 def delete_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:delete, 'sites/{siteUrl}', ) command.params['siteUrl'] = site_url unless site_url.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#delete_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Deletes a sitemap from this site.
120 121 122 123 124 125 126 127 128 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 120 def delete_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:delete, 'sites/{siteUrl}/sitemaps/{feedpath}', ) command.params['siteUrl'] = site_url unless site_url.nil? command.params['feedpath'] = feedpath unless feedpath.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#get_errors_sample(site_url, url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::UrlCrawlErrorsSample
Retrieves details about crawl errors for a site's sample URL.
442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 442 def get_errors_sample(site_url, url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'sites/{siteUrl}/urlCrawlErrorsSamples/{url}', ) command.response_representation = Google::Apis::WebmastersV3::UrlCrawlErrorsSample::Representation command.response_class = Google::Apis::WebmastersV3::UrlCrawlErrorsSample command.params['siteUrl'] = site_url unless site_url.nil? command.params['url'] = url unless url.nil? command.query['category'] = category unless category.nil? command.query['platform'] = platform unless platform.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#get_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::WmxSite
Retrieves information about specific site.
326 327 328 329 330 331 332 333 334 335 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 326 def get_site(site_url, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'sites/{siteUrl}', ) command.response_representation = Google::Apis::WebmastersV3::WmxSite::Representation command.response_class = Google::Apis::WebmastersV3::WmxSite command.params['siteUrl'] = site_url unless site_url.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#get_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::WmxSitemap
Retrieves information about a specific sitemap.
154 155 156 157 158 159 160 161 162 163 164 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 154 def get_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'sites/{siteUrl}/sitemaps/{feedpath}', ) command.response_representation = Google::Apis::WebmastersV3::WmxSitemap::Representation command.response_class = Google::Apis::WebmastersV3::WmxSitemap command.params['siteUrl'] = site_url unless site_url.nil? command.params['feedpath'] = feedpath unless feedpath.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_errors_samples(site_url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::ListUrlCrawlErrorsSamplesResponse
Lists a site's sample URLs for the specified crawl error category and platform.
482 483 484 485 486 487 488 489 490 491 492 493 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 482 def list_errors_samples(site_url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'sites/{siteUrl}/urlCrawlErrorsSamples', ) command.response_representation = Google::Apis::WebmastersV3::ListUrlCrawlErrorsSamplesResponse::Representation command.response_class = Google::Apis::WebmastersV3::ListUrlCrawlErrorsSamplesResponse command.params['siteUrl'] = site_url unless site_url.nil? command.query['category'] = category unless category.nil? command.query['platform'] = platform unless platform.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_sitemaps(site_url, sitemap_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::ListSitemapsResponse
Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request).
192 193 194 195 196 197 198 199 200 201 202 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 192 def list_sitemaps(site_url, sitemap_index: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'sites/{siteUrl}/sitemaps', ) command.response_representation = Google::Apis::WebmastersV3::ListSitemapsResponse::Representation command.response_class = Google::Apis::WebmastersV3::ListSitemapsResponse command.params['siteUrl'] = site_url unless site_url.nil? command.query['sitemapIndex'] = sitemap_index unless sitemap_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_sites(fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::ListSitesResponse
Lists the user's Search Console sites.
357 358 359 360 361 362 363 364 365 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 357 def list_sites(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'sites', ) command.response_representation = Google::Apis::WebmastersV3::ListSitesResponse::Representation command.response_class = Google::Apis::WebmastersV3::ListSitesResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#mark_as_fixed(site_url, url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Marks the provided site's sample URL as fixed, and removes it from the samples list.
526 527 528 529 530 531 532 533 534 535 536 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 526 def mark_as_fixed(site_url, url, category, platform, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:delete, 'sites/{siteUrl}/urlCrawlErrorsSamples/{url}', ) command.params['siteUrl'] = site_url unless site_url.nil? command.params['url'] = url unless url.nil? command.query['category'] = category unless category.nil? command.query['platform'] = platform unless platform.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#query_errors_count(site_url, category: nil, latest_counts_only: nil, platform: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::QueryUrlCrawlErrorsCountsResponse
Retrieves a time series of the number of URL crawl errors per error category and platform.
398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 398 def query_errors_count(site_url, category: nil, latest_counts_only: nil, platform: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'sites/{siteUrl}/urlCrawlErrorsCounts/query', ) command.response_representation = Google::Apis::WebmastersV3::QueryUrlCrawlErrorsCountsResponse::Representation command.response_class = Google::Apis::WebmastersV3::QueryUrlCrawlErrorsCountsResponse command.params['siteUrl'] = site_url unless site_url.nil? command.query['category'] = category unless category.nil? command.query['latestCountsOnly'] = latest_counts_only unless latest_counts_only.nil? command.query['platform'] = platform unless platform.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#query_search_analytics(site_url, search_analytics_query_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse
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.
83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 83 def query_search_analytics(site_url, search_analytics_query_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, 'sites/{siteUrl}/searchAnalytics/query', ) command.request_representation = Google::Apis::WebmastersV3::SearchAnalyticsQueryRequest::Representation command.request_object = search_analytics_query_request_object command.response_representation = Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse::Representation command.response_class = Google::Apis::WebmastersV3::SearchAnalyticsQueryResponse command.params['siteUrl'] = site_url unless site_url.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#submit_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Submits a sitemap for a site.
228 229 230 231 232 233 234 235 236 |
# File 'generated/google/apis/webmasters_v3/service.rb', line 228 def submit_sitemap(site_url, feedpath, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:put, 'sites/{siteUrl}/sitemaps/{feedpath}', ) command.params['siteUrl'] = site_url unless site_url.nil? command.params['feedpath'] = feedpath unless feedpath.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |