Debian Codegraph @

blogger/v3/blogger-gen.go

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