Debian Codegraph @

blogger/v2/blogger-gen.go

raw symbols SCIP
1 // Copyright 2025 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/v2"
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 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // bloggerService, err := blogger.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // bloggerService, err := blogger.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package blogger // import "google.golang.org/api/blogger/v2"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "blogger:v2"
93 const apiName = "blogger"
94 const apiVersion = "v2"
95 const basePath = "https://blogger.googleapis.com/"
96 const basePathTemplate = "https://blogger.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://blogger.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // Manage your Blogger account
102 BloggerScope = "https://www.googleapis.com/auth/blogger"
103 )
104
105 // NewService creates a new Service.
106 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
107 scopesOption := internaloption.WithDefaultScopes(
108 "https://www.googleapis.com/auth/blogger",
109 )
110 // NOTE: prepend, so we don't override user-specified scopes.
111 opts = append([]option.ClientOption{scopesOption}, opts...)
112 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
113 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
114 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
115 opts = append(opts, internaloption.EnableNewAuthLibrary())
116 client, endpoint, err := htransport.NewClient(ctx, opts...)
117 if err != nil {
118 return nil, err
119 }
120 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
121 s.Blogs = NewBlogsService(s)
122 s.Comments = NewCommentsService(s)
123 s.Pages = NewPagesService(s)
124 s.Posts = NewPostsService(s)
125 s.Users = NewUsersService(s)
126 if endpoint != "" {
127 s.BasePath = endpoint
128 }
129 return s, nil
130 }
131
132 // New creates a new Service. It uses the provided http.Client for requests.
133 //
134 // Deprecated: please use NewService instead.
135 // To provide a custom HTTP client, use option.WithHTTPClient.
136 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
137 func New(client *http.Client) (*Service, error) {
138 if client == nil {
139 return nil, errors.New("client is nil")
140 }
141 return NewService(context.TODO(), option.WithHTTPClient(client))
142 }
143
144 type Service struct {
145 client *http.Client
146 logger *slog.Logger
147 BasePath string // API endpoint base URL
148 UserAgent string // optional additional User-Agent fragment
149
150 Blogs *BlogsService
151
152 Comments *CommentsService
153
154 Pages *PagesService
155
156 Posts *PostsService
157
158 Users *UsersService
159 }
160
161 func (s *Service) userAgent() string {
162 if s.UserAgent == "" {
163 return googleapi.UserAgent
164 }
165 return googleapi.UserAgent + " " + s.UserAgent
166 }
167
168 func NewBlogsService(s *Service) *BlogsService {
169 rs := &BlogsService{s: s}
170 return rs
171 }
172
173 type BlogsService struct {
174 s *Service
175 }
176
177 func NewCommentsService(s *Service) *CommentsService {
178 rs := &CommentsService{s: s}
179 return rs
180 }
181
182 type CommentsService struct {
183 s *Service
184 }
185
186 func NewPagesService(s *Service) *PagesService {
187 rs := &PagesService{s: s}
188 return rs
189 }
190
191 type PagesService struct {
192 s *Service
193 }
194
195 func NewPostsService(s *Service) *PostsService {
196 rs := &PostsService{s: s}
197 return rs
198 }
199
200 type PostsService struct {
201 s *Service
202 }
203
204 func NewUsersService(s *Service) *UsersService {
205 rs := &UsersService{s: s}
206 return rs
207 }
208
209 type UsersService struct {
210 s *Service
211 }
212
213 type Blog struct {
214 // CustomMetaData: The JSON custom meta-data for the Blog.
215 CustomMetaData string `json:"customMetaData,omitempty"`
216 // Description: The description of this blog. This is displayed underneath the
217 // title.
218 Description string `json:"description,omitempty"`
219 // Id: The identifier for this resource.
220 Id string `json:"id,omitempty"`
221 // Kind: The kind of this entry. Always blogger#blog.
222 Kind string `json:"kind,omitempty"`
223 // Locale: The locale this Blog is set to.
224 Locale *BlogLocale `json:"locale,omitempty"`
225 // Name: The name of this blog. This is displayed as the title.
226 Name string `json:"name,omitempty"`
227 // Pages: The container of pages in this blog.
228 Pages *BlogPages `json:"pages,omitempty"`
229 // Posts: The container of posts in this blog.
230 Posts *BlogPosts `json:"posts,omitempty"`
231 // Published: RFC 3339 date-time when this blog was published.
232 Published string `json:"published,omitempty"`
233 // SelfLink: The API REST URL to fetch this resource from.
234 SelfLink string `json:"selfLink,omitempty"`
235 // Status: The status of the blog.
236 //
237 // Possible values:
238 // "LIVE"
239 // "DELETED"
240 Status string `json:"status,omitempty"`
241 // Updated: RFC 3339 date-time when this blog was last updated.
242 Updated string `json:"updated,omitempty"`
243 // Url: The URL where this blog is published.
244 Url string `json:"url,omitempty"`
245
246 // ServerResponse contains the HTTP response code and headers from the server.
247 googleapi.ServerResponse `json:"-"`
248 // ForceSendFields is a list of field names (e.g. "CustomMetaData") to
249 // unconditionally include in API requests. By default, fields with empty or
250 // default values are omitted from API requests. See
251 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
252 // details.
253 ForceSendFields []string `json:"-"`
254 // NullFields is a list of field names (e.g. "CustomMetaData") to include in
255 // API requests with the JSON null value. By default, fields with empty values
256 // are omitted from API requests. See
257 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
258 NullFields []string `json:"-"`
259 }
260
261 func (s Blog) MarshalJSON() ([]byte, error) {
262 type NoMethod Blog
263 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
264 }
265
266 // BlogLocale: The locale this Blog is set to.
267 type BlogLocale struct {
268 // Country: The country this blog's locale is set to.
269 Country string `json:"country,omitempty"`
270 // Language: The language this blog is authored in.
271 Language string `json:"language,omitempty"`
272 // Variant: The language variant this blog is authored in.
273 Variant string `json:"variant,omitempty"`
274 // ForceSendFields is a list of field names (e.g. "Country") to unconditionally
275 // include in API requests. By default, fields with empty or default values are
276 // omitted from API requests. See
277 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
278 // details.
279 ForceSendFields []string `json:"-"`
280 // NullFields is a list of field names (e.g. "Country") to include in API
281 // requests with the JSON null value. By default, fields with empty values are
282 // omitted from API requests. See
283 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
284 NullFields []string `json:"-"`
285 }
286
287 func (s BlogLocale) MarshalJSON() ([]byte, error) {
288 type NoMethod BlogLocale
289 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
290 }
291
292 // BlogPages: The container of pages in this blog.
293 type BlogPages struct {
294 // SelfLink: The URL of the container for pages in this blog.
295 SelfLink string `json:"selfLink,omitempty"`
296 // TotalItems: The count of pages in this blog.
297 TotalItems int64 `json:"totalItems,omitempty"`
298 // ForceSendFields is a list of field names (e.g. "SelfLink") to
299 // unconditionally include in API requests. By default, fields with empty or
300 // default values are omitted from API requests. See
301 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
302 // details.
303 ForceSendFields []string `json:"-"`
304 // NullFields is a list of field names (e.g. "SelfLink") to include in API
305 // requests with the JSON null value. By default, fields with empty values are
306 // omitted from API requests. See
307 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
308 NullFields []string `json:"-"`
309 }
310
311 func (s BlogPages) MarshalJSON() ([]byte, error) {
312 type NoMethod BlogPages
313 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
314 }
315
316 // BlogPosts: The container of posts in this blog.
317 type BlogPosts struct {
318 // Items: The List of Posts for this Blog.
319 Items []*Post `json:"items,omitempty"`
320 // SelfLink: The URL of the container for posts in this blog.
321 SelfLink string `json:"selfLink,omitempty"`
322 // TotalItems: The count of posts in this blog.
323 TotalItems int64 `json:"totalItems,omitempty"`
324 // ForceSendFields is a list of field names (e.g. "Items") to unconditionally
325 // include in API requests. By default, fields with empty or default values are
326 // omitted from API requests. See
327 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
328 // details.
329 ForceSendFields []string `json:"-"`
330 // NullFields is a list of field names (e.g. "Items") to include in API
331 // requests with the JSON null value. By default, fields with empty values are
332 // omitted from API requests. See
333 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
334 NullFields []string `json:"-"`
335 }
336
337 func (s BlogPosts) MarshalJSON() ([]byte, error) {
338 type NoMethod BlogPosts
339 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
340 }
341
342 type BlogList struct {
343 // BlogUserInfos: Admin level list of blog per-user information.
344 BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"`
345 // Items: The list of Blogs this user has Authorship or Admin rights over.
346 Items []*Blog `json:"items,omitempty"`
347 // Kind: The kind of this entity. Always blogger#blogList.
348 Kind string `json:"kind,omitempty"`
349
350 // ServerResponse contains the HTTP response code and headers from the server.
351 googleapi.ServerResponse `json:"-"`
352 // ForceSendFields is a list of field names (e.g. "BlogUserInfos") to
353 // unconditionally include in API requests. By default, fields with empty or
354 // default values are omitted from API requests. See
355 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
356 // details.
357 ForceSendFields []string `json:"-"`
358 // NullFields is a list of field names (e.g. "BlogUserInfos") to include in API
359 // requests with the JSON null value. By default, fields with empty values are
360 // omitted from API requests. See
361 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
362 NullFields []string `json:"-"`
363 }
364
365 func (s BlogList) MarshalJSON() ([]byte, error) {
366 type NoMethod BlogList
367 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
368 }
369
370 type BlogPerUserInfo struct {
371 // BlogId: ID of the Blog resource.
372 BlogId string `json:"blogId,omitempty"`
373 // HasAdminAccess: True if the user has Admin level access to the blog.
374 HasAdminAccess bool `json:"hasAdminAccess,omitempty"`
375 // Kind: The kind of this entity. Always blogger#blogPerUserInfo.
376 Kind string `json:"kind,omitempty"`
377 // PhotosAlbumKey: The Photo Album Key for the user when adding photos to the
378 // blog.
379 PhotosAlbumKey string `json:"photosAlbumKey,omitempty"`
380 // Role: Access permissions that the user has for the blog (ADMIN, AUTHOR, or
381 // READER).
382 //
383 // Possible values:
384 // "VIEW_TYPE_UNSPECIFIED"
385 // "READER"
386 // "AUTHOR"
387 // "ADMIN"
388 Role string `json:"role,omitempty"`
389 // UserId: ID of the User.
390 UserId string `json:"userId,omitempty"`
391 // ForceSendFields is a list of field names (e.g. "BlogId") to unconditionally
392 // include in API requests. By default, fields with empty or default values are
393 // omitted from API requests. See
394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
395 // details.
396 ForceSendFields []string `json:"-"`
397 // NullFields is a list of field names (e.g. "BlogId") to include in API
398 // requests with the JSON null value. By default, fields with empty values are
399 // omitted from API requests. See
400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
401 NullFields []string `json:"-"`
402 }
403
404 func (s BlogPerUserInfo) MarshalJSON() ([]byte, error) {
405 type NoMethod BlogPerUserInfo
406 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
407 }
408
409 type BlogUserInfo struct {
410 // Blog: The Blog resource.
411 Blog *Blog `json:"blog,omitempty"`
412 // BlogUserInfo: Information about a User for the Blog.
413 BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"`
414 // Kind: The kind of this entity. Always blogger#blogUserInfo.
415 Kind string `json:"kind,omitempty"`
416 // ForceSendFields is a list of field names (e.g. "Blog") to unconditionally
417 // include in API requests. By default, fields with empty or default values are
418 // omitted from API requests. See
419 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
420 // details.
421 ForceSendFields []string `json:"-"`
422 // NullFields is a list of field names (e.g. "Blog") to include in API requests
423 // with the JSON null value. By default, fields with empty values are omitted
424 // from API requests. See
425 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
426 NullFields []string `json:"-"`
427 }
428
429 func (s BlogUserInfo) MarshalJSON() ([]byte, error) {
430 type NoMethod BlogUserInfo
431 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
432 }
433
434 type Comment struct {
435 // Author: The author of this Comment.
436 Author *CommentAuthor `json:"author,omitempty"`
437 // Blog: Data about the blog containing this comment.
438 Blog *CommentBlog `json:"blog,omitempty"`
439 // Content: The actual content of the comment. May include HTML markup.
440 Content string `json:"content,omitempty"`
441 // Id: The identifier for this resource.
442 Id string `json:"id,omitempty"`
443 // InReplyTo: Data about the comment this is in reply to.
444 InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"`
445 // Kind: The kind of this entry. Always blogger#comment.
446 Kind string `json:"kind,omitempty"`
447 // Post: Data about the post containing this comment.
448 Post *CommentPost `json:"post,omitempty"`
449 // Published: RFC 3339 date-time when this comment was published.
450 Published string `json:"published,omitempty"`
451 // SelfLink: The API REST URL to fetch this resource from.
452 SelfLink string `json:"selfLink,omitempty"`
453 // Status: The status of the comment (only populated for admin users).
454 //
455 // Possible values:
456 // "LIVE"
457 // "EMPTIED"
458 // "PENDING"
459 // "SPAM"
460 Status string `json:"status,omitempty"`
461 // Updated: RFC 3339 date-time when this comment was last updated.
462 Updated string `json:"updated,omitempty"`
463
464 // ServerResponse contains the HTTP response code and headers from the server.
465 googleapi.ServerResponse `json:"-"`
466 // ForceSendFields is a list of field names (e.g. "Author") to unconditionally
467 // include in API requests. By default, fields with empty or default values are
468 // omitted from API requests. See
469 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
470 // details.
471 ForceSendFields []string `json:"-"`
472 // NullFields is a list of field names (e.g. "Author") to include in API
473 // requests with the JSON null value. By default, fields with empty values are
474 // omitted from API requests. See
475 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
476 NullFields []string `json:"-"`
477 }
478
479 func (s Comment) MarshalJSON() ([]byte, error) {
480 type NoMethod Comment
481 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
482 }
483
484 // CommentAuthor: The author of this Comment.
485 type CommentAuthor struct {
486 // DisplayName: The display name.
487 DisplayName string `json:"displayName,omitempty"`
488 // Id: The identifier of the creator.
489 Id string `json:"id,omitempty"`
490 // Image: The creator's avatar.
491 Image *CommentAuthorImage `json:"image,omitempty"`
492 // Url: The URL of the creator's Profile page.
493 Url string `json:"url,omitempty"`
494 // ForceSendFields is a list of field names (e.g. "DisplayName") to
495 // unconditionally include in API requests. By default, fields with empty or
496 // default values are omitted from API requests. See
497 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
498 // details.
499 ForceSendFields []string `json:"-"`
500 // NullFields is a list of field names (e.g. "DisplayName") to include in API
501 // requests with the JSON null value. By default, fields with empty values are
502 // omitted from API requests. See
503 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
504 NullFields []string `json:"-"`
505 }
506
507 func (s CommentAuthor) MarshalJSON() ([]byte, error) {
508 type NoMethod CommentAuthor
509 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
510 }
511
512 // CommentAuthorImage: The creator's avatar.
513 type CommentAuthorImage struct {
514 // Url: The creator's avatar URL.
515 Url string `json:"url,omitempty"`
516 // ForceSendFields is a list of field names (e.g. "Url") to unconditionally
517 // include in API requests. By default, fields with empty or default values are
518 // omitted from API requests. See
519 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
520 // details.
521 ForceSendFields []string `json:"-"`
522 // NullFields is a list of field names (e.g. "Url") to include in API requests
523 // with the JSON null value. By default, fields with empty values are omitted
524 // from API requests. See
525 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
526 NullFields []string `json:"-"`
527 }
528
529 func (s CommentAuthorImage) MarshalJSON() ([]byte, error) {
530 type NoMethod CommentAuthorImage
531 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
532 }
533
534 // CommentBlog: Data about the blog containing this comment.
535 type CommentBlog struct {
536 // Id: The identifier of the blog containing this comment.
537 Id string `json:"id,omitempty"`
538 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
539 // include in API requests. By default, fields with empty or default values are
540 // omitted from API requests. See
541 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
542 // details.
543 ForceSendFields []string `json:"-"`
544 // NullFields is a list of field names (e.g. "Id") to include in API requests
545 // with the JSON null value. By default, fields with empty values are omitted
546 // from API requests. See
547 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
548 NullFields []string `json:"-"`
549 }
550
551 func (s CommentBlog) MarshalJSON() ([]byte, error) {
552 type NoMethod CommentBlog
553 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
554 }
555
556 // CommentInReplyTo: Data about the comment this is in reply to.
557 type CommentInReplyTo struct {
558 // Id: The identified of the parent of this comment.
559 Id string `json:"id,omitempty"`
560 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
561 // include in API requests. By default, fields with empty or default values are
562 // omitted from API requests. See
563 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
564 // details.
565 ForceSendFields []string `json:"-"`
566 // NullFields is a list of field names (e.g. "Id") to include in API requests
567 // with the JSON null value. By default, fields with empty values are omitted
568 // from API requests. See
569 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
570 NullFields []string `json:"-"`
571 }
572
573 func (s CommentInReplyTo) MarshalJSON() ([]byte, error) {
574 type NoMethod CommentInReplyTo
575 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
576 }
577
578 // CommentPost: Data about the post containing this comment.
579 type CommentPost struct {
580 // Id: The identifier of the post containing this comment.
581 Id string `json:"id,omitempty"`
582 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
583 // include in API requests. By default, fields with empty or default values are
584 // omitted from API requests. See
585 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
586 // details.
587 ForceSendFields []string `json:"-"`
588 // NullFields is a list of field names (e.g. "Id") to include in API requests
589 // with the JSON null value. By default, fields with empty values are omitted
590 // from API requests. See
591 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
592 NullFields []string `json:"-"`
593 }
594
595 func (s CommentPost) MarshalJSON() ([]byte, error) {
596 type NoMethod CommentPost
597 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
598 }
599
600 type CommentList struct {
601 // Etag: Etag of the response.
602 Etag string `json:"etag,omitempty"`
603 // Items: The List of Comments for a Post.
604 Items []*Comment `json:"items,omitempty"`
605 // Kind: The kind of this entry. Always blogger#commentList.
606 Kind string `json:"kind,omitempty"`
607 // NextPageToken: Pagination token to fetch the next page, if one exists.
608 NextPageToken string `json:"nextPageToken,omitempty"`
609 // PrevPageToken: Pagination token to fetch the previous page, if one exists.
610 PrevPageToken string `json:"prevPageToken,omitempty"`
611
612 // ServerResponse contains the HTTP response code and headers from the server.
613 googleapi.ServerResponse `json:"-"`
614 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
615 // include in API requests. By default, fields with empty or default values are
616 // omitted from API requests. See
617 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
618 // details.
619 ForceSendFields []string `json:"-"`
620 // NullFields is a list of field names (e.g. "Etag") to include in API requests
621 // with the JSON null value. By default, fields with empty values are omitted
622 // from API requests. See
623 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
624 NullFields []string `json:"-"`
625 }
626
627 func (s CommentList) MarshalJSON() ([]byte, error) {
628 type NoMethod CommentList
629 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
630 }
631
632 type Page struct {
633 // Author: The author of this Page.
634 Author *PageAuthor `json:"author,omitempty"`
635 // Blog: Data about the blog containing this Page.
636 Blog *PageBlog `json:"blog,omitempty"`
637 // Content: The body content of this Page, in HTML.
638 Content string `json:"content,omitempty"`
639 // Etag: Etag of the resource.
640 Etag string `json:"etag,omitempty"`
641 // Id: The identifier for this resource.
642 Id string `json:"id,omitempty"`
643 // Kind: The kind of this entity. Always blogger#page.
644 Kind string `json:"kind,omitempty"`
645 // Published: RFC 3339 date-time when this Page was published.
646 Published string `json:"published,omitempty"`
647 // SelfLink: The API REST URL to fetch this resource from.
648 SelfLink string `json:"selfLink,omitempty"`
649 // Status: The status of the page for admin resources (either LIVE or DRAFT).
650 //
651 // Possible values:
652 // "LIVE"
653 // "DRAFT"
654 // "SOFT_TRASHED"
655 Status string `json:"status,omitempty"`
656 // Title: The title of this entity. This is the name displayed in the Admin
657 // user interface.
658 Title string `json:"title,omitempty"`
659 // Trashed: RFC 3339 date-time when this Page was trashed.
660 Trashed string `json:"trashed,omitempty"`
661 // Updated: RFC 3339 date-time when this Page was last updated.
662 Updated string `json:"updated,omitempty"`
663 // Url: The URL that this Page is displayed at.
664 Url string `json:"url,omitempty"`
665
666 // ServerResponse contains the HTTP response code and headers from the server.
667 googleapi.ServerResponse `json:"-"`
668 // ForceSendFields is a list of field names (e.g. "Author") to unconditionally
669 // include in API requests. By default, fields with empty or default values are
670 // omitted from API requests. See
671 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
672 // details.
673 ForceSendFields []string `json:"-"`
674 // NullFields is a list of field names (e.g. "Author") to include in API
675 // requests with the JSON null value. By default, fields with empty values are
676 // omitted from API requests. See
677 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
678 NullFields []string `json:"-"`
679 }
680
681 func (s Page) MarshalJSON() ([]byte, error) {
682 type NoMethod Page
683 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
684 }
685
686 // PageAuthor: The author of this Page.
687 type PageAuthor struct {
688 // DisplayName: The display name.
689 DisplayName string `json:"displayName,omitempty"`
690 // Id: The identifier of the creator.
691 Id string `json:"id,omitempty"`
692 // Image: The creator's avatar.
693 Image *PageAuthorImage `json:"image,omitempty"`
694 // Url: The URL of the creator's Profile page.
695 Url string `json:"url,omitempty"`
696 // ForceSendFields is a list of field names (e.g. "DisplayName") to
697 // unconditionally include in API requests. By default, fields with empty or
698 // default values are omitted from API requests. See
699 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
700 // details.
701 ForceSendFields []string `json:"-"`
702 // NullFields is a list of field names (e.g. "DisplayName") to include in API
703 // requests with the JSON null value. By default, fields with empty values are
704 // omitted from API requests. See
705 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
706 NullFields []string `json:"-"`
707 }
708
709 func (s PageAuthor) MarshalJSON() ([]byte, error) {
710 type NoMethod PageAuthor
711 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
712 }
713
714 // PageAuthorImage: The creator's avatar.
715 type PageAuthorImage struct {
716 // Url: The creator's avatar URL.
717 Url string `json:"url,omitempty"`
718 // ForceSendFields is a list of field names (e.g. "Url") to unconditionally
719 // include in API requests. By default, fields with empty or default values are
720 // omitted from API requests. See
721 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
722 // details.
723 ForceSendFields []string `json:"-"`
724 // NullFields is a list of field names (e.g. "Url") to include in API requests
725 // with the JSON null value. By default, fields with empty values are omitted
726 // from API requests. See
727 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
728 NullFields []string `json:"-"`
729 }
730
731 func (s PageAuthorImage) MarshalJSON() ([]byte, error) {
732 type NoMethod PageAuthorImage
733 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
734 }
735
736 // PageBlog: Data about the blog containing this Page.
737 type PageBlog struct {
738 // Id: The identifier of the blog containing this page.
739 Id string `json:"id,omitempty"`
740 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
741 // include in API requests. By default, fields with empty or default values are
742 // omitted from API requests. See
743 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
744 // details.
745 ForceSendFields []string `json:"-"`
746 // NullFields is a list of field names (e.g. "Id") to include in API requests
747 // with the JSON null value. By default, fields with empty values are omitted
748 // from API requests. See
749 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
750 NullFields []string `json:"-"`
751 }
752
753 func (s PageBlog) MarshalJSON() ([]byte, error) {
754 type NoMethod PageBlog
755 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
756 }
757
758 type PageList struct {
759 // Etag: Etag of the response.
760 Etag string `json:"etag,omitempty"`
761 // Items: The list of Pages for a Blog.
762 Items []*Page `json:"items,omitempty"`
763 // Kind: The kind of this entity. Always blogger#pageList.
764 Kind string `json:"kind,omitempty"`
765 // NextPageToken: Pagination token to fetch the next page, if one exists.
766 NextPageToken string `json:"nextPageToken,omitempty"`
767
768 // ServerResponse contains the HTTP response code and headers from the server.
769 googleapi.ServerResponse `json:"-"`
770 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
771 // include in API requests. By default, fields with empty or default values are
772 // omitted from API requests. See
773 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
774 // details.
775 ForceSendFields []string `json:"-"`
776 // NullFields is a list of field names (e.g. "Etag") to include in API requests
777 // with the JSON null value. By default, fields with empty values are omitted
778 // from API requests. See
779 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
780 NullFields []string `json:"-"`
781 }
782
783 func (s PageList) MarshalJSON() ([]byte, error) {
784 type NoMethod PageList
785 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
786 }
787
788 type Post struct {
789 // Author: The author of this Post.
790 Author *PostAuthor `json:"author,omitempty"`
791 // Blog: Data about the blog containing this Post.
792 Blog *PostBlog `json:"blog,omitempty"`
793 // Content: The content of the Post. May contain HTML markup.
794 Content string `json:"content,omitempty"`
795 // CustomMetaData: The JSON meta-data for the Post.
796 CustomMetaData string `json:"customMetaData,omitempty"`
797 // Etag: Etag of the resource.
798 Etag string `json:"etag,omitempty"`
799 // Id: The identifier of this Post.
800 Id string `json:"id,omitempty"`
801 // Images: Display image for the Post.
802 Images []*PostImages `json:"images,omitempty"`
803 // Kind: The kind of this entity. Always blogger#post.
804 Kind string `json:"kind,omitempty"`
805 // Labels: The list of labels this Post was tagged with.
806 Labels []string `json:"labels,omitempty"`
807 // Location: The location for geotagged posts.
808 Location *PostLocation `json:"location,omitempty"`
809 // Published: RFC 3339 date-time when this Post was published.
810 Published string `json:"published,omitempty"`
811 // ReaderComments: Comment control and display setting for readers of this
812 // post.
813 //
814 // Possible values:
815 // "ALLOW"
816 // "DONT_ALLOW_SHOW_EXISTING"
817 // "DONT_ALLOW_HIDE_EXISTING"
818 ReaderComments string `json:"readerComments,omitempty"`
819 // Replies: The container of comments on this Post.
820 Replies *PostReplies `json:"replies,omitempty"`
821 // SelfLink: The API REST URL to fetch this resource from.
822 SelfLink string `json:"selfLink,omitempty"`
823 // Status: Status of the post. Only set for admin-level requests.
824 //
825 // Possible values:
826 // "LIVE"
827 // "DRAFT"
828 // "SCHEDULED"
829 // "SOFT_TRASHED"
830 Status string `json:"status,omitempty"`
831 // Title: The title of the Post.
832 Title string `json:"title,omitempty"`
833 // TitleLink: The title link URL, similar to atom's related link.
834 TitleLink string `json:"titleLink,omitempty"`
835 // Trashed: RFC 3339 date-time when this Post was last trashed.
836 Trashed string `json:"trashed,omitempty"`
837 // Updated: RFC 3339 date-time when this Post was last updated.
838 Updated string `json:"updated,omitempty"`
839 // Url: The URL where this Post is displayed.
840 Url string `json:"url,omitempty"`
841
842 // ServerResponse contains the HTTP response code and headers from the server.
843 googleapi.ServerResponse `json:"-"`
844 // ForceSendFields is a list of field names (e.g. "Author") to unconditionally
845 // include in API requests. By default, fields with empty or default values are
846 // omitted from API requests. See
847 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
848 // details.
849 ForceSendFields []string `json:"-"`
850 // NullFields is a list of field names (e.g. "Author") to include in API
851 // requests with the JSON null value. By default, fields with empty values are
852 // omitted from API requests. See
853 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
854 NullFields []string `json:"-"`
855 }
856
857 func (s Post) MarshalJSON() ([]byte, error) {
858 type NoMethod Post
859 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
860 }
861
862 // PostAuthor: The author of this Post.
863 type PostAuthor struct {
864 // DisplayName: The display name.
865 DisplayName string `json:"displayName,omitempty"`
866 // Id: The identifier of the creator.
867 Id string `json:"id,omitempty"`
868 // Image: The creator's avatar.
869 Image *PostAuthorImage `json:"image,omitempty"`
870 // Url: The URL of the creator's Profile page.
871 Url string `json:"url,omitempty"`
872 // ForceSendFields is a list of field names (e.g. "DisplayName") to
873 // unconditionally include in API requests. By default, fields with empty or
874 // default values are omitted from API requests. See
875 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
876 // details.
877 ForceSendFields []string `json:"-"`
878 // NullFields is a list of field names (e.g. "DisplayName") to include in API
879 // requests with the JSON null value. By default, fields with empty values are
880 // omitted from API requests. See
881 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
882 NullFields []string `json:"-"`
883 }
884
885 func (s PostAuthor) MarshalJSON() ([]byte, error) {
886 type NoMethod PostAuthor
887 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
888 }
889
890 // PostAuthorImage: The creator's avatar.
891 type PostAuthorImage struct {
892 // Url: The creator's avatar URL.
893 Url string `json:"url,omitempty"`
894 // ForceSendFields is a list of field names (e.g. "Url") to unconditionally
895 // include in API requests. By default, fields with empty or default values are
896 // omitted from API requests. See
897 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
898 // details.
899 ForceSendFields []string `json:"-"`
900 // NullFields is a list of field names (e.g. "Url") to include in API requests
901 // with the JSON null value. By default, fields with empty values are omitted
902 // from API requests. See
903 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
904 NullFields []string `json:"-"`
905 }
906
907 func (s PostAuthorImage) MarshalJSON() ([]byte, error) {
908 type NoMethod PostAuthorImage
909 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
910 }
911
912 // PostBlog: Data about the blog containing this Post.
913 type PostBlog struct {
914 // Id: The identifier of the Blog that contains this Post.
915 Id string `json:"id,omitempty"`
916 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
917 // include in API requests. By default, fields with empty or default values are
918 // omitted from API requests. See
919 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
920 // details.
921 ForceSendFields []string `json:"-"`
922 // NullFields is a list of field names (e.g. "Id") to include in API requests
923 // with the JSON null value. By default, fields with empty values are omitted
924 // from API requests. See
925 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
926 NullFields []string `json:"-"`
927 }
928
929 func (s PostBlog) MarshalJSON() ([]byte, error) {
930 type NoMethod PostBlog
931 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
932 }
933
934 type PostImages struct {
935 Url string `json:"url,omitempty"`
936 // ForceSendFields is a list of field names (e.g. "Url") to unconditionally
937 // include in API requests. By default, fields with empty or default values are
938 // omitted from API requests. See
939 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
940 // details.
941 ForceSendFields []string `json:"-"`
942 // NullFields is a list of field names (e.g. "Url") to include in API requests
943 // with the JSON null value. By default, fields with empty values are omitted
944 // from API requests. See
945 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
946 NullFields []string `json:"-"`
947 }
948
949 func (s PostImages) MarshalJSON() ([]byte, error) {
950 type NoMethod PostImages
951 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
952 }
953
954 // PostLocation: The location for geotagged posts.
955 type PostLocation struct {
956 // Lat: Location's latitude.
957 Lat float64 `json:"lat,omitempty"`
958 // Lng: Location's longitude.
959 Lng float64 `json:"lng,omitempty"`
960 // Name: Location name.
961 Name string `json:"name,omitempty"`
962 // Span: Location's viewport span. Can be used when rendering a map preview.
963 Span string `json:"span,omitempty"`
964 // ForceSendFields is a list of field names (e.g. "Lat") to unconditionally
965 // include in API requests. By default, fields with empty or default values are
966 // omitted from API requests. See
967 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
968 // details.
969 ForceSendFields []string `json:"-"`
970 // NullFields is a list of field names (e.g. "Lat") to include in API requests
971 // with the JSON null value. By default, fields with empty values are omitted
972 // from API requests. See
973 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
974 NullFields []string `json:"-"`
975 }
976
977 func (s PostLocation) MarshalJSON() ([]byte, error) {
978 type NoMethod PostLocation
979 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
980 }
981
982 func (s *PostLocation) UnmarshalJSON(data []byte) error {
983 type NoMethod PostLocation
984 var s1 struct {
985 Lat gensupport.JSONFloat64 `json:"lat"`
986 Lng gensupport.JSONFloat64 `json:"lng"`
987 *NoMethod
988 }
989 s1.NoMethod = (*NoMethod)(s)
990 if err := json.Unmarshal(data, &s1); err != nil {
991 return err
992 }
993 s.Lat = float64(s1.Lat)
994 s.Lng = float64(s1.Lng)
995 return nil
996 }
997
998 // PostReplies: The container of comments on this Post.
999 type PostReplies struct {
1000 // Items: The List of Comments for this Post.
1001 Items []*Comment `json:"items,omitempty"`
1002 // SelfLink: The URL of the comments on this post.
1003 SelfLink string `json:"selfLink,omitempty"`
1004 // TotalItems: The count of comments on this post.
1005 TotalItems int64 `json:"totalItems,omitempty,string"`
1006 // ForceSendFields is a list of field names (e.g. "Items") to unconditionally
1007 // include in API requests. By default, fields with empty or default values are
1008 // omitted from API requests. See
1009 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1010 // details.
1011 ForceSendFields []string `json:"-"`
1012 // NullFields is a list of field names (e.g. "Items") to include in API
1013 // requests with the JSON null value. By default, fields with empty values are
1014 // omitted from API requests. See
1015 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1016 NullFields []string `json:"-"`
1017 }
1018
1019 func (s PostReplies) MarshalJSON() ([]byte, error) {
1020 type NoMethod PostReplies
1021 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1022 }
1023
1024 type PostList struct {
1025 // Etag: Etag of the response.
1026 Etag string `json:"etag,omitempty"`
1027 // Items: The list of Posts for this Blog.
1028 Items []*Post `json:"items,omitempty"`
1029 // Kind: The kind of this entity. Always blogger#postList.
1030 Kind string `json:"kind,omitempty"`
1031 // NextPageToken: Pagination token to fetch the next page, if one exists.
1032 NextPageToken string `json:"nextPageToken,omitempty"`
1033 // PrevPageToken: Pagination token to fetch the previous page, if one exists.
1034 PrevPageToken string `json:"prevPageToken,omitempty"`
1035
1036 // ServerResponse contains the HTTP response code and headers from the server.
1037 googleapi.ServerResponse `json:"-"`
1038 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
1039 // include in API requests. By default, fields with empty or default values are
1040 // omitted from API requests. See
1041 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1042 // details.
1043 ForceSendFields []string `json:"-"`
1044 // NullFields is a list of field names (e.g. "Etag") to include in API requests
1045 // with the JSON null value. By default, fields with empty values are omitted
1046 // from API requests. See
1047 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1048 NullFields []string `json:"-"`
1049 }
1050
1051 func (s PostList) MarshalJSON() ([]byte, error) {
1052 type NoMethod PostList
1053 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1054 }
1055
1056 type User struct {
1057 // About: Profile summary information.
1058 About string `json:"about,omitempty"`
1059 // Blogs: The container of blogs for this user.
1060 Blogs *UserBlogs `json:"blogs,omitempty"`
1061 // Created: The timestamp of when this profile was created, in seconds since
1062 // epoch.
1063 Created string `json:"created,omitempty"`
1064 // DisplayName: The display name.
1065 DisplayName string `json:"displayName,omitempty"`
1066 // Id: The identifier for this User.
1067 Id string `json:"id,omitempty"`
1068 // Kind: The kind of this entity. Always blogger#user.
1069 Kind string `json:"kind,omitempty"`
1070 // Locale: This user's locale
1071 Locale *UserLocale `json:"locale,omitempty"`
1072 // SelfLink: The API REST URL to fetch this resource from.
1073 SelfLink string `json:"selfLink,omitempty"`
1074 // Url: The user's profile page.
1075 Url string `json:"url,omitempty"`
1076
1077 // ServerResponse contains the HTTP response code and headers from the server.
1078 googleapi.ServerResponse `json:"-"`
1079 // ForceSendFields is a list of field names (e.g. "About") to unconditionally
1080 // include in API requests. By default, fields with empty or default values are
1081 // omitted from API requests. See
1082 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1083 // details.
1084 ForceSendFields []string `json:"-"`
1085 // NullFields is a list of field names (e.g. "About") to include in API
1086 // requests with the JSON null value. By default, fields with empty values are
1087 // omitted from API requests. See
1088 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1089 NullFields []string `json:"-"`
1090 }
1091
1092 func (s User) MarshalJSON() ([]byte, error) {
1093 type NoMethod User
1094 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1095 }
1096
1097 // UserBlogs: The container of blogs for this user.
1098 type UserBlogs struct {
1099 // SelfLink: The URL of the Blogs for this user.
1100 SelfLink string `json:"selfLink,omitempty"`
1101 // ForceSendFields is a list of field names (e.g. "SelfLink") to
1102 // unconditionally include in API requests. By default, fields with empty or
1103 // default values are omitted from API requests. See
1104 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1105 // details.
1106 ForceSendFields []string `json:"-"`
1107 // NullFields is a list of field names (e.g. "SelfLink") to include in API
1108 // requests with the JSON null value. By default, fields with empty values are
1109 // omitted from API requests. See
1110 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1111 NullFields []string `json:"-"`
1112 }
1113
1114 func (s UserBlogs) MarshalJSON() ([]byte, error) {
1115 type NoMethod UserBlogs
1116 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1117 }
1118
1119 // UserLocale: This user's locale
1120 type UserLocale struct {
1121 // Country: The country this blog's locale is set to.
1122 Country string `json:"country,omitempty"`
1123 // Language: The language this blog is authored in.
1124 Language string `json:"language,omitempty"`
1125 // Variant: The language variant this blog is authored in.
1126 Variant string `json:"variant,omitempty"`
1127 // ForceSendFields is a list of field names (e.g. "Country") to unconditionally
1128 // include in API requests. By default, fields with empty or default values are
1129 // omitted from API requests. See
1130 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1131 // details.
1132 ForceSendFields []string `json:"-"`
1133 // NullFields is a list of field names (e.g. "Country") to include in API
1134 // requests with the JSON null value. By default, fields with empty values are
1135 // omitted from API requests. See
1136 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1137 NullFields []string `json:"-"`
1138 }
1139
1140 func (s UserLocale) MarshalJSON() ([]byte, error) {
1141 type NoMethod UserLocale
1142 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1143 }
1144
1145 type BlogsGetCall struct {
1146 s *Service
1147 blogId string
1148 urlParams_ gensupport.URLParams
1149 ifNoneMatch_ string
1150 ctx_ context.Context
1151 header_ http.Header
1152 }
1153
1154 // Get: Gets a blog by id.
1155 //
1156 // - blogId: .
1157 func (r *BlogsService) Get(blogId string) *BlogsGetCall {
1158 c := &BlogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1159 c.blogId = blogId
1160 return c
1161 }
1162
1163 // Fields allows partial responses to be retrieved. See
1164 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1165 // details.
1166 func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall {
1167 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1168 return c
1169 }
1170
1171 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1172 // object's ETag matches the given value. This is useful for getting updates
1173 // only after the object has changed since the last request.
1174 func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall {
1175 c.ifNoneMatch_ = entityTag
1176 return c
1177 }
1178
1179 // Context sets the context to be used in this call's Do method.
1180 func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall {
1181 c.ctx_ = ctx
1182 return c
1183 }
1184
1185 // Header returns a http.Header that can be modified by the caller to add
1186 // headers to the request.
1187 func (c *BlogsGetCall) Header() http.Header {
1188 if c.header_ == nil {
1189 c.header_ = make(http.Header)
1190 }
1191 return c.header_
1192 }
1193
1194 func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) {
1195 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1196 if c.ifNoneMatch_ != "" {
1197 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1198 }
1199 c.urlParams_.Set("alt", alt)
1200 c.urlParams_.Set("prettyPrint", "false")
1201 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}")
1202 urls += "?" + c.urlParams_.Encode()
1203 req, err := http.NewRequest("GET", urls, nil)
1204 if err != nil {
1205 return nil, err
1206 }
1207 req.Header = reqHeaders
1208 googleapi.Expand(req.URL, map[string]string{
1209 "blogId": c.blogId,
1210 })
1211 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.blogs.get", "request", internallog.HTTPRequest(req, nil))
1212 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1213 }
1214
1215 // Do executes the "blogger.blogs.get" call.
1216 // Any non-2xx status code is an error. Response headers are in either
1217 // *Blog.ServerResponse.Header or (if a response was returned at all) in
1218 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1219 // whether the returned error was because http.StatusNotModified was returned.
1220 func (c *BlogsGetCall) Do(opts ...googleapi.CallOption) (*Blog, error) {
1221 gensupport.SetOptions(c.urlParams_, opts...)
1222 res, err := c.doRequest("json")
1223 if res != nil && res.StatusCode == http.StatusNotModified {
1224 if res.Body != nil {
1225 res.Body.Close()
1226 }
1227 return nil, gensupport.WrapError(&googleapi.Error{
1228 Code: res.StatusCode,
1229 Header: res.Header,
1230 })
1231 }
1232 if err != nil {
1233 return nil, err
1234 }
1235 defer googleapi.CloseBody(res)
1236 if err := googleapi.CheckResponse(res); err != nil {
1237 return nil, gensupport.WrapError(err)
1238 }
1239 ret := &Blog{
1240 ServerResponse: googleapi.ServerResponse{
1241 Header: res.Header,
1242 HTTPStatusCode: res.StatusCode,
1243 },
1244 }
1245 target := &ret
1246 b, err := gensupport.DecodeResponseBytes(target, res)
1247 if err != nil {
1248 return nil, err
1249 }
1250 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.blogs.get", "response", internallog.HTTPResponse(res, b))
1251 return ret, nil
1252 }
1253
1254 type BlogsListCall struct {
1255 s *Service
1256 userId string
1257 urlParams_ gensupport.URLParams
1258 ifNoneMatch_ string
1259 ctx_ context.Context
1260 header_ http.Header
1261 }
1262
1263 // List: Lists blogs by user id, possibly filtered.
1264 //
1265 // - userId: .
1266 func (r *BlogsService) List(userId string) *BlogsListCall {
1267 c := &BlogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1268 c.userId = userId
1269 return c
1270 }
1271
1272 // Fields allows partial responses to be retrieved. See
1273 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1274 // details.
1275 func (c *BlogsListCall) Fields(s ...googleapi.Field) *BlogsListCall {
1276 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1277 return c
1278 }
1279
1280 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1281 // object's ETag matches the given value. This is useful for getting updates
1282 // only after the object has changed since the last request.
1283 func (c *BlogsListCall) IfNoneMatch(entityTag string) *BlogsListCall {
1284 c.ifNoneMatch_ = entityTag
1285 return c
1286 }
1287
1288 // Context sets the context to be used in this call's Do method.
1289 func (c *BlogsListCall) Context(ctx context.Context) *BlogsListCall {
1290 c.ctx_ = ctx
1291 return c
1292 }
1293
1294 // Header returns a http.Header that can be modified by the caller to add
1295 // headers to the request.
1296 func (c *BlogsListCall) Header() http.Header {
1297 if c.header_ == nil {
1298 c.header_ = make(http.Header)
1299 }
1300 return c.header_
1301 }
1302
1303 func (c *BlogsListCall) doRequest(alt string) (*http.Response, error) {
1304 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1305 if c.ifNoneMatch_ != "" {
1306 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1307 }
1308 c.urlParams_.Set("alt", alt)
1309 c.urlParams_.Set("prettyPrint", "false")
1310 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/blogs")
1311 urls += "?" + c.urlParams_.Encode()
1312 req, err := http.NewRequest("GET", urls, nil)
1313 if err != nil {
1314 return nil, err
1315 }
1316 req.Header = reqHeaders
1317 googleapi.Expand(req.URL, map[string]string{
1318 "userId": c.userId,
1319 })
1320 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.blogs.list", "request", internallog.HTTPRequest(req, nil))
1321 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1322 }
1323
1324 // Do executes the "blogger.blogs.list" call.
1325 // Any non-2xx status code is an error. Response headers are in either
1326 // *BlogList.ServerResponse.Header or (if a response was returned at all) in
1327 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1328 // whether the returned error was because http.StatusNotModified was returned.
1329 func (c *BlogsListCall) Do(opts ...googleapi.CallOption) (*BlogList, error) {
1330 gensupport.SetOptions(c.urlParams_, opts...)
1331 res, err := c.doRequest("json")
1332 if res != nil && res.StatusCode == http.StatusNotModified {
1333 if res.Body != nil {
1334 res.Body.Close()
1335 }
1336 return nil, gensupport.WrapError(&googleapi.Error{
1337 Code: res.StatusCode,
1338 Header: res.Header,
1339 })
1340 }
1341 if err != nil {
1342 return nil, err
1343 }
1344 defer googleapi.CloseBody(res)
1345 if err := googleapi.CheckResponse(res); err != nil {
1346 return nil, gensupport.WrapError(err)
1347 }
1348 ret := &BlogList{
1349 ServerResponse: googleapi.ServerResponse{
1350 Header: res.Header,
1351 HTTPStatusCode: res.StatusCode,
1352 },
1353 }
1354 target := &ret
1355 b, err := gensupport.DecodeResponseBytes(target, res)
1356 if err != nil {
1357 return nil, err
1358 }
1359 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.blogs.list", "response", internallog.HTTPResponse(res, b))
1360 return ret, nil
1361 }
1362
1363 type CommentsGetCall struct {
1364 s *Service
1365 blogId string
1366 postId string
1367 commentId string
1368 urlParams_ gensupport.URLParams
1369 ifNoneMatch_ string
1370 ctx_ context.Context
1371 header_ http.Header
1372 }
1373
1374 // Get: Gets a comment by blog id, post id and comment id.
1375 //
1376 // - blogId: .
1377 // - commentId: .
1378 // - postId: .
1379 func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall {
1380 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1381 c.blogId = blogId
1382 c.postId = postId
1383 c.commentId = commentId
1384 return c
1385 }
1386
1387 // Fields allows partial responses to be retrieved. See
1388 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1389 // details.
1390 func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
1391 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1392 return c
1393 }
1394
1395 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1396 // object's ETag matches the given value. This is useful for getting updates
1397 // only after the object has changed since the last request.
1398 func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall {
1399 c.ifNoneMatch_ = entityTag
1400 return c
1401 }
1402
1403 // Context sets the context to be used in this call's Do method.
1404 func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall {
1405 c.ctx_ = ctx
1406 return c
1407 }
1408
1409 // Header returns a http.Header that can be modified by the caller to add
1410 // headers to the request.
1411 func (c *CommentsGetCall) Header() http.Header {
1412 if c.header_ == nil {
1413 c.header_ = make(http.Header)
1414 }
1415 return c.header_
1416 }
1417
1418 func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) {
1419 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1420 if c.ifNoneMatch_ != "" {
1421 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1422 }
1423 c.urlParams_.Set("alt", alt)
1424 c.urlParams_.Set("prettyPrint", "false")
1425 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments/{commentId}")
1426 urls += "?" + c.urlParams_.Encode()
1427 req, err := http.NewRequest("GET", urls, nil)
1428 if err != nil {
1429 return nil, err
1430 }
1431 req.Header = reqHeaders
1432 googleapi.Expand(req.URL, map[string]string{
1433 "blogId": c.blogId,
1434 "postId": c.postId,
1435 "commentId": c.commentId,
1436 })
1437 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.comments.get", "request", internallog.HTTPRequest(req, nil))
1438 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1439 }
1440
1441 // Do executes the "blogger.comments.get" call.
1442 // Any non-2xx status code is an error. Response headers are in either
1443 // *Comment.ServerResponse.Header or (if a response was returned at all) in
1444 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1445 // whether the returned error was because http.StatusNotModified was returned.
1446 func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
1447 gensupport.SetOptions(c.urlParams_, opts...)
1448 res, err := c.doRequest("json")
1449 if res != nil && res.StatusCode == http.StatusNotModified {
1450 if res.Body != nil {
1451 res.Body.Close()
1452 }
1453 return nil, gensupport.WrapError(&googleapi.Error{
1454 Code: res.StatusCode,
1455 Header: res.Header,
1456 })
1457 }
1458 if err != nil {
1459 return nil, err
1460 }
1461 defer googleapi.CloseBody(res)
1462 if err := googleapi.CheckResponse(res); err != nil {
1463 return nil, gensupport.WrapError(err)
1464 }
1465 ret := &Comment{
1466 ServerResponse: googleapi.ServerResponse{
1467 Header: res.Header,
1468 HTTPStatusCode: res.StatusCode,
1469 },
1470 }
1471 target := &ret
1472 b, err := gensupport.DecodeResponseBytes(target, res)
1473 if err != nil {
1474 return nil, err
1475 }
1476 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.comments.get", "response", internallog.HTTPResponse(res, b))
1477 return ret, nil
1478 }
1479
1480 type CommentsListCall struct {
1481 s *Service
1482 blogId string
1483 postId string
1484 urlParams_ gensupport.URLParams
1485 ifNoneMatch_ string
1486 ctx_ context.Context
1487 header_ http.Header
1488 }
1489
1490 // List: Lists comments.
1491 //
1492 // - blogId: .
1493 // - postId: .
1494 func (r *CommentsService) List(blogId string, postId string) *CommentsListCall {
1495 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1496 c.blogId = blogId
1497 c.postId = postId
1498 return c
1499 }
1500
1501 // FetchBodies sets the optional parameter "fetchBodies":
1502 func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall {
1503 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
1504 return c
1505 }
1506
1507 // MaxResults sets the optional parameter "maxResults":
1508 func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
1509 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1510 return c
1511 }
1512
1513 // PageToken sets the optional parameter "pageToken":
1514 func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
1515 c.urlParams_.Set("pageToken", pageToken)
1516 return c
1517 }
1518
1519 // StartDate sets the optional parameter "startDate":
1520 func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall {
1521 c.urlParams_.Set("startDate", startDate)
1522 return c
1523 }
1524
1525 // Fields allows partial responses to be retrieved. See
1526 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1527 // details.
1528 func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
1529 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1530 return c
1531 }
1532
1533 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1534 // object's ETag matches the given value. This is useful for getting updates
1535 // only after the object has changed since the last request.
1536 func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
1537 c.ifNoneMatch_ = entityTag
1538 return c
1539 }
1540
1541 // Context sets the context to be used in this call's Do method.
1542 func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
1543 c.ctx_ = ctx
1544 return c
1545 }
1546
1547 // Header returns a http.Header that can be modified by the caller to add
1548 // headers to the request.
1549 func (c *CommentsListCall) Header() http.Header {
1550 if c.header_ == nil {
1551 c.header_ = make(http.Header)
1552 }
1553 return c.header_
1554 }
1555
1556 func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
1557 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1558 if c.ifNoneMatch_ != "" {
1559 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1560 }
1561 c.urlParams_.Set("alt", alt)
1562 c.urlParams_.Set("prettyPrint", "false")
1563 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments")
1564 urls += "?" + c.urlParams_.Encode()
1565 req, err := http.NewRequest("GET", urls, nil)
1566 if err != nil {
1567 return nil, err
1568 }
1569 req.Header = reqHeaders
1570 googleapi.Expand(req.URL, map[string]string{
1571 "blogId": c.blogId,
1572 "postId": c.postId,
1573 })
1574 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.comments.list", "request", internallog.HTTPRequest(req, nil))
1575 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1576 }
1577
1578 // Do executes the "blogger.comments.list" call.
1579 // Any non-2xx status code is an error. Response headers are in either
1580 // *CommentList.ServerResponse.Header or (if a response was returned at all) in
1581 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1582 // whether the returned error was because http.StatusNotModified was returned.
1583 func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
1584 gensupport.SetOptions(c.urlParams_, opts...)
1585 res, err := c.doRequest("json")
1586 if res != nil && res.StatusCode == http.StatusNotModified {
1587 if res.Body != nil {
1588 res.Body.Close()
1589 }
1590 return nil, gensupport.WrapError(&googleapi.Error{
1591 Code: res.StatusCode,
1592 Header: res.Header,
1593 })
1594 }
1595 if err != nil {
1596 return nil, err
1597 }
1598 defer googleapi.CloseBody(res)
1599 if err := googleapi.CheckResponse(res); err != nil {
1600 return nil, gensupport.WrapError(err)
1601 }
1602 ret := &CommentList{
1603 ServerResponse: googleapi.ServerResponse{
1604 Header: res.Header,
1605 HTTPStatusCode: res.StatusCode,
1606 },
1607 }
1608 target := &ret
1609 b, err := gensupport.DecodeResponseBytes(target, res)
1610 if err != nil {
1611 return nil, err
1612 }
1613 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.comments.list", "response", internallog.HTTPResponse(res, b))
1614 return ret, nil
1615 }
1616
1617 // Pages invokes f for each page of results.
1618 // A non-nil error returned from f will halt the iteration.
1619 // The provided context supersedes any context provided to the Context method.
1620 func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error {
1621 c.ctx_ = ctx
1622 defer c.PageToken(c.urlParams_.Get("pageToken"))
1623 for {
1624 x, err := c.Do()
1625 if err != nil {
1626 return err
1627 }
1628 if err := f(x); err != nil {
1629 return err
1630 }
1631 if x.NextPageToken == "" {
1632 return nil
1633 }
1634 c.PageToken(x.NextPageToken)
1635 }
1636 }
1637
1638 type PagesGetCall struct {
1639 s *Service
1640 blogId string
1641 pageId string
1642 urlParams_ gensupport.URLParams
1643 ifNoneMatch_ string
1644 ctx_ context.Context
1645 header_ http.Header
1646 }
1647
1648 // Get: Gets a page by blog id and page id.
1649 //
1650 // - blogId: .
1651 // - pageId: .
1652 func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall {
1653 c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1654 c.blogId = blogId
1655 c.pageId = pageId
1656 return c
1657 }
1658
1659 // Fields allows partial responses to be retrieved. See
1660 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1661 // details.
1662 func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall {
1663 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1664 return c
1665 }
1666
1667 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1668 // object's ETag matches the given value. This is useful for getting updates
1669 // only after the object has changed since the last request.
1670 func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall {
1671 c.ifNoneMatch_ = entityTag
1672 return c
1673 }
1674
1675 // Context sets the context to be used in this call's Do method.
1676 func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall {
1677 c.ctx_ = ctx
1678 return c
1679 }
1680
1681 // Header returns a http.Header that can be modified by the caller to add
1682 // headers to the request.
1683 func (c *PagesGetCall) Header() http.Header {
1684 if c.header_ == nil {
1685 c.header_ = make(http.Header)
1686 }
1687 return c.header_
1688 }
1689
1690 func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) {
1691 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1692 if c.ifNoneMatch_ != "" {
1693 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1694 }
1695 c.urlParams_.Set("alt", alt)
1696 c.urlParams_.Set("prettyPrint", "false")
1697 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages/{pageId}")
1698 urls += "?" + c.urlParams_.Encode()
1699 req, err := http.NewRequest("GET", urls, nil)
1700 if err != nil {
1701 return nil, err
1702 }
1703 req.Header = reqHeaders
1704 googleapi.Expand(req.URL, map[string]string{
1705 "blogId": c.blogId,
1706 "pageId": c.pageId,
1707 })
1708 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.pages.get", "request", internallog.HTTPRequest(req, nil))
1709 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1710 }
1711
1712 // Do executes the "blogger.pages.get" call.
1713 // Any non-2xx status code is an error. Response headers are in either
1714 // *Page.ServerResponse.Header or (if a response was returned at all) in
1715 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1716 // whether the returned error was because http.StatusNotModified was returned.
1717 func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*Page, error) {
1718 gensupport.SetOptions(c.urlParams_, opts...)
1719 res, err := c.doRequest("json")
1720 if res != nil && res.StatusCode == http.StatusNotModified {
1721 if res.Body != nil {
1722 res.Body.Close()
1723 }
1724 return nil, gensupport.WrapError(&googleapi.Error{
1725 Code: res.StatusCode,
1726 Header: res.Header,
1727 })
1728 }
1729 if err != nil {
1730 return nil, err
1731 }
1732 defer googleapi.CloseBody(res)
1733 if err := googleapi.CheckResponse(res); err != nil {
1734 return nil, gensupport.WrapError(err)
1735 }
1736 ret := &Page{
1737 ServerResponse: googleapi.ServerResponse{
1738 Header: res.Header,
1739 HTTPStatusCode: res.StatusCode,
1740 },
1741 }
1742 target := &ret
1743 b, err := gensupport.DecodeResponseBytes(target, res)
1744 if err != nil {
1745 return nil, err
1746 }
1747 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.pages.get", "response", internallog.HTTPResponse(res, b))
1748 return ret, nil
1749 }
1750
1751 type PagesListCall struct {
1752 s *Service
1753 blogId string
1754 urlParams_ gensupport.URLParams
1755 ifNoneMatch_ string
1756 ctx_ context.Context
1757 header_ http.Header
1758 }
1759
1760 // List: Lists pages.
1761 //
1762 // - blogId: .
1763 func (r *PagesService) List(blogId string) *PagesListCall {
1764 c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1765 c.blogId = blogId
1766 return c
1767 }
1768
1769 // FetchBodies sets the optional parameter "fetchBodies":
1770 func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall {
1771 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
1772 return c
1773 }
1774
1775 // Fields allows partial responses to be retrieved. See
1776 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1777 // details.
1778 func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall {
1779 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1780 return c
1781 }
1782
1783 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1784 // object's ETag matches the given value. This is useful for getting updates
1785 // only after the object has changed since the last request.
1786 func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall {
1787 c.ifNoneMatch_ = entityTag
1788 return c
1789 }
1790
1791 // Context sets the context to be used in this call's Do method.
1792 func (c *PagesListCall) Context(ctx context.Context) *PagesListCall {
1793 c.ctx_ = ctx
1794 return c
1795 }
1796
1797 // Header returns a http.Header that can be modified by the caller to add
1798 // headers to the request.
1799 func (c *PagesListCall) Header() http.Header {
1800 if c.header_ == nil {
1801 c.header_ = make(http.Header)
1802 }
1803 return c.header_
1804 }
1805
1806 func (c *PagesListCall) doRequest(alt string) (*http.Response, error) {
1807 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1808 if c.ifNoneMatch_ != "" {
1809 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1810 }
1811 c.urlParams_.Set("alt", alt)
1812 c.urlParams_.Set("prettyPrint", "false")
1813 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages")
1814 urls += "?" + c.urlParams_.Encode()
1815 req, err := http.NewRequest("GET", urls, nil)
1816 if err != nil {
1817 return nil, err
1818 }
1819 req.Header = reqHeaders
1820 googleapi.Expand(req.URL, map[string]string{
1821 "blogId": c.blogId,
1822 })
1823 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.pages.list", "request", internallog.HTTPRequest(req, nil))
1824 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1825 }
1826
1827 // Do executes the "blogger.pages.list" call.
1828 // Any non-2xx status code is an error. Response headers are in either
1829 // *PageList.ServerResponse.Header or (if a response was returned at all) in
1830 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1831 // whether the returned error was because http.StatusNotModified was returned.
1832 func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*PageList, error) {
1833 gensupport.SetOptions(c.urlParams_, opts...)
1834 res, err := c.doRequest("json")
1835 if res != nil && res.StatusCode == http.StatusNotModified {
1836 if res.Body != nil {
1837 res.Body.Close()
1838 }
1839 return nil, gensupport.WrapError(&googleapi.Error{
1840 Code: res.StatusCode,
1841 Header: res.Header,
1842 })
1843 }
1844 if err != nil {
1845 return nil, err
1846 }
1847 defer googleapi.CloseBody(res)
1848 if err := googleapi.CheckResponse(res); err != nil {
1849 return nil, gensupport.WrapError(err)
1850 }
1851 ret := &PageList{
1852 ServerResponse: googleapi.ServerResponse{
1853 Header: res.Header,
1854 HTTPStatusCode: res.StatusCode,
1855 },
1856 }
1857 target := &ret
1858 b, err := gensupport.DecodeResponseBytes(target, res)
1859 if err != nil {
1860 return nil, err
1861 }
1862 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.pages.list", "response", internallog.HTTPResponse(res, b))
1863 return ret, nil
1864 }
1865
1866 type PostsGetCall struct {
1867 s *Service
1868 blogId string
1869 postId string
1870 urlParams_ gensupport.URLParams
1871 ifNoneMatch_ string
1872 ctx_ context.Context
1873 header_ http.Header
1874 }
1875
1876 // Get: Gets a post by blog id and post id
1877 //
1878 // - blogId: .
1879 // - postId: .
1880 func (r *PostsService) Get(blogId string, postId string) *PostsGetCall {
1881 c := &PostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1882 c.blogId = blogId
1883 c.postId = postId
1884 return c
1885 }
1886
1887 // Fields allows partial responses to be retrieved. See
1888 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1889 // details.
1890 func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall {
1891 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1892 return c
1893 }
1894
1895 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1896 // object's ETag matches the given value. This is useful for getting updates
1897 // only after the object has changed since the last request.
1898 func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall {
1899 c.ifNoneMatch_ = entityTag
1900 return c
1901 }
1902
1903 // Context sets the context to be used in this call's Do method.
1904 func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall {
1905 c.ctx_ = ctx
1906 return c
1907 }
1908
1909 // Header returns a http.Header that can be modified by the caller to add
1910 // headers to the request.
1911 func (c *PostsGetCall) Header() http.Header {
1912 if c.header_ == nil {
1913 c.header_ = make(http.Header)
1914 }
1915 return c.header_
1916 }
1917
1918 func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) {
1919 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1920 if c.ifNoneMatch_ != "" {
1921 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1922 }
1923 c.urlParams_.Set("alt", alt)
1924 c.urlParams_.Set("prettyPrint", "false")
1925 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}")
1926 urls += "?" + c.urlParams_.Encode()
1927 req, err := http.NewRequest("GET", urls, nil)
1928 if err != nil {
1929 return nil, err
1930 }
1931 req.Header = reqHeaders
1932 googleapi.Expand(req.URL, map[string]string{
1933 "blogId": c.blogId,
1934 "postId": c.postId,
1935 })
1936 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.posts.get", "request", internallog.HTTPRequest(req, nil))
1937 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1938 }
1939
1940 // Do executes the "blogger.posts.get" call.
1941 // Any non-2xx status code is an error. Response headers are in either
1942 // *Post.ServerResponse.Header or (if a response was returned at all) in
1943 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1944 // whether the returned error was because http.StatusNotModified was returned.
1945 func (c *PostsGetCall) Do(opts ...googleapi.CallOption) (*Post, error) {
1946 gensupport.SetOptions(c.urlParams_, opts...)
1947 res, err := c.doRequest("json")
1948 if res != nil && res.StatusCode == http.StatusNotModified {
1949 if res.Body != nil {
1950 res.Body.Close()
1951 }
1952 return nil, gensupport.WrapError(&googleapi.Error{
1953 Code: res.StatusCode,
1954 Header: res.Header,
1955 })
1956 }
1957 if err != nil {
1958 return nil, err
1959 }
1960 defer googleapi.CloseBody(res)
1961 if err := googleapi.CheckResponse(res); err != nil {
1962 return nil, gensupport.WrapError(err)
1963 }
1964 ret := &Post{
1965 ServerResponse: googleapi.ServerResponse{
1966 Header: res.Header,
1967 HTTPStatusCode: res.StatusCode,
1968 },
1969 }
1970 target := &ret
1971 b, err := gensupport.DecodeResponseBytes(target, res)
1972 if err != nil {
1973 return nil, err
1974 }
1975 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.posts.get", "response", internallog.HTTPResponse(res, b))
1976 return ret, nil
1977 }
1978
1979 type PostsListCall struct {
1980 s *Service
1981 blogId string
1982 urlParams_ gensupport.URLParams
1983 ifNoneMatch_ string
1984 ctx_ context.Context
1985 header_ http.Header
1986 }
1987
1988 // List: Lists posts.
1989 //
1990 // - blogId: .
1991 func (r *PostsService) List(blogId string) *PostsListCall {
1992 c := &PostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1993 c.blogId = blogId
1994 return c
1995 }
1996
1997 // FetchBodies sets the optional parameter "fetchBodies":
1998 func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall {
1999 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
2000 return c
2001 }
2002
2003 // MaxResults sets the optional parameter "maxResults":
2004 func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall {
2005 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2006 return c
2007 }
2008
2009 // PageToken sets the optional parameter "pageToken":
2010 func (c *PostsListCall) PageToken(pageToken string) *PostsListCall {
2011 c.urlParams_.Set("pageToken", pageToken)
2012 return c
2013 }
2014
2015 // StartDate sets the optional parameter "startDate":
2016 func (c *PostsListCall) StartDate(startDate string) *PostsListCall {
2017 c.urlParams_.Set("startDate", startDate)
2018 return c
2019 }
2020
2021 // Fields allows partial responses to be retrieved. See
2022 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2023 // details.
2024 func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall {
2025 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2026 return c
2027 }
2028
2029 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2030 // object's ETag matches the given value. This is useful for getting updates
2031 // only after the object has changed since the last request.
2032 func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall {
2033 c.ifNoneMatch_ = entityTag
2034 return c
2035 }
2036
2037 // Context sets the context to be used in this call's Do method.
2038 func (c *PostsListCall) Context(ctx context.Context) *PostsListCall {
2039 c.ctx_ = ctx
2040 return c
2041 }
2042
2043 // Header returns a http.Header that can be modified by the caller to add
2044 // headers to the request.
2045 func (c *PostsListCall) Header() http.Header {
2046 if c.header_ == nil {
2047 c.header_ = make(http.Header)
2048 }
2049 return c.header_
2050 }
2051
2052 func (c *PostsListCall) doRequest(alt string) (*http.Response, error) {
2053 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2054 if c.ifNoneMatch_ != "" {
2055 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2056 }
2057 c.urlParams_.Set("alt", alt)
2058 c.urlParams_.Set("prettyPrint", "false")
2059 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts")
2060 urls += "?" + c.urlParams_.Encode()
2061 req, err := http.NewRequest("GET", urls, nil)
2062 if err != nil {
2063 return nil, err
2064 }
2065 req.Header = reqHeaders
2066 googleapi.Expand(req.URL, map[string]string{
2067 "blogId": c.blogId,
2068 })
2069 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.posts.list", "request", internallog.HTTPRequest(req, nil))
2070 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2071 }
2072
2073 // Do executes the "blogger.posts.list" call.
2074 // Any non-2xx status code is an error. Response headers are in either
2075 // *PostList.ServerResponse.Header or (if a response was returned at all) in
2076 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2077 // whether the returned error was because http.StatusNotModified was returned.
2078 func (c *PostsListCall) Do(opts ...googleapi.CallOption) (*PostList, error) {
2079 gensupport.SetOptions(c.urlParams_, opts...)
2080 res, err := c.doRequest("json")
2081 if res != nil && res.StatusCode == http.StatusNotModified {
2082 if res.Body != nil {
2083 res.Body.Close()
2084 }
2085 return nil, gensupport.WrapError(&googleapi.Error{
2086 Code: res.StatusCode,
2087 Header: res.Header,
2088 })
2089 }
2090 if err != nil {
2091 return nil, err
2092 }
2093 defer googleapi.CloseBody(res)
2094 if err := googleapi.CheckResponse(res); err != nil {
2095 return nil, gensupport.WrapError(err)
2096 }
2097 ret := &PostList{
2098 ServerResponse: googleapi.ServerResponse{
2099 Header: res.Header,
2100 HTTPStatusCode: res.StatusCode,
2101 },
2102 }
2103 target := &ret
2104 b, err := gensupport.DecodeResponseBytes(target, res)
2105 if err != nil {
2106 return nil, err
2107 }
2108 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.posts.list", "response", internallog.HTTPResponse(res, b))
2109 return ret, nil
2110 }
2111
2112 // Pages invokes f for each page of results.
2113 // A non-nil error returned from f will halt the iteration.
2114 // The provided context supersedes any context provided to the Context method.
2115 func (c *PostsListCall) Pages(ctx context.Context, f func(*PostList) error) error {
2116 c.ctx_ = ctx
2117 defer c.PageToken(c.urlParams_.Get("pageToken"))
2118 for {
2119 x, err := c.Do()
2120 if err != nil {
2121 return err
2122 }
2123 if err := f(x); err != nil {
2124 return err
2125 }
2126 if x.NextPageToken == "" {
2127 return nil
2128 }
2129 c.PageToken(x.NextPageToken)
2130 }
2131 }
2132
2133 type UsersGetCall struct {
2134 s *Service
2135 userId string
2136 urlParams_ gensupport.URLParams
2137 ifNoneMatch_ string
2138 ctx_ context.Context
2139 header_ http.Header
2140 }
2141
2142 // Get: Gets a user by user id.
2143 //
2144 // - userId: .
2145 func (r *UsersService) Get(userId string) *UsersGetCall {
2146 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2147 c.userId = userId
2148 return c
2149 }
2150
2151 // Fields allows partial responses to be retrieved. See
2152 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2153 // details.
2154 func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
2155 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2156 return c
2157 }
2158
2159 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2160 // object's ETag matches the given value. This is useful for getting updates
2161 // only after the object has changed since the last request.
2162 func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
2163 c.ifNoneMatch_ = entityTag
2164 return c
2165 }
2166
2167 // Context sets the context to be used in this call's Do method.
2168 func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
2169 c.ctx_ = ctx
2170 return c
2171 }
2172
2173 // Header returns a http.Header that can be modified by the caller to add
2174 // headers to the request.
2175 func (c *UsersGetCall) Header() http.Header {
2176 if c.header_ == nil {
2177 c.header_ = make(http.Header)
2178 }
2179 return c.header_
2180 }
2181
2182 func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
2183 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2184 if c.ifNoneMatch_ != "" {
2185 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2186 }
2187 c.urlParams_.Set("alt", alt)
2188 c.urlParams_.Set("prettyPrint", "false")
2189 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}")
2190 urls += "?" + c.urlParams_.Encode()
2191 req, err := http.NewRequest("GET", urls, nil)
2192 if err != nil {
2193 return nil, err
2194 }
2195 req.Header = reqHeaders
2196 googleapi.Expand(req.URL, map[string]string{
2197 "userId": c.userId,
2198 })
2199 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.users.get", "request", internallog.HTTPRequest(req, nil))
2200 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2201 }
2202
2203 // Do executes the "blogger.users.get" call.
2204 // Any non-2xx status code is an error. Response headers are in either
2205 // *User.ServerResponse.Header or (if a response was returned at all) in
2206 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2207 // whether the returned error was because http.StatusNotModified was returned.
2208 func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
2209 gensupport.SetOptions(c.urlParams_, opts...)
2210 res, err := c.doRequest("json")
2211 if res != nil && res.StatusCode == http.StatusNotModified {
2212 if res.Body != nil {
2213 res.Body.Close()
2214 }
2215 return nil, gensupport.WrapError(&googleapi.Error{
2216 Code: res.StatusCode,
2217 Header: res.Header,
2218 })
2219 }
2220 if err != nil {
2221 return nil, err
2222 }
2223 defer googleapi.CloseBody(res)
2224 if err := googleapi.CheckResponse(res); err != nil {
2225 return nil, gensupport.WrapError(err)
2226 }
2227 ret := &User{
2228 ServerResponse: googleapi.ServerResponse{
2229 Header: res.Header,
2230 HTTPStatusCode: res.StatusCode,
2231 },
2232 }
2233 target := &ret
2234 b, err := gensupport.DecodeResponseBytes(target, res)
2235 if err != nil {
2236 return nil, err
2237 }
2238 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.users.get", "response", internallog.HTTPResponse(res, b))
2239 return ret, nil
2240 }