1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package blogger
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "blogger:v3"
95 const apiName = "blogger"
96 const apiVersion = "v3"
97 const basePath = "https://blogger.googleapis.com/"
98 const basePathTemplate = "https://blogger.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://blogger.mtls.googleapis.com/"
100
101
102 const (
103
104 BloggerScope = "https://www.googleapis.com/auth/blogger"
105
106
107 BloggerReadonlyScope = "https://www.googleapis.com/auth/blogger.readonly"
108 )
109
110
111 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
112 scopesOption := internaloption.WithDefaultScopes(
113 "https://www.googleapis.com/auth/blogger",
114 "https://www.googleapis.com/auth/blogger.readonly",
115 )
116
117 opts = append([]option.ClientOption{scopesOption}, opts...)
118 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
119 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
120 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
121 opts = append(opts, internaloption.EnableNewAuthLibrary())
122 client, endpoint, err := htransport.NewClient(ctx, opts...)
123 if err != nil {
124 return nil, err
125 }
126 s, err := New(client)
127 if err != nil {
128 return nil, err
129 }
130 if endpoint != "" {
131 s.BasePath = endpoint
132 }
133 return s, nil
134 }
135
136
137
138
139
140
141 func New(client *http.Client) (*Service, error) {
142 if client == nil {
143 return nil, errors.New("client is nil")
144 }
145 s := &Service{client: client, BasePath: basePath}
146 s.BlogUserInfos = NewBlogUserInfosService(s)
147 s.Blogs = NewBlogsService(s)
148 s.Comments = NewCommentsService(s)
149 s.PageViews = NewPageViewsService(s)
150 s.Pages = NewPagesService(s)
151 s.PostUserInfos = NewPostUserInfosService(s)
152 s.Posts = NewPostsService(s)
153 s.Users = NewUsersService(s)
154 return s, nil
155 }
156
157 type Service struct {
158 client *http.Client
159 BasePath string
160 UserAgent string
161
162 BlogUserInfos *BlogUserInfosService
163
164 Blogs *BlogsService
165
166 Comments *CommentsService
167
168 PageViews *PageViewsService
169
170 Pages *PagesService
171
172 PostUserInfos *PostUserInfosService
173
174 Posts *PostsService
175
176 Users *UsersService
177 }
178
179 func (s *Service) userAgent() string {
180 if s.UserAgent == "" {
181 return googleapi.UserAgent
182 }
183 return googleapi.UserAgent + " " + s.UserAgent
184 }
185
186 func NewBlogUserInfosService(s *Service) *BlogUserInfosService {
187 rs := &BlogUserInfosService{s: s}
188 return rs
189 }
190
191 type BlogUserInfosService struct {
192 s *Service
193 }
194
195 func NewBlogsService(s *Service) *BlogsService {
196 rs := &BlogsService{s: s}
197 return rs
198 }
199
200 type BlogsService struct {
201 s *Service
202 }
203
204 func NewCommentsService(s *Service) *CommentsService {
205 rs := &CommentsService{s: s}
206 return rs
207 }
208
209 type CommentsService struct {
210 s *Service
211 }
212
213 func NewPageViewsService(s *Service) *PageViewsService {
214 rs := &PageViewsService{s: s}
215 return rs
216 }
217
218 type PageViewsService struct {
219 s *Service
220 }
221
222 func NewPagesService(s *Service) *PagesService {
223 rs := &PagesService{s: s}
224 return rs
225 }
226
227 type PagesService struct {
228 s *Service
229 }
230
231 func NewPostUserInfosService(s *Service) *PostUserInfosService {
232 rs := &PostUserInfosService{s: s}
233 return rs
234 }
235
236 type PostUserInfosService struct {
237 s *Service
238 }
239
240 func NewPostsService(s *Service) *PostsService {
241 rs := &PostsService{s: s}
242 return rs
243 }
244
245 type PostsService struct {
246 s *Service
247 }
248
249 func NewUsersService(s *Service) *UsersService {
250 rs := &UsersService{s: s}
251 return rs
252 }
253
254 type UsersService struct {
255 s *Service
256 }
257
258 type Blog struct {
259
260 CustomMetaData string `json:"customMetaData,omitempty"`
261
262
263 Description string `json:"description,omitempty"`
264
265 Id string `json:"id,omitempty"`
266
267 Kind string `json:"kind,omitempty"`
268
269 Locale *BlogLocale `json:"locale,omitempty"`
270
271 Name string `json:"name,omitempty"`
272
273 Pages *BlogPages `json:"pages,omitempty"`
274
275 Posts *BlogPosts `json:"posts,omitempty"`
276
277 Published string `json:"published,omitempty"`
278
279 SelfLink string `json:"selfLink,omitempty"`
280
281
282
283
284
285 Status string `json:"status,omitempty"`
286
287 Updated string `json:"updated,omitempty"`
288
289 Url string `json:"url,omitempty"`
290
291
292 googleapi.ServerResponse `json:"-"`
293
294
295
296
297
298 ForceSendFields []string `json:"-"`
299
300
301
302
303 NullFields []string `json:"-"`
304 }
305
306 func (s *Blog) MarshalJSON() ([]byte, error) {
307 type NoMethod Blog
308 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
309 }
310
311
312 type BlogLocale struct {
313
314 Country string `json:"country,omitempty"`
315
316 Language string `json:"language,omitempty"`
317
318 Variant string `json:"variant,omitempty"`
319
320
321
322
323
324 ForceSendFields []string `json:"-"`
325
326
327
328
329 NullFields []string `json:"-"`
330 }
331
332 func (s *BlogLocale) MarshalJSON() ([]byte, error) {
333 type NoMethod BlogLocale
334 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
335 }
336
337
338 type BlogPages struct {
339
340 SelfLink string `json:"selfLink,omitempty"`
341
342 TotalItems int64 `json:"totalItems,omitempty"`
343
344
345
346
347
348 ForceSendFields []string `json:"-"`
349
350
351
352
353 NullFields []string `json:"-"`
354 }
355
356 func (s *BlogPages) MarshalJSON() ([]byte, error) {
357 type NoMethod BlogPages
358 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
359 }
360
361
362 type BlogPosts struct {
363
364 Items []*Post `json:"items,omitempty"`
365
366 SelfLink string `json:"selfLink,omitempty"`
367
368 TotalItems int64 `json:"totalItems,omitempty"`
369
370
371
372
373
374 ForceSendFields []string `json:"-"`
375
376
377
378
379 NullFields []string `json:"-"`
380 }
381
382 func (s *BlogPosts) MarshalJSON() ([]byte, error) {
383 type NoMethod BlogPosts
384 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
385 }
386
387 type BlogList struct {
388
389 BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"`
390
391 Items []*Blog `json:"items,omitempty"`
392
393 Kind string `json:"kind,omitempty"`
394
395
396 googleapi.ServerResponse `json:"-"`
397
398
399
400
401
402 ForceSendFields []string `json:"-"`
403
404
405
406
407 NullFields []string `json:"-"`
408 }
409
410 func (s *BlogList) MarshalJSON() ([]byte, error) {
411 type NoMethod BlogList
412 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
413 }
414
415 type BlogPerUserInfo struct {
416
417 BlogId string `json:"blogId,omitempty"`
418
419 HasAdminAccess bool `json:"hasAdminAccess,omitempty"`
420
421 Kind string `json:"kind,omitempty"`
422
423
424 PhotosAlbumKey string `json:"photosAlbumKey,omitempty"`
425
426
427
428
429
430
431
432
433 Role string `json:"role,omitempty"`
434
435 UserId string `json:"userId,omitempty"`
436
437
438
439
440
441 ForceSendFields []string `json:"-"`
442
443
444
445
446 NullFields []string `json:"-"`
447 }
448
449 func (s *BlogPerUserInfo) MarshalJSON() ([]byte, error) {
450 type NoMethod BlogPerUserInfo
451 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
452 }
453
454 type BlogUserInfo struct {
455
456 Blog *Blog `json:"blog,omitempty"`
457
458 BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"`
459
460 Kind string `json:"kind,omitempty"`
461
462
463 googleapi.ServerResponse `json:"-"`
464
465
466
467
468
469 ForceSendFields []string `json:"-"`
470
471
472
473
474 NullFields []string `json:"-"`
475 }
476
477 func (s *BlogUserInfo) MarshalJSON() ([]byte, error) {
478 type NoMethod BlogUserInfo
479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
480 }
481
482 type Comment struct {
483
484 Author *CommentAuthor `json:"author,omitempty"`
485
486 Blog *CommentBlog `json:"blog,omitempty"`
487
488 Content string `json:"content,omitempty"`
489
490 Id string `json:"id,omitempty"`
491
492 InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"`
493
494 Kind string `json:"kind,omitempty"`
495
496 Post *CommentPost `json:"post,omitempty"`
497
498 Published string `json:"published,omitempty"`
499
500 SelfLink string `json:"selfLink,omitempty"`
501
502
503
504
505
506
507
508 Status string `json:"status,omitempty"`
509
510 Updated string `json:"updated,omitempty"`
511
512
513 googleapi.ServerResponse `json:"-"`
514
515
516
517
518
519 ForceSendFields []string `json:"-"`
520
521
522
523
524 NullFields []string `json:"-"`
525 }
526
527 func (s *Comment) MarshalJSON() ([]byte, error) {
528 type NoMethod Comment
529 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
530 }
531
532
533 type CommentAuthor struct {
534
535 DisplayName string `json:"displayName,omitempty"`
536
537 Id string `json:"id,omitempty"`
538
539 Image *CommentAuthorImage `json:"image,omitempty"`
540
541 Url string `json:"url,omitempty"`
542
543
544
545
546
547 ForceSendFields []string `json:"-"`
548
549
550
551
552 NullFields []string `json:"-"`
553 }
554
555 func (s *CommentAuthor) MarshalJSON() ([]byte, error) {
556 type NoMethod CommentAuthor
557 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
558 }
559
560
561 type CommentAuthorImage struct {
562
563 Url string `json:"url,omitempty"`
564
565
566
567
568
569 ForceSendFields []string `json:"-"`
570
571
572
573
574 NullFields []string `json:"-"`
575 }
576
577 func (s *CommentAuthorImage) MarshalJSON() ([]byte, error) {
578 type NoMethod CommentAuthorImage
579 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
580 }
581
582
583 type CommentBlog struct {
584
585 Id string `json:"id,omitempty"`
586
587
588
589
590
591 ForceSendFields []string `json:"-"`
592
593
594
595
596 NullFields []string `json:"-"`
597 }
598
599 func (s *CommentBlog) MarshalJSON() ([]byte, error) {
600 type NoMethod CommentBlog
601 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
602 }
603
604
605 type CommentInReplyTo struct {
606
607 Id string `json:"id,omitempty"`
608
609
610
611
612
613 ForceSendFields []string `json:"-"`
614
615
616
617
618 NullFields []string `json:"-"`
619 }
620
621 func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) {
622 type NoMethod CommentInReplyTo
623 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
624 }
625
626
627 type CommentPost struct {
628
629 Id string `json:"id,omitempty"`
630
631
632
633
634
635 ForceSendFields []string `json:"-"`
636
637
638
639
640 NullFields []string `json:"-"`
641 }
642
643 func (s *CommentPost) MarshalJSON() ([]byte, error) {
644 type NoMethod CommentPost
645 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
646 }
647
648 type CommentList struct {
649
650 Etag string `json:"etag,omitempty"`
651
652 Items []*Comment `json:"items,omitempty"`
653
654 Kind string `json:"kind,omitempty"`
655
656 NextPageToken string `json:"nextPageToken,omitempty"`
657
658 PrevPageToken string `json:"prevPageToken,omitempty"`
659
660
661 googleapi.ServerResponse `json:"-"`
662
663
664
665
666
667 ForceSendFields []string `json:"-"`
668
669
670
671
672 NullFields []string `json:"-"`
673 }
674
675 func (s *CommentList) MarshalJSON() ([]byte, error) {
676 type NoMethod CommentList
677 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
678 }
679
680 type Page struct {
681
682 Author *PageAuthor `json:"author,omitempty"`
683
684 Blog *PageBlog `json:"blog,omitempty"`
685
686 Content string `json:"content,omitempty"`
687
688 Etag string `json:"etag,omitempty"`
689
690 Id string `json:"id,omitempty"`
691
692 Kind string `json:"kind,omitempty"`
693
694 Published string `json:"published,omitempty"`
695
696 SelfLink string `json:"selfLink,omitempty"`
697
698
699
700
701
702
703 Status string `json:"status,omitempty"`
704
705
706 Title string `json:"title,omitempty"`
707
708 Trashed string `json:"trashed,omitempty"`
709
710 Updated string `json:"updated,omitempty"`
711
712 Url string `json:"url,omitempty"`
713
714
715 googleapi.ServerResponse `json:"-"`
716
717
718
719
720
721 ForceSendFields []string `json:"-"`
722
723
724
725
726 NullFields []string `json:"-"`
727 }
728
729 func (s *Page) MarshalJSON() ([]byte, error) {
730 type NoMethod Page
731 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
732 }
733
734
735 type PageAuthor struct {
736
737 DisplayName string `json:"displayName,omitempty"`
738
739 Id string `json:"id,omitempty"`
740
741 Image *PageAuthorImage `json:"image,omitempty"`
742
743 Url string `json:"url,omitempty"`
744
745
746
747
748
749 ForceSendFields []string `json:"-"`
750
751
752
753
754 NullFields []string `json:"-"`
755 }
756
757 func (s *PageAuthor) MarshalJSON() ([]byte, error) {
758 type NoMethod PageAuthor
759 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
760 }
761
762
763 type PageAuthorImage struct {
764
765 Url string `json:"url,omitempty"`
766
767
768
769
770
771 ForceSendFields []string `json:"-"`
772
773
774
775
776 NullFields []string `json:"-"`
777 }
778
779 func (s *PageAuthorImage) MarshalJSON() ([]byte, error) {
780 type NoMethod PageAuthorImage
781 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
782 }
783
784
785 type PageBlog struct {
786
787 Id string `json:"id,omitempty"`
788
789
790
791
792
793 ForceSendFields []string `json:"-"`
794
795
796
797
798 NullFields []string `json:"-"`
799 }
800
801 func (s *PageBlog) MarshalJSON() ([]byte, error) {
802 type NoMethod PageBlog
803 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
804 }
805
806 type PageList struct {
807
808 Etag string `json:"etag,omitempty"`
809
810 Items []*Page `json:"items,omitempty"`
811
812 Kind string `json:"kind,omitempty"`
813
814 NextPageToken string `json:"nextPageToken,omitempty"`
815
816
817 googleapi.ServerResponse `json:"-"`
818
819
820
821
822
823 ForceSendFields []string `json:"-"`
824
825
826
827
828 NullFields []string `json:"-"`
829 }
830
831 func (s *PageList) MarshalJSON() ([]byte, error) {
832 type NoMethod PageList
833 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
834 }
835
836 type Pageviews struct {
837
838 BlogId string `json:"blogId,omitempty"`
839
840 Counts []*PageviewsCounts `json:"counts,omitempty"`
841
842 Kind string `json:"kind,omitempty"`
843
844
845 googleapi.ServerResponse `json:"-"`
846
847
848
849
850
851 ForceSendFields []string `json:"-"`
852
853
854
855
856 NullFields []string `json:"-"`
857 }
858
859 func (s *Pageviews) MarshalJSON() ([]byte, error) {
860 type NoMethod Pageviews
861 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
862 }
863
864 type PageviewsCounts struct {
865
866 Count int64 `json:"count,omitempty,string"`
867
868
869
870
871
872
873 TimeRange string `json:"timeRange,omitempty"`
874
875
876
877
878
879 ForceSendFields []string `json:"-"`
880
881
882
883
884 NullFields []string `json:"-"`
885 }
886
887 func (s *PageviewsCounts) MarshalJSON() ([]byte, error) {
888 type NoMethod PageviewsCounts
889 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
890 }
891
892 type Post struct {
893
894 Author *PostAuthor `json:"author,omitempty"`
895
896 Blog *PostBlog `json:"blog,omitempty"`
897
898 Content string `json:"content,omitempty"`
899
900 CustomMetaData string `json:"customMetaData,omitempty"`
901
902 Etag string `json:"etag,omitempty"`
903
904 Id string `json:"id,omitempty"`
905
906 Images []*PostImages `json:"images,omitempty"`
907
908 Kind string `json:"kind,omitempty"`
909
910 Labels []string `json:"labels,omitempty"`
911
912 Location *PostLocation `json:"location,omitempty"`
913
914 Published string `json:"published,omitempty"`
915
916
917
918
919
920
921
922 ReaderComments string `json:"readerComments,omitempty"`
923
924 Replies *PostReplies `json:"replies,omitempty"`
925
926 SelfLink string `json:"selfLink,omitempty"`
927
928
929
930
931
932
933
934 Status string `json:"status,omitempty"`
935
936 Title string `json:"title,omitempty"`
937
938 TitleLink string `json:"titleLink,omitempty"`
939
940 Trashed string `json:"trashed,omitempty"`
941
942 Updated string `json:"updated,omitempty"`
943
944 Url string `json:"url,omitempty"`
945
946
947 googleapi.ServerResponse `json:"-"`
948
949
950
951
952
953 ForceSendFields []string `json:"-"`
954
955
956
957
958 NullFields []string `json:"-"`
959 }
960
961 func (s *Post) MarshalJSON() ([]byte, error) {
962 type NoMethod Post
963 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
964 }
965
966
967 type PostAuthor struct {
968
969 DisplayName string `json:"displayName,omitempty"`
970
971 Id string `json:"id,omitempty"`
972
973 Image *PostAuthorImage `json:"image,omitempty"`
974
975 Url string `json:"url,omitempty"`
976
977
978
979
980
981 ForceSendFields []string `json:"-"`
982
983
984
985
986 NullFields []string `json:"-"`
987 }
988
989 func (s *PostAuthor) MarshalJSON() ([]byte, error) {
990 type NoMethod PostAuthor
991 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
992 }
993
994
995 type PostAuthorImage struct {
996
997 Url string `json:"url,omitempty"`
998
999
1000
1001
1002
1003 ForceSendFields []string `json:"-"`
1004
1005
1006
1007
1008 NullFields []string `json:"-"`
1009 }
1010
1011 func (s *PostAuthorImage) MarshalJSON() ([]byte, error) {
1012 type NoMethod PostAuthorImage
1013 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1014 }
1015
1016
1017 type PostBlog struct {
1018
1019 Id string `json:"id,omitempty"`
1020
1021
1022
1023
1024
1025 ForceSendFields []string `json:"-"`
1026
1027
1028
1029
1030 NullFields []string `json:"-"`
1031 }
1032
1033 func (s *PostBlog) MarshalJSON() ([]byte, error) {
1034 type NoMethod PostBlog
1035 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1036 }
1037
1038 type PostImages struct {
1039 Url string `json:"url,omitempty"`
1040
1041
1042
1043
1044
1045 ForceSendFields []string `json:"-"`
1046
1047
1048
1049
1050 NullFields []string `json:"-"`
1051 }
1052
1053 func (s *PostImages) MarshalJSON() ([]byte, error) {
1054 type NoMethod PostImages
1055 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1056 }
1057
1058
1059 type PostLocation struct {
1060
1061 Lat float64 `json:"lat,omitempty"`
1062
1063 Lng float64 `json:"lng,omitempty"`
1064
1065 Name string `json:"name,omitempty"`
1066
1067 Span string `json:"span,omitempty"`
1068
1069
1070
1071
1072
1073 ForceSendFields []string `json:"-"`
1074
1075
1076
1077
1078 NullFields []string `json:"-"`
1079 }
1080
1081 func (s *PostLocation) MarshalJSON() ([]byte, error) {
1082 type NoMethod PostLocation
1083 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1084 }
1085
1086 func (s *PostLocation) UnmarshalJSON(data []byte) error {
1087 type NoMethod PostLocation
1088 var s1 struct {
1089 Lat gensupport.JSONFloat64 `json:"lat"`
1090 Lng gensupport.JSONFloat64 `json:"lng"`
1091 *NoMethod
1092 }
1093 s1.NoMethod = (*NoMethod)(s)
1094 if err := json.Unmarshal(data, &s1); err != nil {
1095 return err
1096 }
1097 s.Lat = float64(s1.Lat)
1098 s.Lng = float64(s1.Lng)
1099 return nil
1100 }
1101
1102
1103 type PostReplies struct {
1104
1105 Items []*Comment `json:"items,omitempty"`
1106
1107 SelfLink string `json:"selfLink,omitempty"`
1108
1109 TotalItems int64 `json:"totalItems,omitempty,string"`
1110
1111
1112
1113
1114
1115 ForceSendFields []string `json:"-"`
1116
1117
1118
1119
1120 NullFields []string `json:"-"`
1121 }
1122
1123 func (s *PostReplies) MarshalJSON() ([]byte, error) {
1124 type NoMethod PostReplies
1125 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1126 }
1127
1128 type PostList struct {
1129
1130 Etag string `json:"etag,omitempty"`
1131
1132 Items []*Post `json:"items,omitempty"`
1133
1134 Kind string `json:"kind,omitempty"`
1135
1136 NextPageToken string `json:"nextPageToken,omitempty"`
1137
1138 PrevPageToken string `json:"prevPageToken,omitempty"`
1139
1140
1141 googleapi.ServerResponse `json:"-"`
1142
1143
1144
1145
1146
1147 ForceSendFields []string `json:"-"`
1148
1149
1150
1151
1152 NullFields []string `json:"-"`
1153 }
1154
1155 func (s *PostList) MarshalJSON() ([]byte, error) {
1156 type NoMethod PostList
1157 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1158 }
1159
1160 type PostPerUserInfo struct {
1161
1162 BlogId string `json:"blogId,omitempty"`
1163
1164 HasEditAccess bool `json:"hasEditAccess,omitempty"`
1165
1166 Kind string `json:"kind,omitempty"`
1167
1168 PostId string `json:"postId,omitempty"`
1169
1170 UserId string `json:"userId,omitempty"`
1171
1172
1173
1174
1175
1176 ForceSendFields []string `json:"-"`
1177
1178
1179
1180
1181 NullFields []string `json:"-"`
1182 }
1183
1184 func (s *PostPerUserInfo) MarshalJSON() ([]byte, error) {
1185 type NoMethod PostPerUserInfo
1186 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1187 }
1188
1189 type PostUserInfo struct {
1190
1191 Kind string `json:"kind,omitempty"`
1192
1193 Post *Post `json:"post,omitempty"`
1194
1195 PostUserInfo *PostPerUserInfo `json:"post_user_info,omitempty"`
1196
1197
1198 googleapi.ServerResponse `json:"-"`
1199
1200
1201
1202
1203
1204 ForceSendFields []string `json:"-"`
1205
1206
1207
1208
1209 NullFields []string `json:"-"`
1210 }
1211
1212 func (s *PostUserInfo) MarshalJSON() ([]byte, error) {
1213 type NoMethod PostUserInfo
1214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1215 }
1216
1217 type PostUserInfosList struct {
1218
1219 Items []*PostUserInfo `json:"items,omitempty"`
1220
1221 Kind string `json:"kind,omitempty"`
1222
1223 NextPageToken string `json:"nextPageToken,omitempty"`
1224
1225
1226 googleapi.ServerResponse `json:"-"`
1227
1228
1229
1230
1231
1232 ForceSendFields []string `json:"-"`
1233
1234
1235
1236
1237 NullFields []string `json:"-"`
1238 }
1239
1240 func (s *PostUserInfosList) MarshalJSON() ([]byte, error) {
1241 type NoMethod PostUserInfosList
1242 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1243 }
1244
1245 type User struct {
1246
1247 About string `json:"about,omitempty"`
1248
1249 Blogs *UserBlogs `json:"blogs,omitempty"`
1250
1251
1252 Created string `json:"created,omitempty"`
1253
1254 DisplayName string `json:"displayName,omitempty"`
1255
1256 Id string `json:"id,omitempty"`
1257
1258 Kind string `json:"kind,omitempty"`
1259
1260 Locale *UserLocale `json:"locale,omitempty"`
1261
1262 SelfLink string `json:"selfLink,omitempty"`
1263
1264 Url string `json:"url,omitempty"`
1265
1266
1267 googleapi.ServerResponse `json:"-"`
1268
1269
1270
1271
1272
1273 ForceSendFields []string `json:"-"`
1274
1275
1276
1277
1278 NullFields []string `json:"-"`
1279 }
1280
1281 func (s *User) MarshalJSON() ([]byte, error) {
1282 type NoMethod User
1283 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1284 }
1285
1286
1287 type UserBlogs struct {
1288
1289 SelfLink string `json:"selfLink,omitempty"`
1290
1291
1292
1293
1294
1295 ForceSendFields []string `json:"-"`
1296
1297
1298
1299
1300 NullFields []string `json:"-"`
1301 }
1302
1303 func (s *UserBlogs) MarshalJSON() ([]byte, error) {
1304 type NoMethod UserBlogs
1305 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1306 }
1307
1308
1309 type UserLocale struct {
1310
1311 Country string `json:"country,omitempty"`
1312
1313 Language string `json:"language,omitempty"`
1314
1315 Variant string `json:"variant,omitempty"`
1316
1317
1318
1319
1320
1321 ForceSendFields []string `json:"-"`
1322
1323
1324
1325
1326 NullFields []string `json:"-"`
1327 }
1328
1329 func (s *UserLocale) MarshalJSON() ([]byte, error) {
1330 type NoMethod UserLocale
1331 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1332 }
1333
1334 type BlogUserInfosGetCall struct {
1335 s *Service
1336 userId string
1337 blogId string
1338 urlParams_ gensupport.URLParams
1339 ifNoneMatch_ string
1340 ctx_ context.Context
1341 header_ http.Header
1342 }
1343
1344
1345
1346
1347
1348 func (r *BlogUserInfosService) Get(userId string, blogId string) *BlogUserInfosGetCall {
1349 c := &BlogUserInfosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1350 c.userId = userId
1351 c.blogId = blogId
1352 return c
1353 }
1354
1355
1356 func (c *BlogUserInfosGetCall) MaxPosts(maxPosts int64) *BlogUserInfosGetCall {
1357 c.urlParams_.Set("maxPosts", fmt.Sprint(maxPosts))
1358 return c
1359 }
1360
1361
1362
1363
1364 func (c *BlogUserInfosGetCall) Fields(s ...googleapi.Field) *BlogUserInfosGetCall {
1365 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1366 return c
1367 }
1368
1369
1370
1371
1372 func (c *BlogUserInfosGetCall) IfNoneMatch(entityTag string) *BlogUserInfosGetCall {
1373 c.ifNoneMatch_ = entityTag
1374 return c
1375 }
1376
1377
1378 func (c *BlogUserInfosGetCall) Context(ctx context.Context) *BlogUserInfosGetCall {
1379 c.ctx_ = ctx
1380 return c
1381 }
1382
1383
1384
1385 func (c *BlogUserInfosGetCall) Header() http.Header {
1386 if c.header_ == nil {
1387 c.header_ = make(http.Header)
1388 }
1389 return c.header_
1390 }
1391
1392 func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) {
1393 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1394 if c.ifNoneMatch_ != "" {
1395 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1396 }
1397 var body io.Reader = nil
1398 c.urlParams_.Set("alt", alt)
1399 c.urlParams_.Set("prettyPrint", "false")
1400 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs/{blogId}")
1401 urls += "?" + c.urlParams_.Encode()
1402 req, err := http.NewRequest("GET", urls, body)
1403 if err != nil {
1404 return nil, err
1405 }
1406 req.Header = reqHeaders
1407 googleapi.Expand(req.URL, map[string]string{
1408 "userId": c.userId,
1409 "blogId": c.blogId,
1410 })
1411 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1412 }
1413
1414
1415
1416
1417
1418
1419 func (c *BlogUserInfosGetCall) Do(opts ...googleapi.CallOption) (*BlogUserInfo, error) {
1420 gensupport.SetOptions(c.urlParams_, opts...)
1421 res, err := c.doRequest("json")
1422 if res != nil && res.StatusCode == http.StatusNotModified {
1423 if res.Body != nil {
1424 res.Body.Close()
1425 }
1426 return nil, gensupport.WrapError(&googleapi.Error{
1427 Code: res.StatusCode,
1428 Header: res.Header,
1429 })
1430 }
1431 if err != nil {
1432 return nil, err
1433 }
1434 defer googleapi.CloseBody(res)
1435 if err := googleapi.CheckResponse(res); err != nil {
1436 return nil, gensupport.WrapError(err)
1437 }
1438 ret := &BlogUserInfo{
1439 ServerResponse: googleapi.ServerResponse{
1440 Header: res.Header,
1441 HTTPStatusCode: res.StatusCode,
1442 },
1443 }
1444 target := &ret
1445 if err := gensupport.DecodeResponse(target, res); err != nil {
1446 return nil, err
1447 }
1448 return ret, nil
1449 }
1450
1451 type BlogsGetCall struct {
1452 s *Service
1453 blogId string
1454 urlParams_ gensupport.URLParams
1455 ifNoneMatch_ string
1456 ctx_ context.Context
1457 header_ http.Header
1458 }
1459
1460
1461
1462
1463 func (r *BlogsService) Get(blogId string) *BlogsGetCall {
1464 c := &BlogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1465 c.blogId = blogId
1466 return c
1467 }
1468
1469
1470 func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall {
1471 c.urlParams_.Set("maxPosts", fmt.Sprint(maxPosts))
1472 return c
1473 }
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483 func (c *BlogsGetCall) View(view string) *BlogsGetCall {
1484 c.urlParams_.Set("view", view)
1485 return c
1486 }
1487
1488
1489
1490
1491 func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall {
1492 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1493 return c
1494 }
1495
1496
1497
1498
1499 func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall {
1500 c.ifNoneMatch_ = entityTag
1501 return c
1502 }
1503
1504
1505 func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall {
1506 c.ctx_ = ctx
1507 return c
1508 }
1509
1510
1511
1512 func (c *BlogsGetCall) Header() http.Header {
1513 if c.header_ == nil {
1514 c.header_ = make(http.Header)
1515 }
1516 return c.header_
1517 }
1518
1519 func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) {
1520 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1521 if c.ifNoneMatch_ != "" {
1522 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1523 }
1524 var body io.Reader = nil
1525 c.urlParams_.Set("alt", alt)
1526 c.urlParams_.Set("prettyPrint", "false")
1527 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}")
1528 urls += "?" + c.urlParams_.Encode()
1529 req, err := http.NewRequest("GET", urls, body)
1530 if err != nil {
1531 return nil, err
1532 }
1533 req.Header = reqHeaders
1534 googleapi.Expand(req.URL, map[string]string{
1535 "blogId": c.blogId,
1536 })
1537 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1538 }
1539
1540
1541
1542
1543
1544
1545 func (c *BlogsGetCall) Do(opts ...googleapi.CallOption) (*Blog, error) {
1546 gensupport.SetOptions(c.urlParams_, opts...)
1547 res, err := c.doRequest("json")
1548 if res != nil && res.StatusCode == http.StatusNotModified {
1549 if res.Body != nil {
1550 res.Body.Close()
1551 }
1552 return nil, gensupport.WrapError(&googleapi.Error{
1553 Code: res.StatusCode,
1554 Header: res.Header,
1555 })
1556 }
1557 if err != nil {
1558 return nil, err
1559 }
1560 defer googleapi.CloseBody(res)
1561 if err := googleapi.CheckResponse(res); err != nil {
1562 return nil, gensupport.WrapError(err)
1563 }
1564 ret := &Blog{
1565 ServerResponse: googleapi.ServerResponse{
1566 Header: res.Header,
1567 HTTPStatusCode: res.StatusCode,
1568 },
1569 }
1570 target := &ret
1571 if err := gensupport.DecodeResponse(target, res); err != nil {
1572 return nil, err
1573 }
1574 return ret, nil
1575 }
1576
1577 type BlogsGetByUrlCall struct {
1578 s *Service
1579 urlParams_ gensupport.URLParams
1580 ifNoneMatch_ string
1581 ctx_ context.Context
1582 header_ http.Header
1583 }
1584
1585
1586
1587
1588 func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall {
1589 c := &BlogsGetByUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1590 c.urlParams_.Set("url", url)
1591 return c
1592 }
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602 func (c *BlogsGetByUrlCall) View(view string) *BlogsGetByUrlCall {
1603 c.urlParams_.Set("view", view)
1604 return c
1605 }
1606
1607
1608
1609
1610 func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall {
1611 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1612 return c
1613 }
1614
1615
1616
1617
1618 func (c *BlogsGetByUrlCall) IfNoneMatch(entityTag string) *BlogsGetByUrlCall {
1619 c.ifNoneMatch_ = entityTag
1620 return c
1621 }
1622
1623
1624 func (c *BlogsGetByUrlCall) Context(ctx context.Context) *BlogsGetByUrlCall {
1625 c.ctx_ = ctx
1626 return c
1627 }
1628
1629
1630
1631 func (c *BlogsGetByUrlCall) Header() http.Header {
1632 if c.header_ == nil {
1633 c.header_ = make(http.Header)
1634 }
1635 return c.header_
1636 }
1637
1638 func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) {
1639 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1640 if c.ifNoneMatch_ != "" {
1641 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1642 }
1643 var body io.Reader = nil
1644 c.urlParams_.Set("alt", alt)
1645 c.urlParams_.Set("prettyPrint", "false")
1646 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/byurl")
1647 urls += "?" + c.urlParams_.Encode()
1648 req, err := http.NewRequest("GET", urls, body)
1649 if err != nil {
1650 return nil, err
1651 }
1652 req.Header = reqHeaders
1653 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1654 }
1655
1656
1657
1658
1659
1660
1661 func (c *BlogsGetByUrlCall) Do(opts ...googleapi.CallOption) (*Blog, error) {
1662 gensupport.SetOptions(c.urlParams_, opts...)
1663 res, err := c.doRequest("json")
1664 if res != nil && res.StatusCode == http.StatusNotModified {
1665 if res.Body != nil {
1666 res.Body.Close()
1667 }
1668 return nil, gensupport.WrapError(&googleapi.Error{
1669 Code: res.StatusCode,
1670 Header: res.Header,
1671 })
1672 }
1673 if err != nil {
1674 return nil, err
1675 }
1676 defer googleapi.CloseBody(res)
1677 if err := googleapi.CheckResponse(res); err != nil {
1678 return nil, gensupport.WrapError(err)
1679 }
1680 ret := &Blog{
1681 ServerResponse: googleapi.ServerResponse{
1682 Header: res.Header,
1683 HTTPStatusCode: res.StatusCode,
1684 },
1685 }
1686 target := &ret
1687 if err := gensupport.DecodeResponse(target, res); err != nil {
1688 return nil, err
1689 }
1690 return ret, nil
1691 }
1692
1693 type BlogsListByUserCall struct {
1694 s *Service
1695 userId string
1696 urlParams_ gensupport.URLParams
1697 ifNoneMatch_ string
1698 ctx_ context.Context
1699 header_ http.Header
1700 }
1701
1702
1703
1704
1705 func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall {
1706 c := &BlogsListByUserCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1707 c.userId = userId
1708 return c
1709 }
1710
1711
1712 func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall {
1713 c.urlParams_.Set("fetchUserInfo", fmt.Sprint(fetchUserInfo))
1714 return c
1715 }
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725 func (c *BlogsListByUserCall) Role(role ...string) *BlogsListByUserCall {
1726 c.urlParams_.SetMulti("role", append([]string{}, role...))
1727 return c
1728 }
1729
1730
1731
1732
1733
1734
1735
1736
1737 func (c *BlogsListByUserCall) Status(status ...string) *BlogsListByUserCall {
1738 c.urlParams_.SetMulti("status", append([]string{}, status...))
1739 return c
1740 }
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750 func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall {
1751 c.urlParams_.Set("view", view)
1752 return c
1753 }
1754
1755
1756
1757
1758 func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall {
1759 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1760 return c
1761 }
1762
1763
1764
1765
1766 func (c *BlogsListByUserCall) IfNoneMatch(entityTag string) *BlogsListByUserCall {
1767 c.ifNoneMatch_ = entityTag
1768 return c
1769 }
1770
1771
1772 func (c *BlogsListByUserCall) Context(ctx context.Context) *BlogsListByUserCall {
1773 c.ctx_ = ctx
1774 return c
1775 }
1776
1777
1778
1779 func (c *BlogsListByUserCall) Header() http.Header {
1780 if c.header_ == nil {
1781 c.header_ = make(http.Header)
1782 }
1783 return c.header_
1784 }
1785
1786 func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) {
1787 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1788 if c.ifNoneMatch_ != "" {
1789 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1790 }
1791 var body io.Reader = nil
1792 c.urlParams_.Set("alt", alt)
1793 c.urlParams_.Set("prettyPrint", "false")
1794 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs")
1795 urls += "?" + c.urlParams_.Encode()
1796 req, err := http.NewRequest("GET", urls, body)
1797 if err != nil {
1798 return nil, err
1799 }
1800 req.Header = reqHeaders
1801 googleapi.Expand(req.URL, map[string]string{
1802 "userId": c.userId,
1803 })
1804 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1805 }
1806
1807
1808
1809
1810
1811
1812 func (c *BlogsListByUserCall) Do(opts ...googleapi.CallOption) (*BlogList, error) {
1813 gensupport.SetOptions(c.urlParams_, opts...)
1814 res, err := c.doRequest("json")
1815 if res != nil && res.StatusCode == http.StatusNotModified {
1816 if res.Body != nil {
1817 res.Body.Close()
1818 }
1819 return nil, gensupport.WrapError(&googleapi.Error{
1820 Code: res.StatusCode,
1821 Header: res.Header,
1822 })
1823 }
1824 if err != nil {
1825 return nil, err
1826 }
1827 defer googleapi.CloseBody(res)
1828 if err := googleapi.CheckResponse(res); err != nil {
1829 return nil, gensupport.WrapError(err)
1830 }
1831 ret := &BlogList{
1832 ServerResponse: googleapi.ServerResponse{
1833 Header: res.Header,
1834 HTTPStatusCode: res.StatusCode,
1835 },
1836 }
1837 target := &ret
1838 if err := gensupport.DecodeResponse(target, res); err != nil {
1839 return nil, err
1840 }
1841 return ret, nil
1842 }
1843
1844 type CommentsApproveCall struct {
1845 s *Service
1846 blogId string
1847 postId string
1848 commentId string
1849 urlParams_ gensupport.URLParams
1850 ctx_ context.Context
1851 header_ http.Header
1852 }
1853
1854
1855
1856
1857
1858
1859 func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall {
1860 c := &CommentsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1861 c.blogId = blogId
1862 c.postId = postId
1863 c.commentId = commentId
1864 return c
1865 }
1866
1867
1868
1869
1870 func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall {
1871 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1872 return c
1873 }
1874
1875
1876 func (c *CommentsApproveCall) Context(ctx context.Context) *CommentsApproveCall {
1877 c.ctx_ = ctx
1878 return c
1879 }
1880
1881
1882
1883 func (c *CommentsApproveCall) Header() http.Header {
1884 if c.header_ == nil {
1885 c.header_ = make(http.Header)
1886 }
1887 return c.header_
1888 }
1889
1890 func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) {
1891 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1892 var body io.Reader = nil
1893 c.urlParams_.Set("alt", alt)
1894 c.urlParams_.Set("prettyPrint", "false")
1895 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/approve")
1896 urls += "?" + c.urlParams_.Encode()
1897 req, err := http.NewRequest("POST", urls, body)
1898 if err != nil {
1899 return nil, err
1900 }
1901 req.Header = reqHeaders
1902 googleapi.Expand(req.URL, map[string]string{
1903 "blogId": c.blogId,
1904 "postId": c.postId,
1905 "commentId": c.commentId,
1906 })
1907 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1908 }
1909
1910
1911
1912
1913
1914
1915 func (c *CommentsApproveCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
1916 gensupport.SetOptions(c.urlParams_, opts...)
1917 res, err := c.doRequest("json")
1918 if res != nil && res.StatusCode == http.StatusNotModified {
1919 if res.Body != nil {
1920 res.Body.Close()
1921 }
1922 return nil, gensupport.WrapError(&googleapi.Error{
1923 Code: res.StatusCode,
1924 Header: res.Header,
1925 })
1926 }
1927 if err != nil {
1928 return nil, err
1929 }
1930 defer googleapi.CloseBody(res)
1931 if err := googleapi.CheckResponse(res); err != nil {
1932 return nil, gensupport.WrapError(err)
1933 }
1934 ret := &Comment{
1935 ServerResponse: googleapi.ServerResponse{
1936 Header: res.Header,
1937 HTTPStatusCode: res.StatusCode,
1938 },
1939 }
1940 target := &ret
1941 if err := gensupport.DecodeResponse(target, res); err != nil {
1942 return nil, err
1943 }
1944 return ret, nil
1945 }
1946
1947 type CommentsDeleteCall struct {
1948 s *Service
1949 blogId string
1950 postId string
1951 commentId string
1952 urlParams_ gensupport.URLParams
1953 ctx_ context.Context
1954 header_ http.Header
1955 }
1956
1957
1958
1959
1960
1961
1962 func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall {
1963 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1964 c.blogId = blogId
1965 c.postId = postId
1966 c.commentId = commentId
1967 return c
1968 }
1969
1970
1971
1972
1973 func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
1974 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1975 return c
1976 }
1977
1978
1979 func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
1980 c.ctx_ = ctx
1981 return c
1982 }
1983
1984
1985
1986 func (c *CommentsDeleteCall) Header() http.Header {
1987 if c.header_ == nil {
1988 c.header_ = make(http.Header)
1989 }
1990 return c.header_
1991 }
1992
1993 func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
1994 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1995 var body io.Reader = nil
1996 c.urlParams_.Set("alt", alt)
1997 c.urlParams_.Set("prettyPrint", "false")
1998 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}")
1999 urls += "?" + c.urlParams_.Encode()
2000 req, err := http.NewRequest("DELETE", urls, body)
2001 if err != nil {
2002 return nil, err
2003 }
2004 req.Header = reqHeaders
2005 googleapi.Expand(req.URL, map[string]string{
2006 "blogId": c.blogId,
2007 "postId": c.postId,
2008 "commentId": c.commentId,
2009 })
2010 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2011 }
2012
2013
2014 func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
2015 gensupport.SetOptions(c.urlParams_, opts...)
2016 res, err := c.doRequest("json")
2017 if err != nil {
2018 return err
2019 }
2020 defer googleapi.CloseBody(res)
2021 if err := googleapi.CheckResponse(res); err != nil {
2022 return gensupport.WrapError(err)
2023 }
2024 return nil
2025 }
2026
2027 type CommentsGetCall struct {
2028 s *Service
2029 blogId string
2030 postId string
2031 commentId string
2032 urlParams_ gensupport.URLParams
2033 ifNoneMatch_ string
2034 ctx_ context.Context
2035 header_ http.Header
2036 }
2037
2038
2039
2040
2041
2042
2043 func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall {
2044 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2045 c.blogId = blogId
2046 c.postId = postId
2047 c.commentId = commentId
2048 return c
2049 }
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059 func (c *CommentsGetCall) View(view string) *CommentsGetCall {
2060 c.urlParams_.Set("view", view)
2061 return c
2062 }
2063
2064
2065
2066
2067 func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
2068 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2069 return c
2070 }
2071
2072
2073
2074
2075 func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall {
2076 c.ifNoneMatch_ = entityTag
2077 return c
2078 }
2079
2080
2081 func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall {
2082 c.ctx_ = ctx
2083 return c
2084 }
2085
2086
2087
2088 func (c *CommentsGetCall) Header() http.Header {
2089 if c.header_ == nil {
2090 c.header_ = make(http.Header)
2091 }
2092 return c.header_
2093 }
2094
2095 func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) {
2096 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2097 if c.ifNoneMatch_ != "" {
2098 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2099 }
2100 var body io.Reader = nil
2101 c.urlParams_.Set("alt", alt)
2102 c.urlParams_.Set("prettyPrint", "false")
2103 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}")
2104 urls += "?" + c.urlParams_.Encode()
2105 req, err := http.NewRequest("GET", urls, body)
2106 if err != nil {
2107 return nil, err
2108 }
2109 req.Header = reqHeaders
2110 googleapi.Expand(req.URL, map[string]string{
2111 "blogId": c.blogId,
2112 "postId": c.postId,
2113 "commentId": c.commentId,
2114 })
2115 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2116 }
2117
2118
2119
2120
2121
2122
2123 func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
2124 gensupport.SetOptions(c.urlParams_, opts...)
2125 res, err := c.doRequest("json")
2126 if res != nil && res.StatusCode == http.StatusNotModified {
2127 if res.Body != nil {
2128 res.Body.Close()
2129 }
2130 return nil, gensupport.WrapError(&googleapi.Error{
2131 Code: res.StatusCode,
2132 Header: res.Header,
2133 })
2134 }
2135 if err != nil {
2136 return nil, err
2137 }
2138 defer googleapi.CloseBody(res)
2139 if err := googleapi.CheckResponse(res); err != nil {
2140 return nil, gensupport.WrapError(err)
2141 }
2142 ret := &Comment{
2143 ServerResponse: googleapi.ServerResponse{
2144 Header: res.Header,
2145 HTTPStatusCode: res.StatusCode,
2146 },
2147 }
2148 target := &ret
2149 if err := gensupport.DecodeResponse(target, res); err != nil {
2150 return nil, err
2151 }
2152 return ret, nil
2153 }
2154
2155 type CommentsListCall struct {
2156 s *Service
2157 blogId string
2158 postId string
2159 urlParams_ gensupport.URLParams
2160 ifNoneMatch_ string
2161 ctx_ context.Context
2162 header_ http.Header
2163 }
2164
2165
2166
2167
2168
2169 func (r *CommentsService) List(blogId string, postId string) *CommentsListCall {
2170 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2171 c.blogId = blogId
2172 c.postId = postId
2173 return c
2174 }
2175
2176
2177 func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall {
2178 c.urlParams_.Set("endDate", endDate)
2179 return c
2180 }
2181
2182
2183 func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall {
2184 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
2185 return c
2186 }
2187
2188
2189 func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
2190 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2191 return c
2192 }
2193
2194
2195 func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
2196 c.urlParams_.Set("pageToken", pageToken)
2197 return c
2198 }
2199
2200
2201 func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall {
2202 c.urlParams_.Set("startDate", startDate)
2203 return c
2204 }
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214 func (c *CommentsListCall) Status(status string) *CommentsListCall {
2215 c.urlParams_.Set("status", status)
2216 return c
2217 }
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227 func (c *CommentsListCall) View(view string) *CommentsListCall {
2228 c.urlParams_.Set("view", view)
2229 return c
2230 }
2231
2232
2233
2234
2235 func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
2236 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2237 return c
2238 }
2239
2240
2241
2242
2243 func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
2244 c.ifNoneMatch_ = entityTag
2245 return c
2246 }
2247
2248
2249 func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
2250 c.ctx_ = ctx
2251 return c
2252 }
2253
2254
2255
2256 func (c *CommentsListCall) Header() http.Header {
2257 if c.header_ == nil {
2258 c.header_ = make(http.Header)
2259 }
2260 return c.header_
2261 }
2262
2263 func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
2264 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2265 if c.ifNoneMatch_ != "" {
2266 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2267 }
2268 var body io.Reader = nil
2269 c.urlParams_.Set("alt", alt)
2270 c.urlParams_.Set("prettyPrint", "false")
2271 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments")
2272 urls += "?" + c.urlParams_.Encode()
2273 req, err := http.NewRequest("GET", urls, body)
2274 if err != nil {
2275 return nil, err
2276 }
2277 req.Header = reqHeaders
2278 googleapi.Expand(req.URL, map[string]string{
2279 "blogId": c.blogId,
2280 "postId": c.postId,
2281 })
2282 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2283 }
2284
2285
2286
2287
2288
2289
2290 func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
2291 gensupport.SetOptions(c.urlParams_, opts...)
2292 res, err := c.doRequest("json")
2293 if res != nil && res.StatusCode == http.StatusNotModified {
2294 if res.Body != nil {
2295 res.Body.Close()
2296 }
2297 return nil, gensupport.WrapError(&googleapi.Error{
2298 Code: res.StatusCode,
2299 Header: res.Header,
2300 })
2301 }
2302 if err != nil {
2303 return nil, err
2304 }
2305 defer googleapi.CloseBody(res)
2306 if err := googleapi.CheckResponse(res); err != nil {
2307 return nil, gensupport.WrapError(err)
2308 }
2309 ret := &CommentList{
2310 ServerResponse: googleapi.ServerResponse{
2311 Header: res.Header,
2312 HTTPStatusCode: res.StatusCode,
2313 },
2314 }
2315 target := &ret
2316 if err := gensupport.DecodeResponse(target, res); err != nil {
2317 return nil, err
2318 }
2319 return ret, nil
2320 }
2321
2322
2323
2324
2325 func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error {
2326 c.ctx_ = ctx
2327 defer c.PageToken(c.urlParams_.Get("pageToken"))
2328 for {
2329 x, err := c.Do()
2330 if err != nil {
2331 return err
2332 }
2333 if err := f(x); err != nil {
2334 return err
2335 }
2336 if x.NextPageToken == "" {
2337 return nil
2338 }
2339 c.PageToken(x.NextPageToken)
2340 }
2341 }
2342
2343 type CommentsListByBlogCall struct {
2344 s *Service
2345 blogId string
2346 urlParams_ gensupport.URLParams
2347 ifNoneMatch_ string
2348 ctx_ context.Context
2349 header_ http.Header
2350 }
2351
2352
2353
2354
2355 func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall {
2356 c := &CommentsListByBlogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2357 c.blogId = blogId
2358 return c
2359 }
2360
2361
2362 func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall {
2363 c.urlParams_.Set("endDate", endDate)
2364 return c
2365 }
2366
2367
2368 func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall {
2369 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
2370 return c
2371 }
2372
2373
2374 func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall {
2375 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2376 return c
2377 }
2378
2379
2380 func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall {
2381 c.urlParams_.Set("pageToken", pageToken)
2382 return c
2383 }
2384
2385
2386 func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall {
2387 c.urlParams_.Set("startDate", startDate)
2388 return c
2389 }
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399 func (c *CommentsListByBlogCall) Status(status ...string) *CommentsListByBlogCall {
2400 c.urlParams_.SetMulti("status", append([]string{}, status...))
2401 return c
2402 }
2403
2404
2405
2406
2407 func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall {
2408 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2409 return c
2410 }
2411
2412
2413
2414
2415 func (c *CommentsListByBlogCall) IfNoneMatch(entityTag string) *CommentsListByBlogCall {
2416 c.ifNoneMatch_ = entityTag
2417 return c
2418 }
2419
2420
2421 func (c *CommentsListByBlogCall) Context(ctx context.Context) *CommentsListByBlogCall {
2422 c.ctx_ = ctx
2423 return c
2424 }
2425
2426
2427
2428 func (c *CommentsListByBlogCall) Header() http.Header {
2429 if c.header_ == nil {
2430 c.header_ = make(http.Header)
2431 }
2432 return c.header_
2433 }
2434
2435 func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) {
2436 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2437 if c.ifNoneMatch_ != "" {
2438 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2439 }
2440 var body io.Reader = nil
2441 c.urlParams_.Set("alt", alt)
2442 c.urlParams_.Set("prettyPrint", "false")
2443 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/comments")
2444 urls += "?" + c.urlParams_.Encode()
2445 req, err := http.NewRequest("GET", urls, body)
2446 if err != nil {
2447 return nil, err
2448 }
2449 req.Header = reqHeaders
2450 googleapi.Expand(req.URL, map[string]string{
2451 "blogId": c.blogId,
2452 })
2453 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2454 }
2455
2456
2457
2458
2459
2460
2461 func (c *CommentsListByBlogCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
2462 gensupport.SetOptions(c.urlParams_, opts...)
2463 res, err := c.doRequest("json")
2464 if res != nil && res.StatusCode == http.StatusNotModified {
2465 if res.Body != nil {
2466 res.Body.Close()
2467 }
2468 return nil, gensupport.WrapError(&googleapi.Error{
2469 Code: res.StatusCode,
2470 Header: res.Header,
2471 })
2472 }
2473 if err != nil {
2474 return nil, err
2475 }
2476 defer googleapi.CloseBody(res)
2477 if err := googleapi.CheckResponse(res); err != nil {
2478 return nil, gensupport.WrapError(err)
2479 }
2480 ret := &CommentList{
2481 ServerResponse: googleapi.ServerResponse{
2482 Header: res.Header,
2483 HTTPStatusCode: res.StatusCode,
2484 },
2485 }
2486 target := &ret
2487 if err := gensupport.DecodeResponse(target, res); err != nil {
2488 return nil, err
2489 }
2490 return ret, nil
2491 }
2492
2493
2494
2495
2496 func (c *CommentsListByBlogCall) Pages(ctx context.Context, f func(*CommentList) error) error {
2497 c.ctx_ = ctx
2498 defer c.PageToken(c.urlParams_.Get("pageToken"))
2499 for {
2500 x, err := c.Do()
2501 if err != nil {
2502 return err
2503 }
2504 if err := f(x); err != nil {
2505 return err
2506 }
2507 if x.NextPageToken == "" {
2508 return nil
2509 }
2510 c.PageToken(x.NextPageToken)
2511 }
2512 }
2513
2514 type CommentsMarkAsSpamCall struct {
2515 s *Service
2516 blogId string
2517 postId string
2518 commentId string
2519 urlParams_ gensupport.URLParams
2520 ctx_ context.Context
2521 header_ http.Header
2522 }
2523
2524
2525
2526
2527
2528
2529 func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall {
2530 c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2531 c.blogId = blogId
2532 c.postId = postId
2533 c.commentId = commentId
2534 return c
2535 }
2536
2537
2538
2539
2540 func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall {
2541 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2542 return c
2543 }
2544
2545
2546 func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall {
2547 c.ctx_ = ctx
2548 return c
2549 }
2550
2551
2552
2553 func (c *CommentsMarkAsSpamCall) Header() http.Header {
2554 if c.header_ == nil {
2555 c.header_ = make(http.Header)
2556 }
2557 return c.header_
2558 }
2559
2560 func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) {
2561 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2562 var body io.Reader = nil
2563 c.urlParams_.Set("alt", alt)
2564 c.urlParams_.Set("prettyPrint", "false")
2565 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/spam")
2566 urls += "?" + c.urlParams_.Encode()
2567 req, err := http.NewRequest("POST", urls, body)
2568 if err != nil {
2569 return nil, err
2570 }
2571 req.Header = reqHeaders
2572 googleapi.Expand(req.URL, map[string]string{
2573 "blogId": c.blogId,
2574 "postId": c.postId,
2575 "commentId": c.commentId,
2576 })
2577 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2578 }
2579
2580
2581
2582
2583
2584
2585 func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
2586 gensupport.SetOptions(c.urlParams_, opts...)
2587 res, err := c.doRequest("json")
2588 if res != nil && res.StatusCode == http.StatusNotModified {
2589 if res.Body != nil {
2590 res.Body.Close()
2591 }
2592 return nil, gensupport.WrapError(&googleapi.Error{
2593 Code: res.StatusCode,
2594 Header: res.Header,
2595 })
2596 }
2597 if err != nil {
2598 return nil, err
2599 }
2600 defer googleapi.CloseBody(res)
2601 if err := googleapi.CheckResponse(res); err != nil {
2602 return nil, gensupport.WrapError(err)
2603 }
2604 ret := &Comment{
2605 ServerResponse: googleapi.ServerResponse{
2606 Header: res.Header,
2607 HTTPStatusCode: res.StatusCode,
2608 },
2609 }
2610 target := &ret
2611 if err := gensupport.DecodeResponse(target, res); err != nil {
2612 return nil, err
2613 }
2614 return ret, nil
2615 }
2616
2617 type CommentsRemoveContentCall struct {
2618 s *Service
2619 blogId string
2620 postId string
2621 commentId string
2622 urlParams_ gensupport.URLParams
2623 ctx_ context.Context
2624 header_ http.Header
2625 }
2626
2627
2628
2629
2630
2631
2632
2633 func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall {
2634 c := &CommentsRemoveContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2635 c.blogId = blogId
2636 c.postId = postId
2637 c.commentId = commentId
2638 return c
2639 }
2640
2641
2642
2643
2644 func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall {
2645 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2646 return c
2647 }
2648
2649
2650 func (c *CommentsRemoveContentCall) Context(ctx context.Context) *CommentsRemoveContentCall {
2651 c.ctx_ = ctx
2652 return c
2653 }
2654
2655
2656
2657 func (c *CommentsRemoveContentCall) Header() http.Header {
2658 if c.header_ == nil {
2659 c.header_ = make(http.Header)
2660 }
2661 return c.header_
2662 }
2663
2664 func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) {
2665 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2666 var body io.Reader = nil
2667 c.urlParams_.Set("alt", alt)
2668 c.urlParams_.Set("prettyPrint", "false")
2669 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent")
2670 urls += "?" + c.urlParams_.Encode()
2671 req, err := http.NewRequest("POST", urls, body)
2672 if err != nil {
2673 return nil, err
2674 }
2675 req.Header = reqHeaders
2676 googleapi.Expand(req.URL, map[string]string{
2677 "blogId": c.blogId,
2678 "postId": c.postId,
2679 "commentId": c.commentId,
2680 })
2681 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2682 }
2683
2684
2685
2686
2687
2688
2689 func (c *CommentsRemoveContentCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
2690 gensupport.SetOptions(c.urlParams_, opts...)
2691 res, err := c.doRequest("json")
2692 if res != nil && res.StatusCode == http.StatusNotModified {
2693 if res.Body != nil {
2694 res.Body.Close()
2695 }
2696 return nil, gensupport.WrapError(&googleapi.Error{
2697 Code: res.StatusCode,
2698 Header: res.Header,
2699 })
2700 }
2701 if err != nil {
2702 return nil, err
2703 }
2704 defer googleapi.CloseBody(res)
2705 if err := googleapi.CheckResponse(res); err != nil {
2706 return nil, gensupport.WrapError(err)
2707 }
2708 ret := &Comment{
2709 ServerResponse: googleapi.ServerResponse{
2710 Header: res.Header,
2711 HTTPStatusCode: res.StatusCode,
2712 },
2713 }
2714 target := &ret
2715 if err := gensupport.DecodeResponse(target, res); err != nil {
2716 return nil, err
2717 }
2718 return ret, nil
2719 }
2720
2721 type PageViewsGetCall struct {
2722 s *Service
2723 blogId string
2724 urlParams_ gensupport.URLParams
2725 ifNoneMatch_ string
2726 ctx_ context.Context
2727 header_ http.Header
2728 }
2729
2730
2731
2732
2733 func (r *PageViewsService) Get(blogId string) *PageViewsGetCall {
2734 c := &PageViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2735 c.blogId = blogId
2736 return c
2737 }
2738
2739
2740
2741
2742
2743
2744
2745
2746 func (c *PageViewsGetCall) Range(range_ ...string) *PageViewsGetCall {
2747 c.urlParams_.SetMulti("range", append([]string{}, range_...))
2748 return c
2749 }
2750
2751
2752
2753
2754 func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall {
2755 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2756 return c
2757 }
2758
2759
2760
2761
2762 func (c *PageViewsGetCall) IfNoneMatch(entityTag string) *PageViewsGetCall {
2763 c.ifNoneMatch_ = entityTag
2764 return c
2765 }
2766
2767
2768 func (c *PageViewsGetCall) Context(ctx context.Context) *PageViewsGetCall {
2769 c.ctx_ = ctx
2770 return c
2771 }
2772
2773
2774
2775 func (c *PageViewsGetCall) Header() http.Header {
2776 if c.header_ == nil {
2777 c.header_ = make(http.Header)
2778 }
2779 return c.header_
2780 }
2781
2782 func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) {
2783 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2784 if c.ifNoneMatch_ != "" {
2785 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2786 }
2787 var body io.Reader = nil
2788 c.urlParams_.Set("alt", alt)
2789 c.urlParams_.Set("prettyPrint", "false")
2790 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pageviews")
2791 urls += "?" + c.urlParams_.Encode()
2792 req, err := http.NewRequest("GET", urls, body)
2793 if err != nil {
2794 return nil, err
2795 }
2796 req.Header = reqHeaders
2797 googleapi.Expand(req.URL, map[string]string{
2798 "blogId": c.blogId,
2799 })
2800 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2801 }
2802
2803
2804
2805
2806
2807
2808 func (c *PageViewsGetCall) Do(opts ...googleapi.CallOption) (*Pageviews, error) {
2809 gensupport.SetOptions(c.urlParams_, opts...)
2810 res, err := c.doRequest("json")
2811 if res != nil && res.StatusCode == http.StatusNotModified {
2812 if res.Body != nil {
2813 res.Body.Close()
2814 }
2815 return nil, gensupport.WrapError(&googleapi.Error{
2816 Code: res.StatusCode,
2817 Header: res.Header,
2818 })
2819 }
2820 if err != nil {
2821 return nil, err
2822 }
2823 defer googleapi.CloseBody(res)
2824 if err := googleapi.CheckResponse(res); err != nil {
2825 return nil, gensupport.WrapError(err)
2826 }
2827 ret := &Pageviews{
2828 ServerResponse: googleapi.ServerResponse{
2829 Header: res.Header,
2830 HTTPStatusCode: res.StatusCode,
2831 },
2832 }
2833 target := &ret
2834 if err := gensupport.DecodeResponse(target, res); err != nil {
2835 return nil, err
2836 }
2837 return ret, nil
2838 }
2839
2840 type PagesDeleteCall struct {
2841 s *Service
2842 blogId string
2843 pageId string
2844 urlParams_ gensupport.URLParams
2845 ctx_ context.Context
2846 header_ http.Header
2847 }
2848
2849
2850
2851
2852
2853 func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall {
2854 c := &PagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2855 c.blogId = blogId
2856 c.pageId = pageId
2857 return c
2858 }
2859
2860
2861 func (c *PagesDeleteCall) UseTrash(useTrash bool) *PagesDeleteCall {
2862 c.urlParams_.Set("useTrash", fmt.Sprint(useTrash))
2863 return c
2864 }
2865
2866
2867
2868
2869 func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall {
2870 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2871 return c
2872 }
2873
2874
2875 func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall {
2876 c.ctx_ = ctx
2877 return c
2878 }
2879
2880
2881
2882 func (c *PagesDeleteCall) Header() http.Header {
2883 if c.header_ == nil {
2884 c.header_ = make(http.Header)
2885 }
2886 return c.header_
2887 }
2888
2889 func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) {
2890 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2891 var body io.Reader = nil
2892 c.urlParams_.Set("alt", alt)
2893 c.urlParams_.Set("prettyPrint", "false")
2894 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}")
2895 urls += "?" + c.urlParams_.Encode()
2896 req, err := http.NewRequest("DELETE", urls, body)
2897 if err != nil {
2898 return nil, err
2899 }
2900 req.Header = reqHeaders
2901 googleapi.Expand(req.URL, map[string]string{
2902 "blogId": c.blogId,
2903 "pageId": c.pageId,
2904 })
2905 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2906 }
2907
2908
2909 func (c *PagesDeleteCall) Do(opts ...googleapi.CallOption) error {
2910 gensupport.SetOptions(c.urlParams_, opts...)
2911 res, err := c.doRequest("json")
2912 if err != nil {
2913 return err
2914 }
2915 defer googleapi.CloseBody(res)
2916 if err := googleapi.CheckResponse(res); err != nil {
2917 return gensupport.WrapError(err)
2918 }
2919 return nil
2920 }
2921
2922 type PagesGetCall struct {
2923 s *Service
2924 blogId string
2925 pageId string
2926 urlParams_ gensupport.URLParams
2927 ifNoneMatch_ string
2928 ctx_ context.Context
2929 header_ http.Header
2930 }
2931
2932
2933
2934
2935
2936 func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall {
2937 c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2938 c.blogId = blogId
2939 c.pageId = pageId
2940 return c
2941 }
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951 func (c *PagesGetCall) View(view string) *PagesGetCall {
2952 c.urlParams_.Set("view", view)
2953 return c
2954 }
2955
2956
2957
2958
2959 func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall {
2960 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2961 return c
2962 }
2963
2964
2965
2966
2967 func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall {
2968 c.ifNoneMatch_ = entityTag
2969 return c
2970 }
2971
2972
2973 func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall {
2974 c.ctx_ = ctx
2975 return c
2976 }
2977
2978
2979
2980 func (c *PagesGetCall) Header() http.Header {
2981 if c.header_ == nil {
2982 c.header_ = make(http.Header)
2983 }
2984 return c.header_
2985 }
2986
2987 func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) {
2988 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2989 if c.ifNoneMatch_ != "" {
2990 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2991 }
2992 var body io.Reader = nil
2993 c.urlParams_.Set("alt", alt)
2994 c.urlParams_.Set("prettyPrint", "false")
2995 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}")
2996 urls += "?" + c.urlParams_.Encode()
2997 req, err := http.NewRequest("GET", urls, body)
2998 if err != nil {
2999 return nil, err
3000 }
3001 req.Header = reqHeaders
3002 googleapi.Expand(req.URL, map[string]string{
3003 "blogId": c.blogId,
3004 "pageId": c.pageId,
3005 })
3006 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3007 }
3008
3009
3010
3011
3012
3013
3014 func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*Page, error) {
3015 gensupport.SetOptions(c.urlParams_, opts...)
3016 res, err := c.doRequest("json")
3017 if res != nil && res.StatusCode == http.StatusNotModified {
3018 if res.Body != nil {
3019 res.Body.Close()
3020 }
3021 return nil, gensupport.WrapError(&googleapi.Error{
3022 Code: res.StatusCode,
3023 Header: res.Header,
3024 })
3025 }
3026 if err != nil {
3027 return nil, err
3028 }
3029 defer googleapi.CloseBody(res)
3030 if err := googleapi.CheckResponse(res); err != nil {
3031 return nil, gensupport.WrapError(err)
3032 }
3033 ret := &Page{
3034 ServerResponse: googleapi.ServerResponse{
3035 Header: res.Header,
3036 HTTPStatusCode: res.StatusCode,
3037 },
3038 }
3039 target := &ret
3040 if err := gensupport.DecodeResponse(target, res); err != nil {
3041 return nil, err
3042 }
3043 return ret, nil
3044 }
3045
3046 type PagesInsertCall struct {
3047 s *Service
3048 blogId string
3049 page *Page
3050 urlParams_ gensupport.URLParams
3051 ctx_ context.Context
3052 header_ http.Header
3053 }
3054
3055
3056
3057
3058 func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall {
3059 c := &PagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3060 c.blogId = blogId
3061 c.page = page
3062 return c
3063 }
3064
3065
3066 func (c *PagesInsertCall) IsDraft(isDraft bool) *PagesInsertCall {
3067 c.urlParams_.Set("isDraft", fmt.Sprint(isDraft))
3068 return c
3069 }
3070
3071
3072
3073
3074 func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall {
3075 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3076 return c
3077 }
3078
3079
3080 func (c *PagesInsertCall) Context(ctx context.Context) *PagesInsertCall {
3081 c.ctx_ = ctx
3082 return c
3083 }
3084
3085
3086
3087 func (c *PagesInsertCall) Header() http.Header {
3088 if c.header_ == nil {
3089 c.header_ = make(http.Header)
3090 }
3091 return c.header_
3092 }
3093
3094 func (c *PagesInsertCall) doRequest(alt string) (*http.Response, error) {
3095 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3096 var body io.Reader = nil
3097 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
3098 if err != nil {
3099 return nil, err
3100 }
3101 c.urlParams_.Set("alt", alt)
3102 c.urlParams_.Set("prettyPrint", "false")
3103 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages")
3104 urls += "?" + c.urlParams_.Encode()
3105 req, err := http.NewRequest("POST", urls, body)
3106 if err != nil {
3107 return nil, err
3108 }
3109 req.Header = reqHeaders
3110 googleapi.Expand(req.URL, map[string]string{
3111 "blogId": c.blogId,
3112 })
3113 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3114 }
3115
3116
3117
3118
3119
3120
3121 func (c *PagesInsertCall) Do(opts ...googleapi.CallOption) (*Page, error) {
3122 gensupport.SetOptions(c.urlParams_, opts...)
3123 res, err := c.doRequest("json")
3124 if res != nil && res.StatusCode == http.StatusNotModified {
3125 if res.Body != nil {
3126 res.Body.Close()
3127 }
3128 return nil, gensupport.WrapError(&googleapi.Error{
3129 Code: res.StatusCode,
3130 Header: res.Header,
3131 })
3132 }
3133 if err != nil {
3134 return nil, err
3135 }
3136 defer googleapi.CloseBody(res)
3137 if err := googleapi.CheckResponse(res); err != nil {
3138 return nil, gensupport.WrapError(err)
3139 }
3140 ret := &Page{
3141 ServerResponse: googleapi.ServerResponse{
3142 Header: res.Header,
3143 HTTPStatusCode: res.StatusCode,
3144 },
3145 }
3146 target := &ret
3147 if err := gensupport.DecodeResponse(target, res); err != nil {
3148 return nil, err
3149 }
3150 return ret, nil
3151 }
3152
3153 type PagesListCall struct {
3154 s *Service
3155 blogId string
3156 urlParams_ gensupport.URLParams
3157 ifNoneMatch_ string
3158 ctx_ context.Context
3159 header_ http.Header
3160 }
3161
3162
3163
3164
3165 func (r *PagesService) List(blogId string) *PagesListCall {
3166 c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3167 c.blogId = blogId
3168 return c
3169 }
3170
3171
3172 func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall {
3173 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
3174 return c
3175 }
3176
3177
3178 func (c *PagesListCall) MaxResults(maxResults int64) *PagesListCall {
3179 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3180 return c
3181 }
3182
3183
3184 func (c *PagesListCall) PageToken(pageToken string) *PagesListCall {
3185 c.urlParams_.Set("pageToken", pageToken)
3186 return c
3187 }
3188
3189
3190
3191
3192
3193
3194
3195
3196 func (c *PagesListCall) Status(status ...string) *PagesListCall {
3197 c.urlParams_.SetMulti("status", append([]string{}, status...))
3198 return c
3199 }
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209 func (c *PagesListCall) View(view string) *PagesListCall {
3210 c.urlParams_.Set("view", view)
3211 return c
3212 }
3213
3214
3215
3216
3217 func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall {
3218 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3219 return c
3220 }
3221
3222
3223
3224
3225 func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall {
3226 c.ifNoneMatch_ = entityTag
3227 return c
3228 }
3229
3230
3231 func (c *PagesListCall) Context(ctx context.Context) *PagesListCall {
3232 c.ctx_ = ctx
3233 return c
3234 }
3235
3236
3237
3238 func (c *PagesListCall) Header() http.Header {
3239 if c.header_ == nil {
3240 c.header_ = make(http.Header)
3241 }
3242 return c.header_
3243 }
3244
3245 func (c *PagesListCall) doRequest(alt string) (*http.Response, error) {
3246 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3247 if c.ifNoneMatch_ != "" {
3248 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3249 }
3250 var body io.Reader = nil
3251 c.urlParams_.Set("alt", alt)
3252 c.urlParams_.Set("prettyPrint", "false")
3253 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages")
3254 urls += "?" + c.urlParams_.Encode()
3255 req, err := http.NewRequest("GET", urls, body)
3256 if err != nil {
3257 return nil, err
3258 }
3259 req.Header = reqHeaders
3260 googleapi.Expand(req.URL, map[string]string{
3261 "blogId": c.blogId,
3262 })
3263 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3264 }
3265
3266
3267
3268
3269
3270
3271 func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*PageList, error) {
3272 gensupport.SetOptions(c.urlParams_, opts...)
3273 res, err := c.doRequest("json")
3274 if res != nil && res.StatusCode == http.StatusNotModified {
3275 if res.Body != nil {
3276 res.Body.Close()
3277 }
3278 return nil, gensupport.WrapError(&googleapi.Error{
3279 Code: res.StatusCode,
3280 Header: res.Header,
3281 })
3282 }
3283 if err != nil {
3284 return nil, err
3285 }
3286 defer googleapi.CloseBody(res)
3287 if err := googleapi.CheckResponse(res); err != nil {
3288 return nil, gensupport.WrapError(err)
3289 }
3290 ret := &PageList{
3291 ServerResponse: googleapi.ServerResponse{
3292 Header: res.Header,
3293 HTTPStatusCode: res.StatusCode,
3294 },
3295 }
3296 target := &ret
3297 if err := gensupport.DecodeResponse(target, res); err != nil {
3298 return nil, err
3299 }
3300 return ret, nil
3301 }
3302
3303
3304
3305
3306 func (c *PagesListCall) Pages(ctx context.Context, f func(*PageList) error) error {
3307 c.ctx_ = ctx
3308 defer c.PageToken(c.urlParams_.Get("pageToken"))
3309 for {
3310 x, err := c.Do()
3311 if err != nil {
3312 return err
3313 }
3314 if err := f(x); err != nil {
3315 return err
3316 }
3317 if x.NextPageToken == "" {
3318 return nil
3319 }
3320 c.PageToken(x.NextPageToken)
3321 }
3322 }
3323
3324 type PagesPatchCall struct {
3325 s *Service
3326 blogId string
3327 pageId string
3328 page *Page
3329 urlParams_ gensupport.URLParams
3330 ctx_ context.Context
3331 header_ http.Header
3332 }
3333
3334
3335
3336
3337
3338 func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall {
3339 c := &PagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3340 c.blogId = blogId
3341 c.pageId = pageId
3342 c.page = page
3343 return c
3344 }
3345
3346
3347 func (c *PagesPatchCall) Publish(publish bool) *PagesPatchCall {
3348 c.urlParams_.Set("publish", fmt.Sprint(publish))
3349 return c
3350 }
3351
3352
3353 func (c *PagesPatchCall) Revert(revert bool) *PagesPatchCall {
3354 c.urlParams_.Set("revert", fmt.Sprint(revert))
3355 return c
3356 }
3357
3358
3359
3360
3361 func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall {
3362 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3363 return c
3364 }
3365
3366
3367 func (c *PagesPatchCall) Context(ctx context.Context) *PagesPatchCall {
3368 c.ctx_ = ctx
3369 return c
3370 }
3371
3372
3373
3374 func (c *PagesPatchCall) Header() http.Header {
3375 if c.header_ == nil {
3376 c.header_ = make(http.Header)
3377 }
3378 return c.header_
3379 }
3380
3381 func (c *PagesPatchCall) doRequest(alt string) (*http.Response, error) {
3382 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3383 var body io.Reader = nil
3384 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
3385 if err != nil {
3386 return nil, err
3387 }
3388 c.urlParams_.Set("alt", alt)
3389 c.urlParams_.Set("prettyPrint", "false")
3390 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}")
3391 urls += "?" + c.urlParams_.Encode()
3392 req, err := http.NewRequest("PATCH", urls, body)
3393 if err != nil {
3394 return nil, err
3395 }
3396 req.Header = reqHeaders
3397 googleapi.Expand(req.URL, map[string]string{
3398 "blogId": c.blogId,
3399 "pageId": c.pageId,
3400 })
3401 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3402 }
3403
3404
3405
3406
3407
3408
3409 func (c *PagesPatchCall) Do(opts ...googleapi.CallOption) (*Page, error) {
3410 gensupport.SetOptions(c.urlParams_, opts...)
3411 res, err := c.doRequest("json")
3412 if res != nil && res.StatusCode == http.StatusNotModified {
3413 if res.Body != nil {
3414 res.Body.Close()
3415 }
3416 return nil, gensupport.WrapError(&googleapi.Error{
3417 Code: res.StatusCode,
3418 Header: res.Header,
3419 })
3420 }
3421 if err != nil {
3422 return nil, err
3423 }
3424 defer googleapi.CloseBody(res)
3425 if err := googleapi.CheckResponse(res); err != nil {
3426 return nil, gensupport.WrapError(err)
3427 }
3428 ret := &Page{
3429 ServerResponse: googleapi.ServerResponse{
3430 Header: res.Header,
3431 HTTPStatusCode: res.StatusCode,
3432 },
3433 }
3434 target := &ret
3435 if err := gensupport.DecodeResponse(target, res); err != nil {
3436 return nil, err
3437 }
3438 return ret, nil
3439 }
3440
3441 type PagesPublishCall struct {
3442 s *Service
3443 blogId string
3444 pageId string
3445 urlParams_ gensupport.URLParams
3446 ctx_ context.Context
3447 header_ http.Header
3448 }
3449
3450
3451
3452
3453
3454 func (r *PagesService) Publish(blogId string, pageId string) *PagesPublishCall {
3455 c := &PagesPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3456 c.blogId = blogId
3457 c.pageId = pageId
3458 return c
3459 }
3460
3461
3462
3463
3464 func (c *PagesPublishCall) Fields(s ...googleapi.Field) *PagesPublishCall {
3465 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3466 return c
3467 }
3468
3469
3470 func (c *PagesPublishCall) Context(ctx context.Context) *PagesPublishCall {
3471 c.ctx_ = ctx
3472 return c
3473 }
3474
3475
3476
3477 func (c *PagesPublishCall) Header() http.Header {
3478 if c.header_ == nil {
3479 c.header_ = make(http.Header)
3480 }
3481 return c.header_
3482 }
3483
3484 func (c *PagesPublishCall) doRequest(alt string) (*http.Response, error) {
3485 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3486 var body io.Reader = nil
3487 c.urlParams_.Set("alt", alt)
3488 c.urlParams_.Set("prettyPrint", "false")
3489 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}/publish")
3490 urls += "?" + c.urlParams_.Encode()
3491 req, err := http.NewRequest("POST", urls, body)
3492 if err != nil {
3493 return nil, err
3494 }
3495 req.Header = reqHeaders
3496 googleapi.Expand(req.URL, map[string]string{
3497 "blogId": c.blogId,
3498 "pageId": c.pageId,
3499 })
3500 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3501 }
3502
3503
3504
3505
3506
3507
3508 func (c *PagesPublishCall) Do(opts ...googleapi.CallOption) (*Page, error) {
3509 gensupport.SetOptions(c.urlParams_, opts...)
3510 res, err := c.doRequest("json")
3511 if res != nil && res.StatusCode == http.StatusNotModified {
3512 if res.Body != nil {
3513 res.Body.Close()
3514 }
3515 return nil, gensupport.WrapError(&googleapi.Error{
3516 Code: res.StatusCode,
3517 Header: res.Header,
3518 })
3519 }
3520 if err != nil {
3521 return nil, err
3522 }
3523 defer googleapi.CloseBody(res)
3524 if err := googleapi.CheckResponse(res); err != nil {
3525 return nil, gensupport.WrapError(err)
3526 }
3527 ret := &Page{
3528 ServerResponse: googleapi.ServerResponse{
3529 Header: res.Header,
3530 HTTPStatusCode: res.StatusCode,
3531 },
3532 }
3533 target := &ret
3534 if err := gensupport.DecodeResponse(target, res); err != nil {
3535 return nil, err
3536 }
3537 return ret, nil
3538 }
3539
3540 type PagesRevertCall struct {
3541 s *Service
3542 blogId string
3543 pageId string
3544 urlParams_ gensupport.URLParams
3545 ctx_ context.Context
3546 header_ http.Header
3547 }
3548
3549
3550
3551
3552
3553 func (r *PagesService) Revert(blogId string, pageId string) *PagesRevertCall {
3554 c := &PagesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3555 c.blogId = blogId
3556 c.pageId = pageId
3557 return c
3558 }
3559
3560
3561
3562
3563 func (c *PagesRevertCall) Fields(s ...googleapi.Field) *PagesRevertCall {
3564 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3565 return c
3566 }
3567
3568
3569 func (c *PagesRevertCall) Context(ctx context.Context) *PagesRevertCall {
3570 c.ctx_ = ctx
3571 return c
3572 }
3573
3574
3575
3576 func (c *PagesRevertCall) Header() http.Header {
3577 if c.header_ == nil {
3578 c.header_ = make(http.Header)
3579 }
3580 return c.header_
3581 }
3582
3583 func (c *PagesRevertCall) doRequest(alt string) (*http.Response, error) {
3584 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3585 var body io.Reader = nil
3586 c.urlParams_.Set("alt", alt)
3587 c.urlParams_.Set("prettyPrint", "false")
3588 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}/revert")
3589 urls += "?" + c.urlParams_.Encode()
3590 req, err := http.NewRequest("POST", urls, body)
3591 if err != nil {
3592 return nil, err
3593 }
3594 req.Header = reqHeaders
3595 googleapi.Expand(req.URL, map[string]string{
3596 "blogId": c.blogId,
3597 "pageId": c.pageId,
3598 })
3599 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3600 }
3601
3602
3603
3604
3605
3606
3607 func (c *PagesRevertCall) Do(opts ...googleapi.CallOption) (*Page, error) {
3608 gensupport.SetOptions(c.urlParams_, opts...)
3609 res, err := c.doRequest("json")
3610 if res != nil && res.StatusCode == http.StatusNotModified {
3611 if res.Body != nil {
3612 res.Body.Close()
3613 }
3614 return nil, gensupport.WrapError(&googleapi.Error{
3615 Code: res.StatusCode,
3616 Header: res.Header,
3617 })
3618 }
3619 if err != nil {
3620 return nil, err
3621 }
3622 defer googleapi.CloseBody(res)
3623 if err := googleapi.CheckResponse(res); err != nil {
3624 return nil, gensupport.WrapError(err)
3625 }
3626 ret := &Page{
3627 ServerResponse: googleapi.ServerResponse{
3628 Header: res.Header,
3629 HTTPStatusCode: res.StatusCode,
3630 },
3631 }
3632 target := &ret
3633 if err := gensupport.DecodeResponse(target, res); err != nil {
3634 return nil, err
3635 }
3636 return ret, nil
3637 }
3638
3639 type PagesUpdateCall struct {
3640 s *Service
3641 blogId string
3642 pageId string
3643 page *Page
3644 urlParams_ gensupport.URLParams
3645 ctx_ context.Context
3646 header_ http.Header
3647 }
3648
3649
3650
3651
3652
3653 func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall {
3654 c := &PagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3655 c.blogId = blogId
3656 c.pageId = pageId
3657 c.page = page
3658 return c
3659 }
3660
3661
3662 func (c *PagesUpdateCall) Publish(publish bool) *PagesUpdateCall {
3663 c.urlParams_.Set("publish", fmt.Sprint(publish))
3664 return c
3665 }
3666
3667
3668 func (c *PagesUpdateCall) Revert(revert bool) *PagesUpdateCall {
3669 c.urlParams_.Set("revert", fmt.Sprint(revert))
3670 return c
3671 }
3672
3673
3674
3675
3676 func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall {
3677 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3678 return c
3679 }
3680
3681
3682 func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall {
3683 c.ctx_ = ctx
3684 return c
3685 }
3686
3687
3688
3689 func (c *PagesUpdateCall) Header() http.Header {
3690 if c.header_ == nil {
3691 c.header_ = make(http.Header)
3692 }
3693 return c.header_
3694 }
3695
3696 func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) {
3697 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3698 var body io.Reader = nil
3699 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
3700 if err != nil {
3701 return nil, err
3702 }
3703 c.urlParams_.Set("alt", alt)
3704 c.urlParams_.Set("prettyPrint", "false")
3705 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/pages/{pageId}")
3706 urls += "?" + c.urlParams_.Encode()
3707 req, err := http.NewRequest("PUT", urls, body)
3708 if err != nil {
3709 return nil, err
3710 }
3711 req.Header = reqHeaders
3712 googleapi.Expand(req.URL, map[string]string{
3713 "blogId": c.blogId,
3714 "pageId": c.pageId,
3715 })
3716 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3717 }
3718
3719
3720
3721
3722
3723
3724 func (c *PagesUpdateCall) Do(opts ...googleapi.CallOption) (*Page, error) {
3725 gensupport.SetOptions(c.urlParams_, opts...)
3726 res, err := c.doRequest("json")
3727 if res != nil && res.StatusCode == http.StatusNotModified {
3728 if res.Body != nil {
3729 res.Body.Close()
3730 }
3731 return nil, gensupport.WrapError(&googleapi.Error{
3732 Code: res.StatusCode,
3733 Header: res.Header,
3734 })
3735 }
3736 if err != nil {
3737 return nil, err
3738 }
3739 defer googleapi.CloseBody(res)
3740 if err := googleapi.CheckResponse(res); err != nil {
3741 return nil, gensupport.WrapError(err)
3742 }
3743 ret := &Page{
3744 ServerResponse: googleapi.ServerResponse{
3745 Header: res.Header,
3746 HTTPStatusCode: res.StatusCode,
3747 },
3748 }
3749 target := &ret
3750 if err := gensupport.DecodeResponse(target, res); err != nil {
3751 return nil, err
3752 }
3753 return ret, nil
3754 }
3755
3756 type PostUserInfosGetCall struct {
3757 s *Service
3758 userId string
3759 blogId string
3760 postId string
3761 urlParams_ gensupport.URLParams
3762 ifNoneMatch_ string
3763 ctx_ context.Context
3764 header_ http.Header
3765 }
3766
3767
3768
3769
3770
3771
3772 func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall {
3773 c := &PostUserInfosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3774 c.userId = userId
3775 c.blogId = blogId
3776 c.postId = postId
3777 return c
3778 }
3779
3780
3781 func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall {
3782 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
3783 return c
3784 }
3785
3786
3787
3788
3789 func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall {
3790 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3791 return c
3792 }
3793
3794
3795
3796
3797 func (c *PostUserInfosGetCall) IfNoneMatch(entityTag string) *PostUserInfosGetCall {
3798 c.ifNoneMatch_ = entityTag
3799 return c
3800 }
3801
3802
3803 func (c *PostUserInfosGetCall) Context(ctx context.Context) *PostUserInfosGetCall {
3804 c.ctx_ = ctx
3805 return c
3806 }
3807
3808
3809
3810 func (c *PostUserInfosGetCall) Header() http.Header {
3811 if c.header_ == nil {
3812 c.header_ = make(http.Header)
3813 }
3814 return c.header_
3815 }
3816
3817 func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) {
3818 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3819 if c.ifNoneMatch_ != "" {
3820 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3821 }
3822 var body io.Reader = nil
3823 c.urlParams_.Set("alt", alt)
3824 c.urlParams_.Set("prettyPrint", "false")
3825 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs/{blogId}/posts/{postId}")
3826 urls += "?" + c.urlParams_.Encode()
3827 req, err := http.NewRequest("GET", urls, body)
3828 if err != nil {
3829 return nil, err
3830 }
3831 req.Header = reqHeaders
3832 googleapi.Expand(req.URL, map[string]string{
3833 "userId": c.userId,
3834 "blogId": c.blogId,
3835 "postId": c.postId,
3836 })
3837 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3838 }
3839
3840
3841
3842
3843
3844
3845 func (c *PostUserInfosGetCall) Do(opts ...googleapi.CallOption) (*PostUserInfo, error) {
3846 gensupport.SetOptions(c.urlParams_, opts...)
3847 res, err := c.doRequest("json")
3848 if res != nil && res.StatusCode == http.StatusNotModified {
3849 if res.Body != nil {
3850 res.Body.Close()
3851 }
3852 return nil, gensupport.WrapError(&googleapi.Error{
3853 Code: res.StatusCode,
3854 Header: res.Header,
3855 })
3856 }
3857 if err != nil {
3858 return nil, err
3859 }
3860 defer googleapi.CloseBody(res)
3861 if err := googleapi.CheckResponse(res); err != nil {
3862 return nil, gensupport.WrapError(err)
3863 }
3864 ret := &PostUserInfo{
3865 ServerResponse: googleapi.ServerResponse{
3866 Header: res.Header,
3867 HTTPStatusCode: res.StatusCode,
3868 },
3869 }
3870 target := &ret
3871 if err := gensupport.DecodeResponse(target, res); err != nil {
3872 return nil, err
3873 }
3874 return ret, nil
3875 }
3876
3877 type PostUserInfosListCall struct {
3878 s *Service
3879 userId string
3880 blogId string
3881 urlParams_ gensupport.URLParams
3882 ifNoneMatch_ string
3883 ctx_ context.Context
3884 header_ http.Header
3885 }
3886
3887
3888
3889
3890
3891 func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall {
3892 c := &PostUserInfosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3893 c.userId = userId
3894 c.blogId = blogId
3895 return c
3896 }
3897
3898
3899 func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall {
3900 c.urlParams_.Set("endDate", endDate)
3901 return c
3902 }
3903
3904
3905 func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall {
3906 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
3907 return c
3908 }
3909
3910
3911 func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall {
3912 c.urlParams_.Set("labels", labels)
3913 return c
3914 }
3915
3916
3917 func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall {
3918 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3919 return c
3920 }
3921
3922
3923
3924
3925
3926
3927
3928
3929 func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall {
3930 c.urlParams_.Set("orderBy", orderBy)
3931 return c
3932 }
3933
3934
3935 func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall {
3936 c.urlParams_.Set("pageToken", pageToken)
3937 return c
3938 }
3939
3940
3941 func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall {
3942 c.urlParams_.Set("startDate", startDate)
3943 return c
3944 }
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954 func (c *PostUserInfosListCall) Status(status ...string) *PostUserInfosListCall {
3955 c.urlParams_.SetMulti("status", append([]string{}, status...))
3956 return c
3957 }
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967 func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall {
3968 c.urlParams_.Set("view", view)
3969 return c
3970 }
3971
3972
3973
3974
3975 func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall {
3976 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3977 return c
3978 }
3979
3980
3981
3982
3983 func (c *PostUserInfosListCall) IfNoneMatch(entityTag string) *PostUserInfosListCall {
3984 c.ifNoneMatch_ = entityTag
3985 return c
3986 }
3987
3988
3989 func (c *PostUserInfosListCall) Context(ctx context.Context) *PostUserInfosListCall {
3990 c.ctx_ = ctx
3991 return c
3992 }
3993
3994
3995
3996 func (c *PostUserInfosListCall) Header() http.Header {
3997 if c.header_ == nil {
3998 c.header_ = make(http.Header)
3999 }
4000 return c.header_
4001 }
4002
4003 func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) {
4004 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4005 if c.ifNoneMatch_ != "" {
4006 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4007 }
4008 var body io.Reader = nil
4009 c.urlParams_.Set("alt", alt)
4010 c.urlParams_.Set("prettyPrint", "false")
4011 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}/blogs/{blogId}/posts")
4012 urls += "?" + c.urlParams_.Encode()
4013 req, err := http.NewRequest("GET", urls, body)
4014 if err != nil {
4015 return nil, err
4016 }
4017 req.Header = reqHeaders
4018 googleapi.Expand(req.URL, map[string]string{
4019 "userId": c.userId,
4020 "blogId": c.blogId,
4021 })
4022 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4023 }
4024
4025
4026
4027
4028
4029
4030
4031 func (c *PostUserInfosListCall) Do(opts ...googleapi.CallOption) (*PostUserInfosList, error) {
4032 gensupport.SetOptions(c.urlParams_, opts...)
4033 res, err := c.doRequest("json")
4034 if res != nil && res.StatusCode == http.StatusNotModified {
4035 if res.Body != nil {
4036 res.Body.Close()
4037 }
4038 return nil, gensupport.WrapError(&googleapi.Error{
4039 Code: res.StatusCode,
4040 Header: res.Header,
4041 })
4042 }
4043 if err != nil {
4044 return nil, err
4045 }
4046 defer googleapi.CloseBody(res)
4047 if err := googleapi.CheckResponse(res); err != nil {
4048 return nil, gensupport.WrapError(err)
4049 }
4050 ret := &PostUserInfosList{
4051 ServerResponse: googleapi.ServerResponse{
4052 Header: res.Header,
4053 HTTPStatusCode: res.StatusCode,
4054 },
4055 }
4056 target := &ret
4057 if err := gensupport.DecodeResponse(target, res); err != nil {
4058 return nil, err
4059 }
4060 return ret, nil
4061 }
4062
4063
4064
4065
4066 func (c *PostUserInfosListCall) Pages(ctx context.Context, f func(*PostUserInfosList) error) error {
4067 c.ctx_ = ctx
4068 defer c.PageToken(c.urlParams_.Get("pageToken"))
4069 for {
4070 x, err := c.Do()
4071 if err != nil {
4072 return err
4073 }
4074 if err := f(x); err != nil {
4075 return err
4076 }
4077 if x.NextPageToken == "" {
4078 return nil
4079 }
4080 c.PageToken(x.NextPageToken)
4081 }
4082 }
4083
4084 type PostsDeleteCall struct {
4085 s *Service
4086 blogId string
4087 postId string
4088 urlParams_ gensupport.URLParams
4089 ctx_ context.Context
4090 header_ http.Header
4091 }
4092
4093
4094
4095
4096
4097 func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall {
4098 c := &PostsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4099 c.blogId = blogId
4100 c.postId = postId
4101 return c
4102 }
4103
4104
4105 func (c *PostsDeleteCall) UseTrash(useTrash bool) *PostsDeleteCall {
4106 c.urlParams_.Set("useTrash", fmt.Sprint(useTrash))
4107 return c
4108 }
4109
4110
4111
4112
4113 func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall {
4114 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4115 return c
4116 }
4117
4118
4119 func (c *PostsDeleteCall) Context(ctx context.Context) *PostsDeleteCall {
4120 c.ctx_ = ctx
4121 return c
4122 }
4123
4124
4125
4126 func (c *PostsDeleteCall) Header() http.Header {
4127 if c.header_ == nil {
4128 c.header_ = make(http.Header)
4129 }
4130 return c.header_
4131 }
4132
4133 func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) {
4134 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4135 var body io.Reader = nil
4136 c.urlParams_.Set("alt", alt)
4137 c.urlParams_.Set("prettyPrint", "false")
4138 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}")
4139 urls += "?" + c.urlParams_.Encode()
4140 req, err := http.NewRequest("DELETE", urls, body)
4141 if err != nil {
4142 return nil, err
4143 }
4144 req.Header = reqHeaders
4145 googleapi.Expand(req.URL, map[string]string{
4146 "blogId": c.blogId,
4147 "postId": c.postId,
4148 })
4149 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4150 }
4151
4152
4153 func (c *PostsDeleteCall) Do(opts ...googleapi.CallOption) error {
4154 gensupport.SetOptions(c.urlParams_, opts...)
4155 res, err := c.doRequest("json")
4156 if err != nil {
4157 return err
4158 }
4159 defer googleapi.CloseBody(res)
4160 if err := googleapi.CheckResponse(res); err != nil {
4161 return gensupport.WrapError(err)
4162 }
4163 return nil
4164 }
4165
4166 type PostsGetCall struct {
4167 s *Service
4168 blogId string
4169 postId string
4170 urlParams_ gensupport.URLParams
4171 ifNoneMatch_ string
4172 ctx_ context.Context
4173 header_ http.Header
4174 }
4175
4176
4177
4178
4179
4180 func (r *PostsService) Get(blogId string, postId string) *PostsGetCall {
4181 c := &PostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4182 c.blogId = blogId
4183 c.postId = postId
4184 return c
4185 }
4186
4187
4188 func (c *PostsGetCall) FetchBody(fetchBody bool) *PostsGetCall {
4189 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody))
4190 return c
4191 }
4192
4193
4194 func (c *PostsGetCall) FetchImages(fetchImages bool) *PostsGetCall {
4195 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages))
4196 return c
4197 }
4198
4199
4200 func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall {
4201 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
4202 return c
4203 }
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213 func (c *PostsGetCall) View(view string) *PostsGetCall {
4214 c.urlParams_.Set("view", view)
4215 return c
4216 }
4217
4218
4219
4220
4221 func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall {
4222 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4223 return c
4224 }
4225
4226
4227
4228
4229 func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall {
4230 c.ifNoneMatch_ = entityTag
4231 return c
4232 }
4233
4234
4235 func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall {
4236 c.ctx_ = ctx
4237 return c
4238 }
4239
4240
4241
4242 func (c *PostsGetCall) Header() http.Header {
4243 if c.header_ == nil {
4244 c.header_ = make(http.Header)
4245 }
4246 return c.header_
4247 }
4248
4249 func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) {
4250 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4251 if c.ifNoneMatch_ != "" {
4252 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4253 }
4254 var body io.Reader = nil
4255 c.urlParams_.Set("alt", alt)
4256 c.urlParams_.Set("prettyPrint", "false")
4257 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}")
4258 urls += "?" + c.urlParams_.Encode()
4259 req, err := http.NewRequest("GET", urls, body)
4260 if err != nil {
4261 return nil, err
4262 }
4263 req.Header = reqHeaders
4264 googleapi.Expand(req.URL, map[string]string{
4265 "blogId": c.blogId,
4266 "postId": c.postId,
4267 })
4268 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4269 }
4270
4271
4272
4273
4274
4275
4276 func (c *PostsGetCall) Do(opts ...googleapi.CallOption) (*Post, error) {
4277 gensupport.SetOptions(c.urlParams_, opts...)
4278 res, err := c.doRequest("json")
4279 if res != nil && res.StatusCode == http.StatusNotModified {
4280 if res.Body != nil {
4281 res.Body.Close()
4282 }
4283 return nil, gensupport.WrapError(&googleapi.Error{
4284 Code: res.StatusCode,
4285 Header: res.Header,
4286 })
4287 }
4288 if err != nil {
4289 return nil, err
4290 }
4291 defer googleapi.CloseBody(res)
4292 if err := googleapi.CheckResponse(res); err != nil {
4293 return nil, gensupport.WrapError(err)
4294 }
4295 ret := &Post{
4296 ServerResponse: googleapi.ServerResponse{
4297 Header: res.Header,
4298 HTTPStatusCode: res.StatusCode,
4299 },
4300 }
4301 target := &ret
4302 if err := gensupport.DecodeResponse(target, res); err != nil {
4303 return nil, err
4304 }
4305 return ret, nil
4306 }
4307
4308 type PostsGetByPathCall struct {
4309 s *Service
4310 blogId string
4311 urlParams_ gensupport.URLParams
4312 ifNoneMatch_ string
4313 ctx_ context.Context
4314 header_ http.Header
4315 }
4316
4317
4318
4319
4320
4321 func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall {
4322 c := &PostsGetByPathCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4323 c.blogId = blogId
4324 c.urlParams_.Set("path", path)
4325 return c
4326 }
4327
4328
4329 func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall {
4330 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
4331 return c
4332 }
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342 func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall {
4343 c.urlParams_.Set("view", view)
4344 return c
4345 }
4346
4347
4348
4349
4350 func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall {
4351 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4352 return c
4353 }
4354
4355
4356
4357
4358 func (c *PostsGetByPathCall) IfNoneMatch(entityTag string) *PostsGetByPathCall {
4359 c.ifNoneMatch_ = entityTag
4360 return c
4361 }
4362
4363
4364 func (c *PostsGetByPathCall) Context(ctx context.Context) *PostsGetByPathCall {
4365 c.ctx_ = ctx
4366 return c
4367 }
4368
4369
4370
4371 func (c *PostsGetByPathCall) Header() http.Header {
4372 if c.header_ == nil {
4373 c.header_ = make(http.Header)
4374 }
4375 return c.header_
4376 }
4377
4378 func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) {
4379 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4380 if c.ifNoneMatch_ != "" {
4381 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4382 }
4383 var body io.Reader = nil
4384 c.urlParams_.Set("alt", alt)
4385 c.urlParams_.Set("prettyPrint", "false")
4386 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/bypath")
4387 urls += "?" + c.urlParams_.Encode()
4388 req, err := http.NewRequest("GET", urls, body)
4389 if err != nil {
4390 return nil, err
4391 }
4392 req.Header = reqHeaders
4393 googleapi.Expand(req.URL, map[string]string{
4394 "blogId": c.blogId,
4395 })
4396 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4397 }
4398
4399
4400
4401
4402
4403
4404 func (c *PostsGetByPathCall) Do(opts ...googleapi.CallOption) (*Post, error) {
4405 gensupport.SetOptions(c.urlParams_, opts...)
4406 res, err := c.doRequest("json")
4407 if res != nil && res.StatusCode == http.StatusNotModified {
4408 if res.Body != nil {
4409 res.Body.Close()
4410 }
4411 return nil, gensupport.WrapError(&googleapi.Error{
4412 Code: res.StatusCode,
4413 Header: res.Header,
4414 })
4415 }
4416 if err != nil {
4417 return nil, err
4418 }
4419 defer googleapi.CloseBody(res)
4420 if err := googleapi.CheckResponse(res); err != nil {
4421 return nil, gensupport.WrapError(err)
4422 }
4423 ret := &Post{
4424 ServerResponse: googleapi.ServerResponse{
4425 Header: res.Header,
4426 HTTPStatusCode: res.StatusCode,
4427 },
4428 }
4429 target := &ret
4430 if err := gensupport.DecodeResponse(target, res); err != nil {
4431 return nil, err
4432 }
4433 return ret, nil
4434 }
4435
4436 type PostsInsertCall struct {
4437 s *Service
4438 blogId string
4439 post *Post
4440 urlParams_ gensupport.URLParams
4441 ctx_ context.Context
4442 header_ http.Header
4443 }
4444
4445
4446
4447
4448 func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall {
4449 c := &PostsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4450 c.blogId = blogId
4451 c.post = post
4452 return c
4453 }
4454
4455
4456 func (c *PostsInsertCall) FetchBody(fetchBody bool) *PostsInsertCall {
4457 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody))
4458 return c
4459 }
4460
4461
4462 func (c *PostsInsertCall) FetchImages(fetchImages bool) *PostsInsertCall {
4463 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages))
4464 return c
4465 }
4466
4467
4468 func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall {
4469 c.urlParams_.Set("isDraft", fmt.Sprint(isDraft))
4470 return c
4471 }
4472
4473
4474
4475
4476 func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall {
4477 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4478 return c
4479 }
4480
4481
4482 func (c *PostsInsertCall) Context(ctx context.Context) *PostsInsertCall {
4483 c.ctx_ = ctx
4484 return c
4485 }
4486
4487
4488
4489 func (c *PostsInsertCall) Header() http.Header {
4490 if c.header_ == nil {
4491 c.header_ = make(http.Header)
4492 }
4493 return c.header_
4494 }
4495
4496 func (c *PostsInsertCall) doRequest(alt string) (*http.Response, error) {
4497 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4498 var body io.Reader = nil
4499 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
4500 if err != nil {
4501 return nil, err
4502 }
4503 c.urlParams_.Set("alt", alt)
4504 c.urlParams_.Set("prettyPrint", "false")
4505 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts")
4506 urls += "?" + c.urlParams_.Encode()
4507 req, err := http.NewRequest("POST", urls, body)
4508 if err != nil {
4509 return nil, err
4510 }
4511 req.Header = reqHeaders
4512 googleapi.Expand(req.URL, map[string]string{
4513 "blogId": c.blogId,
4514 })
4515 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4516 }
4517
4518
4519
4520
4521
4522
4523 func (c *PostsInsertCall) Do(opts ...googleapi.CallOption) (*Post, error) {
4524 gensupport.SetOptions(c.urlParams_, opts...)
4525 res, err := c.doRequest("json")
4526 if res != nil && res.StatusCode == http.StatusNotModified {
4527 if res.Body != nil {
4528 res.Body.Close()
4529 }
4530 return nil, gensupport.WrapError(&googleapi.Error{
4531 Code: res.StatusCode,
4532 Header: res.Header,
4533 })
4534 }
4535 if err != nil {
4536 return nil, err
4537 }
4538 defer googleapi.CloseBody(res)
4539 if err := googleapi.CheckResponse(res); err != nil {
4540 return nil, gensupport.WrapError(err)
4541 }
4542 ret := &Post{
4543 ServerResponse: googleapi.ServerResponse{
4544 Header: res.Header,
4545 HTTPStatusCode: res.StatusCode,
4546 },
4547 }
4548 target := &ret
4549 if err := gensupport.DecodeResponse(target, res); err != nil {
4550 return nil, err
4551 }
4552 return ret, nil
4553 }
4554
4555 type PostsListCall struct {
4556 s *Service
4557 blogId string
4558 urlParams_ gensupport.URLParams
4559 ifNoneMatch_ string
4560 ctx_ context.Context
4561 header_ http.Header
4562 }
4563
4564
4565
4566
4567 func (r *PostsService) List(blogId string) *PostsListCall {
4568 c := &PostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4569 c.blogId = blogId
4570 return c
4571 }
4572
4573
4574 func (c *PostsListCall) EndDate(endDate string) *PostsListCall {
4575 c.urlParams_.Set("endDate", endDate)
4576 return c
4577 }
4578
4579
4580 func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall {
4581 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
4582 return c
4583 }
4584
4585
4586 func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall {
4587 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages))
4588 return c
4589 }
4590
4591
4592 func (c *PostsListCall) Labels(labels string) *PostsListCall {
4593 c.urlParams_.Set("labels", labels)
4594 return c
4595 }
4596
4597
4598 func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall {
4599 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4600 return c
4601 }
4602
4603
4604
4605
4606
4607
4608
4609
4610 func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall {
4611 c.urlParams_.Set("orderBy", orderBy)
4612 return c
4613 }
4614
4615
4616 func (c *PostsListCall) PageToken(pageToken string) *PostsListCall {
4617 c.urlParams_.Set("pageToken", pageToken)
4618 return c
4619 }
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632 func (c *PostsListCall) SortOption(sortOption string) *PostsListCall {
4633 c.urlParams_.Set("sortOption", sortOption)
4634 return c
4635 }
4636
4637
4638 func (c *PostsListCall) StartDate(startDate string) *PostsListCall {
4639 c.urlParams_.Set("startDate", startDate)
4640 return c
4641 }
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651 func (c *PostsListCall) Status(status ...string) *PostsListCall {
4652 c.urlParams_.SetMulti("status", append([]string{}, status...))
4653 return c
4654 }
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664 func (c *PostsListCall) View(view string) *PostsListCall {
4665 c.urlParams_.Set("view", view)
4666 return c
4667 }
4668
4669
4670
4671
4672 func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall {
4673 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4674 return c
4675 }
4676
4677
4678
4679
4680 func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall {
4681 c.ifNoneMatch_ = entityTag
4682 return c
4683 }
4684
4685
4686 func (c *PostsListCall) Context(ctx context.Context) *PostsListCall {
4687 c.ctx_ = ctx
4688 return c
4689 }
4690
4691
4692
4693 func (c *PostsListCall) Header() http.Header {
4694 if c.header_ == nil {
4695 c.header_ = make(http.Header)
4696 }
4697 return c.header_
4698 }
4699
4700 func (c *PostsListCall) doRequest(alt string) (*http.Response, error) {
4701 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4702 if c.ifNoneMatch_ != "" {
4703 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4704 }
4705 var body io.Reader = nil
4706 c.urlParams_.Set("alt", alt)
4707 c.urlParams_.Set("prettyPrint", "false")
4708 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts")
4709 urls += "?" + c.urlParams_.Encode()
4710 req, err := http.NewRequest("GET", urls, body)
4711 if err != nil {
4712 return nil, err
4713 }
4714 req.Header = reqHeaders
4715 googleapi.Expand(req.URL, map[string]string{
4716 "blogId": c.blogId,
4717 })
4718 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4719 }
4720
4721
4722
4723
4724
4725
4726 func (c *PostsListCall) Do(opts ...googleapi.CallOption) (*PostList, error) {
4727 gensupport.SetOptions(c.urlParams_, opts...)
4728 res, err := c.doRequest("json")
4729 if res != nil && res.StatusCode == http.StatusNotModified {
4730 if res.Body != nil {
4731 res.Body.Close()
4732 }
4733 return nil, gensupport.WrapError(&googleapi.Error{
4734 Code: res.StatusCode,
4735 Header: res.Header,
4736 })
4737 }
4738 if err != nil {
4739 return nil, err
4740 }
4741 defer googleapi.CloseBody(res)
4742 if err := googleapi.CheckResponse(res); err != nil {
4743 return nil, gensupport.WrapError(err)
4744 }
4745 ret := &PostList{
4746 ServerResponse: googleapi.ServerResponse{
4747 Header: res.Header,
4748 HTTPStatusCode: res.StatusCode,
4749 },
4750 }
4751 target := &ret
4752 if err := gensupport.DecodeResponse(target, res); err != nil {
4753 return nil, err
4754 }
4755 return ret, nil
4756 }
4757
4758
4759
4760
4761 func (c *PostsListCall) Pages(ctx context.Context, f func(*PostList) error) error {
4762 c.ctx_ = ctx
4763 defer c.PageToken(c.urlParams_.Get("pageToken"))
4764 for {
4765 x, err := c.Do()
4766 if err != nil {
4767 return err
4768 }
4769 if err := f(x); err != nil {
4770 return err
4771 }
4772 if x.NextPageToken == "" {
4773 return nil
4774 }
4775 c.PageToken(x.NextPageToken)
4776 }
4777 }
4778
4779 type PostsPatchCall struct {
4780 s *Service
4781 blogId string
4782 postId string
4783 post *Post
4784 urlParams_ gensupport.URLParams
4785 ctx_ context.Context
4786 header_ http.Header
4787 }
4788
4789
4790
4791
4792
4793 func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall {
4794 c := &PostsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4795 c.blogId = blogId
4796 c.postId = postId
4797 c.post = post
4798 return c
4799 }
4800
4801
4802 func (c *PostsPatchCall) FetchBody(fetchBody bool) *PostsPatchCall {
4803 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody))
4804 return c
4805 }
4806
4807
4808 func (c *PostsPatchCall) FetchImages(fetchImages bool) *PostsPatchCall {
4809 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages))
4810 return c
4811 }
4812
4813
4814 func (c *PostsPatchCall) MaxComments(maxComments int64) *PostsPatchCall {
4815 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
4816 return c
4817 }
4818
4819
4820 func (c *PostsPatchCall) Publish(publish bool) *PostsPatchCall {
4821 c.urlParams_.Set("publish", fmt.Sprint(publish))
4822 return c
4823 }
4824
4825
4826 func (c *PostsPatchCall) Revert(revert bool) *PostsPatchCall {
4827 c.urlParams_.Set("revert", fmt.Sprint(revert))
4828 return c
4829 }
4830
4831
4832
4833
4834 func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall {
4835 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4836 return c
4837 }
4838
4839
4840 func (c *PostsPatchCall) Context(ctx context.Context) *PostsPatchCall {
4841 c.ctx_ = ctx
4842 return c
4843 }
4844
4845
4846
4847 func (c *PostsPatchCall) Header() http.Header {
4848 if c.header_ == nil {
4849 c.header_ = make(http.Header)
4850 }
4851 return c.header_
4852 }
4853
4854 func (c *PostsPatchCall) doRequest(alt string) (*http.Response, error) {
4855 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4856 var body io.Reader = nil
4857 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
4858 if err != nil {
4859 return nil, err
4860 }
4861 c.urlParams_.Set("alt", alt)
4862 c.urlParams_.Set("prettyPrint", "false")
4863 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}")
4864 urls += "?" + c.urlParams_.Encode()
4865 req, err := http.NewRequest("PATCH", urls, body)
4866 if err != nil {
4867 return nil, err
4868 }
4869 req.Header = reqHeaders
4870 googleapi.Expand(req.URL, map[string]string{
4871 "blogId": c.blogId,
4872 "postId": c.postId,
4873 })
4874 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4875 }
4876
4877
4878
4879
4880
4881
4882 func (c *PostsPatchCall) Do(opts ...googleapi.CallOption) (*Post, error) {
4883 gensupport.SetOptions(c.urlParams_, opts...)
4884 res, err := c.doRequest("json")
4885 if res != nil && res.StatusCode == http.StatusNotModified {
4886 if res.Body != nil {
4887 res.Body.Close()
4888 }
4889 return nil, gensupport.WrapError(&googleapi.Error{
4890 Code: res.StatusCode,
4891 Header: res.Header,
4892 })
4893 }
4894 if err != nil {
4895 return nil, err
4896 }
4897 defer googleapi.CloseBody(res)
4898 if err := googleapi.CheckResponse(res); err != nil {
4899 return nil, gensupport.WrapError(err)
4900 }
4901 ret := &Post{
4902 ServerResponse: googleapi.ServerResponse{
4903 Header: res.Header,
4904 HTTPStatusCode: res.StatusCode,
4905 },
4906 }
4907 target := &ret
4908 if err := gensupport.DecodeResponse(target, res); err != nil {
4909 return nil, err
4910 }
4911 return ret, nil
4912 }
4913
4914 type PostsPublishCall struct {
4915 s *Service
4916 blogId string
4917 postId string
4918 urlParams_ gensupport.URLParams
4919 ctx_ context.Context
4920 header_ http.Header
4921 }
4922
4923
4924
4925
4926
4927 func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall {
4928 c := &PostsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4929 c.blogId = blogId
4930 c.postId = postId
4931 return c
4932 }
4933
4934
4935 func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall {
4936 c.urlParams_.Set("publishDate", publishDate)
4937 return c
4938 }
4939
4940
4941
4942
4943 func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall {
4944 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4945 return c
4946 }
4947
4948
4949 func (c *PostsPublishCall) Context(ctx context.Context) *PostsPublishCall {
4950 c.ctx_ = ctx
4951 return c
4952 }
4953
4954
4955
4956 func (c *PostsPublishCall) Header() http.Header {
4957 if c.header_ == nil {
4958 c.header_ = make(http.Header)
4959 }
4960 return c.header_
4961 }
4962
4963 func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) {
4964 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4965 var body io.Reader = nil
4966 c.urlParams_.Set("alt", alt)
4967 c.urlParams_.Set("prettyPrint", "false")
4968 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/publish")
4969 urls += "?" + c.urlParams_.Encode()
4970 req, err := http.NewRequest("POST", urls, body)
4971 if err != nil {
4972 return nil, err
4973 }
4974 req.Header = reqHeaders
4975 googleapi.Expand(req.URL, map[string]string{
4976 "blogId": c.blogId,
4977 "postId": c.postId,
4978 })
4979 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4980 }
4981
4982
4983
4984
4985
4986
4987 func (c *PostsPublishCall) Do(opts ...googleapi.CallOption) (*Post, error) {
4988 gensupport.SetOptions(c.urlParams_, opts...)
4989 res, err := c.doRequest("json")
4990 if res != nil && res.StatusCode == http.StatusNotModified {
4991 if res.Body != nil {
4992 res.Body.Close()
4993 }
4994 return nil, gensupport.WrapError(&googleapi.Error{
4995 Code: res.StatusCode,
4996 Header: res.Header,
4997 })
4998 }
4999 if err != nil {
5000 return nil, err
5001 }
5002 defer googleapi.CloseBody(res)
5003 if err := googleapi.CheckResponse(res); err != nil {
5004 return nil, gensupport.WrapError(err)
5005 }
5006 ret := &Post{
5007 ServerResponse: googleapi.ServerResponse{
5008 Header: res.Header,
5009 HTTPStatusCode: res.StatusCode,
5010 },
5011 }
5012 target := &ret
5013 if err := gensupport.DecodeResponse(target, res); err != nil {
5014 return nil, err
5015 }
5016 return ret, nil
5017 }
5018
5019 type PostsRevertCall struct {
5020 s *Service
5021 blogId string
5022 postId string
5023 urlParams_ gensupport.URLParams
5024 ctx_ context.Context
5025 header_ http.Header
5026 }
5027
5028
5029
5030
5031
5032 func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall {
5033 c := &PostsRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5034 c.blogId = blogId
5035 c.postId = postId
5036 return c
5037 }
5038
5039
5040
5041
5042 func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall {
5043 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5044 return c
5045 }
5046
5047
5048 func (c *PostsRevertCall) Context(ctx context.Context) *PostsRevertCall {
5049 c.ctx_ = ctx
5050 return c
5051 }
5052
5053
5054
5055 func (c *PostsRevertCall) Header() http.Header {
5056 if c.header_ == nil {
5057 c.header_ = make(http.Header)
5058 }
5059 return c.header_
5060 }
5061
5062 func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) {
5063 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5064 var body io.Reader = nil
5065 c.urlParams_.Set("alt", alt)
5066 c.urlParams_.Set("prettyPrint", "false")
5067 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}/revert")
5068 urls += "?" + c.urlParams_.Encode()
5069 req, err := http.NewRequest("POST", urls, body)
5070 if err != nil {
5071 return nil, err
5072 }
5073 req.Header = reqHeaders
5074 googleapi.Expand(req.URL, map[string]string{
5075 "blogId": c.blogId,
5076 "postId": c.postId,
5077 })
5078 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5079 }
5080
5081
5082
5083
5084
5085
5086 func (c *PostsRevertCall) Do(opts ...googleapi.CallOption) (*Post, error) {
5087 gensupport.SetOptions(c.urlParams_, opts...)
5088 res, err := c.doRequest("json")
5089 if res != nil && res.StatusCode == http.StatusNotModified {
5090 if res.Body != nil {
5091 res.Body.Close()
5092 }
5093 return nil, gensupport.WrapError(&googleapi.Error{
5094 Code: res.StatusCode,
5095 Header: res.Header,
5096 })
5097 }
5098 if err != nil {
5099 return nil, err
5100 }
5101 defer googleapi.CloseBody(res)
5102 if err := googleapi.CheckResponse(res); err != nil {
5103 return nil, gensupport.WrapError(err)
5104 }
5105 ret := &Post{
5106 ServerResponse: googleapi.ServerResponse{
5107 Header: res.Header,
5108 HTTPStatusCode: res.StatusCode,
5109 },
5110 }
5111 target := &ret
5112 if err := gensupport.DecodeResponse(target, res); err != nil {
5113 return nil, err
5114 }
5115 return ret, nil
5116 }
5117
5118 type PostsSearchCall struct {
5119 s *Service
5120 blogId string
5121 urlParams_ gensupport.URLParams
5122 ifNoneMatch_ string
5123 ctx_ context.Context
5124 header_ http.Header
5125 }
5126
5127
5128
5129
5130
5131 func (r *PostsService) Search(blogId string, q string) *PostsSearchCall {
5132 c := &PostsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5133 c.blogId = blogId
5134 c.urlParams_.Set("q", q)
5135 return c
5136 }
5137
5138
5139 func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall {
5140 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
5141 return c
5142 }
5143
5144
5145
5146
5147
5148
5149
5150
5151 func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall {
5152 c.urlParams_.Set("orderBy", orderBy)
5153 return c
5154 }
5155
5156
5157
5158
5159 func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall {
5160 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5161 return c
5162 }
5163
5164
5165
5166
5167 func (c *PostsSearchCall) IfNoneMatch(entityTag string) *PostsSearchCall {
5168 c.ifNoneMatch_ = entityTag
5169 return c
5170 }
5171
5172
5173 func (c *PostsSearchCall) Context(ctx context.Context) *PostsSearchCall {
5174 c.ctx_ = ctx
5175 return c
5176 }
5177
5178
5179
5180 func (c *PostsSearchCall) Header() http.Header {
5181 if c.header_ == nil {
5182 c.header_ = make(http.Header)
5183 }
5184 return c.header_
5185 }
5186
5187 func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) {
5188 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5189 if c.ifNoneMatch_ != "" {
5190 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5191 }
5192 var body io.Reader = nil
5193 c.urlParams_.Set("alt", alt)
5194 c.urlParams_.Set("prettyPrint", "false")
5195 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/search")
5196 urls += "?" + c.urlParams_.Encode()
5197 req, err := http.NewRequest("GET", urls, body)
5198 if err != nil {
5199 return nil, err
5200 }
5201 req.Header = reqHeaders
5202 googleapi.Expand(req.URL, map[string]string{
5203 "blogId": c.blogId,
5204 })
5205 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5206 }
5207
5208
5209
5210
5211
5212
5213 func (c *PostsSearchCall) Do(opts ...googleapi.CallOption) (*PostList, error) {
5214 gensupport.SetOptions(c.urlParams_, opts...)
5215 res, err := c.doRequest("json")
5216 if res != nil && res.StatusCode == http.StatusNotModified {
5217 if res.Body != nil {
5218 res.Body.Close()
5219 }
5220 return nil, gensupport.WrapError(&googleapi.Error{
5221 Code: res.StatusCode,
5222 Header: res.Header,
5223 })
5224 }
5225 if err != nil {
5226 return nil, err
5227 }
5228 defer googleapi.CloseBody(res)
5229 if err := googleapi.CheckResponse(res); err != nil {
5230 return nil, gensupport.WrapError(err)
5231 }
5232 ret := &PostList{
5233 ServerResponse: googleapi.ServerResponse{
5234 Header: res.Header,
5235 HTTPStatusCode: res.StatusCode,
5236 },
5237 }
5238 target := &ret
5239 if err := gensupport.DecodeResponse(target, res); err != nil {
5240 return nil, err
5241 }
5242 return ret, nil
5243 }
5244
5245 type PostsUpdateCall struct {
5246 s *Service
5247 blogId string
5248 postId string
5249 post *Post
5250 urlParams_ gensupport.URLParams
5251 ctx_ context.Context
5252 header_ http.Header
5253 }
5254
5255
5256
5257
5258
5259 func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall {
5260 c := &PostsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5261 c.blogId = blogId
5262 c.postId = postId
5263 c.post = post
5264 return c
5265 }
5266
5267
5268 func (c *PostsUpdateCall) FetchBody(fetchBody bool) *PostsUpdateCall {
5269 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody))
5270 return c
5271 }
5272
5273
5274 func (c *PostsUpdateCall) FetchImages(fetchImages bool) *PostsUpdateCall {
5275 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages))
5276 return c
5277 }
5278
5279
5280 func (c *PostsUpdateCall) MaxComments(maxComments int64) *PostsUpdateCall {
5281 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
5282 return c
5283 }
5284
5285
5286 func (c *PostsUpdateCall) Publish(publish bool) *PostsUpdateCall {
5287 c.urlParams_.Set("publish", fmt.Sprint(publish))
5288 return c
5289 }
5290
5291
5292 func (c *PostsUpdateCall) Revert(revert bool) *PostsUpdateCall {
5293 c.urlParams_.Set("revert", fmt.Sprint(revert))
5294 return c
5295 }
5296
5297
5298
5299
5300 func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall {
5301 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5302 return c
5303 }
5304
5305
5306 func (c *PostsUpdateCall) Context(ctx context.Context) *PostsUpdateCall {
5307 c.ctx_ = ctx
5308 return c
5309 }
5310
5311
5312
5313 func (c *PostsUpdateCall) Header() http.Header {
5314 if c.header_ == nil {
5315 c.header_ = make(http.Header)
5316 }
5317 return c.header_
5318 }
5319
5320 func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, error) {
5321 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5322 var body io.Reader = nil
5323 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
5324 if err != nil {
5325 return nil, err
5326 }
5327 c.urlParams_.Set("alt", alt)
5328 c.urlParams_.Set("prettyPrint", "false")
5329 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/blogs/{blogId}/posts/{postId}")
5330 urls += "?" + c.urlParams_.Encode()
5331 req, err := http.NewRequest("PUT", urls, body)
5332 if err != nil {
5333 return nil, err
5334 }
5335 req.Header = reqHeaders
5336 googleapi.Expand(req.URL, map[string]string{
5337 "blogId": c.blogId,
5338 "postId": c.postId,
5339 })
5340 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5341 }
5342
5343
5344
5345
5346
5347
5348 func (c *PostsUpdateCall) Do(opts ...googleapi.CallOption) (*Post, error) {
5349 gensupport.SetOptions(c.urlParams_, opts...)
5350 res, err := c.doRequest("json")
5351 if res != nil && res.StatusCode == http.StatusNotModified {
5352 if res.Body != nil {
5353 res.Body.Close()
5354 }
5355 return nil, gensupport.WrapError(&googleapi.Error{
5356 Code: res.StatusCode,
5357 Header: res.Header,
5358 })
5359 }
5360 if err != nil {
5361 return nil, err
5362 }
5363 defer googleapi.CloseBody(res)
5364 if err := googleapi.CheckResponse(res); err != nil {
5365 return nil, gensupport.WrapError(err)
5366 }
5367 ret := &Post{
5368 ServerResponse: googleapi.ServerResponse{
5369 Header: res.Header,
5370 HTTPStatusCode: res.StatusCode,
5371 },
5372 }
5373 target := &ret
5374 if err := gensupport.DecodeResponse(target, res); err != nil {
5375 return nil, err
5376 }
5377 return ret, nil
5378 }
5379
5380 type UsersGetCall struct {
5381 s *Service
5382 userId string
5383 urlParams_ gensupport.URLParams
5384 ifNoneMatch_ string
5385 ctx_ context.Context
5386 header_ http.Header
5387 }
5388
5389
5390
5391
5392 func (r *UsersService) Get(userId string) *UsersGetCall {
5393 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5394 c.userId = userId
5395 return c
5396 }
5397
5398
5399
5400
5401 func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
5402 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5403 return c
5404 }
5405
5406
5407
5408
5409 func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
5410 c.ifNoneMatch_ = entityTag
5411 return c
5412 }
5413
5414
5415 func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
5416 c.ctx_ = ctx
5417 return c
5418 }
5419
5420
5421
5422 func (c *UsersGetCall) Header() http.Header {
5423 if c.header_ == nil {
5424 c.header_ = make(http.Header)
5425 }
5426 return c.header_
5427 }
5428
5429 func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
5430 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5431 if c.ifNoneMatch_ != "" {
5432 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5433 }
5434 var body io.Reader = nil
5435 c.urlParams_.Set("alt", alt)
5436 c.urlParams_.Set("prettyPrint", "false")
5437 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/users/{userId}")
5438 urls += "?" + c.urlParams_.Encode()
5439 req, err := http.NewRequest("GET", urls, body)
5440 if err != nil {
5441 return nil, err
5442 }
5443 req.Header = reqHeaders
5444 googleapi.Expand(req.URL, map[string]string{
5445 "userId": c.userId,
5446 })
5447 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5448 }
5449
5450
5451
5452
5453
5454
5455 func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
5456 gensupport.SetOptions(c.urlParams_, opts...)
5457 res, err := c.doRequest("json")
5458 if res != nil && res.StatusCode == http.StatusNotModified {
5459 if res.Body != nil {
5460 res.Body.Close()
5461 }
5462 return nil, gensupport.WrapError(&googleapi.Error{
5463 Code: res.StatusCode,
5464 Header: res.Header,
5465 })
5466 }
5467 if err != nil {
5468 return nil, err
5469 }
5470 defer googleapi.CloseBody(res)
5471 if err := googleapi.CheckResponse(res); err != nil {
5472 return nil, gensupport.WrapError(err)
5473 }
5474 ret := &User{
5475 ServerResponse: googleapi.ServerResponse{
5476 Header: res.Header,
5477 HTTPStatusCode: res.StatusCode,
5478 },
5479 }
5480 target := &ret
5481 if err := gensupport.DecodeResponse(target, res); err != nil {
5482 return nil, err
5483 }
5484 return ret, nil
5485 }
5486
View as plain text