Class: Google::Apis::BloggerV2::BloggerService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/blogger_v2/service.rb

Overview

Blogger API

API for access to the data within Blogger.

Examples:

require 'google/apis/blogger_v2'

Blogger = Google::Apis::BloggerV2 # Alias the module
service = Blogger::BloggerService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeBloggerService

Returns a new instance of BloggerService



51
52
53
54
# File 'generated/google/apis/blogger_v2/service.rb', line 51

def initialize
  super('https://www.googleapis.com/', 'blogger/v2/')
  @batch_path = 'batch/blogger/v2'
end

Instance Attribute Details

#keyString

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.

Returns:

  • (String)

    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/blogger_v2/service.rb', line 38

def key
  @key
end

#quota_userString

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. Overrides userIp if both are provided.

Returns:

  • (String)

    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. Overrides userIp if both are provided.



44
45
46
# File 'generated/google/apis/blogger_v2/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



49
50
51
# File 'generated/google/apis/blogger_v2/service.rb', line 49

def user_ip
  @user_ip
end

Instance Method Details

#get_blog(blog_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::Blog

Gets one blog by id.

Parameters:

  • blog_id (String)

    The ID of the blog to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



80
81
82
83
84
85
86
87
88
89
# File 'generated/google/apis/blogger_v2/service.rb', line 80

