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

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

Overview

Blogger API v3

The Blogger API provides access to posts, comments and pages of a Blogger blog.

Examples:

require 'google/apis/blogger_v2'

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

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBloggerService

Returns a new instance of BloggerService.



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

def initialize
  super('https://blogger.googleapis.com/', '')
  @batch_path = 'batch'
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.

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.



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

def quota_user
  @quota_user
end

Instance Method Details

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

Gets a blog by id.

Parameters:

  • blog_id (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



69
70
71
72
73
74
75
76
77
# File 'generated/google/apis/blogger_v2/service.rb', line 69

def get_blog(blog_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  execute_or_queue_command(command, &block)
end

#get_comment(blog_id, post_id, comment_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::Comment

Gets a comment by blog id, post id and comment id.

Parameters:

  • blog_id (String)
  • post_id (String)
  • comment_id (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



129
130
131
132
133
134
135
136
137
138
139
# File 'generated/google/apis/blogger_v2/service.rb', line 129

def get_comment(blog_id, post_id, comment_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  execute_or_queue_command(command, &block)
end

#get_page(blog_id, page_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::Page

Gets a page by blog id and page id.

Parameters:

  • blog_id (String)
  • page_id (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



200
201
202
203
204
205
206
207
208
209
# File 'generated/google/apis/blogger_v2/service.rb', line 200

def get_page(blog_id, page_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  execute_or_queue_command(command, &block)
end

#get_post(blog_id, post_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::Post

Gets a post by blog id and post id

Parameters:

  • blog_id (String)
  • post_id (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



262
263
264
265
266
267
268
269
270
271
# File 'generated/google/apis/blogger_v2/service.rb', line 262

def get_post(blog_id, post_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  execute_or_queue_command(command, &block)
end

#get_user(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::User

Gets a user by user id.

Parameters:

  • user_id (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def get_user(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  execute_or_queue_command(command, &block)
end

#list_blogs(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::BlogList

Lists blogs by user id, possibly filtered.

Parameters:

  • user_id (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



98
99
100
101
102
103
104
105
106
# File 'generated/google/apis/blogger_v2/service.rb', line 98

def list_blogs(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  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, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::CommentList

Lists comments.

Parameters:

  • blog_id (String)
  • post_id (String)
  • fetch_bodies (Boolean) (defaults to: nil)
  • max_results (Fixnum) (defaults to: nil)
  • page_token (String) (defaults to: nil)
  • start_date (String) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def list_comments(blog_id, post_id, fetch_bodies: nil, max_results: nil, page_token: nil, start_date: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  execute_or_queue_command(command, &block)
end

#list_pages(blog_id, fetch_bodies: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::PageList

Lists pages.

Parameters:

  • blog_id (String)
  • fetch_bodies (Boolean) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



231
232
233
234
235
236
237
238
239
240
# File 'generated/google/apis/blogger_v2/service.rb', line 231

def list_pages(blog_id, fetch_bodies: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  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, options: nil) {|result, err| ... } ⇒ Google::Apis::BloggerV2::PostList

Lists posts.

Parameters:

  • blog_id (String)
  • fetch_bodies (Boolean) (defaults to: nil)
  • max_results (Fixnum) (defaults to: nil)
  • page_token (String) (defaults to: nil)
  • start_date (String) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'generated/google/apis/blogger_v2/service.rb', line 296

def list_posts(blog_id, fetch_bodies: nil, max_results: nil, page_token: nil, start_date: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/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?
  execute_or_queue_command(command, &block)
end