Class: Google::Apis::SearchconsoleV1::SearchConsoleService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::SearchconsoleV1::SearchConsoleService
- Defined in:
- generated/google/apis/searchconsole_v1/service.rb
Overview
Google Search Console API
The Search Console API provides access to both Search Console data (verified users only) and to public information on an URL basis (anyone)
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#add_site(site_url, fields: nil, quota_user: 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, 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, options: nil) {|result, err| ... }
Deletes a sitemap from this site.
-
#get_site(site_url, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::WmxSite
Retrieves information about specific site.
-
#get_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::WmxSitemap
Retrieves information about a specific sitemap.
-
#initialize ⇒ SearchConsoleService
constructor
A new instance of SearchConsoleService.
-
#list_sitemaps(site_url, sitemap_index: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::SitemapsListResponse
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, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::SitesListResponse
Lists the user's Search Console sites.
-
#query_searchanalytic(site_url, search_analytics_query_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::SearchAnalyticsQueryResponse
Query your data with filters and parameters that you define.
-
#run_mobile_friendly_test(run_mobile_friendly_test_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::RunMobileFriendlyTestResponse
Runs Mobile-Friendly Test for a given URL.
-
#submit_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Submits a sitemap for a site.
Constructor Details
#initialize ⇒ SearchConsoleService
Returns a new instance of SearchConsoleService.
46 47 48 49 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 46 def initialize super('https://searchconsole.googleapis.com/', '') @batch_path = 'batch' 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.
39 40 41 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 39 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
44 45 46 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 44 def quota_user @quota_user end |
Instance Method Details
#add_site(site_url, fields: nil, quota_user: 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.
243 244 245 246 247 248 249 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 243 def add_site(site_url, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'webmasters/v3/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? execute_or_queue_command(command, &block) end |
#delete_site(site_url, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Removes a site from the set of the user's Search Console sites.
272 273 274 275 276 277 278 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 272 def delete_site(site_url, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'webmasters/v3/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? execute_or_queue_command(command, &block) end |
#delete_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Deletes a sitemap from this site.
112 113 114 115 116 117 118 119 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 112 def delete_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'webmasters/v3/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? execute_or_queue_command(command, &block) end |
#get_site(site_url, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::WmxSite
Retrieves information about specific site.
301 302 303 304 305 306 307 308 309 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 301 def get_site(site_url, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'webmasters/v3/sites/{siteUrl}', ) command.response_representation = Google::Apis::SearchconsoleV1::WmxSite::Representation command.response_class = Google::Apis::SearchconsoleV1::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? execute_or_queue_command(command, &block) end |
#get_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::WmxSitemap
Retrieves information about a specific sitemap.
144 145 146 147 148 149 150 151 152 153 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 144 def get_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}', ) command.response_representation = Google::Apis::SearchconsoleV1::WmxSitemap::Representation command.response_class = Google::Apis::SearchconsoleV1::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? execute_or_queue_command(command, &block) end |
#list_sitemaps(site_url, sitemap_index: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::SitemapsListResponse
Lists the sitemaps-entries submitted for this
site, or included in the sitemap index file (if sitemapIndex
is specified in
the request).
180 181 182 183 184 185 186 187 188 189 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 180 def list_sitemaps(site_url, sitemap_index: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'webmasters/v3/sites/{siteUrl}/sitemaps', ) command.response_representation = Google::Apis::SearchconsoleV1::SitemapsListResponse::Representation command.response_class = Google::Apis::SearchconsoleV1::SitemapsListResponse 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? execute_or_queue_command(command, &block) end |
#list_sites(fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::SitesListResponse
Lists the user's Search Console sites.
329 330 331 332 333 334 335 336 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 329 def list_sites(fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'webmasters/v3/sites', ) command.response_representation = Google::Apis::SearchconsoleV1::SitesListResponse::Representation command.response_class = Google::Apis::SearchconsoleV1::SitesListResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#query_searchanalytic(site_url, search_analytics_query_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::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.
77 78 79 80 81 82 83 84 85 86 87 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 77 def query_searchanalytic(site_url, search_analytics_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'webmasters/v3/sites/{siteUrl}/searchAnalytics/query', ) command.request_representation = Google::Apis::SearchconsoleV1::SearchAnalyticsQueryRequest::Representation command.request_object = search_analytics_query_request_object command.response_representation = Google::Apis::SearchconsoleV1::SearchAnalyticsQueryResponse::Representation command.response_class = Google::Apis::SearchconsoleV1::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? execute_or_queue_command(command, &block) end |
#run_mobile_friendly_test(run_mobile_friendly_test_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SearchconsoleV1::RunMobileFriendlyTestResponse
Runs Mobile-Friendly Test for a given URL.
357 358 359 360 361 362 363 364 365 366 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 357 def run_mobile_friendly_test(run_mobile_friendly_test_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/urlTestingTools/mobileFriendlyTest:run', ) command.request_representation = Google::Apis::SearchconsoleV1::RunMobileFriendlyTestRequest::Representation command.request_object = run_mobile_friendly_test_request_object command.response_representation = Google::Apis::SearchconsoleV1::RunMobileFriendlyTestResponse::Representation command.response_class = Google::Apis::SearchconsoleV1::RunMobileFriendlyTestResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#submit_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Submits a sitemap for a site.
214 215 216 217 218 219 220 221 |
# File 'generated/google/apis/searchconsole_v1/service.rb', line 214 def submit_sitemap(site_url, feedpath, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'webmasters/v3/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? execute_or_queue_command(command, &block) end |