1
// Package blogger provides access to the Blogger API.
3
// See https://developers.google.com/blogger/docs/2.0/json/getting_started
7
// import "google.golang.org/api/blogger/v2"
9
// bloggerService, err := blogger.New(oauthHttpClient)
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "blogger:v2"
38
const apiName = "blogger"
39
const apiVersion = "v2"
40
const basePath = "https://www.googleapis.com/blogger/v2/"
42
// OAuth2 scopes used by this API.
44
// Manage your Blogger account
45
BloggerScope = "https://www.googleapis.com/auth/blogger"
48
func New(client *http.Client) (*Service, error) {
50
return nil, errors.New("client is nil")
52
s := &Service{client: client, BasePath: basePath}
53
s.Blogs = NewBlogsService(s)
54
s.Comments = NewCommentsService(s)
55
s.Pages = NewPagesService(s)
56
s.Posts = NewPostsService(s)
57
s.Users = NewUsersService(s)
63
BasePath string // API endpoint base URL
67
Comments *CommentsService
76
func NewBlogsService(s *Service) *BlogsService {
77
rs := &BlogsService{s: s}
81
type BlogsService struct {
85
func NewCommentsService(s *Service) *CommentsService {
86
rs := &CommentsService{s: s}
90
type CommentsService struct {
94
func NewPagesService(s *Service) *PagesService {
95
rs := &PagesService{s: s}
99
type PagesService struct {
103
func NewPostsService(s *Service) *PostsService {
104
rs := &PostsService{s: s}
108
type PostsService struct {
112
func NewUsersService(s *Service) *UsersService {
113
rs := &UsersService{s: s}
114
rs.Blogs = NewUsersBlogsService(s)
118
type UsersService struct {
121
Blogs *UsersBlogsService
124
func NewUsersBlogsService(s *Service) *UsersBlogsService {
125
rs := &UsersBlogsService{s: s}
129
type UsersBlogsService struct {
134
// Description: The description of this blog. This is displayed
135
// underneath the title.
136
Description string `json:"description,omitempty"`
138
// Id: The identifier for this resource.
139
Id int64 `json:"id,omitempty,string"`
141
// Kind: The kind of this entry. Always blogger#blog
142
Kind string `json:"kind,omitempty"`
144
// Locale: The locale this Blog is set to.
145
Locale *BlogLocale `json:"locale,omitempty"`
147
// Name: The name of this blog. This is displayed as the title.
148
Name string `json:"name,omitempty"`
150
// Pages: The container of pages in this blog.
151
Pages *BlogPages `json:"pages,omitempty"`
153
// Posts: The container of posts in this blog.
154
Posts *BlogPosts `json:"posts,omitempty"`
156
// Published: RFC 3339 date-time when this blog was published.
157
Published string `json:"published,omitempty"`
159
// SelfLink: The API REST URL to fetch this resource from.
160
SelfLink string `json:"selfLink,omitempty"`
162
// Updated: RFC 3339 date-time when this blog was last updated.
163
Updated string `json:"updated,omitempty"`
165
// Url: The URL where this blog is published.
166
Url string `json:"url,omitempty"`
169
type BlogLocale struct {
170
// Country: The country this blog's locale is set to.
171
Country string `json:"country,omitempty"`
173
// Language: The language this blog is authored in.
174
Language string `json:"language,omitempty"`
176
// Variant: The language variant this blog is authored in.
177
Variant string `json:"variant,omitempty"`
180
type BlogPages struct {
181
// SelfLink: The URL of the container for pages in this blog.
182
SelfLink string `json:"selfLink,omitempty"`
184
// TotalItems: The count of pages in this blog.
185
TotalItems int64 `json:"totalItems,omitempty"`
188
type BlogPosts struct {
189
// SelfLink: The URL of the container for posts in this blog.
190
SelfLink string `json:"selfLink,omitempty"`
192
// TotalItems: The count of posts in this blog.
193
TotalItems int64 `json:"totalItems,omitempty"`
196
type BlogList struct {
197
// Items: The list of Blogs this user has Authorship or Admin rights
199
Items []*Blog `json:"items,omitempty"`
201
// Kind: The kind of this entity. Always blogger#blogList
202
Kind string `json:"kind,omitempty"`
205
type Comment struct {
206
// Author: The author of this Comment.
207
Author *CommentAuthor `json:"author,omitempty"`
209
// Blog: Data about the blog containing this comment.
210
Blog *CommentBlog `json:"blog,omitempty"`
212
// Content: The actual content of the comment. May include HTML markup.
213
Content string `json:"content,omitempty"`
215
// Id: The identifier for this resource.
216
Id int64 `json:"id,omitempty,string"`
218
// InReplyTo: Data about the comment this is in reply to.
219
InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"`
221
// Kind: The kind of this entry. Always blogger#comment
222
Kind string `json:"kind,omitempty"`
224
// Post: Data about the post containing this comment.
225
Post *CommentPost `json:"post,omitempty"`
227
// Published: RFC 3339 date-time when this comment was published.
228
Published string `json:"published,omitempty"`
230
// SelfLink: The API REST URL to fetch this resource from.
231
SelfLink string `json:"selfLink,omitempty"`
233
// Updated: RFC 3339 date-time when this comment was last updated.
234
Updated string `json:"updated,omitempty"`
237
type CommentAuthor struct {
238
// DisplayName: The display name.
239
DisplayName string `json:"displayName,omitempty"`
241
// Id: The identifier of the Comment creator.
242
Id string `json:"id,omitempty"`
244
// Image: The comment creator's avatar.
245
Image *CommentAuthorImage `json:"image,omitempty"`
247
// Url: The URL of the Comment creator's Profile page.
248
Url string `json:"url,omitempty"`
251
type CommentAuthorImage struct {
252
// Url: The comment creator's avatar URL.
253
Url string `json:"url,omitempty"`
256
type CommentBlog struct {
257
// Id: The identifier of the blog containing this comment.
258
Id int64 `json:"id,omitempty,string"`
261
type CommentInReplyTo struct {
262
// Id: The identified of the parent of this comment.
263
Id int64 `json:"id,omitempty,string"`
266
type CommentPost struct {
267
// Id: The identifier of the post containing this comment.
268
Id int64 `json:"id,omitempty,string"`
271
type CommentList struct {
272
// Items: The List of Comments for a Post.
273
Items []*Comment `json:"items,omitempty"`
275
// Kind: The kind of this entry. Always blogger#commentList
276
Kind string `json:"kind,omitempty"`
278
// NextPageToken: Pagination token to fetch the next page, if one
280
NextPageToken string `json:"nextPageToken,omitempty"`
282
// PrevPageToken: Pagination token to fetch the previous page, if one
284
PrevPageToken string `json:"prevPageToken,omitempty"`
288
// Author: The author of this Page.
289
Author *PageAuthor `json:"author,omitempty"`
291
// Blog: Data about the blog containing this Page.
292
Blog *PageBlog `json:"blog,omitempty"`
294
// Content: The body content of this Page, in HTML.
295
Content string `json:"content,omitempty"`
297
// Id: The identifier for this resource.
298
Id int64 `json:"id,omitempty,string"`
300
// Kind: The kind of this entity. Always blogger#page
301
Kind string `json:"kind,omitempty"`
303
// Published: RFC 3339 date-time when this Page was published.
304
Published string `json:"published,omitempty"`
306
// SelfLink: The API REST URL to fetch this resource from.
307
SelfLink string `json:"selfLink,omitempty"`
309
// Title: The title of this entity. This is the name displayed in the
310
// Admin user interface.
311
Title string `json:"title,omitempty"`
313
// Updated: RFC 3339 date-time when this Page was last updated.
314
Updated string `json:"updated,omitempty"`
316
// Url: The URL that this Page is displayed at.
317
Url string `json:"url,omitempty"`
320
type PageAuthor struct {
321
// DisplayName: The display name.
322
DisplayName string `json:"displayName,omitempty"`
324
// Id: The identifier of the Page creator.
325
Id string `json:"id,omitempty"`
327
// Image: The page author's avatar.
328
Image *PageAuthorImage `json:"image,omitempty"`
330
// Url: The URL of the Page creator's Profile page.
331
Url string `json:"url,omitempty"`
334
type PageAuthorImage struct {
335
// Url: The page author's avatar URL.
336
Url string `json:"url,omitempty"`
339
type PageBlog struct {
340
// Id: The identifier of the blog containing this page.
341
Id int64 `json:"id,omitempty,string"`
344
type PageList struct {
345
// Items: The list of Pages for a Blog.
346
Items []*Page `json:"items,omitempty"`
348
// Kind: The kind of this entity. Always blogger#pageList
349
Kind string `json:"kind,omitempty"`
353
// Author: The author of this Post.
354
Author *PostAuthor `json:"author,omitempty"`
356
// Blog: Data about the blog containing this Post.
357
Blog *PostBlog `json:"blog,omitempty"`
359
// Content: The content of the Post. May contain HTML markup.
360
Content string `json:"content,omitempty"`
362
// Id: The identifier of this Post.
363
Id int64 `json:"id,omitempty,string"`
365
// Kind: The kind of this entity. Always blogger#post
366
Kind string `json:"kind,omitempty"`
368
// Labels: The list of labels this Post was tagged with.
369
Labels []string `json:"labels,omitempty"`
371
// Published: RFC 3339 date-time when this Post was published.
372
Published string `json:"published,omitempty"`
374
// Replies: The container of comments on this Post.
375
Replies *PostReplies `json:"replies,omitempty"`
377
// SelfLink: The API REST URL to fetch this resource from.
378
SelfLink string `json:"selfLink,omitempty"`
380
// Title: The title of the Post.
381
Title string `json:"title,omitempty"`
383
// Updated: RFC 3339 date-time when this Post was last updated.
384
Updated string `json:"updated,omitempty"`
386
// Url: The URL where this Post is displayed.
387
Url string `json:"url,omitempty"`
390
type PostAuthor struct {
391
// DisplayName: The display name.
392
DisplayName string `json:"displayName,omitempty"`
394
// Id: The identifier of the Post creator.
395
Id string `json:"id,omitempty"`
397
// Image: The Post author's avatar.
398
Image *PostAuthorImage `json:"image,omitempty"`
400
// Url: The URL of the Post creator's Profile page.
401
Url string `json:"url,omitempty"`
404
type PostAuthorImage struct {
405
// Url: The Post author's avatar URL.
406
Url string `json:"url,omitempty"`
409
type PostBlog struct {
410
// Id: The identifier of the Blog that contains this Post.
411
Id int64 `json:"id,omitempty,string"`
414
type PostReplies struct {
415
// SelfLink: The URL of the comments on this post.
416
SelfLink string `json:"selfLink,omitempty"`
418
// TotalItems: The count of comments on this post.
419
TotalItems int64 `json:"totalItems,omitempty,string"`
422
type PostList struct {
423
// Items: The list of Posts for this Blog.
424
Items []*Post `json:"items,omitempty"`
426
// Kind: The kind of this entity. Always blogger#postList
427
Kind string `json:"kind,omitempty"`
429
// NextPageToken: Pagination token to fetch the next page, if one
431
NextPageToken string `json:"nextPageToken,omitempty"`
433
// PrevPageToken: Pagination token to fetch the previous page, if one
435
PrevPageToken string `json:"prevPageToken,omitempty"`
439
// About: Profile summary information.
440
About string `json:"about,omitempty"`
442
// Blogs: The container of blogs for this user.
443
Blogs *UserBlogs `json:"blogs,omitempty"`
445
// Created: The timestamp of when this profile was created, in seconds
447
Created string `json:"created,omitempty"`
449
// DisplayName: The display name.
450
DisplayName string `json:"displayName,omitempty"`
452
// Id: The identifier for this User.
453
Id string `json:"id,omitempty"`
455
// Kind: The kind of this entity. Always blogger#user
456
Kind string `json:"kind,omitempty"`
458
// Locale: This user's locale
459
Locale *UserLocale `json:"locale,omitempty"`
461
// SelfLink: The API REST URL to fetch this resource from.
462
SelfLink string `json:"selfLink,omitempty"`
464
// Url: The user's profile page.
465
Url string `json:"url,omitempty"`
468
type UserBlogs struct {
469
// SelfLink: The URL of the Blogs for this user.
470
SelfLink string `json:"selfLink,omitempty"`
473
type UserLocale struct {
474
// Country: The user's country setting.
475
Country string `json:"country,omitempty"`
477
// Language: The user's language setting.
478
Language string `json:"language,omitempty"`
480
// Variant: The user's language variant setting.
481
Variant string `json:"variant,omitempty"`
484
// method id "blogger.blogs.get":
486
type BlogsGetCall struct {
489
opt_ map[string]interface{}
492
// Get: Gets one blog by id.
493
func (r *BlogsService) Get(blogId string) *BlogsGetCall {
494
c := &BlogsGetCall{s: r.s, opt_: make(map[string]interface{})}
499
// Fields allows partial responses to be retrieved.
500
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
501
// for more information.
502
func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall {
503
c.opt_["fields"] = googleapi.CombineFields(s)
507
func (c *BlogsGetCall) Do() (*Blog, error) {
508
var body io.Reader = nil
509
params := make(url.Values)
510
params.Set("alt", "json")
511
if v, ok := c.opt_["fields"]; ok {
512
params.Set("fields", fmt.Sprintf("%v", v))
514
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}")
515
urls += "?" + params.Encode()
516
req, _ := http.NewRequest("GET", urls, body)
517
googleapi.Expand(req.URL, map[string]string{
520
req.Header.Set("User-Agent", "google-api-go-client/0.5")
521
res, err := c.s.client.Do(req)
525
defer googleapi.CloseBody(res)
526
if err := googleapi.CheckResponse(res); err != nil {
530
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
535
// "description": "Gets one blog by id.",
536
// "httpMethod": "GET",
537
// "id": "blogger.blogs.get",
538
// "parameterOrder": [
543
// "description": "The ID of the blog to get.",
544
// "location": "path",
549
// "path": "blogs/{blogId}",
554
// "https://www.googleapis.com/auth/blogger"
560
// method id "blogger.comments.get":
562
type CommentsGetCall struct {
567
opt_ map[string]interface{}
570
// Get: Gets one comment by id.
571
func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall {
572
c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})}
575
c.commentId = commentId
579
// Fields allows partial responses to be retrieved.
580
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
581
// for more information.
582
func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
583
c.opt_["fields"] = googleapi.CombineFields(s)
587
func (c *CommentsGetCall) Do() (*Comment, error) {
588
var body io.Reader = nil
589
params := make(url.Values)
590
params.Set("alt", "json")
591
if v, ok := c.opt_["fields"]; ok {
592
params.Set("fields", fmt.Sprintf("%v", v))
594
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}")
595
urls += "?" + params.Encode()
596
req, _ := http.NewRequest("GET", urls, body)
597
googleapi.Expand(req.URL, map[string]string{
600
"commentId": c.commentId,
602
req.Header.Set("User-Agent", "google-api-go-client/0.5")
603
res, err := c.s.client.Do(req)
607
defer googleapi.CloseBody(res)
608
if err := googleapi.CheckResponse(res); err != nil {
612
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
617
// "description": "Gets one comment by id.",
618
// "httpMethod": "GET",
619
// "id": "blogger.comments.get",
620
// "parameterOrder": [
627
// "description": "ID of the blog to containing the comment.",
628
// "location": "path",
633
// "description": "The ID of the comment to get.",
634
// "location": "path",
639
// "description": "ID of the post to fetch posts from.",
640
// "location": "path",
645
// "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}",
650
// "https://www.googleapis.com/auth/blogger"
656
// method id "blogger.comments.list":
658
type CommentsListCall struct {
662
opt_ map[string]interface{}
665
// List: Retrieves the comments for a blog, possibly filtered.
666
func (r *CommentsService) List(blogId string, postId string) *CommentsListCall {
667
c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})}
673
// FetchBodies sets the optional parameter "fetchBodies": Whether the
674
// body content of the comments is included.
675
func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall {
676
c.opt_["fetchBodies"] = fetchBodies
680
// MaxResults sets the optional parameter "maxResults": Maximum number
681
// of comments to include in the result.
682
func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
683
c.opt_["maxResults"] = maxResults
687
// PageToken sets the optional parameter "pageToken": Continuation token
688
// if request is paged.
689
func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
690
c.opt_["pageToken"] = pageToken
694
// StartDate sets the optional parameter "startDate": Earliest date of
695
// comment to fetch, a date-time with RFC 3339 formatting.
696
func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall {
697
c.opt_["startDate"] = startDate
701
// Fields allows partial responses to be retrieved.
702
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
703
// for more information.
704
func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
705
c.opt_["fields"] = googleapi.CombineFields(s)
709
func (c *CommentsListCall) Do() (*CommentList, error) {
710
var body io.Reader = nil
711
params := make(url.Values)
712
params.Set("alt", "json")
713
if v, ok := c.opt_["fetchBodies"]; ok {
714
params.Set("fetchBodies", fmt.Sprintf("%v", v))
716
if v, ok := c.opt_["maxResults"]; ok {
717
params.Set("maxResults", fmt.Sprintf("%v", v))
719
if v, ok := c.opt_["pageToken"]; ok {
720
params.Set("pageToken", fmt.Sprintf("%v", v))
722
if v, ok := c.opt_["startDate"]; ok {
723
params.Set("startDate", fmt.Sprintf("%v", v))
725
if v, ok := c.opt_["fields"]; ok {
726
params.Set("fields", fmt.Sprintf("%v", v))
728
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments")
729
urls += "?" + params.Encode()
730
req, _ := http.NewRequest("GET", urls, body)
731
googleapi.Expand(req.URL, map[string]string{
735
req.Header.Set("User-Agent", "google-api-go-client/0.5")
736
res, err := c.s.client.Do(req)
740
defer googleapi.CloseBody(res)
741
if err := googleapi.CheckResponse(res); err != nil {
745
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
750
// "description": "Retrieves the comments for a blog, possibly filtered.",
751
// "httpMethod": "GET",
752
// "id": "blogger.comments.list",
753
// "parameterOrder": [
759
// "description": "ID of the blog to fetch comments from.",
760
// "location": "path",
765
// "description": "Whether the body content of the comments is included.",
766
// "location": "query",
770
// "description": "Maximum number of comments to include in the result.",
771
// "format": "uint32",
772
// "location": "query",
776
// "description": "Continuation token if request is paged.",
777
// "location": "query",
781
// "description": "ID of the post to fetch posts from.",
782
// "location": "path",
787
// "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.",
788
// "format": "date-time",
789
// "location": "query",
793
// "path": "blogs/{blogId}/posts/{postId}/comments",
795
// "$ref": "CommentList"
798
// "https://www.googleapis.com/auth/blogger"
804
// method id "blogger.pages.get":
806
type PagesGetCall struct {
810
opt_ map[string]interface{}
813
// Get: Gets one blog page by id.
814
func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall {
815
c := &PagesGetCall{s: r.s, opt_: make(map[string]interface{})}
821
// Fields allows partial responses to be retrieved.
822
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
823
// for more information.
824
func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall {
825
c.opt_["fields"] = googleapi.CombineFields(s)
829
func (c *PagesGetCall) Do() (*Page, error) {
830
var body io.Reader = nil
831
params := make(url.Values)
832
params.Set("alt", "json")
833
if v, ok := c.opt_["fields"]; ok {
834
params.Set("fields", fmt.Sprintf("%v", v))
836
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
837
urls += "?" + params.Encode()
838
req, _ := http.NewRequest("GET", urls, body)
839
googleapi.Expand(req.URL, map[string]string{
843
req.Header.Set("User-Agent", "google-api-go-client/0.5")
844
res, err := c.s.client.Do(req)
848
defer googleapi.CloseBody(res)
849
if err := googleapi.CheckResponse(res); err != nil {
853
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
858
// "description": "Gets one blog page by id.",
859
// "httpMethod": "GET",
860
// "id": "blogger.pages.get",
861
// "parameterOrder": [
867
// "description": "ID of the blog containing the page.",
868
// "location": "path",
873
// "description": "The ID of the page to get.",
874
// "location": "path",
879
// "path": "blogs/{blogId}/pages/{pageId}",
884
// "https://www.googleapis.com/auth/blogger"
890
// method id "blogger.pages.list":
892
type PagesListCall struct {
895
opt_ map[string]interface{}
898
// List: Retrieves pages for a blog, possibly filtered.
899
func (r *PagesService) List(blogId string) *PagesListCall {
900
c := &PagesListCall{s: r.s, opt_: make(map[string]interface{})}
905
// FetchBodies sets the optional parameter "fetchBodies": Whether to
906
// retrieve the Page bodies.
907
func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall {
908
c.opt_["fetchBodies"] = fetchBodies
912
// Fields allows partial responses to be retrieved.
913
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
914
// for more information.
915
func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall {
916
c.opt_["fields"] = googleapi.CombineFields(s)
920
func (c *PagesListCall) Do() (*PageList, error) {
921
var body io.Reader = nil
922
params := make(url.Values)
923
params.Set("alt", "json")
924
if v, ok := c.opt_["fetchBodies"]; ok {
925
params.Set("fetchBodies", fmt.Sprintf("%v", v))
927
if v, ok := c.opt_["fields"]; ok {
928
params.Set("fields", fmt.Sprintf("%v", v))
930
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages")
931
urls += "?" + params.Encode()
932
req, _ := http.NewRequest("GET", urls, body)
933
googleapi.Expand(req.URL, map[string]string{
936
req.Header.Set("User-Agent", "google-api-go-client/0.5")
937
res, err := c.s.client.Do(req)
941
defer googleapi.CloseBody(res)
942
if err := googleapi.CheckResponse(res); err != nil {
946
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
951
// "description": "Retrieves pages for a blog, possibly filtered.",
952
// "httpMethod": "GET",
953
// "id": "blogger.pages.list",
954
// "parameterOrder": [
959
// "description": "ID of the blog to fetch pages from.",
960
// "location": "path",
965
// "description": "Whether to retrieve the Page bodies.",
966
// "location": "query",
970
// "path": "blogs/{blogId}/pages",
972
// "$ref": "PageList"
975
// "https://www.googleapis.com/auth/blogger"
981
// method id "blogger.posts.get":
983
type PostsGetCall struct {
987
opt_ map[string]interface{}
990
// Get: Get a post by id.
991
func (r *PostsService) Get(blogId string, postId string) *PostsGetCall {
992
c := &PostsGetCall{s: r.s, opt_: make(map[string]interface{})}
998
// Fields allows partial responses to be retrieved.
999
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1000
// for more information.
1001
func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall {
1002
c.opt_["fields"] = googleapi.CombineFields(s)
1006
func (c *PostsGetCall) Do() (*Post, error) {
1007
var body io.Reader = nil
1008
params := make(url.Values)
1009
params.Set("alt", "json")
1010
if v, ok := c.opt_["fields"]; ok {
1011
params.Set("fields", fmt.Sprintf("%v", v))
1013
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
1014
urls += "?" + params.Encode()
1015
req, _ := http.NewRequest("GET", urls, body)
1016
googleapi.Expand(req.URL, map[string]string{
1020
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1021
res, err := c.s.client.Do(req)
1025
defer googleapi.CloseBody(res)
1026
if err := googleapi.CheckResponse(res); err != nil {
1030
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1035
// "description": "Get a post by id.",
1036
// "httpMethod": "GET",
1037
// "id": "blogger.posts.get",
1038
// "parameterOrder": [
1044
// "description": "ID of the blog to fetch the post from.",
1045
// "location": "path",
1046
// "required": true,
1050
// "description": "The ID of the post",
1051
// "location": "path",
1052
// "required": true,
1056
// "path": "blogs/{blogId}/posts/{postId}",
1061
// "https://www.googleapis.com/auth/blogger"
1067
// method id "blogger.posts.list":
1069
type PostsListCall struct {
1072
opt_ map[string]interface{}
1075
// List: Retrieves a list of posts, possibly filtered.
1076
func (r *PostsService) List(blogId string) *PostsListCall {
1077
c := &PostsListCall{s: r.s, opt_: make(map[string]interface{})}
1082
// FetchBodies sets the optional parameter "fetchBodies": Whether the
1083
// body content of posts is included.
1084
func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall {
1085
c.opt_["fetchBodies"] = fetchBodies
1089
// MaxResults sets the optional parameter "maxResults": Maximum number
1090
// of posts to fetch.
1091
func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall {
1092
c.opt_["maxResults"] = maxResults
1096
// PageToken sets the optional parameter "pageToken": Continuation token
1097
// if the request is paged.
1098
func (c *PostsListCall) PageToken(pageToken string) *PostsListCall {
1099
c.opt_["pageToken"] = pageToken
1103
// StartDate sets the optional parameter "startDate": Earliest post date
1104
// to fetch, a date-time with RFC 3339 formatting.
1105
func (c *PostsListCall) StartDate(startDate string) *PostsListCall {
1106
c.opt_["startDate"] = startDate
1110
// Fields allows partial responses to be retrieved.
1111
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1112
// for more information.
1113
func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall {
1114
c.opt_["fields"] = googleapi.CombineFields(s)
1118
func (c *PostsListCall) Do() (*PostList, error) {
1119
var body io.Reader = nil
1120
params := make(url.Values)
1121
params.Set("alt", "json")
1122
if v, ok := c.opt_["fetchBodies"]; ok {
1123
params.Set("fetchBodies", fmt.Sprintf("%v", v))
1125
if v, ok := c.opt_["maxResults"]; ok {
1126
params.Set("maxResults", fmt.Sprintf("%v", v))
1128
if v, ok := c.opt_["pageToken"]; ok {
1129
params.Set("pageToken", fmt.Sprintf("%v", v))
1131
if v, ok := c.opt_["startDate"]; ok {
1132
params.Set("startDate", fmt.Sprintf("%v", v))
1134
if v, ok := c.opt_["fields"]; ok {
1135
params.Set("fields", fmt.Sprintf("%v", v))
1137
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts")
1138
urls += "?" + params.Encode()
1139
req, _ := http.NewRequest("GET", urls, body)
1140
googleapi.Expand(req.URL, map[string]string{
1143
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1144
res, err := c.s.client.Do(req)
1148
defer googleapi.CloseBody(res)
1149
if err := googleapi.CheckResponse(res); err != nil {
1153
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1158
// "description": "Retrieves a list of posts, possibly filtered.",
1159
// "httpMethod": "GET",
1160
// "id": "blogger.posts.list",
1161
// "parameterOrder": [
1166
// "description": "ID of the blog to fetch posts from.",
1167
// "location": "path",
1168
// "required": true,
1172
// "description": "Whether the body content of posts is included.",
1173
// "location": "query",
1174
// "type": "boolean"
1177
// "description": "Maximum number of posts to fetch.",
1178
// "format": "uint32",
1179
// "location": "query",
1180
// "type": "integer"
1183
// "description": "Continuation token if the request is paged.",
1184
// "location": "query",
1188
// "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.",
1189
// "format": "date-time",
1190
// "location": "query",
1194
// "path": "blogs/{blogId}/posts",
1196
// "$ref": "PostList"
1199
// "https://www.googleapis.com/auth/blogger"
1205
// method id "blogger.users.get":
1207
type UsersGetCall struct {
1210
opt_ map[string]interface{}
1213
// Get: Gets one user by id.
1214
func (r *UsersService) Get(userId string) *UsersGetCall {
1215
c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})}
1220
// Fields allows partial responses to be retrieved.
1221
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1222
// for more information.
1223
func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
1224
c.opt_["fields"] = googleapi.CombineFields(s)
1228
func (c *UsersGetCall) Do() (*User, error) {
1229
var body io.Reader = nil
1230
params := make(url.Values)
1231
params.Set("alt", "json")
1232
if v, ok := c.opt_["fields"]; ok {
1233
params.Set("fields", fmt.Sprintf("%v", v))
1235
urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}")
1236
urls += "?" + params.Encode()
1237
req, _ := http.NewRequest("GET", urls, body)
1238
googleapi.Expand(req.URL, map[string]string{
1241
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1242
res, err := c.s.client.Do(req)
1246
defer googleapi.CloseBody(res)
1247
if err := googleapi.CheckResponse(res); err != nil {
1251
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1256
// "description": "Gets one user by id.",
1257
// "httpMethod": "GET",
1258
// "id": "blogger.users.get",
1259
// "parameterOrder": [
1264
// "description": "The ID of the user to get.",
1265
// "location": "path",
1266
// "required": true,
1270
// "path": "users/{userId}",
1275
// "https://www.googleapis.com/auth/blogger"
1281
// method id "blogger.users.blogs.list":
1283
type UsersBlogsListCall struct {
1286
opt_ map[string]interface{}
1289
// List: Retrieves a list of blogs, possibly filtered.
1290
func (r *UsersBlogsService) List(userId string) *UsersBlogsListCall {
1291
c := &UsersBlogsListCall{s: r.s, opt_: make(map[string]interface{})}
1296
// Fields allows partial responses to be retrieved.
1297
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1298
// for more information.
1299
func (c *UsersBlogsListCall) Fields(s ...googleapi.Field) *UsersBlogsListCall {
1300
c.opt_["fields"] = googleapi.CombineFields(s)
1304
func (c *UsersBlogsListCall) Do() (*BlogList, error) {
1305
var body io.Reader = nil
1306
params := make(url.Values)
1307
params.Set("alt", "json")
1308
if v, ok := c.opt_["fields"]; ok {
1309
params.Set("fields", fmt.Sprintf("%v", v))
1311
urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs")
1312
urls += "?" + params.Encode()
1313
req, _ := http.NewRequest("GET", urls, body)
1314
googleapi.Expand(req.URL, map[string]string{
1317
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1318
res, err := c.s.client.Do(req)
1322
defer googleapi.CloseBody(res)
1323
if err := googleapi.CheckResponse(res); err != nil {
1327
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1332
// "description": "Retrieves a list of blogs, possibly filtered.",
1333
// "httpMethod": "GET",
1334
// "id": "blogger.users.blogs.list",
1335
// "parameterOrder": [
1340
// "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
1341
// "location": "path",
1342
// "required": true,
1346
// "path": "users/{userId}/blogs",
1348
// "$ref": "BlogList"
1351
// "https://www.googleapis.com/auth/blogger"