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