1
// Package blogger provides access to the Blogger API.
3
// See https://developers.google.com/blogger/docs/3.0/getting_started
7
// import "google.golang.org/api/blogger/v3"
9
// bloggerService, err := blogger.New(oauthHttpClient)
14
"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:v3"
38
const apiName = "blogger"
39
const apiVersion = "v3"
40
const basePath = "https://www.googleapis.com/blogger/v3/"
42
// OAuth2 scopes used by this API.
44
// Manage your Blogger account
45
BloggerScope = "https://www.googleapis.com/auth/blogger"
47
// View your Blogger account
48
BloggerReadonlyScope = "https://www.googleapis.com/auth/blogger.readonly"
51
func New(client *http.Client) (*Service, error) {
53
return nil, errors.New("client is nil")
55
s := &Service{client: client, BasePath: basePath}
56
s.BlogUserInfos = NewBlogUserInfosService(s)
57
s.Blogs = NewBlogsService(s)
58
s.Comments = NewCommentsService(s)
59
s.PageViews = NewPageViewsService(s)
60
s.Pages = NewPagesService(s)
61
s.PostUserInfos = NewPostUserInfosService(s)
62
s.Posts = NewPostsService(s)
63
s.Users = NewUsersService(s)
69
BasePath string // API endpoint base URL
71
BlogUserInfos *BlogUserInfosService
75
Comments *CommentsService
77
PageViews *PageViewsService
81
PostUserInfos *PostUserInfosService
88
func NewBlogUserInfosService(s *Service) *BlogUserInfosService {
89
rs := &BlogUserInfosService{s: s}
93
type BlogUserInfosService struct {
97
func NewBlogsService(s *Service) *BlogsService {
98
rs := &BlogsService{s: s}
102
type BlogsService struct {
106
func NewCommentsService(s *Service) *CommentsService {
107
rs := &CommentsService{s: s}
111
type CommentsService struct {
115
func NewPageViewsService(s *Service) *PageViewsService {
116
rs := &PageViewsService{s: s}
120
type PageViewsService struct {
124
func NewPagesService(s *Service) *PagesService {
125
rs := &PagesService{s: s}
129
type PagesService struct {
133
func NewPostUserInfosService(s *Service) *PostUserInfosService {
134
rs := &PostUserInfosService{s: s}
138
type PostUserInfosService struct {
142
func NewPostsService(s *Service) *PostsService {
143
rs := &PostsService{s: s}
147
type PostsService struct {
151
func NewUsersService(s *Service) *UsersService {
152
rs := &UsersService{s: s}
156
type UsersService struct {
161
// CustomMetaData: The JSON custom meta-data for the Blog
162
CustomMetaData string `json:"customMetaData,omitempty"`
164
// Description: The description of this blog. This is displayed
165
// underneath the title.
166
Description string `json:"description,omitempty"`
168
// Id: The identifier for this resource.
169
Id string `json:"id,omitempty"`
171
// Kind: The kind of this entry. Always blogger#blog
172
Kind string `json:"kind,omitempty"`
174
// Locale: The locale this Blog is set to.
175
Locale *BlogLocale `json:"locale,omitempty"`
177
// Name: The name of this blog. This is displayed as the title.
178
Name string `json:"name,omitempty"`
180
// Pages: The container of pages in this blog.
181
Pages *BlogPages `json:"pages,omitempty"`
183
// Posts: The container of posts in this blog.
184
Posts *BlogPosts `json:"posts,omitempty"`
186
// Published: RFC 3339 date-time when this blog was published.
187
Published string `json:"published,omitempty"`
189
// SelfLink: The API REST URL to fetch this resource from.
190
SelfLink string `json:"selfLink,omitempty"`
192
// Updated: RFC 3339 date-time when this blog was last updated.
193
Updated string `json:"updated,omitempty"`
195
// Url: The URL where this blog is published.
196
Url string `json:"url,omitempty"`
199
type BlogLocale struct {
200
// Country: The country this blog's locale is set to.
201
Country string `json:"country,omitempty"`
203
// Language: The language this blog is authored in.
204
Language string `json:"language,omitempty"`
206
// Variant: The language variant this blog is authored in.
207
Variant string `json:"variant,omitempty"`
210
type BlogPages struct {
211
// SelfLink: The URL of the container for pages in this blog.
212
SelfLink string `json:"selfLink,omitempty"`
214
// TotalItems: The count of pages in this blog.
215
TotalItems int64 `json:"totalItems,omitempty"`
218
type BlogPosts struct {
219
// Items: The List of Posts for this Blog.
220
Items []*Post `json:"items,omitempty"`
222
// SelfLink: The URL of the container for posts in this blog.
223
SelfLink string `json:"selfLink,omitempty"`
225
// TotalItems: The count of posts in this blog.
226
TotalItems int64 `json:"totalItems,omitempty"`
229
type BlogList struct {
230
// BlogUserInfos: Admin level list of blog per-user information
231
BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"`
233
// Items: The list of Blogs this user has Authorship or Admin rights
235
Items []*Blog `json:"items,omitempty"`
237
// Kind: The kind of this entity. Always blogger#blogList
238
Kind string `json:"kind,omitempty"`
241
type BlogPerUserInfo struct {
242
// BlogId: ID of the Blog resource
243
BlogId string `json:"blogId,omitempty"`
245
// HasAdminAccess: True if the user has Admin level access to the blog.
246
HasAdminAccess bool `json:"hasAdminAccess,omitempty"`
248
// Kind: The kind of this entity. Always blogger#blogPerUserInfo
249
Kind string `json:"kind,omitempty"`
251
// PhotosAlbumKey: The Photo Album Key for the user when adding photos
253
PhotosAlbumKey string `json:"photosAlbumKey,omitempty"`
255
// UserId: ID of the User
256
UserId string `json:"userId,omitempty"`
259
type BlogUserInfo struct {
260
// Blog: The Blog resource.
261
Blog *Blog `json:"blog,omitempty"`
263
// Blog_user_info: Information about a User for the Blog.
264
Blog_user_info *BlogPerUserInfo `json:"blog_user_info,omitempty"`
266
// Kind: The kind of this entity. Always blogger#blogUserInfo
267
Kind string `json:"kind,omitempty"`
270
type Comment struct {
271
// Author: The author of this Comment.
272
Author *CommentAuthor `json:"author,omitempty"`
274
// Blog: Data about the blog containing this comment.
275
Blog *CommentBlog `json:"blog,omitempty"`
277
// Content: The actual content of the comment. May include HTML markup.
278
Content string `json:"content,omitempty"`
280
// Id: The identifier for this resource.
281
Id string `json:"id,omitempty"`
283
// InReplyTo: Data about the comment this is in reply to.
284
InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"`
286
// Kind: The kind of this entry. Always blogger#comment
287
Kind string `json:"kind,omitempty"`
289
// Post: Data about the post containing this comment.
290
Post *CommentPost `json:"post,omitempty"`
292
// Published: RFC 3339 date-time when this comment was published.
293
Published string `json:"published,omitempty"`
295
// SelfLink: The API REST URL to fetch this resource from.
296
SelfLink string `json:"selfLink,omitempty"`
298
// Status: The status of the comment (only populated for admin users)
299
Status string `json:"status,omitempty"`
301
// Updated: RFC 3339 date-time when this comment was last updated.
302
Updated string `json:"updated,omitempty"`
305
type CommentAuthor struct {
306
// DisplayName: The display name.
307
DisplayName string `json:"displayName,omitempty"`
309
// Id: The identifier of the Comment creator.
310
Id string `json:"id,omitempty"`
312
// Image: The comment creator's avatar.
313
Image *CommentAuthorImage `json:"image,omitempty"`
315
// Url: The URL of the Comment creator's Profile page.
316
Url string `json:"url,omitempty"`
319
type CommentAuthorImage struct {
320
// Url: The comment creator's avatar URL.
321
Url string `json:"url,omitempty"`
324
type CommentBlog struct {
325
// Id: The identifier of the blog containing this comment.
326
Id string `json:"id,omitempty"`
329
type CommentInReplyTo struct {
330
// Id: The identified of the parent of this comment.
331
Id string `json:"id,omitempty"`
334
type CommentPost struct {
335
// Id: The identifier of the post containing this comment.
336
Id string `json:"id,omitempty"`
339
type CommentList struct {
340
// Items: The List of Comments for a Post.
341
Items []*Comment `json:"items,omitempty"`
343
// Kind: The kind of this entry. Always blogger#commentList
344
Kind string `json:"kind,omitempty"`
346
// NextPageToken: Pagination token to fetch the next page, if one
348
NextPageToken string `json:"nextPageToken,omitempty"`
350
// PrevPageToken: Pagination token to fetch the previous page, if one
352
PrevPageToken string `json:"prevPageToken,omitempty"`
356
// Author: The author of this Page.
357
Author *PageAuthor `json:"author,omitempty"`
359
// Blog: Data about the blog containing this Page.
360
Blog *PageBlog `json:"blog,omitempty"`
362
// Content: The body content of this Page, in HTML.
363
Content string `json:"content,omitempty"`
365
// Id: The identifier for this resource.
366
Id string `json:"id,omitempty"`
368
// Kind: The kind of this entity. Always blogger#page
369
Kind string `json:"kind,omitempty"`
371
// Published: RFC 3339 date-time when this Page was published.
372
Published string `json:"published,omitempty"`
374
// SelfLink: The API REST URL to fetch this resource from.
375
SelfLink string `json:"selfLink,omitempty"`
377
// Status: The status of the page for admin resources (either LIVE or
379
Status string `json:"status,omitempty"`
381
// Title: The title of this entity. This is the name displayed in the
382
// Admin user interface.
383
Title string `json:"title,omitempty"`
385
// Updated: RFC 3339 date-time when this Page was last updated.
386
Updated string `json:"updated,omitempty"`
388
// Url: The URL that this Page is displayed at.
389
Url string `json:"url,omitempty"`
392
type PageAuthor struct {
393
// DisplayName: The display name.
394
DisplayName string `json:"displayName,omitempty"`
396
// Id: The identifier of the Page creator.
397
Id string `json:"id,omitempty"`
399
// Image: The page author's avatar.
400
Image *PageAuthorImage `json:"image,omitempty"`
402
// Url: The URL of the Page creator's Profile page.
403
Url string `json:"url,omitempty"`
406
type PageAuthorImage struct {
407
// Url: The page author's avatar URL.
408
Url string `json:"url,omitempty"`
411
type PageBlog struct {
412
// Id: The identifier of the blog containing this page.
413
Id string `json:"id,omitempty"`
416
type PageList struct {
417
// Items: The list of Pages for a Blog.
418
Items []*Page `json:"items,omitempty"`
420
// Kind: The kind of this entity. Always blogger#pageList
421
Kind string `json:"kind,omitempty"`
424
type Pageviews struct {
426
BlogId int64 `json:"blogId,omitempty,string"`
428
// Counts: The container of posts in this blog.
429
Counts []*PageviewsCounts `json:"counts,omitempty"`
431
// Kind: The kind of this entry. Always blogger#page_views
432
Kind string `json:"kind,omitempty"`
435
type PageviewsCounts struct {
436
// Count: Count of page views for the given time range
437
Count int64 `json:"count,omitempty,string"`
439
// TimeRange: Time range the given count applies to
440
TimeRange string `json:"timeRange,omitempty"`
444
// Author: The author of this Post.
445
Author *PostAuthor `json:"author,omitempty"`
447
// Blog: Data about the blog containing this Post.
448
Blog *PostBlog `json:"blog,omitempty"`
450
// Content: The content of the Post. May contain HTML markup.
451
Content string `json:"content,omitempty"`
453
// CustomMetaData: The JSON meta-data for the Post.
454
CustomMetaData string `json:"customMetaData,omitempty"`
456
// Id: The identifier of this Post.
457
Id string `json:"id,omitempty"`
459
// Images: Display image for the Post.
460
Images []*PostImages `json:"images,omitempty"`
462
// Kind: The kind of this entity. Always blogger#post
463
Kind string `json:"kind,omitempty"`
465
// Labels: The list of labels this Post was tagged with.
466
Labels []string `json:"labels,omitempty"`
468
// Location: The location for geotagged posts.
469
Location *PostLocation `json:"location,omitempty"`
471
// Published: RFC 3339 date-time when this Post was published.
472
Published string `json:"published,omitempty"`
474
// Replies: The container of comments on this Post.
475
Replies *PostReplies `json:"replies,omitempty"`
477
// SelfLink: The API REST URL to fetch this resource from.
478
SelfLink string `json:"selfLink,omitempty"`
480
// Status: Status of the post. Only set for admin-level requests
481
Status string `json:"status,omitempty"`
483
// Title: The title of the Post.
484
Title string `json:"title,omitempty"`
486
// TitleLink: The title link URL, similar to atom's related link.
487
TitleLink string `json:"titleLink,omitempty"`
489
// Updated: RFC 3339 date-time when this Post was last updated.
490
Updated string `json:"updated,omitempty"`
492
// Url: The URL where this Post is displayed.
493
Url string `json:"url,omitempty"`
496
type PostAuthor struct {
497
// DisplayName: The display name.
498
DisplayName string `json:"displayName,omitempty"`
500
// Id: The identifier of the Post creator.
501
Id string `json:"id,omitempty"`
503
// Image: The Post author's avatar.
504
Image *PostAuthorImage `json:"image,omitempty"`
506
// Url: The URL of the Post creator's Profile page.
507
Url string `json:"url,omitempty"`
510
type PostAuthorImage struct {
511
// Url: The Post author's avatar URL.
512
Url string `json:"url,omitempty"`
515
type PostBlog struct {
516
// Id: The identifier of the Blog that contains this Post.
517
Id string `json:"id,omitempty"`
520
type PostImages struct {
521
Url string `json:"url,omitempty"`
524
type PostLocation struct {
525
// Lat: Location's latitude.
526
Lat float64 `json:"lat,omitempty"`
528
// Lng: Location's longitude.
529
Lng float64 `json:"lng,omitempty"`
531
// Name: Location name.
532
Name string `json:"name,omitempty"`
534
// Span: Location's viewport span. Can be used when rendering a map
536
Span string `json:"span,omitempty"`
539
type PostReplies struct {
540
// Items: The List of Comments for this Post.
541
Items []*Comment `json:"items,omitempty"`
543
// SelfLink: The URL of the comments on this post.
544
SelfLink string `json:"selfLink,omitempty"`
546
// TotalItems: The count of comments on this post.
547
TotalItems int64 `json:"totalItems,omitempty,string"`
550
type PostList struct {
551
// Items: The list of Posts for this Blog.
552
Items []*Post `json:"items,omitempty"`
554
// Kind: The kind of this entity. Always blogger#postList
555
Kind string `json:"kind,omitempty"`
557
// NextPageToken: Pagination token to fetch the next page, if one
559
NextPageToken string `json:"nextPageToken,omitempty"`
562
type PostPerUserInfo struct {
563
// BlogId: ID of the Blog that the post resource belongs to.
564
BlogId string `json:"blogId,omitempty"`
566
// HasEditAccess: True if the user has Author level access to the post.
567
HasEditAccess bool `json:"hasEditAccess,omitempty"`
569
// Kind: The kind of this entity. Always blogger#postPerUserInfo
570
Kind string `json:"kind,omitempty"`
572
// PostId: ID of the Post resource.
573
PostId string `json:"postId,omitempty"`
575
// UserId: ID of the User.
576
UserId string `json:"userId,omitempty"`
579
type PostUserInfo struct {
580
// Kind: The kind of this entity. Always blogger#postUserInfo
581
Kind string `json:"kind,omitempty"`
583
// Post: The Post resource.
584
Post *Post `json:"post,omitempty"`
586
// Post_user_info: Information about a User for the Post.
587
Post_user_info *PostPerUserInfo `json:"post_user_info,omitempty"`
590
type PostUserInfosList struct {
591
// Items: The list of Posts with User information for the post, for this
593
Items []*PostUserInfo `json:"items,omitempty"`
595
// Kind: The kind of this entity. Always blogger#postList
596
Kind string `json:"kind,omitempty"`
598
// NextPageToken: Pagination token to fetch the next page, if one
600
NextPageToken string `json:"nextPageToken,omitempty"`
604
// About: Profile summary information.
605
About string `json:"about,omitempty"`
607
// Blogs: The container of blogs for this user.
608
Blogs *UserBlogs `json:"blogs,omitempty"`
610
// Created: The timestamp of when this profile was created, in seconds
612
Created string `json:"created,omitempty"`
614
// DisplayName: The display name.
615
DisplayName string `json:"displayName,omitempty"`
617
// Id: The identifier for this User.
618
Id string `json:"id,omitempty"`
620
// Kind: The kind of this entity. Always blogger#user
621
Kind string `json:"kind,omitempty"`
623
// Locale: This user's locale
624
Locale *UserLocale `json:"locale,omitempty"`
626
// SelfLink: The API REST URL to fetch this resource from.
627
SelfLink string `json:"selfLink,omitempty"`
629
// Url: The user's profile page.
630
Url string `json:"url,omitempty"`
633
type UserBlogs struct {
634
// SelfLink: The URL of the Blogs for this user.
635
SelfLink string `json:"selfLink,omitempty"`
638
type UserLocale struct {
639
// Country: The user's country setting.
640
Country string `json:"country,omitempty"`
642
// Language: The user's language setting.
643
Language string `json:"language,omitempty"`
645
// Variant: The user's language variant setting.
646
Variant string `json:"variant,omitempty"`
649
// method id "blogger.blogUserInfos.get":
651
type BlogUserInfosGetCall struct {
655
opt_ map[string]interface{}
658
// Get: Gets one blog and user info pair by blogId and userId.
659
func (r *BlogUserInfosService) Get(userId string, blogId string) *BlogUserInfosGetCall {
660
c := &BlogUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})}
666
// MaxPosts sets the optional parameter "maxPosts": Maximum number of
667
// posts to pull back with the blog.
668
func (c *BlogUserInfosGetCall) MaxPosts(maxPosts int64) *BlogUserInfosGetCall {
669
c.opt_["maxPosts"] = maxPosts
673
// Fields allows partial responses to be retrieved.
674
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
675
// for more information.
676
func (c *BlogUserInfosGetCall) Fields(s ...googleapi.Field) *BlogUserInfosGetCall {
677
c.opt_["fields"] = googleapi.CombineFields(s)
681
func (c *BlogUserInfosGetCall) Do() (*BlogUserInfo, error) {
682
var body io.Reader = nil
683
params := make(url.Values)
684
params.Set("alt", "json")
685
if v, ok := c.opt_["maxPosts"]; ok {
686
params.Set("maxPosts", fmt.Sprintf("%v", v))
688
if v, ok := c.opt_["fields"]; ok {
689
params.Set("fields", fmt.Sprintf("%v", v))
691
urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}")
692
urls += "?" + params.Encode()
693
req, _ := http.NewRequest("GET", urls, body)
694
googleapi.Expand(req.URL, map[string]string{
698
req.Header.Set("User-Agent", "google-api-go-client/0.5")
699
res, err := c.s.client.Do(req)
703
defer googleapi.CloseBody(res)
704
if err := googleapi.CheckResponse(res); err != nil {
707
var ret *BlogUserInfo
708
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
713
// "description": "Gets one blog and user info pair by blogId and userId.",
714
// "httpMethod": "GET",
715
// "id": "blogger.blogUserInfos.get",
716
// "parameterOrder": [
722
// "description": "The ID of the blog to get.",
723
// "location": "path",
728
// "description": "Maximum number of posts to pull back with the blog.",
729
// "format": "uint32",
730
// "location": "query",
734
// "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
735
// "location": "path",
740
// "path": "users/{userId}/blogs/{blogId}",
742
// "$ref": "BlogUserInfo"
745
// "https://www.googleapis.com/auth/blogger",
746
// "https://www.googleapis.com/auth/blogger.readonly"
752
// method id "blogger.blogs.get":
754
type BlogsGetCall struct {
757
opt_ map[string]interface{}
760
// Get: Gets one blog by id.
761
func (r *BlogsService) Get(blogId string) *BlogsGetCall {
762
c := &BlogsGetCall{s: r.s, opt_: make(map[string]interface{})}
767
// MaxPosts sets the optional parameter "maxPosts": Maximum number of
768
// posts to pull back with the blog.
769
func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall {
770
c.opt_["maxPosts"] = maxPosts
774
// Fields allows partial responses to be retrieved.
775
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
776
// for more information.
777
func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall {
778
c.opt_["fields"] = googleapi.CombineFields(s)
782
func (c *BlogsGetCall) Do() (*Blog, error) {
783
var body io.Reader = nil
784
params := make(url.Values)
785
params.Set("alt", "json")
786
if v, ok := c.opt_["maxPosts"]; ok {
787
params.Set("maxPosts", fmt.Sprintf("%v", v))
789
if v, ok := c.opt_["fields"]; ok {
790
params.Set("fields", fmt.Sprintf("%v", v))
792
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}")
793
urls += "?" + params.Encode()
794
req, _ := http.NewRequest("GET", urls, body)
795
googleapi.Expand(req.URL, map[string]string{
798
req.Header.Set("User-Agent", "google-api-go-client/0.5")
799
res, err := c.s.client.Do(req)
803
defer googleapi.CloseBody(res)
804
if err := googleapi.CheckResponse(res); err != nil {
808
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
813
// "description": "Gets one blog by id.",
814
// "httpMethod": "GET",
815
// "id": "blogger.blogs.get",
816
// "parameterOrder": [
821
// "description": "The ID of the blog to get.",
822
// "location": "path",
827
// "description": "Maximum number of posts to pull back with the blog.",
828
// "format": "uint32",
829
// "location": "query",
833
// "path": "blogs/{blogId}",
838
// "https://www.googleapis.com/auth/blogger",
839
// "https://www.googleapis.com/auth/blogger.readonly"
845
// method id "blogger.blogs.getByUrl":
847
type BlogsGetByUrlCall struct {
850
opt_ map[string]interface{}
853
// GetByUrl: Retrieve a Blog by URL.
854
func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall {
855
c := &BlogsGetByUrlCall{s: r.s, opt_: make(map[string]interface{})}
860
// Fields allows partial responses to be retrieved.
861
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
862
// for more information.
863
func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall {
864
c.opt_["fields"] = googleapi.CombineFields(s)
868
func (c *BlogsGetByUrlCall) Do() (*Blog, error) {
869
var body io.Reader = nil
870
params := make(url.Values)
871
params.Set("alt", "json")
872
params.Set("url", fmt.Sprintf("%v", c.url))
873
if v, ok := c.opt_["fields"]; ok {
874
params.Set("fields", fmt.Sprintf("%v", v))
876
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl")
877
urls += "?" + params.Encode()
878
req, _ := http.NewRequest("GET", urls, body)
879
googleapi.SetOpaque(req.URL)
880
req.Header.Set("User-Agent", "google-api-go-client/0.5")
881
res, err := c.s.client.Do(req)
885
defer googleapi.CloseBody(res)
886
if err := googleapi.CheckResponse(res); err != nil {
890
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
895
// "description": "Retrieve a Blog by URL.",
896
// "httpMethod": "GET",
897
// "id": "blogger.blogs.getByUrl",
898
// "parameterOrder": [
903
// "description": "The URL of the blog to retrieve.",
904
// "location": "query",
909
// "path": "blogs/byurl",
914
// "https://www.googleapis.com/auth/blogger",
915
// "https://www.googleapis.com/auth/blogger.readonly"
921
// method id "blogger.blogs.listByUser":
923
type BlogsListByUserCall struct {
926
opt_ map[string]interface{}
929
// ListByUser: Retrieves a list of blogs, possibly filtered.
930
func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall {
931
c := &BlogsListByUserCall{s: r.s, opt_: make(map[string]interface{})}
936
// FetchUserInfo sets the optional parameter "fetchUserInfo": Whether
937
// the response is a list of blogs with per-user information instead of
939
func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall {
940
c.opt_["fetchUserInfo"] = fetchUserInfo
944
// View sets the optional parameter "view":
945
func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall {
946
c.opt_["view"] = view
950
// Fields allows partial responses to be retrieved.
951
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
952
// for more information.
953
func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall {
954
c.opt_["fields"] = googleapi.CombineFields(s)
958
func (c *BlogsListByUserCall) Do() (*BlogList, error) {
959
var body io.Reader = nil
960
params := make(url.Values)
961
params.Set("alt", "json")
962
if v, ok := c.opt_["fetchUserInfo"]; ok {
963
params.Set("fetchUserInfo", fmt.Sprintf("%v", v))
965
if v, ok := c.opt_["view"]; ok {
966
params.Set("view", fmt.Sprintf("%v", v))
968
if v, ok := c.opt_["fields"]; ok {
969
params.Set("fields", fmt.Sprintf("%v", v))
971
urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs")
972
urls += "?" + params.Encode()
973
req, _ := http.NewRequest("GET", urls, body)
974
googleapi.Expand(req.URL, map[string]string{
977
req.Header.Set("User-Agent", "google-api-go-client/0.5")
978
res, err := c.s.client.Do(req)
982
defer googleapi.CloseBody(res)
983
if err := googleapi.CheckResponse(res); err != nil {
987
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
992
// "description": "Retrieves a list of blogs, possibly filtered.",
993
// "httpMethod": "GET",
994
// "id": "blogger.blogs.listByUser",
995
// "parameterOrder": [
999
// "fetchUserInfo": {
1000
// "description": "Whether the response is a list of blogs with per-user information instead of just blogs.",
1001
// "location": "query",
1002
// "type": "boolean"
1005
// "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
1006
// "location": "path",
1007
// "required": true,
1016
// "enumDescriptions": [
1017
// "Admin level detail",
1018
// "Author level detail",
1019
// "Admin level detail"
1021
// "location": "query",
1025
// "path": "users/{userId}/blogs",
1027
// "$ref": "BlogList"
1030
// "https://www.googleapis.com/auth/blogger",
1031
// "https://www.googleapis.com/auth/blogger.readonly"
1037
// method id "blogger.comments.approve":
1039
type CommentsApproveCall struct {
1044
opt_ map[string]interface{}
1047
// Approve: Marks a comment as not spam.
1048
func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall {
1049
c := &CommentsApproveCall{s: r.s, opt_: make(map[string]interface{})}
1052
c.commentId = commentId
1056
// Fields allows partial responses to be retrieved.
1057
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1058
// for more information.
1059
func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall {
1060
c.opt_["fields"] = googleapi.CombineFields(s)
1064
func (c *CommentsApproveCall) Do() (*Comment, error) {
1065
var body io.Reader = nil
1066
params := make(url.Values)
1067
params.Set("alt", "json")
1068
if v, ok := c.opt_["fields"]; ok {
1069
params.Set("fields", fmt.Sprintf("%v", v))
1071
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve")
1072
urls += "?" + params.Encode()
1073
req, _ := http.NewRequest("POST", urls, body)
1074
googleapi.Expand(req.URL, map[string]string{
1077
"commentId": c.commentId,
1079
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1080
res, err := c.s.client.Do(req)
1084
defer googleapi.CloseBody(res)
1085
if err := googleapi.CheckResponse(res); err != nil {
1089
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1094
// "description": "Marks a comment as not spam.",
1095
// "httpMethod": "POST",
1096
// "id": "blogger.comments.approve",
1097
// "parameterOrder": [
1104
// "description": "The Id of the Blog.",
1105
// "location": "path",
1106
// "required": true,
1110
// "description": "The ID of the comment to mark as not spam.",
1111
// "location": "path",
1112
// "required": true,
1116
// "description": "The ID of the Post.",
1117
// "location": "path",
1118
// "required": true,
1122
// "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve",
1124
// "$ref": "Comment"
1127
// "https://www.googleapis.com/auth/blogger"
1133
// method id "blogger.comments.delete":
1135
type CommentsDeleteCall struct {
1140
opt_ map[string]interface{}
1143
// Delete: Delete a comment by id.
1144
func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall {
1145
c := &CommentsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
1148
c.commentId = commentId
1152
// Fields allows partial responses to be retrieved.
1153
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1154
// for more information.
1155
func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
1156
c.opt_["fields"] = googleapi.CombineFields(s)
1160
func (c *CommentsDeleteCall) Do() error {
1161
var body io.Reader = nil
1162
params := make(url.Values)
1163
params.Set("alt", "json")
1164
if v, ok := c.opt_["fields"]; ok {
1165
params.Set("fields", fmt.Sprintf("%v", v))
1167
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}")
1168
urls += "?" + params.Encode()
1169
req, _ := http.NewRequest("DELETE", urls, body)
1170
googleapi.Expand(req.URL, map[string]string{
1173
"commentId": c.commentId,
1175
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1176
res, err := c.s.client.Do(req)
1180
defer googleapi.CloseBody(res)
1181
if err := googleapi.CheckResponse(res); err != nil {
1186
// "description": "Delete a comment by id.",
1187
// "httpMethod": "DELETE",
1188
// "id": "blogger.comments.delete",
1189
// "parameterOrder": [
1196
// "description": "The Id of the Blog.",
1197
// "location": "path",
1198
// "required": true,
1202
// "description": "The ID of the comment to delete.",
1203
// "location": "path",
1204
// "required": true,
1208
// "description": "The ID of the Post.",
1209
// "location": "path",
1210
// "required": true,
1214
// "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}",
1216
// "https://www.googleapis.com/auth/blogger"
1222
// method id "blogger.comments.get":
1224
type CommentsGetCall struct {
1229
opt_ map[string]interface{}
1232
// Get: Gets one comment by id.
1233
func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall {
1234
c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})}
1237
c.commentId = commentId
1241
// Fields allows partial responses to be retrieved.
1242
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1243
// for more information.
1244
func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
1245
c.opt_["fields"] = googleapi.CombineFields(s)
1249
func (c *CommentsGetCall) Do() (*Comment, error) {
1250
var body io.Reader = nil
1251
params := make(url.Values)
1252
params.Set("alt", "json")
1253
if v, ok := c.opt_["fields"]; ok {
1254
params.Set("fields", fmt.Sprintf("%v", v))
1256
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}")
1257
urls += "?" + params.Encode()
1258
req, _ := http.NewRequest("GET", urls, body)
1259
googleapi.Expand(req.URL, map[string]string{
1262
"commentId": c.commentId,
1264
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1265
res, err := c.s.client.Do(req)
1269
defer googleapi.CloseBody(res)
1270
if err := googleapi.CheckResponse(res); err != nil {
1274
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1279
// "description": "Gets one comment by id.",
1280
// "httpMethod": "GET",
1281
// "id": "blogger.comments.get",
1282
// "parameterOrder": [
1289
// "description": "ID of the blog to containing the comment.",
1290
// "location": "path",
1291
// "required": true,
1295
// "description": "The ID of the comment to get.",
1296
// "location": "path",
1297
// "required": true,
1301
// "description": "ID of the post to fetch posts from.",
1302
// "location": "path",
1303
// "required": true,
1307
// "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}",
1309
// "$ref": "Comment"
1312
// "https://www.googleapis.com/auth/blogger",
1313
// "https://www.googleapis.com/auth/blogger.readonly"
1319
// method id "blogger.comments.list":
1321
type CommentsListCall struct {
1325
opt_ map[string]interface{}
1328
// List: Retrieves the comments for a post, possibly filtered.
1329
func (r *CommentsService) List(blogId string, postId string) *CommentsListCall {
1330
c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})}
1336
// EndDate sets the optional parameter "endDate": Latest date of comment
1337
// to fetch, a date-time with RFC 3339 formatting.
1338
func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall {
1339
c.opt_["endDate"] = endDate
1343
// FetchBodies sets the optional parameter "fetchBodies": Whether the
1344
// body content of the comments is included.
1345
func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall {
1346
c.opt_["fetchBodies"] = fetchBodies
1350
// MaxResults sets the optional parameter "maxResults": Maximum number
1351
// of comments to include in the result.
1352
func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
1353
c.opt_["maxResults"] = maxResults
1357
// PageToken sets the optional parameter "pageToken": Continuation token
1358
// if request is paged.
1359
func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
1360
c.opt_["pageToken"] = pageToken
1364
// StartDate sets the optional parameter "startDate": Earliest date of
1365
// comment to fetch, a date-time with RFC 3339 formatting.
1366
func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall {
1367
c.opt_["startDate"] = startDate
1371
// Statuses sets the optional parameter "statuses":
1372
func (c *CommentsListCall) Statuses(statuses string) *CommentsListCall {
1373
c.opt_["statuses"] = statuses
1377
// View sets the optional parameter "view":
1378
func (c *CommentsListCall) View(view string) *CommentsListCall {
1379
c.opt_["view"] = view
1383
// Fields allows partial responses to be retrieved.
1384
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1385
// for more information.
1386
func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
1387
c.opt_["fields"] = googleapi.CombineFields(s)
1391
func (c *CommentsListCall) Do() (*CommentList, error) {
1392
var body io.Reader = nil
1393
params := make(url.Values)
1394
params.Set("alt", "json")
1395
if v, ok := c.opt_["endDate"]; ok {
1396
params.Set("endDate", fmt.Sprintf("%v", v))
1398
if v, ok := c.opt_["fetchBodies"]; ok {
1399
params.Set("fetchBodies", fmt.Sprintf("%v", v))
1401
if v, ok := c.opt_["maxResults"]; ok {
1402
params.Set("maxResults", fmt.Sprintf("%v", v))
1404
if v, ok := c.opt_["pageToken"]; ok {
1405
params.Set("pageToken", fmt.Sprintf("%v", v))
1407
if v, ok := c.opt_["startDate"]; ok {
1408
params.Set("startDate", fmt.Sprintf("%v", v))
1410
if v, ok := c.opt_["statuses"]; ok {
1411
params.Set("statuses", fmt.Sprintf("%v", v))
1413
if v, ok := c.opt_["view"]; ok {
1414
params.Set("view", fmt.Sprintf("%v", v))
1416
if v, ok := c.opt_["fields"]; ok {
1417
params.Set("fields", fmt.Sprintf("%v", v))
1419
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments")
1420
urls += "?" + params.Encode()
1421
req, _ := http.NewRequest("GET", urls, body)
1422
googleapi.Expand(req.URL, map[string]string{
1426
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1427
res, err := c.s.client.Do(req)
1431
defer googleapi.CloseBody(res)
1432
if err := googleapi.CheckResponse(res); err != nil {
1435
var ret *CommentList
1436
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1441
// "description": "Retrieves the comments for a post, possibly filtered.",
1442
// "httpMethod": "GET",
1443
// "id": "blogger.comments.list",
1444
// "parameterOrder": [
1450
// "description": "ID of the blog to fetch comments from.",
1451
// "location": "path",
1452
// "required": true,
1456
// "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.",
1457
// "format": "date-time",
1458
// "location": "query",
1462
// "description": "Whether the body content of the comments is included.",
1463
// "location": "query",
1464
// "type": "boolean"
1467
// "description": "Maximum number of comments to include in the result.",
1468
// "format": "uint32",
1469
// "location": "query",
1470
// "type": "integer"
1473
// "description": "Continuation token if request is paged.",
1474
// "location": "query",
1478
// "description": "ID of the post to fetch posts from.",
1479
// "location": "path",
1480
// "required": true,
1484
// "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.",
1485
// "format": "date-time",
1486
// "location": "query",
1496
// "enumDescriptions": [
1497
// "Comments that have had their content removed",
1498
// "Comments that are publicly visible",
1499
// "Comments that are awaiting administrator approval",
1500
// "Comments marked as spam by the administrator"
1502
// "location": "query",
1503
// "repeated": true,
1512
// "enumDescriptions": [
1513
// "Admin level detail",
1514
// "Author level detail",
1515
// "Admin level detail"
1517
// "location": "query",
1521
// "path": "blogs/{blogId}/posts/{postId}/comments",
1523
// "$ref": "CommentList"
1526
// "https://www.googleapis.com/auth/blogger",
1527
// "https://www.googleapis.com/auth/blogger.readonly"
1533
// method id "blogger.comments.listByBlog":
1535
type CommentsListByBlogCall struct {
1538
opt_ map[string]interface{}
1541
// ListByBlog: Retrieves the comments for a blog, across all posts,
1542
// possibly filtered.
1543
func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall {
1544
c := &CommentsListByBlogCall{s: r.s, opt_: make(map[string]interface{})}
1549
// EndDate sets the optional parameter "endDate": Latest date of comment
1550
// to fetch, a date-time with RFC 3339 formatting.
1551
func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall {
1552
c.opt_["endDate"] = endDate
1556
// FetchBodies sets the optional parameter "fetchBodies": Whether the
1557
// body content of the comments is included.
1558
func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall {
1559
c.opt_["fetchBodies"] = fetchBodies
1563
// MaxResults sets the optional parameter "maxResults": Maximum number
1564
// of comments to include in the result.
1565
func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall {
1566
c.opt_["maxResults"] = maxResults
1570
// PageToken sets the optional parameter "pageToken": Continuation token
1571
// if request is paged.
1572
func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall {
1573
c.opt_["pageToken"] = pageToken
1577
// StartDate sets the optional parameter "startDate": Earliest date of
1578
// comment to fetch, a date-time with RFC 3339 formatting.
1579
func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall {
1580
c.opt_["startDate"] = startDate
1584
// Fields allows partial responses to be retrieved.
1585
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1586
// for more information.
1587
func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall {
1588
c.opt_["fields"] = googleapi.CombineFields(s)
1592
func (c *CommentsListByBlogCall) Do() (*CommentList, error) {
1593
var body io.Reader = nil
1594
params := make(url.Values)
1595
params.Set("alt", "json")
1596
if v, ok := c.opt_["endDate"]; ok {
1597
params.Set("endDate", fmt.Sprintf("%v", v))
1599
if v, ok := c.opt_["fetchBodies"]; ok {
1600
params.Set("fetchBodies", fmt.Sprintf("%v", v))
1602
if v, ok := c.opt_["maxResults"]; ok {
1603
params.Set("maxResults", fmt.Sprintf("%v", v))
1605
if v, ok := c.opt_["pageToken"]; ok {
1606
params.Set("pageToken", fmt.Sprintf("%v", v))
1608
if v, ok := c.opt_["startDate"]; ok {
1609
params.Set("startDate", fmt.Sprintf("%v", v))
1611
if v, ok := c.opt_["fields"]; ok {
1612
params.Set("fields", fmt.Sprintf("%v", v))
1614
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments")
1615
urls += "?" + params.Encode()
1616
req, _ := http.NewRequest("GET", urls, body)
1617
googleapi.Expand(req.URL, map[string]string{
1620
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1621
res, err := c.s.client.Do(req)
1625
defer googleapi.CloseBody(res)
1626
if err := googleapi.CheckResponse(res); err != nil {
1629
var ret *CommentList
1630
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1635
// "description": "Retrieves the comments for a blog, across all posts, possibly filtered.",
1636
// "httpMethod": "GET",
1637
// "id": "blogger.comments.listByBlog",
1638
// "parameterOrder": [
1643
// "description": "ID of the blog to fetch comments from.",
1644
// "location": "path",
1645
// "required": true,
1649
// "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.",
1650
// "format": "date-time",
1651
// "location": "query",
1655
// "description": "Whether the body content of the comments is included.",
1656
// "location": "query",
1657
// "type": "boolean"
1660
// "description": "Maximum number of comments to include in the result.",
1661
// "format": "uint32",
1662
// "location": "query",
1663
// "type": "integer"
1666
// "description": "Continuation token if request is paged.",
1667
// "location": "query",
1671
// "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.",
1672
// "format": "date-time",
1673
// "location": "query",
1677
// "path": "blogs/{blogId}/comments",
1679
// "$ref": "CommentList"
1682
// "https://www.googleapis.com/auth/blogger",
1683
// "https://www.googleapis.com/auth/blogger.readonly"
1689
// method id "blogger.comments.markAsSpam":
1691
type CommentsMarkAsSpamCall struct {
1696
opt_ map[string]interface{}
1699
// MarkAsSpam: Marks a comment as spam.
1700
func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall {
1701
c := &CommentsMarkAsSpamCall{s: r.s, opt_: make(map[string]interface{})}
1704
c.commentId = commentId
1708
// Fields allows partial responses to be retrieved.
1709
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1710
// for more information.
1711
func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall {
1712
c.opt_["fields"] = googleapi.CombineFields(s)
1716
func (c *CommentsMarkAsSpamCall) Do() (*Comment, error) {
1717
var body io.Reader = nil
1718
params := make(url.Values)
1719
params.Set("alt", "json")
1720
if v, ok := c.opt_["fields"]; ok {
1721
params.Set("fields", fmt.Sprintf("%v", v))
1723
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam")
1724
urls += "?" + params.Encode()
1725
req, _ := http.NewRequest("POST", urls, body)
1726
googleapi.Expand(req.URL, map[string]string{
1729
"commentId": c.commentId,
1731
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1732
res, err := c.s.client.Do(req)
1736
defer googleapi.CloseBody(res)
1737
if err := googleapi.CheckResponse(res); err != nil {
1741
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1746
// "description": "Marks a comment as spam.",
1747
// "httpMethod": "POST",
1748
// "id": "blogger.comments.markAsSpam",
1749
// "parameterOrder": [
1756
// "description": "The Id of the Blog.",
1757
// "location": "path",
1758
// "required": true,
1762
// "description": "The ID of the comment to mark as spam.",
1763
// "location": "path",
1764
// "required": true,
1768
// "description": "The ID of the Post.",
1769
// "location": "path",
1770
// "required": true,
1774
// "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam",
1776
// "$ref": "Comment"
1779
// "https://www.googleapis.com/auth/blogger"
1785
// method id "blogger.comments.removeContent":
1787
type CommentsRemoveContentCall struct {
1792
opt_ map[string]interface{}
1795
// RemoveContent: Removes the content of a comment.
1796
func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall {
1797
c := &CommentsRemoveContentCall{s: r.s, opt_: make(map[string]interface{})}
1800
c.commentId = commentId
1804
// Fields allows partial responses to be retrieved.
1805
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1806
// for more information.
1807
func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall {
1808
c.opt_["fields"] = googleapi.CombineFields(s)
1812
func (c *CommentsRemoveContentCall) Do() (*Comment, error) {
1813
var body io.Reader = nil
1814
params := make(url.Values)
1815
params.Set("alt", "json")
1816
if v, ok := c.opt_["fields"]; ok {
1817
params.Set("fields", fmt.Sprintf("%v", v))
1819
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent")
1820
urls += "?" + params.Encode()
1821
req, _ := http.NewRequest("POST", urls, body)
1822
googleapi.Expand(req.URL, map[string]string{
1825
"commentId": c.commentId,
1827
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1828
res, err := c.s.client.Do(req)
1832
defer googleapi.CloseBody(res)
1833
if err := googleapi.CheckResponse(res); err != nil {
1837
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1842
// "description": "Removes the content of a comment.",
1843
// "httpMethod": "POST",
1844
// "id": "blogger.comments.removeContent",
1845
// "parameterOrder": [
1852
// "description": "The Id of the Blog.",
1853
// "location": "path",
1854
// "required": true,
1858
// "description": "The ID of the comment to delete content from.",
1859
// "location": "path",
1860
// "required": true,
1864
// "description": "The ID of the Post.",
1865
// "location": "path",
1866
// "required": true,
1870
// "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent",
1872
// "$ref": "Comment"
1875
// "https://www.googleapis.com/auth/blogger"
1881
// method id "blogger.pageViews.get":
1883
type PageViewsGetCall struct {
1886
opt_ map[string]interface{}
1889
// Get: Retrieve pageview stats for a Blog.
1890
func (r *PageViewsService) Get(blogId string) *PageViewsGetCall {
1891
c := &PageViewsGetCall{s: r.s, opt_: make(map[string]interface{})}
1896
// Range sets the optional parameter "range":
1897
func (c *PageViewsGetCall) Range(range_ string) *PageViewsGetCall {
1898
c.opt_["range"] = range_
1902
// Fields allows partial responses to be retrieved.
1903
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1904
// for more information.
1905
func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall {
1906
c.opt_["fields"] = googleapi.CombineFields(s)
1910
func (c *PageViewsGetCall) Do() (*Pageviews, error) {
1911
var body io.Reader = nil
1912
params := make(url.Values)
1913
params.Set("alt", "json")
1914
if v, ok := c.opt_["range"]; ok {
1915
params.Set("range", fmt.Sprintf("%v", v))
1917
if v, ok := c.opt_["fields"]; ok {
1918
params.Set("fields", fmt.Sprintf("%v", v))
1920
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews")
1921
urls += "?" + params.Encode()
1922
req, _ := http.NewRequest("GET", urls, body)
1923
googleapi.Expand(req.URL, map[string]string{
1926
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1927
res, err := c.s.client.Do(req)
1931
defer googleapi.CloseBody(res)
1932
if err := googleapi.CheckResponse(res); err != nil {
1936
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1941
// "description": "Retrieve pageview stats for a Blog.",
1942
// "httpMethod": "GET",
1943
// "id": "blogger.pageViews.get",
1944
// "parameterOrder": [
1949
// "description": "The ID of the blog to get.",
1950
// "location": "path",
1951
// "required": true,
1960
// "enumDescriptions": [
1961
// "Page view counts from the last thirty days.",
1962
// "Page view counts from the last seven days.",
1963
// "Total page view counts from all time."
1965
// "location": "query",
1966
// "repeated": true,
1970
// "path": "blogs/{blogId}/pageviews",
1972
// "$ref": "Pageviews"
1975
// "https://www.googleapis.com/auth/blogger"
1981
// method id "blogger.pages.delete":
1983
type PagesDeleteCall struct {
1987
opt_ map[string]interface{}
1990
// Delete: Delete a page by id.
1991
func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall {
1992
c := &PagesDeleteCall{s: r.s, opt_: make(map[string]interface{})}
1998
// Fields allows partial responses to be retrieved.
1999
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2000
// for more information.
2001
func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall {
2002
c.opt_["fields"] = googleapi.CombineFields(s)
2006
func (c *PagesDeleteCall) Do() error {
2007
var body io.Reader = nil
2008
params := make(url.Values)
2009
params.Set("alt", "json")
2010
if v, ok := c.opt_["fields"]; ok {
2011
params.Set("fields", fmt.Sprintf("%v", v))
2013
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
2014
urls += "?" + params.Encode()
2015
req, _ := http.NewRequest("DELETE", urls, body)
2016
googleapi.Expand(req.URL, map[string]string{
2020
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2021
res, err := c.s.client.Do(req)
2025
defer googleapi.CloseBody(res)
2026
if err := googleapi.CheckResponse(res); err != nil {
2031
// "description": "Delete a page by id.",
2032
// "httpMethod": "DELETE",
2033
// "id": "blogger.pages.delete",
2034
// "parameterOrder": [
2040
// "description": "The Id of the Blog.",
2041
// "location": "path",
2042
// "required": true,
2046
// "description": "The ID of the Page.",
2047
// "location": "path",
2048
// "required": true,
2052
// "path": "blogs/{blogId}/pages/{pageId}",
2054
// "https://www.googleapis.com/auth/blogger"
2060
// method id "blogger.pages.get":
2062
type PagesGetCall struct {
2066
opt_ map[string]interface{}
2069
// Get: Gets one blog page by id.
2070
func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall {
2071
c := &PagesGetCall{s: r.s, opt_: make(map[string]interface{})}
2077
// View sets the optional parameter "view":
2078
func (c *PagesGetCall) View(view string) *PagesGetCall {
2079
c.opt_["view"] = view
2083
// Fields allows partial responses to be retrieved.
2084
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2085
// for more information.
2086
func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall {
2087
c.opt_["fields"] = googleapi.CombineFields(s)
2091
func (c *PagesGetCall) Do() (*Page, error) {
2092
var body io.Reader = nil
2093
params := make(url.Values)
2094
params.Set("alt", "json")
2095
if v, ok := c.opt_["view"]; ok {
2096
params.Set("view", fmt.Sprintf("%v", v))
2098
if v, ok := c.opt_["fields"]; ok {
2099
params.Set("fields", fmt.Sprintf("%v", v))
2101
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
2102
urls += "?" + params.Encode()
2103
req, _ := http.NewRequest("GET", urls, body)
2104
googleapi.Expand(req.URL, map[string]string{
2108
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2109
res, err := c.s.client.Do(req)
2113
defer googleapi.CloseBody(res)
2114
if err := googleapi.CheckResponse(res); err != nil {
2118
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2123
// "description": "Gets one blog page by id.",
2124
// "httpMethod": "GET",
2125
// "id": "blogger.pages.get",
2126
// "parameterOrder": [
2132
// "description": "ID of the blog containing the page.",
2133
// "location": "path",
2134
// "required": true,
2138
// "description": "The ID of the page to get.",
2139
// "location": "path",
2140
// "required": true,
2149
// "enumDescriptions": [
2150
// "Admin level detail",
2151
// "Author level detail",
2152
// "Admin level detail"
2154
// "location": "query",
2158
// "path": "blogs/{blogId}/pages/{pageId}",
2163
// "https://www.googleapis.com/auth/blogger",
2164
// "https://www.googleapis.com/auth/blogger.readonly"
2170
// method id "blogger.pages.insert":
2172
type PagesInsertCall struct {
2176
opt_ map[string]interface{}
2179
// Insert: Add a page.
2180
func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall {
2181
c := &PagesInsertCall{s: r.s, opt_: make(map[string]interface{})}
2187
// Fields allows partial responses to be retrieved.
2188
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2189
// for more information.
2190
func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall {
2191
c.opt_["fields"] = googleapi.CombineFields(s)
2195
func (c *PagesInsertCall) Do() (*Page, error) {
2196
var body io.Reader = nil
2197
body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
2201
ctype := "application/json"
2202
params := make(url.Values)
2203
params.Set("alt", "json")
2204
if v, ok := c.opt_["fields"]; ok {
2205
params.Set("fields", fmt.Sprintf("%v", v))
2207
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages")
2208
urls += "?" + params.Encode()
2209
req, _ := http.NewRequest("POST", urls, body)
2210
googleapi.Expand(req.URL, map[string]string{
2213
req.Header.Set("Content-Type", ctype)
2214
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2215
res, err := c.s.client.Do(req)
2219
defer googleapi.CloseBody(res)
2220
if err := googleapi.CheckResponse(res); err != nil {
2224
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2229
// "description": "Add a page.",
2230
// "httpMethod": "POST",
2231
// "id": "blogger.pages.insert",
2232
// "parameterOrder": [
2237
// "description": "ID of the blog to add the page to.",
2238
// "location": "path",
2239
// "required": true,
2243
// "path": "blogs/{blogId}/pages",
2251
// "https://www.googleapis.com/auth/blogger"
2257
// method id "blogger.pages.list":
2259
type PagesListCall struct {
2262
opt_ map[string]interface{}
2265
// List: Retrieves the pages for a blog, optionally including non-LIVE
2267
func (r *PagesService) List(blogId string) *PagesListCall {
2268
c := &PagesListCall{s: r.s, opt_: make(map[string]interface{})}
2273
// FetchBodies sets the optional parameter "fetchBodies": Whether to
2274
// retrieve the Page bodies.
2275
func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall {
2276
c.opt_["fetchBodies"] = fetchBodies
2280
// Statuses sets the optional parameter "statuses":
2281
func (c *PagesListCall) Statuses(statuses string) *PagesListCall {
2282
c.opt_["statuses"] = statuses
2286
// View sets the optional parameter "view":
2287
func (c *PagesListCall) View(view string) *PagesListCall {
2288
c.opt_["view"] = view
2292
// Fields allows partial responses to be retrieved.
2293
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2294
// for more information.
2295
func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall {
2296
c.opt_["fields"] = googleapi.CombineFields(s)
2300
func (c *PagesListCall) Do() (*PageList, error) {
2301
var body io.Reader = nil
2302
params := make(url.Values)
2303
params.Set("alt", "json")
2304
if v, ok := c.opt_["fetchBodies"]; ok {
2305
params.Set("fetchBodies", fmt.Sprintf("%v", v))
2307
if v, ok := c.opt_["statuses"]; ok {
2308
params.Set("statuses", fmt.Sprintf("%v", v))
2310
if v, ok := c.opt_["view"]; ok {
2311
params.Set("view", fmt.Sprintf("%v", v))
2313
if v, ok := c.opt_["fields"]; ok {
2314
params.Set("fields", fmt.Sprintf("%v", v))
2316
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages")
2317
urls += "?" + params.Encode()
2318
req, _ := http.NewRequest("GET", urls, body)
2319
googleapi.Expand(req.URL, map[string]string{
2322
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2323
res, err := c.s.client.Do(req)
2327
defer googleapi.CloseBody(res)
2328
if err := googleapi.CheckResponse(res); err != nil {
2332
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2337
// "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.",
2338
// "httpMethod": "GET",
2339
// "id": "blogger.pages.list",
2340
// "parameterOrder": [
2345
// "description": "ID of the blog to fetch pages from.",
2346
// "location": "path",
2347
// "required": true,
2351
// "description": "Whether to retrieve the Page bodies.",
2352
// "location": "query",
2353
// "type": "boolean"
2361
// "enumDescriptions": [
2362
// "Draft (unpublished) Pages",
2363
// "Pages that have had their content removed",
2364
// "Pages that are publicly visible"
2366
// "location": "query",
2367
// "repeated": true,
2376
// "enumDescriptions": [
2377
// "Admin level detail",
2378
// "Author level detail",
2379
// "Admin level detail"
2381
// "location": "query",
2385
// "path": "blogs/{blogId}/pages",
2387
// "$ref": "PageList"
2390
// "https://www.googleapis.com/auth/blogger",
2391
// "https://www.googleapis.com/auth/blogger.readonly"
2397
// method id "blogger.pages.patch":
2399
type PagesPatchCall struct {
2404
opt_ map[string]interface{}
2407
// Patch: Update a page. This method supports patch semantics.
2408
func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall {
2409
c := &PagesPatchCall{s: r.s, opt_: make(map[string]interface{})}
2416
// Fields allows partial responses to be retrieved.
2417
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2418
// for more information.
2419
func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall {
2420
c.opt_["fields"] = googleapi.CombineFields(s)
2424
func (c *PagesPatchCall) Do() (*Page, error) {
2425
var body io.Reader = nil
2426
body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
2430
ctype := "application/json"
2431
params := make(url.Values)
2432
params.Set("alt", "json")
2433
if v, ok := c.opt_["fields"]; ok {
2434
params.Set("fields", fmt.Sprintf("%v", v))
2436
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
2437
urls += "?" + params.Encode()
2438
req, _ := http.NewRequest("PATCH", urls, body)
2439
googleapi.Expand(req.URL, map[string]string{
2443
req.Header.Set("Content-Type", ctype)
2444
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2445
res, err := c.s.client.Do(req)
2449
defer googleapi.CloseBody(res)
2450
if err := googleapi.CheckResponse(res); err != nil {
2454
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2459
// "description": "Update a page. This method supports patch semantics.",
2460
// "httpMethod": "PATCH",
2461
// "id": "blogger.pages.patch",
2462
// "parameterOrder": [
2468
// "description": "The ID of the Blog.",
2469
// "location": "path",
2470
// "required": true,
2474
// "description": "The ID of the Page.",
2475
// "location": "path",
2476
// "required": true,
2480
// "path": "blogs/{blogId}/pages/{pageId}",
2488
// "https://www.googleapis.com/auth/blogger"
2494
// method id "blogger.pages.update":
2496
type PagesUpdateCall struct {
2501
opt_ map[string]interface{}
2504
// Update: Update a page.
2505
func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall {
2506
c := &PagesUpdateCall{s: r.s, opt_: make(map[string]interface{})}
2513
// Fields allows partial responses to be retrieved.
2514
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2515
// for more information.
2516
func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall {
2517
c.opt_["fields"] = googleapi.CombineFields(s)
2521
func (c *PagesUpdateCall) Do() (*Page, error) {
2522
var body io.Reader = nil
2523
body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
2527
ctype := "application/json"
2528
params := make(url.Values)
2529
params.Set("alt", "json")
2530
if v, ok := c.opt_["fields"]; ok {
2531
params.Set("fields", fmt.Sprintf("%v", v))
2533
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
2534
urls += "?" + params.Encode()
2535
req, _ := http.NewRequest("PUT", urls, body)
2536
googleapi.Expand(req.URL, map[string]string{
2540
req.Header.Set("Content-Type", ctype)
2541
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2542
res, err := c.s.client.Do(req)
2546
defer googleapi.CloseBody(res)
2547
if err := googleapi.CheckResponse(res); err != nil {
2551
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2556
// "description": "Update a page.",
2557
// "httpMethod": "PUT",
2558
// "id": "blogger.pages.update",
2559
// "parameterOrder": [
2565
// "description": "The ID of the Blog.",
2566
// "location": "path",
2567
// "required": true,
2571
// "description": "The ID of the Page.",
2572
// "location": "path",
2573
// "required": true,
2577
// "path": "blogs/{blogId}/pages/{pageId}",
2585
// "https://www.googleapis.com/auth/blogger"
2591
// method id "blogger.postUserInfos.get":
2593
type PostUserInfosGetCall struct {
2598
opt_ map[string]interface{}
2601
// Get: Gets one post and user info pair by postId and userId.
2602
func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall {
2603
c := &PostUserInfosGetCall{s: r.s, opt_: make(map[string]interface{})}
2610
// MaxComments sets the optional parameter "maxComments": Maximum number
2611
// of comments to pull back on a post.
2612
func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall {
2613
c.opt_["maxComments"] = maxComments
2617
// Fields allows partial responses to be retrieved.
2618
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2619
// for more information.
2620
func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall {
2621
c.opt_["fields"] = googleapi.CombineFields(s)
2625
func (c *PostUserInfosGetCall) Do() (*PostUserInfo, error) {
2626
var body io.Reader = nil
2627
params := make(url.Values)
2628
params.Set("alt", "json")
2629
if v, ok := c.opt_["maxComments"]; ok {
2630
params.Set("maxComments", fmt.Sprintf("%v", v))
2632
if v, ok := c.opt_["fields"]; ok {
2633
params.Set("fields", fmt.Sprintf("%v", v))
2635
urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}")
2636
urls += "?" + params.Encode()
2637
req, _ := http.NewRequest("GET", urls, body)
2638
googleapi.Expand(req.URL, map[string]string{
2643
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2644
res, err := c.s.client.Do(req)
2648
defer googleapi.CloseBody(res)
2649
if err := googleapi.CheckResponse(res); err != nil {
2652
var ret *PostUserInfo
2653
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2658
// "description": "Gets one post and user info pair by postId and userId.",
2659
// "httpMethod": "GET",
2660
// "id": "blogger.postUserInfos.get",
2661
// "parameterOrder": [
2668
// "description": "The ID of the blog.",
2669
// "location": "path",
2670
// "required": true,
2674
// "description": "Maximum number of comments to pull back on a post.",
2675
// "format": "uint32",
2676
// "location": "query",
2677
// "type": "integer"
2680
// "description": "The ID of the post to get.",
2681
// "location": "path",
2682
// "required": true,
2686
// "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
2687
// "location": "path",
2688
// "required": true,
2692
// "path": "users/{userId}/blogs/{blogId}/posts/{postId}",
2694
// "$ref": "PostUserInfo"
2697
// "https://www.googleapis.com/auth/blogger",
2698
// "https://www.googleapis.com/auth/blogger.readonly"
2704
// method id "blogger.postUserInfos.list":
2706
type PostUserInfosListCall struct {
2710
opt_ map[string]interface{}
2713
// List: Retrieves a list of post and user info pairs, possibly
2715
func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall {
2716
c := &PostUserInfosListCall{s: r.s, opt_: make(map[string]interface{})}
2722
// EndDate sets the optional parameter "endDate": Latest post date to
2723
// fetch, a date-time with RFC 3339 formatting.
2724
func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall {
2725
c.opt_["endDate"] = endDate
2729
// FetchBodies sets the optional parameter "fetchBodies": Whether the
2730
// body content of posts is included.
2731
func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall {
2732
c.opt_["fetchBodies"] = fetchBodies
2736
// Labels sets the optional parameter "labels": Comma-separated list of
2737
// labels to search for.
2738
func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall {
2739
c.opt_["labels"] = labels
2743
// MaxResults sets the optional parameter "maxResults": Maximum number
2744
// of posts to fetch.
2745
func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall {
2746
c.opt_["maxResults"] = maxResults
2750
// OrderBy sets the optional parameter "orderBy": Sort search results
2751
func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall {
2752
c.opt_["orderBy"] = orderBy
2756
// PageToken sets the optional parameter "pageToken": Continuation token
2757
// if the request is paged.
2758
func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall {
2759
c.opt_["pageToken"] = pageToken
2763
// StartDate sets the optional parameter "startDate": Earliest post date
2764
// to fetch, a date-time with RFC 3339 formatting.
2765
func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall {
2766
c.opt_["startDate"] = startDate
2770
// Statuses sets the optional parameter "statuses":
2771
func (c *PostUserInfosListCall) Statuses(statuses string) *PostUserInfosListCall {
2772
c.opt_["statuses"] = statuses
2776
// View sets the optional parameter "view":
2777
func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall {
2778
c.opt_["view"] = view
2782
// Fields allows partial responses to be retrieved.
2783
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2784
// for more information.
2785
func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall {
2786
c.opt_["fields"] = googleapi.CombineFields(s)
2790
func (c *PostUserInfosListCall) Do() (*PostUserInfosList, error) {
2791
var body io.Reader = nil
2792
params := make(url.Values)
2793
params.Set("alt", "json")
2794
if v, ok := c.opt_["endDate"]; ok {
2795
params.Set("endDate", fmt.Sprintf("%v", v))
2797
if v, ok := c.opt_["fetchBodies"]; ok {
2798
params.Set("fetchBodies", fmt.Sprintf("%v", v))
2800
if v, ok := c.opt_["labels"]; ok {
2801
params.Set("labels", fmt.Sprintf("%v", v))
2803
if v, ok := c.opt_["maxResults"]; ok {
2804
params.Set("maxResults", fmt.Sprintf("%v", v))
2806
if v, ok := c.opt_["orderBy"]; ok {
2807
params.Set("orderBy", fmt.Sprintf("%v", v))
2809
if v, ok := c.opt_["pageToken"]; ok {
2810
params.Set("pageToken", fmt.Sprintf("%v", v))
2812
if v, ok := c.opt_["startDate"]; ok {
2813
params.Set("startDate", fmt.Sprintf("%v", v))
2815
if v, ok := c.opt_["statuses"]; ok {
2816
params.Set("statuses", fmt.Sprintf("%v", v))
2818
if v, ok := c.opt_["view"]; ok {
2819
params.Set("view", fmt.Sprintf("%v", v))
2821
if v, ok := c.opt_["fields"]; ok {
2822
params.Set("fields", fmt.Sprintf("%v", v))
2824
urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts")
2825
urls += "?" + params.Encode()
2826
req, _ := http.NewRequest("GET", urls, body)
2827
googleapi.Expand(req.URL, map[string]string{
2831
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2832
res, err := c.s.client.Do(req)
2836
defer googleapi.CloseBody(res)
2837
if err := googleapi.CheckResponse(res); err != nil {
2840
var ret *PostUserInfosList
2841
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2846
// "description": "Retrieves a list of post and user info pairs, possibly filtered.",
2847
// "httpMethod": "GET",
2848
// "id": "blogger.postUserInfos.list",
2849
// "parameterOrder": [
2855
// "description": "ID of the blog to fetch posts from.",
2856
// "location": "path",
2857
// "required": true,
2861
// "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.",
2862
// "format": "date-time",
2863
// "location": "query",
2867
// "description": "Whether the body content of posts is included.",
2868
// "location": "query",
2869
// "type": "boolean"
2872
// "description": "Comma-separated list of labels to search for.",
2873
// "location": "query",
2877
// "description": "Maximum number of posts to fetch.",
2878
// "format": "uint32",
2879
// "location": "query",
2880
// "type": "integer"
2883
// "default": "PUBLISHED",
2884
// "description": "Sort search results",
2889
// "enumDescriptions": [
2890
// "Order by the date the post was published",
2891
// "Order by the date the post was last updated"
2893
// "location": "query",
2897
// "description": "Continuation token if the request is paged.",
2898
// "location": "query",
2902
// "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.",
2903
// "format": "date-time",
2904
// "location": "query",
2913
// "enumDescriptions": [
2915
// "Published posts",
2916
// "Posts that are scheduled to publish in future."
2918
// "location": "query",
2919
// "repeated": true,
2923
// "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
2924
// "location": "path",
2925
// "required": true,
2934
// "enumDescriptions": [
2935
// "Admin level detail",
2936
// "Author level detail",
2937
// "Reader level detail"
2939
// "location": "query",
2943
// "path": "users/{userId}/blogs/{blogId}/posts",
2945
// "$ref": "PostUserInfosList"
2948
// "https://www.googleapis.com/auth/blogger",
2949
// "https://www.googleapis.com/auth/blogger.readonly"
2955
// method id "blogger.posts.delete":
2957
type PostsDeleteCall struct {
2961
opt_ map[string]interface{}
2964
// Delete: Delete a post by id.
2965
func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall {
2966
c := &PostsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
2972
// Fields allows partial responses to be retrieved.
2973
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2974
// for more information.
2975
func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall {
2976
c.opt_["fields"] = googleapi.CombineFields(s)
2980
func (c *PostsDeleteCall) Do() error {
2981
var body io.Reader = nil
2982
params := make(url.Values)
2983
params.Set("alt", "json")
2984
if v, ok := c.opt_["fields"]; ok {
2985
params.Set("fields", fmt.Sprintf("%v", v))
2987
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
2988
urls += "?" + params.Encode()
2989
req, _ := http.NewRequest("DELETE", urls, body)
2990
googleapi.Expand(req.URL, map[string]string{
2994
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2995
res, err := c.s.client.Do(req)
2999
defer googleapi.CloseBody(res)
3000
if err := googleapi.CheckResponse(res); err != nil {
3005
// "description": "Delete a post by id.",
3006
// "httpMethod": "DELETE",
3007
// "id": "blogger.posts.delete",
3008
// "parameterOrder": [
3014
// "description": "The Id of the Blog.",
3015
// "location": "path",
3016
// "required": true,
3020
// "description": "The ID of the Post.",
3021
// "location": "path",
3022
// "required": true,
3026
// "path": "blogs/{blogId}/posts/{postId}",
3028
// "https://www.googleapis.com/auth/blogger"
3034
// method id "blogger.posts.get":
3036
type PostsGetCall struct {
3040
opt_ map[string]interface{}
3043
// Get: Get a post by id.
3044
func (r *PostsService) Get(blogId string, postId string) *PostsGetCall {
3045
c := &PostsGetCall{s: r.s, opt_: make(map[string]interface{})}
3051
// MaxComments sets the optional parameter "maxComments": Maximum number
3052
// of comments to pull back on a post.
3053
func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall {
3054
c.opt_["maxComments"] = maxComments
3058
// View sets the optional parameter "view":
3059
func (c *PostsGetCall) View(view string) *PostsGetCall {
3060
c.opt_["view"] = view
3064
// Fields allows partial responses to be retrieved.
3065
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3066
// for more information.
3067
func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall {
3068
c.opt_["fields"] = googleapi.CombineFields(s)
3072
func (c *PostsGetCall) Do() (*Post, error) {
3073
var body io.Reader = nil
3074
params := make(url.Values)
3075
params.Set("alt", "json")
3076
if v, ok := c.opt_["maxComments"]; ok {
3077
params.Set("maxComments", fmt.Sprintf("%v", v))
3079
if v, ok := c.opt_["view"]; ok {
3080
params.Set("view", fmt.Sprintf("%v", v))
3082
if v, ok := c.opt_["fields"]; ok {
3083
params.Set("fields", fmt.Sprintf("%v", v))
3085
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
3086
urls += "?" + params.Encode()
3087
req, _ := http.NewRequest("GET", urls, body)
3088
googleapi.Expand(req.URL, map[string]string{
3092
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3093
res, err := c.s.client.Do(req)
3097
defer googleapi.CloseBody(res)
3098
if err := googleapi.CheckResponse(res); err != nil {
3102
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3107
// "description": "Get a post by id.",
3108
// "httpMethod": "GET",
3109
// "id": "blogger.posts.get",
3110
// "parameterOrder": [
3116
// "description": "ID of the blog to fetch the post from.",
3117
// "location": "path",
3118
// "required": true,
3122
// "description": "Maximum number of comments to pull back on a post.",
3123
// "format": "uint32",
3124
// "location": "query",
3125
// "type": "integer"
3128
// "description": "The ID of the post",
3129
// "location": "path",
3130
// "required": true,
3139
// "enumDescriptions": [
3140
// "Admin level detail",
3141
// "Author level detail",
3142
// "Admin level detail"
3144
// "location": "query",
3148
// "path": "blogs/{blogId}/posts/{postId}",
3153
// "https://www.googleapis.com/auth/blogger",
3154
// "https://www.googleapis.com/auth/blogger.readonly"
3160
// method id "blogger.posts.getByPath":
3162
type PostsGetByPathCall struct {
3166
opt_ map[string]interface{}
3169
// GetByPath: Retrieve a Post by Path.
3170
func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall {
3171
c := &PostsGetByPathCall{s: r.s, opt_: make(map[string]interface{})}
3177
// MaxComments sets the optional parameter "maxComments": Maximum number
3178
// of comments to pull back on a post.
3179
func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall {
3180
c.opt_["maxComments"] = maxComments
3184
// View sets the optional parameter "view":
3185
func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall {
3186
c.opt_["view"] = view
3190
// Fields allows partial responses to be retrieved.
3191
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3192
// for more information.
3193
func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall {
3194
c.opt_["fields"] = googleapi.CombineFields(s)
3198
func (c *PostsGetByPathCall) Do() (*Post, error) {
3199
var body io.Reader = nil
3200
params := make(url.Values)
3201
params.Set("alt", "json")
3202
params.Set("path", fmt.Sprintf("%v", c.path))
3203
if v, ok := c.opt_["maxComments"]; ok {
3204
params.Set("maxComments", fmt.Sprintf("%v", v))
3206
if v, ok := c.opt_["view"]; ok {
3207
params.Set("view", fmt.Sprintf("%v", v))
3209
if v, ok := c.opt_["fields"]; ok {
3210
params.Set("fields", fmt.Sprintf("%v", v))
3212
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath")
3213
urls += "?" + params.Encode()
3214
req, _ := http.NewRequest("GET", urls, body)
3215
googleapi.Expand(req.URL, map[string]string{
3218
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3219
res, err := c.s.client.Do(req)
3223
defer googleapi.CloseBody(res)
3224
if err := googleapi.CheckResponse(res); err != nil {
3228
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3233
// "description": "Retrieve a Post by Path.",
3234
// "httpMethod": "GET",
3235
// "id": "blogger.posts.getByPath",
3236
// "parameterOrder": [
3242
// "description": "ID of the blog to fetch the post from.",
3243
// "location": "path",
3244
// "required": true,
3248
// "description": "Maximum number of comments to pull back on a post.",
3249
// "format": "uint32",
3250
// "location": "query",
3251
// "type": "integer"
3254
// "description": "Path of the Post to retrieve.",
3255
// "location": "query",
3256
// "required": true,
3265
// "enumDescriptions": [
3266
// "Admin level detail",
3267
// "Author level detail",
3268
// "Admin level detail"
3270
// "location": "query",
3274
// "path": "blogs/{blogId}/posts/bypath",
3279
// "https://www.googleapis.com/auth/blogger",
3280
// "https://www.googleapis.com/auth/blogger.readonly"
3286
// method id "blogger.posts.insert":
3288
type PostsInsertCall struct {
3292
opt_ map[string]interface{}
3295
// Insert: Add a post.
3296
func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall {
3297
c := &PostsInsertCall{s: r.s, opt_: make(map[string]interface{})}
3303
// IsDraft sets the optional parameter "isDraft": Whether to create the
3305
func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall {
3306
c.opt_["isDraft"] = isDraft
3310
// Fields allows partial responses to be retrieved.
3311
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3312
// for more information.
3313
func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall {
3314
c.opt_["fields"] = googleapi.CombineFields(s)
3318
func (c *PostsInsertCall) Do() (*Post, error) {
3319
var body io.Reader = nil
3320
body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
3324
ctype := "application/json"
3325
params := make(url.Values)
3326
params.Set("alt", "json")
3327
if v, ok := c.opt_["isDraft"]; ok {
3328
params.Set("isDraft", fmt.Sprintf("%v", v))
3330
if v, ok := c.opt_["fields"]; ok {
3331
params.Set("fields", fmt.Sprintf("%v", v))
3333
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts")
3334
urls += "?" + params.Encode()
3335
req, _ := http.NewRequest("POST", urls, body)
3336
googleapi.Expand(req.URL, map[string]string{
3339
req.Header.Set("Content-Type", ctype)
3340
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3341
res, err := c.s.client.Do(req)
3345
defer googleapi.CloseBody(res)
3346
if err := googleapi.CheckResponse(res); err != nil {
3350
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3355
// "description": "Add a post.",
3356
// "httpMethod": "POST",
3357
// "id": "blogger.posts.insert",
3358
// "parameterOrder": [
3363
// "description": "ID of the blog to add the post to.",
3364
// "location": "path",
3365
// "required": true,
3369
// "description": "Whether to create the post as a draft",
3370
// "location": "query",
3371
// "type": "boolean"
3374
// "path": "blogs/{blogId}/posts",
3382
// "https://www.googleapis.com/auth/blogger"
3388
// method id "blogger.posts.list":
3390
type PostsListCall struct {
3393
opt_ map[string]interface{}
3396
// List: Retrieves a list of posts, possibly filtered.
3397
func (r *PostsService) List(blogId string) *PostsListCall {
3398
c := &PostsListCall{s: r.s, opt_: make(map[string]interface{})}
3403
// EndDate sets the optional parameter "endDate": Latest post date to
3404
// fetch, a date-time with RFC 3339 formatting.
3405
func (c *PostsListCall) EndDate(endDate string) *PostsListCall {
3406
c.opt_["endDate"] = endDate
3410
// FetchBodies sets the optional parameter "fetchBodies": Whether the
3411
// body content of posts is included (default: true). This should be set
3412
// to false when the post bodies are not required, to help minimize
3414
func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall {
3415
c.opt_["fetchBodies"] = fetchBodies
3419
// FetchImages sets the optional parameter "fetchImages": Whether image
3420
// URL metadata for each post is included.
3421
func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall {
3422
c.opt_["fetchImages"] = fetchImages
3426
// Labels sets the optional parameter "labels": Comma-separated list of
3427
// labels to search for.
3428
func (c *PostsListCall) Labels(labels string) *PostsListCall {
3429
c.opt_["labels"] = labels
3433
// MaxResults sets the optional parameter "maxResults": Maximum number
3434
// of posts to fetch.
3435
func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall {
3436
c.opt_["maxResults"] = maxResults
3440
// OrderBy sets the optional parameter "orderBy": Sort search results
3441
func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall {
3442
c.opt_["orderBy"] = orderBy
3446
// PageToken sets the optional parameter "pageToken": Continuation token
3447
// if the request is paged.
3448
func (c *PostsListCall) PageToken(pageToken string) *PostsListCall {
3449
c.opt_["pageToken"] = pageToken
3453
// StartDate sets the optional parameter "startDate": Earliest post date
3454
// to fetch, a date-time with RFC 3339 formatting.
3455
func (c *PostsListCall) StartDate(startDate string) *PostsListCall {
3456
c.opt_["startDate"] = startDate
3460
// Statuses sets the optional parameter "statuses":
3461
func (c *PostsListCall) Statuses(statuses string) *PostsListCall {
3462
c.opt_["statuses"] = statuses
3466
// View sets the optional parameter "view":
3467
func (c *PostsListCall) View(view string) *PostsListCall {
3468
c.opt_["view"] = view
3472
// Fields allows partial responses to be retrieved.
3473
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3474
// for more information.
3475
func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall {
3476
c.opt_["fields"] = googleapi.CombineFields(s)
3480
func (c *PostsListCall) Do() (*PostList, error) {
3481
var body io.Reader = nil
3482
params := make(url.Values)
3483
params.Set("alt", "json")
3484
if v, ok := c.opt_["endDate"]; ok {
3485
params.Set("endDate", fmt.Sprintf("%v", v))
3487
if v, ok := c.opt_["fetchBodies"]; ok {
3488
params.Set("fetchBodies", fmt.Sprintf("%v", v))
3490
if v, ok := c.opt_["fetchImages"]; ok {
3491
params.Set("fetchImages", fmt.Sprintf("%v", v))
3493
if v, ok := c.opt_["labels"]; ok {
3494
params.Set("labels", fmt.Sprintf("%v", v))
3496
if v, ok := c.opt_["maxResults"]; ok {
3497
params.Set("maxResults", fmt.Sprintf("%v", v))
3499
if v, ok := c.opt_["orderBy"]; ok {
3500
params.Set("orderBy", fmt.Sprintf("%v", v))
3502
if v, ok := c.opt_["pageToken"]; ok {
3503
params.Set("pageToken", fmt.Sprintf("%v", v))
3505
if v, ok := c.opt_["startDate"]; ok {
3506
params.Set("startDate", fmt.Sprintf("%v", v))
3508
if v, ok := c.opt_["statuses"]; ok {
3509
params.Set("statuses", fmt.Sprintf("%v", v))
3511
if v, ok := c.opt_["view"]; ok {
3512
params.Set("view", fmt.Sprintf("%v", v))
3514
if v, ok := c.opt_["fields"]; ok {
3515
params.Set("fields", fmt.Sprintf("%v", v))
3517
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts")
3518
urls += "?" + params.Encode()
3519
req, _ := http.NewRequest("GET", urls, body)
3520
googleapi.Expand(req.URL, map[string]string{
3523
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3524
res, err := c.s.client.Do(req)
3528
defer googleapi.CloseBody(res)
3529
if err := googleapi.CheckResponse(res); err != nil {
3533
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3538
// "description": "Retrieves a list of posts, possibly filtered.",
3539
// "httpMethod": "GET",
3540
// "id": "blogger.posts.list",
3541
// "parameterOrder": [
3546
// "description": "ID of the blog to fetch posts from.",
3547
// "location": "path",
3548
// "required": true,
3552
// "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.",
3553
// "format": "date-time",
3554
// "location": "query",
3558
// "default": "true",
3559
// "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.",
3560
// "location": "query",
3561
// "type": "boolean"
3564
// "description": "Whether image URL metadata for each post is included.",
3565
// "location": "query",
3566
// "type": "boolean"
3569
// "description": "Comma-separated list of labels to search for.",
3570
// "location": "query",
3574
// "description": "Maximum number of posts to fetch.",
3575
// "format": "uint32",
3576
// "location": "query",
3577
// "type": "integer"
3580
// "default": "PUBLISHED",
3581
// "description": "Sort search results",
3586
// "enumDescriptions": [
3587
// "Order by the date the post was published",
3588
// "Order by the date the post was last updated"
3590
// "location": "query",
3594
// "description": "Continuation token if the request is paged.",
3595
// "location": "query",
3599
// "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.",
3600
// "format": "date-time",
3601
// "location": "query",
3610
// "enumDescriptions": [
3612
// "Published posts",
3613
// "Posts that are scheduled to publish in future."
3615
// "location": "query",
3616
// "repeated": true,
3625
// "enumDescriptions": [
3626
// "Admin level detail",
3627
// "Author level detail",
3628
// "Reader level detail"
3630
// "location": "query",
3634
// "path": "blogs/{blogId}/posts",
3636
// "$ref": "PostList"
3639
// "https://www.googleapis.com/auth/blogger",
3640
// "https://www.googleapis.com/auth/blogger.readonly"
3646
// method id "blogger.posts.patch":
3648
type PostsPatchCall struct {
3653
opt_ map[string]interface{}
3656
// Patch: Update a post. This method supports patch semantics.
3657
func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall {
3658
c := &PostsPatchCall{s: r.s, opt_: make(map[string]interface{})}
3665
// Fields allows partial responses to be retrieved.
3666
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3667
// for more information.
3668
func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall {
3669
c.opt_["fields"] = googleapi.CombineFields(s)
3673
func (c *PostsPatchCall) Do() (*Post, error) {
3674
var body io.Reader = nil
3675
body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
3679
ctype := "application/json"
3680
params := make(url.Values)
3681
params.Set("alt", "json")
3682
if v, ok := c.opt_["fields"]; ok {
3683
params.Set("fields", fmt.Sprintf("%v", v))
3685
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
3686
urls += "?" + params.Encode()
3687
req, _ := http.NewRequest("PATCH", urls, body)
3688
googleapi.Expand(req.URL, map[string]string{
3692
req.Header.Set("Content-Type", ctype)
3693
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3694
res, err := c.s.client.Do(req)
3698
defer googleapi.CloseBody(res)
3699
if err := googleapi.CheckResponse(res); err != nil {
3703
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3708
// "description": "Update a post. This method supports patch semantics.",
3709
// "httpMethod": "PATCH",
3710
// "id": "blogger.posts.patch",
3711
// "parameterOrder": [
3717
// "description": "The ID of the Blog.",
3718
// "location": "path",
3719
// "required": true,
3723
// "description": "The ID of the Post.",
3724
// "location": "path",
3725
// "required": true,
3729
// "path": "blogs/{blogId}/posts/{postId}",
3737
// "https://www.googleapis.com/auth/blogger"
3743
// method id "blogger.posts.publish":
3745
type PostsPublishCall struct {
3749
opt_ map[string]interface{}
3752
// Publish: Publish a draft post.
3753
func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall {
3754
c := &PostsPublishCall{s: r.s, opt_: make(map[string]interface{})}
3760
// PublishDate sets the optional parameter "publishDate": The date and
3761
// time to schedule the publishing of the Blog.
3762
func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall {
3763
c.opt_["publishDate"] = publishDate
3767
// Fields allows partial responses to be retrieved.
3768
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3769
// for more information.
3770
func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall {
3771
c.opt_["fields"] = googleapi.CombineFields(s)
3775
func (c *PostsPublishCall) Do() (*Post, error) {
3776
var body io.Reader = nil
3777
params := make(url.Values)
3778
params.Set("alt", "json")
3779
if v, ok := c.opt_["publishDate"]; ok {
3780
params.Set("publishDate", fmt.Sprintf("%v", v))
3782
if v, ok := c.opt_["fields"]; ok {
3783
params.Set("fields", fmt.Sprintf("%v", v))
3785
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish")
3786
urls += "?" + params.Encode()
3787
req, _ := http.NewRequest("POST", urls, body)
3788
googleapi.Expand(req.URL, map[string]string{
3792
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3793
res, err := c.s.client.Do(req)
3797
defer googleapi.CloseBody(res)
3798
if err := googleapi.CheckResponse(res); err != nil {
3802
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3807
// "description": "Publish a draft post.",
3808
// "httpMethod": "POST",
3809
// "id": "blogger.posts.publish",
3810
// "parameterOrder": [
3816
// "description": "The ID of the Blog.",
3817
// "location": "path",
3818
// "required": true,
3822
// "description": "The ID of the Post.",
3823
// "location": "path",
3824
// "required": true,
3828
// "description": "The date and time to schedule the publishing of the Blog.",
3829
// "format": "date-time",
3830
// "location": "query",
3834
// "path": "blogs/{blogId}/posts/{postId}/publish",
3839
// "https://www.googleapis.com/auth/blogger"
3845
// method id "blogger.posts.revert":
3847
type PostsRevertCall struct {
3851
opt_ map[string]interface{}
3854
// Revert: Revert a published or scheduled post to draft state.
3855
func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall {
3856
c := &PostsRevertCall{s: r.s, opt_: make(map[string]interface{})}
3862
// Fields allows partial responses to be retrieved.
3863
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3864
// for more information.
3865
func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall {
3866
c.opt_["fields"] = googleapi.CombineFields(s)
3870
func (c *PostsRevertCall) Do() (*Post, error) {
3871
var body io.Reader = nil
3872
params := make(url.Values)
3873
params.Set("alt", "json")
3874
if v, ok := c.opt_["fields"]; ok {
3875
params.Set("fields", fmt.Sprintf("%v", v))
3877
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert")
3878
urls += "?" + params.Encode()
3879
req, _ := http.NewRequest("POST", urls, body)
3880
googleapi.Expand(req.URL, map[string]string{
3884
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3885
res, err := c.s.client.Do(req)
3889
defer googleapi.CloseBody(res)
3890
if err := googleapi.CheckResponse(res); err != nil {
3894
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3899
// "description": "Revert a published or scheduled post to draft state.",
3900
// "httpMethod": "POST",
3901
// "id": "blogger.posts.revert",
3902
// "parameterOrder": [
3908
// "description": "The ID of the Blog.",
3909
// "location": "path",
3910
// "required": true,
3914
// "description": "The ID of the Post.",
3915
// "location": "path",
3916
// "required": true,
3920
// "path": "blogs/{blogId}/posts/{postId}/revert",
3925
// "https://www.googleapis.com/auth/blogger"
3931
// method id "blogger.posts.search":
3933
type PostsSearchCall struct {
3937
opt_ map[string]interface{}
3940
// Search: Search for a post.
3941
func (r *PostsService) Search(blogId string, q string) *PostsSearchCall {
3942
c := &PostsSearchCall{s: r.s, opt_: make(map[string]interface{})}
3948
// FetchBodies sets the optional parameter "fetchBodies": Whether the
3949
// body content of posts is included (default: true). This should be set
3950
// to false when the post bodies are not required, to help minimize
3952
func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall {
3953
c.opt_["fetchBodies"] = fetchBodies
3957
// OrderBy sets the optional parameter "orderBy": Sort search results
3958
func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall {
3959
c.opt_["orderBy"] = orderBy
3963
// Fields allows partial responses to be retrieved.
3964
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3965
// for more information.
3966
func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall {
3967
c.opt_["fields"] = googleapi.CombineFields(s)
3971
func (c *PostsSearchCall) Do() (*PostList, error) {
3972
var body io.Reader = nil
3973
params := make(url.Values)
3974
params.Set("alt", "json")
3975
params.Set("q", fmt.Sprintf("%v", c.q))
3976
if v, ok := c.opt_["fetchBodies"]; ok {
3977
params.Set("fetchBodies", fmt.Sprintf("%v", v))
3979
if v, ok := c.opt_["orderBy"]; ok {
3980
params.Set("orderBy", fmt.Sprintf("%v", v))
3982
if v, ok := c.opt_["fields"]; ok {
3983
params.Set("fields", fmt.Sprintf("%v", v))
3985
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search")
3986
urls += "?" + params.Encode()
3987
req, _ := http.NewRequest("GET", urls, body)
3988
googleapi.Expand(req.URL, map[string]string{
3991
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3992
res, err := c.s.client.Do(req)
3996
defer googleapi.CloseBody(res)
3997
if err := googleapi.CheckResponse(res); err != nil {
4001
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4006
// "description": "Search for a post.",
4007
// "httpMethod": "GET",
4008
// "id": "blogger.posts.search",
4009
// "parameterOrder": [
4015
// "description": "ID of the blog to fetch the post from.",
4016
// "location": "path",
4017
// "required": true,
4021
// "default": "true",
4022
// "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.",
4023
// "location": "query",
4024
// "type": "boolean"
4027
// "default": "PUBLISHED",
4028
// "description": "Sort search results",
4033
// "enumDescriptions": [
4034
// "Order by the date the post was published",
4035
// "Order by the date the post was last updated"
4037
// "location": "query",
4041
// "description": "Query terms to search this blog for matching posts.",
4042
// "location": "query",
4043
// "required": true,
4047
// "path": "blogs/{blogId}/posts/search",
4049
// "$ref": "PostList"
4052
// "https://www.googleapis.com/auth/blogger",
4053
// "https://www.googleapis.com/auth/blogger.readonly"
4059
// method id "blogger.posts.update":
4061
type PostsUpdateCall struct {
4066
opt_ map[string]interface{}
4069
// Update: Update a post.
4070
func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall {
4071
c := &PostsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
4078
// Fields allows partial responses to be retrieved.
4079
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4080
// for more information.
4081
func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall {
4082
c.opt_["fields"] = googleapi.CombineFields(s)
4086
func (c *PostsUpdateCall) Do() (*Post, error) {
4087
var body io.Reader = nil
4088
body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
4092
ctype := "application/json"
4093
params := make(url.Values)
4094
params.Set("alt", "json")
4095
if v, ok := c.opt_["fields"]; ok {
4096
params.Set("fields", fmt.Sprintf("%v", v))
4098
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
4099
urls += "?" + params.Encode()
4100
req, _ := http.NewRequest("PUT", urls, body)
4101
googleapi.Expand(req.URL, map[string]string{
4105
req.Header.Set("Content-Type", ctype)
4106
req.Header.Set("User-Agent", "google-api-go-client/0.5")
4107
res, err := c.s.client.Do(req)
4111
defer googleapi.CloseBody(res)
4112
if err := googleapi.CheckResponse(res); err != nil {
4116
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4121
// "description": "Update a post.",
4122
// "httpMethod": "PUT",
4123
// "id": "blogger.posts.update",
4124
// "parameterOrder": [
4130
// "description": "The ID of the Blog.",
4131
// "location": "path",
4132
// "required": true,
4136
// "description": "The ID of the Post.",
4137
// "location": "path",
4138
// "required": true,
4142
// "path": "blogs/{blogId}/posts/{postId}",
4150
// "https://www.googleapis.com/auth/blogger"
4156
// method id "blogger.users.get":
4158
type UsersGetCall struct {
4161
opt_ map[string]interface{}
4164
// Get: Gets one user by id.
4165
func (r *UsersService) Get(userId string) *UsersGetCall {
4166
c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})}
4171
// Fields allows partial responses to be retrieved.
4172
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4173
// for more information.
4174
func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
4175
c.opt_["fields"] = googleapi.CombineFields(s)
4179
func (c *UsersGetCall) Do() (*User, error) {
4180
var body io.Reader = nil
4181
params := make(url.Values)
4182
params.Set("alt", "json")
4183
if v, ok := c.opt_["fields"]; ok {
4184
params.Set("fields", fmt.Sprintf("%v", v))
4186
urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}")
4187
urls += "?" + params.Encode()
4188
req, _ := http.NewRequest("GET", urls, body)
4189
googleapi.Expand(req.URL, map[string]string{
4192
req.Header.Set("User-Agent", "google-api-go-client/0.5")
4193
res, err := c.s.client.Do(req)
4197
defer googleapi.CloseBody(res)
4198
if err := googleapi.CheckResponse(res); err != nil {
4202
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4207
// "description": "Gets one user by id.",
4208
// "httpMethod": "GET",
4209
// "id": "blogger.users.get",
4210
// "parameterOrder": [
4215
// "description": "The ID of the user to get.",
4216
// "location": "path",
4217
// "required": true,
4221
// "path": "users/{userId}",
4226
// "https://www.googleapis.com/auth/blogger",
4227
// "https://www.googleapis.com/auth/blogger.readonly"