def get_blog(blog_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'blogs/{blogId}', options)
  command.response_representation = Google::Apis::BloggerV2::Blog::Representation
  command.response_class = Google::Apis::BloggerV2::Blog
  command.params['blogId'] = blog_id unless blog_id.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_comment(blog_id, post_id, comment_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::Comment

Gets one comment by id.

Parameters:

  • blog_id (String)

    ID of the blog to containing the comment.

  • post_id (String)

    ID of the post to fetch posts from.

  • comment_id (String)

    The ID of the comment to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



119
120
121
122
123
124
125
126
127
128
129
130
# File 'generated/google/apis/blogger_v2/service.rb', line 119

def get_comment(blog_id, post_id, comment_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'blogs/{blogId}/posts/{postId}/comments/{commentId}', options)
  command.response_representation = Google::Apis::BloggerV2::Comment::Representation
  command.response_class = Google::Apis::BloggerV2::Comment
  command.params['blogId'] = blog_id unless blog_id.nil?
  command.params['postId'] = post_id unless post_id.nil?
  command.params['commentId'] = comment_id unless comment_id.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_page(blog_id, page_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::Page

Gets one blog page by id.

Parameters:

  • blog_id (String)

    ID of the blog containing the page.

  • page_id (String)

    The ID of the page to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



208
209
210
211
212
213
214
215
216
217
218
# File 'generated/google/apis/blogger_v2/service.rb', line 208

def get_page(blog_id, page_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'blogs/{blogId}/pages/{pageId}', options)
  command.response_representation = Google::Apis::BloggerV2::Page::Representation
  command.response_class = Google::Apis::BloggerV2::Page
  command.params['blogId'] = blog_id unless blog_id.nil?
  command.params['pageId'] = page_id unless page_id.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_post(blog_id, post_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::Post

Get a post by id.

Parameters:

  • blog_id (String)

    ID of the blog to fetch the post from.

  • post_id (String)

    The ID of the post

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



284
285
286
287
288
289
290
291
292
293
294
# File 'generated/google/apis/blogger_v2/service.rb', line 284

def get_post(blog_id, post_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'blogs/{blogId}/posts/{postId}', options)
  command.response_representation = Google::Apis::BloggerV2::Post::Representation
  command.response_class = Google::Apis::BloggerV2::Post
  command.params['blogId'] = blog_id unless blog_id.nil?
  command.params['postId'] = post_id unless post_id.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_user(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::User

Gets one user by id.

Parameters:

  • user_id (String)

    The ID of the user to get.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



367
368
369
370
371
372
373
374
375
376
# File 'generated/google/apis/blogger_v2/service.rb', line 367

def get_user(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'users/{userId}', options)
  command.response_representation = Google::Apis::BloggerV2::User::Representation
  command.response_class = Google::Apis::BloggerV2::User
  command.params['userId'] = user_id unless user_id.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_comments(blog_id, post_id, fetch_bodies: nil, max_results: nil, page_token: nil, start_date: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::CommentList

Retrieves the comments for a blog, possibly filtered.

Parameters:

  • blog_id (String)

    ID of the blog to fetch comments from.

  • post_id (String)

    ID of the post to fetch posts from.

  • fetch_bodies (Boolean)

    Whether the body content of the comments is included.

  • max_results (Fixnum)

    Maximum number of comments to include in the result.

  • page_token (String)

    Continuation token if request is paged.

  • start_date (DateTime)

    Earliest date of comment to fetch, a date-time with RFC 3339 formatting.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'generated/google/apis/blogger_v2/service.rb', line 166

def list_comments(blog_id, post_id, fetch_bodies: nil, max_results: nil, page_token: nil, start_date: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'blogs/{blogId}/posts/{postId}/comments', options)
  command.response_representation = Google::Apis::BloggerV2::CommentList::Representation
  command.response_class = Google::Apis::BloggerV2::CommentList
  command.params['blogId'] = blog_id unless blog_id.nil?
  command.params['postId'] = post_id unless post_id.nil?
  command.query['fetchBodies'] = fetch_bodies unless fetch_bodies.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['startDate'] = start_date unless start_date.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_pages(blog_id, fetch_bodies: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::PageList

Retrieves pages for a blog, possibly filtered.

Parameters:

  • blog_id (String)

    ID of the blog to fetch pages from.

  • fetch_bodies (Boolean)

    Whether to retrieve the Page bodies.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



246
247
248
249
250
251
252
253
254
255
256
# File 'generated/google/apis/blogger_v2/service.rb', line 246

def list_pages(blog_id, fetch_bodies: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'blogs/{blogId}/pages', options)
  command.response_representation = Google::Apis::BloggerV2::PageList::Representation
  command.response_class = Google::Apis::BloggerV2::PageList
  command.params['blogId'] = blog_id unless blog_id.nil?
  command.query['fetchBodies'] = fetch_bodies unless fetch_bodies.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_posts(blog_id, fetch_bodies: nil, max_results: nil, page_token: nil, start_date: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::PostList

Retrieves a list of posts, possibly filtered.

Parameters:

  • blog_id (String)

    ID of the blog to fetch posts from.

  • fetch_bodies (Boolean)

    Whether the body content of posts is included.

  • max_results (Fixnum)

    Maximum number of posts to fetch.

  • page_token (String)

    Continuation token if the request is paged.

  • start_date (DateTime)

    Earliest post date to fetch, a date-time with RFC 3339 formatting.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'generated/google/apis/blogger_v2/service.rb', line 328

def list_posts(blog_id, fetch_bodies: nil, max_results: nil, page_token: nil, start_date: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'blogs/{blogId}/posts', options)
  command.response_representation = Google::Apis::BloggerV2::PostList::Representation
  command.response_class = Google::Apis::BloggerV2::PostList
  command.params['blogId'] = blog_id unless blog_id.nil?
  command.query['fetchBodies'] = fetch_bodies unless fetch_bodies.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['startDate'] = start_date unless start_date.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_user_blogs(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::BlogList

Retrieves a list of blogs, possibly filtered.

Parameters:

  • user_id (String)

    ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    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. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



403
404
405
406
407
408
409
410
411
412
# File 'generated/google/apis/blogger_v2/service.rb', line 403

def list_user_blogs(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'users/{userId}/blogs', options)
  command.response_representation = Google::Apis::BloggerV2::BlogList::Representation
  command.response_class = Google::Apis::BloggerV2::BlogList
  command.params['userId'] = user_id unless user_id.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