1// Copyright 2020 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 v3. 8// 9// For product documentation, see: https://developers.google.com/blogger/docs/3.0/getting_started 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/blogger/v2" 16// ... 17// ctx := context.Background() 18// bloggerService, err := blogger.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// bloggerService, err := blogger.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// bloggerService, err := blogger.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package blogger // import "google.golang.org/api/blogger/v2" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "blogger:v2" 75const apiName = "blogger" 76const apiVersion = "v2" 77const basePath = "https://blogger.googleapis.com/" 78 79// OAuth2 scopes used by this API. 80const ( 81 // Manage your Blogger account 82 BloggerScope = "https://www.googleapis.com/auth/blogger" 83) 84 85// NewService creates a new Service. 86func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 87 scopesOption := option.WithScopes( 88 "https://www.googleapis.com/auth/blogger", 89 ) 90 // NOTE: prepend, so we don't override user-specified scopes. 91 opts = append([]option.ClientOption{scopesOption}, opts...) 92 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 93 client, endpoint, err := htransport.NewClient(ctx, opts...) 94 if err != nil { 95 return nil, err 96 } 97 s, err := New(client) 98 if err != nil { 99 return nil, err 100 } 101 if endpoint != "" { 102 s.BasePath = endpoint 103 } 104 return s, nil 105} 106 107// New creates a new Service. It uses the provided http.Client for requests. 108// 109// Deprecated: please use NewService instead. 110// To provide a custom HTTP client, use option.WithHTTPClient. 111// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 112func New(client *http.Client) (*Service, error) { 113 if client == nil { 114 return nil, errors.New("client is nil") 115 } 116 s := &Service{client: client, BasePath: basePath} 117 s.Blogs = NewBlogsService(s) 118 s.Comments = NewCommentsService(s) 119 s.Pages = NewPagesService(s) 120 s.Posts = NewPostsService(s) 121 s.Users = NewUsersService(s) 122 return s, nil 123} 124 125type Service struct { 126 client *http.Client 127 BasePath string // API endpoint base URL 128 UserAgent string // optional additional User-Agent fragment 129 130 Blogs *BlogsService 131 132 Comments *CommentsService 133 134 Pages *PagesService 135 136 Posts *PostsService 137 138 Users *UsersService 139} 140 141func (s *Service) userAgent() string { 142 if s.UserAgent == "" { 143 return googleapi.UserAgent 144 } 145 return googleapi.UserAgent + " " + s.UserAgent 146} 147 148func NewBlogsService(s *Service) *BlogsService { 149 rs := &BlogsService{s: s} 150 return rs 151} 152 153type BlogsService struct { 154 s *Service 155} 156 157func NewCommentsService(s *Service) *CommentsService { 158 rs := &CommentsService{s: s} 159 return rs 160} 161 162type CommentsService struct { 163 s *Service 164} 165 166func NewPagesService(s *Service) *PagesService { 167 rs := &PagesService{s: s} 168 return rs 169} 170 171type PagesService struct { 172 s *Service 173} 174 175func NewPostsService(s *Service) *PostsService { 176 rs := &PostsService{s: s} 177 return rs 178} 179 180type PostsService struct { 181 s *Service 182} 183 184func NewUsersService(s *Service) *UsersService { 185 rs := &UsersService{s: s} 186 return rs 187} 188 189type UsersService struct { 190 s *Service 191} 192 193type Blog struct { 194 // CustomMetaData: The JSON custom meta-data for the Blog. 195 CustomMetaData string `json:"customMetaData,omitempty"` 196 197 // Description: The description of this blog. This is displayed 198 // underneath the title. 199 Description string `json:"description,omitempty"` 200 201 // Id: The identifier for this resource. 202 Id string `json:"id,omitempty"` 203 204 // Kind: The kind of this entry. Always blogger#blog. 205 Kind string `json:"kind,omitempty"` 206 207 // Locale: The locale this Blog is set to. 208 Locale *BlogLocale `json:"locale,omitempty"` 209 210 // Name: The name of this blog. This is displayed as the title. 211 Name string `json:"name,omitempty"` 212 213 // Pages: The container of pages in this blog. 214 Pages *BlogPages `json:"pages,omitempty"` 215 216 // Posts: The container of posts in this blog. 217 Posts *BlogPosts `json:"posts,omitempty"` 218 219 // Published: RFC 3339 date-time when this blog was published. 220 Published string `json:"published,omitempty"` 221 222 // SelfLink: The API REST URL to fetch this resource from. 223 SelfLink string `json:"selfLink,omitempty"` 224 225 // Status: The status of the blog. 226 // 227 // Possible values: 228 // "LIVE" 229 // "DELETED" 230 Status string `json:"status,omitempty"` 231 232 // Updated: RFC 3339 date-time when this blog was last updated. 233 Updated string `json:"updated,omitempty"` 234 235 // Url: The URL where this blog is published. 236 Url string `json:"url,omitempty"` 237 238 // ServerResponse contains the HTTP response code and headers from the 239 // server. 240 googleapi.ServerResponse `json:"-"` 241 242 // ForceSendFields is a list of field names (e.g. "CustomMetaData") to 243 // unconditionally include in API requests. By default, fields with 244 // empty values are omitted from API requests. However, any non-pointer, 245 // non-interface field appearing in ForceSendFields will be sent to the 246 // server regardless of whether the field is empty or not. This may be 247 // used to include empty fields in Patch requests. 248 ForceSendFields []string `json:"-"` 249 250 // NullFields is a list of field names (e.g. "CustomMetaData") to 251 // include in API requests with the JSON null value. By default, fields 252 // with empty values are omitted from API requests. However, any field 253 // with an empty value appearing in NullFields will be sent to the 254 // server as null. It is an error if a field in this list has a 255 // non-empty value. This may be used to include null fields in Patch 256 // requests. 257 NullFields []string `json:"-"` 258} 259 260func (s *Blog) MarshalJSON() ([]byte, error) { 261 type NoMethod Blog 262 raw := NoMethod(*s) 263 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 264} 265 266// BlogLocale: The locale this Blog is set to. 267type BlogLocale struct { 268 // Country: The country this blog's locale is set to. 269 Country string `json:"country,omitempty"` 270 271 // Language: The language this blog is authored in. 272 Language string `json:"language,omitempty"` 273 274 // Variant: The language variant this blog is authored in. 275 Variant string `json:"variant,omitempty"` 276 277 // ForceSendFields is a list of field names (e.g. "Country") to 278 // unconditionally include in API requests. By default, fields with 279 // empty values are omitted from API requests. However, any non-pointer, 280 // non-interface field appearing in ForceSendFields will be sent to the 281 // server regardless of whether the field is empty or not. This may be 282 // used to include empty fields in Patch requests. 283 ForceSendFields []string `json:"-"` 284 285 // NullFields is a list of field names (e.g. "Country") to include in 286 // API requests with the JSON null value. By default, fields with empty 287 // values are omitted from API requests. However, any field with an 288 // empty value appearing in NullFields will be sent to the server as 289 // null. It is an error if a field in this list has a non-empty value. 290 // This may be used to include null fields in Patch requests. 291 NullFields []string `json:"-"` 292} 293 294func (s *BlogLocale) MarshalJSON() ([]byte, error) { 295 type NoMethod BlogLocale 296 raw := NoMethod(*s) 297 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 298} 299 300// BlogPages: The container of pages in this blog. 301type BlogPages struct { 302 // SelfLink: The URL of the container for pages in this blog. 303 SelfLink string `json:"selfLink,omitempty"` 304 305 // TotalItems: The count of pages in this blog. 306 TotalItems int64 `json:"totalItems,omitempty"` 307 308 // ForceSendFields is a list of field names (e.g. "SelfLink") to 309 // unconditionally include in API requests. By default, fields with 310 // empty values are omitted from API requests. However, any non-pointer, 311 // non-interface field appearing in ForceSendFields will be sent to the 312 // server regardless of whether the field is empty or not. This may be 313 // used to include empty fields in Patch requests. 314 ForceSendFields []string `json:"-"` 315 316 // NullFields is a list of field names (e.g. "SelfLink") to include in 317 // API requests with the JSON null value. By default, fields with empty 318 // values are omitted from API requests. However, any field with an 319 // empty value appearing in NullFields will be sent to the server as 320 // null. It is an error if a field in this list has a non-empty value. 321 // This may be used to include null fields in Patch requests. 322 NullFields []string `json:"-"` 323} 324 325func (s *BlogPages) MarshalJSON() ([]byte, error) { 326 type NoMethod BlogPages 327 raw := NoMethod(*s) 328 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 329} 330 331// BlogPosts: The container of posts in this blog. 332type BlogPosts struct { 333 // Items: The List of Posts for this Blog. 334 Items []*Post `json:"items,omitempty"` 335 336 // SelfLink: The URL of the container for posts in this blog. 337 SelfLink string `json:"selfLink,omitempty"` 338 339 // TotalItems: The count of posts in this blog. 340 TotalItems int64 `json:"totalItems,omitempty"` 341 342 // ForceSendFields is a list of field names (e.g. "Items") to 343 // unconditionally include in API requests. By default, fields with 344 // empty values are omitted from API requests. However, any non-pointer, 345 // non-interface field appearing in ForceSendFields will be sent to the 346 // server regardless of whether the field is empty or not. This may be 347 // used to include empty fields in Patch requests. 348 ForceSendFields []string `json:"-"` 349 350 // NullFields is a list of field names (e.g. "Items") to include in API 351 // requests with the JSON null value. By default, fields with empty 352 // values are omitted from API requests. However, any field with an 353 // empty value appearing in NullFields will be sent to the server as 354 // null. It is an error if a field in this list has a non-empty value. 355 // This may be used to include null fields in Patch requests. 356 NullFields []string `json:"-"` 357} 358 359func (s *BlogPosts) MarshalJSON() ([]byte, error) { 360 type NoMethod BlogPosts 361 raw := NoMethod(*s) 362 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 363} 364 365type BlogList struct { 366 // BlogUserInfos: Admin level list of blog per-user information. 367 BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"` 368 369 // Items: The list of Blogs this user has Authorship or Admin rights 370 // over. 371 Items []*Blog `json:"items,omitempty"` 372 373 // Kind: The kind of this entity. Always blogger#blogList. 374 Kind string `json:"kind,omitempty"` 375 376 // ServerResponse contains the HTTP response code and headers from the 377 // server. 378 googleapi.ServerResponse `json:"-"` 379 380 // ForceSendFields is a list of field names (e.g. "BlogUserInfos") to 381 // unconditionally include in API requests. By default, fields with 382 // empty values are omitted from API requests. However, any non-pointer, 383 // non-interface field appearing in ForceSendFields will be sent to the 384 // server regardless of whether the field is empty or not. This may be 385 // used to include empty fields in Patch requests. 386 ForceSendFields []string `json:"-"` 387 388 // NullFields is a list of field names (e.g. "BlogUserInfos") to include 389 // in API requests with the JSON null value. By default, fields with 390 // empty values are omitted from API requests. However, any field with 391 // an empty value appearing in NullFields will be sent to the server as 392 // null. It is an error if a field in this list has a non-empty value. 393 // This may be used to include null fields in Patch requests. 394 NullFields []string `json:"-"` 395} 396 397func (s *BlogList) MarshalJSON() ([]byte, error) { 398 type NoMethod BlogList 399 raw := NoMethod(*s) 400 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 401} 402 403type BlogPerUserInfo struct { 404 // BlogId: ID of the Blog resource. 405 BlogId string `json:"blogId,omitempty"` 406 407 // HasAdminAccess: True if the user has Admin level access to the blog. 408 HasAdminAccess bool `json:"hasAdminAccess,omitempty"` 409 410 // Kind: The kind of this entity. Always blogger#blogPerUserInfo. 411 Kind string `json:"kind,omitempty"` 412 413 // PhotosAlbumKey: The Photo Album Key for the user when adding photos 414 // to the blog. 415 PhotosAlbumKey string `json:"photosAlbumKey,omitempty"` 416 417 // Role: Access permissions that the user has for the blog (ADMIN, 418 // AUTHOR, or 419 // READER). 420 // 421 // Possible values: 422 // "VIEW_TYPE_UNSPECIFIED" 423 // "READER" 424 // "AUTHOR" 425 // "ADMIN" 426 Role string `json:"role,omitempty"` 427 428 // UserId: ID of the User. 429 UserId string `json:"userId,omitempty"` 430 431 // ForceSendFields is a list of field names (e.g. "BlogId") to 432 // unconditionally include in API requests. By default, fields with 433 // empty values are omitted from API requests. However, any non-pointer, 434 // non-interface field appearing in ForceSendFields will be sent to the 435 // server regardless of whether the field is empty or not. This may be 436 // used to include empty fields in Patch requests. 437 ForceSendFields []string `json:"-"` 438 439 // NullFields is a list of field names (e.g. "BlogId") to include in API 440 // requests with the JSON null value. By default, fields with empty 441 // values are omitted from API requests. However, any field with an 442 // empty value appearing in NullFields will be sent to the server as 443 // null. It is an error if a field in this list has a non-empty value. 444 // This may be used to include null fields in Patch requests. 445 NullFields []string `json:"-"` 446} 447 448func (s *BlogPerUserInfo) MarshalJSON() ([]byte, error) { 449 type NoMethod BlogPerUserInfo 450 raw := NoMethod(*s) 451 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 452} 453 454type BlogUserInfo struct { 455 // Blog: The Blog resource. 456 Blog *Blog `json:"blog,omitempty"` 457 458 // BlogUserInfo: Information about a User for the Blog. 459 BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"` 460 461 // Kind: The kind of this entity. Always blogger#blogUserInfo. 462 Kind string `json:"kind,omitempty"` 463 464 // ForceSendFields is a list of field names (e.g. "Blog") to 465 // unconditionally include in API requests. By default, fields with 466 // empty values are omitted from API requests. However, any non-pointer, 467 // non-interface field appearing in ForceSendFields will be sent to the 468 // server regardless of whether the field is empty or not. This may be 469 // used to include empty fields in Patch requests. 470 ForceSendFields []string `json:"-"` 471 472 // NullFields is a list of field names (e.g. "Blog") to include in API 473 // requests with the JSON null value. By default, fields with empty 474 // values are omitted from API requests. However, any field with an 475 // empty value appearing in NullFields will be sent to the server as 476 // null. It is an error if a field in this list has a non-empty value. 477 // This may be used to include null fields in Patch requests. 478 NullFields []string `json:"-"` 479} 480 481func (s *BlogUserInfo) MarshalJSON() ([]byte, error) { 482 type NoMethod BlogUserInfo 483 raw := NoMethod(*s) 484 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 485} 486 487type Comment struct { 488 // Author: The author of this Comment. 489 Author *CommentAuthor `json:"author,omitempty"` 490 491 // Blog: Data about the blog containing this comment. 492 Blog *CommentBlog `json:"blog,omitempty"` 493 494 // Content: The actual content of the comment. May include HTML markup. 495 Content string `json:"content,omitempty"` 496 497 // Id: The identifier for this resource. 498 Id string `json:"id,omitempty"` 499 500 // InReplyTo: Data about the comment this is in reply to. 501 InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` 502 503 // Kind: The kind of this entry. Always blogger#comment. 504 Kind string `json:"kind,omitempty"` 505 506 // Post: Data about the post containing this comment. 507 Post *CommentPost `json:"post,omitempty"` 508 509 // Published: RFC 3339 date-time when this comment was published. 510 Published string `json:"published,omitempty"` 511 512 // SelfLink: The API REST URL to fetch this resource from. 513 SelfLink string `json:"selfLink,omitempty"` 514 515 // Status: The status of the comment (only populated for admin users). 516 // 517 // Possible values: 518 // "LIVE" 519 // "EMPTIED" 520 // "PENDING" 521 // "SPAM" 522 Status string `json:"status,omitempty"` 523 524 // Updated: RFC 3339 date-time when this comment was last updated. 525 Updated string `json:"updated,omitempty"` 526 527 // ServerResponse contains the HTTP response code and headers from the 528 // server. 529 googleapi.ServerResponse `json:"-"` 530 531 // ForceSendFields is a list of field names (e.g. "Author") to 532 // unconditionally include in API requests. By default, fields with 533 // empty values are omitted from API requests. However, any non-pointer, 534 // non-interface field appearing in ForceSendFields will be sent to the 535 // server regardless of whether the field is empty or not. This may be 536 // used to include empty fields in Patch requests. 537 ForceSendFields []string `json:"-"` 538 539 // NullFields is a list of field names (e.g. "Author") to include in API 540 // requests with the JSON null value. By default, fields with empty 541 // values are omitted from API requests. However, any field with an 542 // empty value appearing in NullFields will be sent to the server as 543 // null. It is an error if a field in this list has a non-empty value. 544 // This may be used to include null fields in Patch requests. 545 NullFields []string `json:"-"` 546} 547 548func (s *Comment) MarshalJSON() ([]byte, error) { 549 type NoMethod Comment 550 raw := NoMethod(*s) 551 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 552} 553 554// CommentAuthor: The author of this Comment. 555type CommentAuthor struct { 556 // DisplayName: The display name. 557 DisplayName string `json:"displayName,omitempty"` 558 559 // Id: The identifier of the creator. 560 Id string `json:"id,omitempty"` 561 562 // Image: The creator's avatar. 563 Image *CommentAuthorImage `json:"image,omitempty"` 564 565 // Url: The URL of the creator's Profile page. 566 Url string `json:"url,omitempty"` 567 568 // ForceSendFields is a list of field names (e.g. "DisplayName") to 569 // unconditionally include in API requests. By default, fields with 570 // empty values are omitted from API requests. However, any non-pointer, 571 // non-interface field appearing in ForceSendFields will be sent to the 572 // server regardless of whether the field is empty or not. This may be 573 // used to include empty fields in Patch requests. 574 ForceSendFields []string `json:"-"` 575 576 // NullFields is a list of field names (e.g. "DisplayName") to include 577 // in API requests with the JSON null value. By default, fields with 578 // empty values are omitted from API requests. However, any field with 579 // an empty value appearing in NullFields will be sent to the server as 580 // null. It is an error if a field in this list has a non-empty value. 581 // This may be used to include null fields in Patch requests. 582 NullFields []string `json:"-"` 583} 584 585func (s *CommentAuthor) MarshalJSON() ([]byte, error) { 586 type NoMethod CommentAuthor 587 raw := NoMethod(*s) 588 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 589} 590 591// CommentAuthorImage: The creator's avatar. 592type CommentAuthorImage struct { 593 // Url: The creator's avatar URL. 594 Url string `json:"url,omitempty"` 595 596 // ForceSendFields is a list of field names (e.g. "Url") to 597 // unconditionally include in API requests. By default, fields with 598 // empty values are omitted from API requests. However, any non-pointer, 599 // non-interface field appearing in ForceSendFields will be sent to the 600 // server regardless of whether the field is empty or not. This may be 601 // used to include empty fields in Patch requests. 602 ForceSendFields []string `json:"-"` 603 604 // NullFields is a list of field names (e.g. "Url") to include in API 605 // requests with the JSON null value. By default, fields with empty 606 // values are omitted from API requests. However, any field with an 607 // empty value appearing in NullFields will be sent to the server as 608 // null. It is an error if a field in this list has a non-empty value. 609 // This may be used to include null fields in Patch requests. 610 NullFields []string `json:"-"` 611} 612 613func (s *CommentAuthorImage) MarshalJSON() ([]byte, error) { 614 type NoMethod CommentAuthorImage 615 raw := NoMethod(*s) 616 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 617} 618 619// CommentBlog: Data about the blog containing this comment. 620type CommentBlog struct { 621 // Id: The identifier of the blog containing this comment. 622 Id string `json:"id,omitempty"` 623 624 // ForceSendFields is a list of field names (e.g. "Id") to 625 // unconditionally include in API requests. By default, fields with 626 // empty values are omitted from API requests. However, any non-pointer, 627 // non-interface field appearing in ForceSendFields will be sent to the 628 // server regardless of whether the field is empty or not. This may be 629 // used to include empty fields in Patch requests. 630 ForceSendFields []string `json:"-"` 631 632 // NullFields is a list of field names (e.g. "Id") to include in API 633 // requests with the JSON null value. By default, fields with empty 634 // values are omitted from API requests. However, any field with an 635 // empty value appearing in NullFields will be sent to the server as 636 // null. It is an error if a field in this list has a non-empty value. 637 // This may be used to include null fields in Patch requests. 638 NullFields []string `json:"-"` 639} 640 641func (s *CommentBlog) MarshalJSON() ([]byte, error) { 642 type NoMethod CommentBlog 643 raw := NoMethod(*s) 644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 645} 646 647// CommentInReplyTo: Data about the comment this is in reply to. 648type CommentInReplyTo struct { 649 // Id: The identified of the parent of this comment. 650 Id string `json:"id,omitempty"` 651 652 // ForceSendFields is a list of field names (e.g. "Id") to 653 // unconditionally include in API requests. By default, fields with 654 // empty values are omitted from API requests. However, any non-pointer, 655 // non-interface field appearing in ForceSendFields will be sent to the 656 // server regardless of whether the field is empty or not. This may be 657 // used to include empty fields in Patch requests. 658 ForceSendFields []string `json:"-"` 659 660 // NullFields is a list of field names (e.g. "Id") to include in API 661 // requests with the JSON null value. By default, fields with empty 662 // values are omitted from API requests. However, any field with an 663 // empty value appearing in NullFields will be sent to the server as 664 // null. It is an error if a field in this list has a non-empty value. 665 // This may be used to include null fields in Patch requests. 666 NullFields []string `json:"-"` 667} 668 669func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) { 670 type NoMethod CommentInReplyTo 671 raw := NoMethod(*s) 672 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 673} 674 675// CommentPost: Data about the post containing this comment. 676type CommentPost struct { 677 // Id: The identifier of the post containing this comment. 678 Id string `json:"id,omitempty"` 679 680 // ForceSendFields is a list of field names (e.g. "Id") to 681 // unconditionally include in API requests. By default, fields with 682 // empty values are omitted from API requests. However, any non-pointer, 683 // non-interface field appearing in ForceSendFields will be sent to the 684 // server regardless of whether the field is empty or not. This may be 685 // used to include empty fields in Patch requests. 686 ForceSendFields []string `json:"-"` 687 688 // NullFields is a list of field names (e.g. "Id") to include in API 689 // requests with the JSON null value. By default, fields with empty 690 // values are omitted from API requests. However, any field with an 691 // empty value appearing in NullFields will be sent to the server as 692 // null. It is an error if a field in this list has a non-empty value. 693 // This may be used to include null fields in Patch requests. 694 NullFields []string `json:"-"` 695} 696 697func (s *CommentPost) MarshalJSON() ([]byte, error) { 698 type NoMethod CommentPost 699 raw := NoMethod(*s) 700 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 701} 702 703type CommentList struct { 704 // Etag: Etag of the response. 705 Etag string `json:"etag,omitempty"` 706 707 // Items: The List of Comments for a Post. 708 Items []*Comment `json:"items,omitempty"` 709 710 // Kind: The kind of this entry. Always blogger#commentList. 711 Kind string `json:"kind,omitempty"` 712 713 // NextPageToken: Pagination token to fetch the next page, if one 714 // exists. 715 NextPageToken string `json:"nextPageToken,omitempty"` 716 717 // PrevPageToken: Pagination token to fetch the previous page, if one 718 // exists. 719 PrevPageToken string `json:"prevPageToken,omitempty"` 720 721 // ServerResponse contains the HTTP response code and headers from the 722 // server. 723 googleapi.ServerResponse `json:"-"` 724 725 // ForceSendFields is a list of field names (e.g. "Etag") to 726 // unconditionally include in API requests. By default, fields with 727 // empty values are omitted from API requests. However, any non-pointer, 728 // non-interface field appearing in ForceSendFields will be sent to the 729 // server regardless of whether the field is empty or not. This may be 730 // used to include empty fields in Patch requests. 731 ForceSendFields []string `json:"-"` 732 733 // NullFields is a list of field names (e.g. "Etag") to include in API 734 // requests with the JSON null value. By default, fields with empty 735 // values are omitted from API requests. However, any field with an 736 // empty value appearing in NullFields will be sent to the server as 737 // null. It is an error if a field in this list has a non-empty value. 738 // This may be used to include null fields in Patch requests. 739 NullFields []string `json:"-"` 740} 741 742func (s *CommentList) MarshalJSON() ([]byte, error) { 743 type NoMethod CommentList 744 raw := NoMethod(*s) 745 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 746} 747 748type Page struct { 749 // Author: The author of this Page. 750 Author *PageAuthor `json:"author,omitempty"` 751 752 // Blog: Data about the blog containing this Page. 753 Blog *PageBlog `json:"blog,omitempty"` 754 755 // Content: The body content of this Page, in HTML. 756 Content string `json:"content,omitempty"` 757 758 // Etag: Etag of the resource. 759 Etag string `json:"etag,omitempty"` 760 761 // Id: The identifier for this resource. 762 Id string `json:"id,omitempty"` 763 764 // Kind: The kind of this entity. Always blogger#page. 765 Kind string `json:"kind,omitempty"` 766 767 // Published: RFC 3339 date-time when this Page was published. 768 Published string `json:"published,omitempty"` 769 770 // SelfLink: The API REST URL to fetch this resource from. 771 SelfLink string `json:"selfLink,omitempty"` 772 773 // Status: The status of the page for admin resources (either LIVE or 774 // DRAFT). 775 // 776 // Possible values: 777 // "LIVE" 778 // "DRAFT" 779 Status string `json:"status,omitempty"` 780 781 // Title: The title of this entity. This is the name displayed in the 782 // Admin user 783 // interface. 784 Title string `json:"title,omitempty"` 785 786 // Updated: RFC 3339 date-time when this Page was last updated. 787 Updated string `json:"updated,omitempty"` 788 789 // Url: The URL that this Page is displayed at. 790 Url string `json:"url,omitempty"` 791 792 // ServerResponse contains the HTTP response code and headers from the 793 // server. 794 googleapi.ServerResponse `json:"-"` 795 796 // ForceSendFields is a list of field names (e.g. "Author") to 797 // unconditionally include in API requests. By default, fields with 798 // empty values are omitted from API requests. However, any non-pointer, 799 // non-interface field appearing in ForceSendFields will be sent to the 800 // server regardless of whether the field is empty or not. This may be 801 // used to include empty fields in Patch requests. 802 ForceSendFields []string `json:"-"` 803 804 // NullFields is a list of field names (e.g. "Author") to include in API 805 // requests with the JSON null value. By default, fields with empty 806 // values are omitted from API requests. However, any field with an 807 // empty value appearing in NullFields will be sent to the server as 808 // null. It is an error if a field in this list has a non-empty value. 809 // This may be used to include null fields in Patch requests. 810 NullFields []string `json:"-"` 811} 812 813func (s *Page) MarshalJSON() ([]byte, error) { 814 type NoMethod Page 815 raw := NoMethod(*s) 816 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 817} 818 819// PageAuthor: The author of this Page. 820type PageAuthor struct { 821 // DisplayName: The display name. 822 DisplayName string `json:"displayName,omitempty"` 823 824 // Id: The identifier of the creator. 825 Id string `json:"id,omitempty"` 826 827 // Image: The creator's avatar. 828 Image *PageAuthorImage `json:"image,omitempty"` 829 830 // Url: The URL of the creator's Profile page. 831 Url string `json:"url,omitempty"` 832 833 // ForceSendFields is a list of field names (e.g. "DisplayName") to 834 // unconditionally include in API requests. By default, fields with 835 // empty values are omitted from API requests. However, any non-pointer, 836 // non-interface field appearing in ForceSendFields will be sent to the 837 // server regardless of whether the field is empty or not. This may be 838 // used to include empty fields in Patch requests. 839 ForceSendFields []string `json:"-"` 840 841 // NullFields is a list of field names (e.g. "DisplayName") to include 842 // in API requests with the JSON null value. By default, fields with 843 // empty values are omitted from API requests. However, any field with 844 // an empty value appearing in NullFields will be sent to the server as 845 // null. It is an error if a field in this list has a non-empty value. 846 // This may be used to include null fields in Patch requests. 847 NullFields []string `json:"-"` 848} 849 850func (s *PageAuthor) MarshalJSON() ([]byte, error) { 851 type NoMethod PageAuthor 852 raw := NoMethod(*s) 853 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 854} 855 856// PageAuthorImage: The creator's avatar. 857type PageAuthorImage struct { 858 // Url: The creator's avatar URL. 859 Url string `json:"url,omitempty"` 860 861 // ForceSendFields is a list of field names (e.g. "Url") to 862 // unconditionally include in API requests. By default, fields with 863 // empty values are omitted from API requests. However, any non-pointer, 864 // non-interface field appearing in ForceSendFields will be sent to the 865 // server regardless of whether the field is empty or not. This may be 866 // used to include empty fields in Patch requests. 867 ForceSendFields []string `json:"-"` 868 869 // NullFields is a list of field names (e.g. "Url") to include in API 870 // requests with the JSON null value. By default, fields with empty 871 // values are omitted from API requests. However, any field with an 872 // empty value appearing in NullFields will be sent to the server as 873 // null. It is an error if a field in this list has a non-empty value. 874 // This may be used to include null fields in Patch requests. 875 NullFields []string `json:"-"` 876} 877 878func (s *PageAuthorImage) MarshalJSON() ([]byte, error) { 879 type NoMethod PageAuthorImage 880 raw := NoMethod(*s) 881 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 882} 883 884// PageBlog: Data about the blog containing this Page. 885type PageBlog struct { 886 // Id: The identifier of the blog containing this page. 887 Id string `json:"id,omitempty"` 888 889 // ForceSendFields is a list of field names (e.g. "Id") to 890 // unconditionally include in API requests. By default, fields with 891 // empty values are omitted from API requests. However, any non-pointer, 892 // non-interface field appearing in ForceSendFields will be sent to the 893 // server regardless of whether the field is empty or not. This may be 894 // used to include empty fields in Patch requests. 895 ForceSendFields []string `json:"-"` 896 897 // NullFields is a list of field names (e.g. "Id") to include in API 898 // requests with the JSON null value. By default, fields with empty 899 // values are omitted from API requests. However, any field with an 900 // empty value appearing in NullFields will be sent to the server as 901 // null. It is an error if a field in this list has a non-empty value. 902 // This may be used to include null fields in Patch requests. 903 NullFields []string `json:"-"` 904} 905 906func (s *PageBlog) MarshalJSON() ([]byte, error) { 907 type NoMethod PageBlog 908 raw := NoMethod(*s) 909 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 910} 911 912type PageList struct { 913 // Etag: Etag of the response. 914 Etag string `json:"etag,omitempty"` 915 916 // Items: The list of Pages for a Blog. 917 Items []*Page `json:"items,omitempty"` 918 919 // Kind: The kind of this entity. Always blogger#pageList. 920 Kind string `json:"kind,omitempty"` 921 922 // NextPageToken: Pagination token to fetch the next page, if one 923 // exists. 924 NextPageToken string `json:"nextPageToken,omitempty"` 925 926 // ServerResponse contains the HTTP response code and headers from the 927 // server. 928 googleapi.ServerResponse `json:"-"` 929 930 // ForceSendFields is a list of field names (e.g. "Etag") to 931 // unconditionally include in API requests. By default, fields with 932 // empty values are omitted from API requests. However, any non-pointer, 933 // non-interface field appearing in ForceSendFields will be sent to the 934 // server regardless of whether the field is empty or not. This may be 935 // used to include empty fields in Patch requests. 936 ForceSendFields []string `json:"-"` 937 938 // NullFields is a list of field names (e.g. "Etag") to include in API 939 // requests with the JSON null value. By default, fields with empty 940 // values are omitted from API requests. However, any field with an 941 // empty value appearing in NullFields will be sent to the server as 942 // null. It is an error if a field in this list has a non-empty value. 943 // This may be used to include null fields in Patch requests. 944 NullFields []string `json:"-"` 945} 946 947func (s *PageList) MarshalJSON() ([]byte, error) { 948 type NoMethod PageList 949 raw := NoMethod(*s) 950 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 951} 952 953type Post struct { 954 // Author: The author of this Post. 955 Author *PostAuthor `json:"author,omitempty"` 956 957 // Blog: Data about the blog containing this Post. 958 Blog *PostBlog `json:"blog,omitempty"` 959 960 // Content: The content of the Post. May contain HTML markup. 961 Content string `json:"content,omitempty"` 962 963 // CustomMetaData: The JSON meta-data for the Post. 964 CustomMetaData string `json:"customMetaData,omitempty"` 965 966 // Etag: Etag of the resource. 967 Etag string `json:"etag,omitempty"` 968 969 // Id: The identifier of this Post. 970 Id string `json:"id,omitempty"` 971 972 // Images: Display image for the Post. 973 Images []*PostImages `json:"images,omitempty"` 974 975 // Kind: The kind of this entity. Always blogger#post. 976 Kind string `json:"kind,omitempty"` 977 978 // Labels: The list of labels this Post was tagged with. 979 Labels []string `json:"labels,omitempty"` 980 981 // Location: The location for geotagged posts. 982 Location *PostLocation `json:"location,omitempty"` 983 984 // Published: RFC 3339 date-time when this Post was published. 985 Published string `json:"published,omitempty"` 986 987 // ReaderComments: Comment control and display setting for readers of 988 // this post. 989 // 990 // Possible values: 991 // "ALLOW" 992 // "DONT_ALLOW_SHOW_EXISTING" 993 // "DONT_ALLOW_HIDE_EXISTING" 994 ReaderComments string `json:"readerComments,omitempty"` 995 996 // Replies: The container of comments on this Post. 997 Replies *PostReplies `json:"replies,omitempty"` 998 999 // SelfLink: The API REST URL to fetch this resource from. 1000 SelfLink string `json:"selfLink,omitempty"` 1001 1002 // Status: Status of the post. Only set for admin-level requests. 1003 // 1004 // Possible values: 1005 // "LIVE" 1006 // "DRAFT" 1007 // "SCHEDULED" 1008 Status string `json:"status,omitempty"` 1009 1010 // Title: The title of the Post. 1011 Title string `json:"title,omitempty"` 1012 1013 // TitleLink: The title link URL, similar to atom's related link. 1014 TitleLink string `json:"titleLink,omitempty"` 1015 1016 // Updated: RFC 3339 date-time when this Post was last updated. 1017 Updated string `json:"updated,omitempty"` 1018 1019 // Url: The URL where this Post is displayed. 1020 Url string `json:"url,omitempty"` 1021 1022 // ServerResponse contains the HTTP response code and headers from the 1023 // server. 1024 googleapi.ServerResponse `json:"-"` 1025 1026 // ForceSendFields is a list of field names (e.g. "Author") to 1027 // unconditionally include in API requests. By default, fields with 1028 // empty values are omitted from API requests. However, any non-pointer, 1029 // non-interface field appearing in ForceSendFields will be sent to the 1030 // server regardless of whether the field is empty or not. This may be 1031 // used to include empty fields in Patch requests. 1032 ForceSendFields []string `json:"-"` 1033 1034 // NullFields is a list of field names (e.g. "Author") to include in API 1035 // requests with the JSON null value. By default, fields with empty 1036 // values are omitted from API requests. However, any field with an 1037 // empty value appearing in NullFields will be sent to the server as 1038 // null. It is an error if a field in this list has a non-empty value. 1039 // This may be used to include null fields in Patch requests. 1040 NullFields []string `json:"-"` 1041} 1042 1043func (s *Post) MarshalJSON() ([]byte, error) { 1044 type NoMethod Post 1045 raw := NoMethod(*s) 1046 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1047} 1048 1049// PostAuthor: The author of this Post. 1050type PostAuthor struct { 1051 // DisplayName: The display name. 1052 DisplayName string `json:"displayName,omitempty"` 1053 1054 // Id: The identifier of the creator. 1055 Id string `json:"id,omitempty"` 1056 1057 // Image: The creator's avatar. 1058 Image *PostAuthorImage `json:"image,omitempty"` 1059 1060 // Url: The URL of the creator's Profile page. 1061 Url string `json:"url,omitempty"` 1062 1063 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1064 // unconditionally include in API requests. By default, fields with 1065 // empty values are omitted from API requests. However, any non-pointer, 1066 // non-interface field appearing in ForceSendFields will be sent to the 1067 // server regardless of whether the field is empty or not. This may be 1068 // used to include empty fields in Patch requests. 1069 ForceSendFields []string `json:"-"` 1070 1071 // NullFields is a list of field names (e.g. "DisplayName") to include 1072 // in API requests with the JSON null value. By default, fields with 1073 // empty values are omitted from API requests. However, any field with 1074 // an empty value appearing in NullFields will be sent to the server as 1075 // null. It is an error if a field in this list has a non-empty value. 1076 // This may be used to include null fields in Patch requests. 1077 NullFields []string `json:"-"` 1078} 1079 1080func (s *PostAuthor) MarshalJSON() ([]byte, error) { 1081 type NoMethod PostAuthor 1082 raw := NoMethod(*s) 1083 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1084} 1085 1086// PostAuthorImage: The creator's avatar. 1087type PostAuthorImage struct { 1088 // Url: The creator's avatar URL. 1089 Url string `json:"url,omitempty"` 1090 1091 // ForceSendFields is a list of field names (e.g. "Url") to 1092 // unconditionally include in API requests. By default, fields with 1093 // empty values are omitted from API requests. However, any non-pointer, 1094 // non-interface field appearing in ForceSendFields will be sent to the 1095 // server regardless of whether the field is empty or not. This may be 1096 // used to include empty fields in Patch requests. 1097 ForceSendFields []string `json:"-"` 1098 1099 // NullFields is a list of field names (e.g. "Url") to include in API 1100 // requests with the JSON null value. By default, fields with empty 1101 // values are omitted from API requests. However, any field with an 1102 // empty value appearing in NullFields will be sent to the server as 1103 // null. It is an error if a field in this list has a non-empty value. 1104 // This may be used to include null fields in Patch requests. 1105 NullFields []string `json:"-"` 1106} 1107 1108func (s *PostAuthorImage) MarshalJSON() ([]byte, error) { 1109 type NoMethod PostAuthorImage 1110 raw := NoMethod(*s) 1111 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1112} 1113 1114// PostBlog: Data about the blog containing this Post. 1115type PostBlog struct { 1116 // Id: The identifier of the Blog that contains this Post. 1117 Id string `json:"id,omitempty"` 1118 1119 // ForceSendFields is a list of field names (e.g. "Id") to 1120 // unconditionally include in API requests. By default, fields with 1121 // empty values are omitted from API requests. However, any non-pointer, 1122 // non-interface field appearing in ForceSendFields will be sent to the 1123 // server regardless of whether the field is empty or not. This may be 1124 // used to include empty fields in Patch requests. 1125 ForceSendFields []string `json:"-"` 1126 1127 // NullFields is a list of field names (e.g. "Id") to include in API 1128 // requests with the JSON null value. By default, fields with empty 1129 // values are omitted from API requests. However, any field with an 1130 // empty value appearing in NullFields will be sent to the server as 1131 // null. It is an error if a field in this list has a non-empty value. 1132 // This may be used to include null fields in Patch requests. 1133 NullFields []string `json:"-"` 1134} 1135 1136func (s *PostBlog) MarshalJSON() ([]byte, error) { 1137 type NoMethod PostBlog 1138 raw := NoMethod(*s) 1139 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1140} 1141 1142type PostImages struct { 1143 Url string `json:"url,omitempty"` 1144 1145 // ForceSendFields is a list of field names (e.g. "Url") to 1146 // unconditionally include in API requests. By default, fields with 1147 // empty values are omitted from API requests. However, any non-pointer, 1148 // non-interface field appearing in ForceSendFields will be sent to the 1149 // server regardless of whether the field is empty or not. This may be 1150 // used to include empty fields in Patch requests. 1151 ForceSendFields []string `json:"-"` 1152 1153 // NullFields is a list of field names (e.g. "Url") to include in API 1154 // requests with the JSON null value. By default, fields with empty 1155 // values are omitted from API requests. However, any field with an 1156 // empty value appearing in NullFields will be sent to the server as 1157 // null. It is an error if a field in this list has a non-empty value. 1158 // This may be used to include null fields in Patch requests. 1159 NullFields []string `json:"-"` 1160} 1161 1162func (s *PostImages) MarshalJSON() ([]byte, error) { 1163 type NoMethod PostImages 1164 raw := NoMethod(*s) 1165 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1166} 1167 1168// PostLocation: The location for geotagged posts. 1169type PostLocation struct { 1170 // Lat: Location's latitude. 1171 Lat float64 `json:"lat,omitempty"` 1172 1173 // Lng: Location's longitude. 1174 Lng float64 `json:"lng,omitempty"` 1175 1176 // Name: Location name. 1177 Name string `json:"name,omitempty"` 1178 1179 // Span: Location's viewport span. Can be used when rendering a map 1180 // preview. 1181 Span string `json:"span,omitempty"` 1182 1183 // ForceSendFields is a list of field names (e.g. "Lat") to 1184 // unconditionally include in API requests. By default, fields with 1185 // empty values are omitted from API requests. However, any non-pointer, 1186 // non-interface field appearing in ForceSendFields will be sent to the 1187 // server regardless of whether the field is empty or not. This may be 1188 // used to include empty fields in Patch requests. 1189 ForceSendFields []string `json:"-"` 1190 1191 // NullFields is a list of field names (e.g. "Lat") to include in API 1192 // requests with the JSON null value. By default, fields with empty 1193 // values are omitted from API requests. However, any field with an 1194 // empty value appearing in NullFields will be sent to the server as 1195 // null. It is an error if a field in this list has a non-empty value. 1196 // This may be used to include null fields in Patch requests. 1197 NullFields []string `json:"-"` 1198} 1199 1200func (s *PostLocation) MarshalJSON() ([]byte, error) { 1201 type NoMethod PostLocation 1202 raw := NoMethod(*s) 1203 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1204} 1205 1206func (s *PostLocation) UnmarshalJSON(data []byte) error { 1207 type NoMethod PostLocation 1208 var s1 struct { 1209 Lat gensupport.JSONFloat64 `json:"lat"` 1210 Lng gensupport.JSONFloat64 `json:"lng"` 1211 *NoMethod 1212 } 1213 s1.NoMethod = (*NoMethod)(s) 1214 if err := json.Unmarshal(data, &s1); err != nil { 1215 return err 1216 } 1217 s.Lat = float64(s1.Lat) 1218 s.Lng = float64(s1.Lng) 1219 return nil 1220} 1221 1222// PostReplies: The container of comments on this Post. 1223type PostReplies struct { 1224 // Items: The List of Comments for this Post. 1225 Items []*Comment `json:"items,omitempty"` 1226 1227 // SelfLink: The URL of the comments on this post. 1228 SelfLink string `json:"selfLink,omitempty"` 1229 1230 // TotalItems: The count of comments on this post. 1231 TotalItems int64 `json:"totalItems,omitempty,string"` 1232 1233 // ForceSendFields is a list of field names (e.g. "Items") to 1234 // unconditionally include in API requests. By default, fields with 1235 // empty values are omitted from API requests. However, any non-pointer, 1236 // non-interface field appearing in ForceSendFields will be sent to the 1237 // server regardless of whether the field is empty or not. This may be 1238 // used to include empty fields in Patch requests. 1239 ForceSendFields []string `json:"-"` 1240 1241 // NullFields is a list of field names (e.g. "Items") to include in API 1242 // requests with the JSON null value. By default, fields with empty 1243 // values are omitted from API requests. However, any field with an 1244 // empty value appearing in NullFields will be sent to the server as 1245 // null. It is an error if a field in this list has a non-empty value. 1246 // This may be used to include null fields in Patch requests. 1247 NullFields []string `json:"-"` 1248} 1249 1250func (s *PostReplies) MarshalJSON() ([]byte, error) { 1251 type NoMethod PostReplies 1252 raw := NoMethod(*s) 1253 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1254} 1255 1256type PostList struct { 1257 // Etag: Etag of the response. 1258 Etag string `json:"etag,omitempty"` 1259 1260 // Items: The list of Posts for this Blog. 1261 Items []*Post `json:"items,omitempty"` 1262 1263 // Kind: The kind of this entity. Always blogger#postList. 1264 Kind string `json:"kind,omitempty"` 1265 1266 // NextPageToken: Pagination token to fetch the next page, if one 1267 // exists. 1268 NextPageToken string `json:"nextPageToken,omitempty"` 1269 1270 // PrevPageToken: Pagination token to fetch the previous page, if one 1271 // exists. 1272 PrevPageToken string `json:"prevPageToken,omitempty"` 1273 1274 // ServerResponse contains the HTTP response code and headers from the 1275 // server. 1276 googleapi.ServerResponse `json:"-"` 1277 1278 // ForceSendFields is a list of field names (e.g. "Etag") to 1279 // unconditionally include in API requests. By default, fields with 1280 // empty values are omitted from API requests. However, any non-pointer, 1281 // non-interface field appearing in ForceSendFields will be sent to the 1282 // server regardless of whether the field is empty or not. This may be 1283 // used to include empty fields in Patch requests. 1284 ForceSendFields []string `json:"-"` 1285 1286 // NullFields is a list of field names (e.g. "Etag") to include in API 1287 // requests with the JSON null value. By default, fields with empty 1288 // values are omitted from API requests. However, any field with an 1289 // empty value appearing in NullFields will be sent to the server as 1290 // null. It is an error if a field in this list has a non-empty value. 1291 // This may be used to include null fields in Patch requests. 1292 NullFields []string `json:"-"` 1293} 1294 1295func (s *PostList) MarshalJSON() ([]byte, error) { 1296 type NoMethod PostList 1297 raw := NoMethod(*s) 1298 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1299} 1300 1301type User struct { 1302 // About: Profile summary information. 1303 About string `json:"about,omitempty"` 1304 1305 // Blogs: The container of blogs for this user. 1306 Blogs *UserBlogs `json:"blogs,omitempty"` 1307 1308 // Created: The timestamp of when this profile was created, in seconds 1309 // since epoch. 1310 Created string `json:"created,omitempty"` 1311 1312 // DisplayName: The display name. 1313 DisplayName string `json:"displayName,omitempty"` 1314 1315 // Id: The identifier for this User. 1316 Id string `json:"id,omitempty"` 1317 1318 // Kind: The kind of this entity. Always blogger#user. 1319 Kind string `json:"kind,omitempty"` 1320 1321 // Locale: This user's locale 1322 Locale *UserLocale `json:"locale,omitempty"` 1323 1324 // SelfLink: The API REST URL to fetch this resource from. 1325 SelfLink string `json:"selfLink,omitempty"` 1326 1327 // Url: The user's profile page. 1328 Url string `json:"url,omitempty"` 1329 1330 // ServerResponse contains the HTTP response code and headers from the 1331 // server. 1332 googleapi.ServerResponse `json:"-"` 1333 1334 // ForceSendFields is a list of field names (e.g. "About") to 1335 // unconditionally include in API requests. By default, fields with 1336 // empty values are omitted from API requests. However, any non-pointer, 1337 // non-interface field appearing in ForceSendFields will be sent to the 1338 // server regardless of whether the field is empty or not. This may be 1339 // used to include empty fields in Patch requests. 1340 ForceSendFields []string `json:"-"` 1341 1342 // NullFields is a list of field names (e.g. "About") to include in API 1343 // requests with the JSON null value. By default, fields with empty 1344 // values are omitted from API requests. However, any field with an 1345 // empty value appearing in NullFields will be sent to the server as 1346 // null. It is an error if a field in this list has a non-empty value. 1347 // This may be used to include null fields in Patch requests. 1348 NullFields []string `json:"-"` 1349} 1350 1351func (s *User) MarshalJSON() ([]byte, error) { 1352 type NoMethod User 1353 raw := NoMethod(*s) 1354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1355} 1356 1357// UserBlogs: The container of blogs for this user. 1358type UserBlogs struct { 1359 // SelfLink: The URL of the Blogs for this user. 1360 SelfLink string `json:"selfLink,omitempty"` 1361 1362 // ForceSendFields is a list of field names (e.g. "SelfLink") to 1363 // unconditionally include in API requests. By default, fields with 1364 // empty values are omitted from API requests. However, any non-pointer, 1365 // non-interface field appearing in ForceSendFields will be sent to the 1366 // server regardless of whether the field is empty or not. This may be 1367 // used to include empty fields in Patch requests. 1368 ForceSendFields []string `json:"-"` 1369 1370 // NullFields is a list of field names (e.g. "SelfLink") to include in 1371 // API requests with the JSON null value. By default, fields with empty 1372 // values are omitted from API requests. However, any field with an 1373 // empty value appearing in NullFields will be sent to the server as 1374 // null. It is an error if a field in this list has a non-empty value. 1375 // This may be used to include null fields in Patch requests. 1376 NullFields []string `json:"-"` 1377} 1378 1379func (s *UserBlogs) MarshalJSON() ([]byte, error) { 1380 type NoMethod UserBlogs 1381 raw := NoMethod(*s) 1382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1383} 1384 1385// UserLocale: This user's locale 1386type UserLocale struct { 1387 // Country: The country this blog's locale is set to. 1388 Country string `json:"country,omitempty"` 1389 1390 // Language: The language this blog is authored in. 1391 Language string `json:"language,omitempty"` 1392 1393 // Variant: The language variant this blog is authored in. 1394 Variant string `json:"variant,omitempty"` 1395 1396 // ForceSendFields is a list of field names (e.g. "Country") to 1397 // unconditionally include in API requests. By default, fields with 1398 // empty values are omitted from API requests. However, any non-pointer, 1399 // non-interface field appearing in ForceSendFields will be sent to the 1400 // server regardless of whether the field is empty or not. This may be 1401 // used to include empty fields in Patch requests. 1402 ForceSendFields []string `json:"-"` 1403 1404 // NullFields is a list of field names (e.g. "Country") to include in 1405 // API requests with the JSON null value. By default, fields with empty 1406 // values are omitted from API requests. However, any field with an 1407 // empty value appearing in NullFields will be sent to the server as 1408 // null. It is an error if a field in this list has a non-empty value. 1409 // This may be used to include null fields in Patch requests. 1410 NullFields []string `json:"-"` 1411} 1412 1413func (s *UserLocale) MarshalJSON() ([]byte, error) { 1414 type NoMethod UserLocale 1415 raw := NoMethod(*s) 1416 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1417} 1418 1419// method id "blogger.blogs.get": 1420 1421type BlogsGetCall struct { 1422 s *Service 1423 blogId string 1424 urlParams_ gensupport.URLParams 1425 ifNoneMatch_ string 1426 ctx_ context.Context 1427 header_ http.Header 1428} 1429 1430// Get: Gets a blog by id. 1431func (r *BlogsService) Get(blogId string) *BlogsGetCall { 1432 c := &BlogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1433 c.blogId = blogId 1434 return c 1435} 1436 1437// Fields allows partial responses to be retrieved. See 1438// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1439// for more information. 1440func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { 1441 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1442 return c 1443} 1444 1445// IfNoneMatch sets the optional parameter which makes the operation 1446// fail if the object's ETag matches the given value. This is useful for 1447// getting updates only after the object has changed since the last 1448// request. Use googleapi.IsNotModified to check whether the response 1449// error from Do is the result of In-None-Match. 1450func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { 1451 c.ifNoneMatch_ = entityTag 1452 return c 1453} 1454 1455// Context sets the context to be used in this call's Do method. Any 1456// pending HTTP request will be aborted if the provided context is 1457// canceled. 1458func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { 1459 c.ctx_ = ctx 1460 return c 1461} 1462 1463// Header returns an http.Header that can be modified by the caller to 1464// add HTTP headers to the request. 1465func (c *BlogsGetCall) Header() http.Header { 1466 if c.header_ == nil { 1467 c.header_ = make(http.Header) 1468 } 1469 return c.header_ 1470} 1471 1472func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { 1473 reqHeaders := make(http.Header) 1474 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1475 for k, v := range c.header_ { 1476 reqHeaders[k] = v 1477 } 1478 reqHeaders.Set("User-Agent", c.s.userAgent()) 1479 if c.ifNoneMatch_ != "" { 1480 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1481 } 1482 var body io.Reader = nil 1483 c.urlParams_.Set("alt", alt) 1484 c.urlParams_.Set("prettyPrint", "false") 1485 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}") 1486 urls += "?" + c.urlParams_.Encode() 1487 req, err := http.NewRequest("GET", urls, body) 1488 if err != nil { 1489 return nil, err 1490 } 1491 req.Header = reqHeaders 1492 googleapi.Expand(req.URL, map[string]string{ 1493 "blogId": c.blogId, 1494 }) 1495 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1496} 1497 1498// Do executes the "blogger.blogs.get" call. 1499// Exactly one of *Blog or error will be non-nil. Any non-2xx status 1500// code is an error. Response headers are in either 1501// *Blog.ServerResponse.Header or (if a response was returned at all) in 1502// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1503// whether the returned error was because http.StatusNotModified was 1504// returned. 1505func (c *BlogsGetCall) Do(opts ...googleapi.CallOption) (*Blog, error) { 1506 gensupport.SetOptions(c.urlParams_, opts...) 1507 res, err := c.doRequest("json") 1508 if res != nil && res.StatusCode == http.StatusNotModified { 1509 if res.Body != nil { 1510 res.Body.Close() 1511 } 1512 return nil, &googleapi.Error{ 1513 Code: res.StatusCode, 1514 Header: res.Header, 1515 } 1516 } 1517 if err != nil { 1518 return nil, err 1519 } 1520 defer googleapi.CloseBody(res) 1521 if err := googleapi.CheckResponse(res); err != nil { 1522 return nil, err 1523 } 1524 ret := &Blog{ 1525 ServerResponse: googleapi.ServerResponse{ 1526 Header: res.Header, 1527 HTTPStatusCode: res.StatusCode, 1528 }, 1529 } 1530 target := &ret 1531 if err := gensupport.DecodeResponse(target, res); err != nil { 1532 return nil, err 1533 } 1534 return ret, nil 1535 // { 1536 // "description": "Gets a blog by id.", 1537 // "flatPath": "v2/blogs/{blogId}", 1538 // "httpMethod": "GET", 1539 // "id": "blogger.blogs.get", 1540 // "parameterOrder": [ 1541 // "blogId" 1542 // ], 1543 // "parameters": { 1544 // "blogId": { 1545 // "location": "path", 1546 // "required": true, 1547 // "type": "string" 1548 // } 1549 // }, 1550 // "path": "v2/blogs/{blogId}", 1551 // "response": { 1552 // "$ref": "Blog" 1553 // }, 1554 // "scopes": [ 1555 // "https://www.googleapis.com/auth/blogger" 1556 // ] 1557 // } 1558 1559} 1560 1561// method id "blogger.blogs.list": 1562 1563type BlogsListCall struct { 1564 s *Service 1565 userId string 1566 urlParams_ gensupport.URLParams 1567 ifNoneMatch_ string 1568 ctx_ context.Context 1569 header_ http.Header 1570} 1571 1572// List: Lists blogs by user id, possibly filtered. 1573func (r *BlogsService) List(userId string) *BlogsListCall { 1574 c := &BlogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1575 c.userId = userId 1576 return c 1577} 1578 1579// Fields allows partial responses to be retrieved. See 1580// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1581// for more information. 1582func (c *BlogsListCall) Fields(s ...googleapi.Field) *BlogsListCall { 1583 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1584 return c 1585} 1586 1587// IfNoneMatch sets the optional parameter which makes the operation 1588// fail if the object's ETag matches the given value. This is useful for 1589// getting updates only after the object has changed since the last 1590// request. Use googleapi.IsNotModified to check whether the response 1591// error from Do is the result of In-None-Match. 1592func (c *BlogsListCall) IfNoneMatch(entityTag string) *BlogsListCall { 1593 c.ifNoneMatch_ = entityTag 1594 return c 1595} 1596 1597// Context sets the context to be used in this call's Do method. Any 1598// pending HTTP request will be aborted if the provided context is 1599// canceled. 1600func (c *BlogsListCall) Context(ctx context.Context) *BlogsListCall { 1601 c.ctx_ = ctx 1602 return c 1603} 1604 1605// Header returns an http.Header that can be modified by the caller to 1606// add HTTP headers to the request. 1607func (c *BlogsListCall) Header() http.Header { 1608 if c.header_ == nil { 1609 c.header_ = make(http.Header) 1610 } 1611 return c.header_ 1612} 1613 1614func (c *BlogsListCall) doRequest(alt string) (*http.Response, error) { 1615 reqHeaders := make(http.Header) 1616 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1617 for k, v := range c.header_ { 1618 reqHeaders[k] = v 1619 } 1620 reqHeaders.Set("User-Agent", c.s.userAgent()) 1621 if c.ifNoneMatch_ != "" { 1622 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1623 } 1624 var body io.Reader = nil 1625 c.urlParams_.Set("alt", alt) 1626 c.urlParams_.Set("prettyPrint", "false") 1627 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/blogs") 1628 urls += "?" + c.urlParams_.Encode() 1629 req, err := http.NewRequest("GET", urls, body) 1630 if err != nil { 1631 return nil, err 1632 } 1633 req.Header = reqHeaders 1634 googleapi.Expand(req.URL, map[string]string{ 1635 "userId": c.userId, 1636 }) 1637 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1638} 1639 1640// Do executes the "blogger.blogs.list" call. 1641// Exactly one of *BlogList or error will be non-nil. Any non-2xx status 1642// code is an error. Response headers are in either 1643// *BlogList.ServerResponse.Header or (if a response was returned at 1644// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1645// to check whether the returned error was because 1646// http.StatusNotModified was returned. 1647func (c *BlogsListCall) Do(opts ...googleapi.CallOption) (*BlogList, error) { 1648 gensupport.SetOptions(c.urlParams_, opts...) 1649 res, err := c.doRequest("json") 1650 if res != nil && res.StatusCode == http.StatusNotModified { 1651 if res.Body != nil { 1652 res.Body.Close() 1653 } 1654 return nil, &googleapi.Error{ 1655 Code: res.StatusCode, 1656 Header: res.Header, 1657 } 1658 } 1659 if err != nil { 1660 return nil, err 1661 } 1662 defer googleapi.CloseBody(res) 1663 if err := googleapi.CheckResponse(res); err != nil { 1664 return nil, err 1665 } 1666 ret := &BlogList{ 1667 ServerResponse: googleapi.ServerResponse{ 1668 Header: res.Header, 1669 HTTPStatusCode: res.StatusCode, 1670 }, 1671 } 1672 target := &ret 1673 if err := gensupport.DecodeResponse(target, res); err != nil { 1674 return nil, err 1675 } 1676 return ret, nil 1677 // { 1678 // "description": "Lists blogs by user id, possibly filtered.", 1679 // "flatPath": "v2/users/{userId}/blogs", 1680 // "httpMethod": "GET", 1681 // "id": "blogger.blogs.list", 1682 // "parameterOrder": [ 1683 // "userId" 1684 // ], 1685 // "parameters": { 1686 // "userId": { 1687 // "location": "path", 1688 // "required": true, 1689 // "type": "string" 1690 // } 1691 // }, 1692 // "path": "v2/users/{userId}/blogs", 1693 // "response": { 1694 // "$ref": "BlogList" 1695 // }, 1696 // "scopes": [ 1697 // "https://www.googleapis.com/auth/blogger" 1698 // ] 1699 // } 1700 1701} 1702 1703// method id "blogger.comments.get": 1704 1705type CommentsGetCall struct { 1706 s *Service 1707 blogId string 1708 postId string 1709 commentId string 1710 urlParams_ gensupport.URLParams 1711 ifNoneMatch_ string 1712 ctx_ context.Context 1713 header_ http.Header 1714} 1715 1716// Get: Gets a comment by blog id, post id and comment id. 1717func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { 1718 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1719 c.blogId = blogId 1720 c.postId = postId 1721 c.commentId = commentId 1722 return c 1723} 1724 1725// Fields allows partial responses to be retrieved. See 1726// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1727// for more information. 1728func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { 1729 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1730 return c 1731} 1732 1733// IfNoneMatch sets the optional parameter which makes the operation 1734// fail if the object's ETag matches the given value. This is useful for 1735// getting updates only after the object has changed since the last 1736// request. Use googleapi.IsNotModified to check whether the response 1737// error from Do is the result of In-None-Match. 1738func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { 1739 c.ifNoneMatch_ = entityTag 1740 return c 1741} 1742 1743// Context sets the context to be used in this call's Do method. Any 1744// pending HTTP request will be aborted if the provided context is 1745// canceled. 1746func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { 1747 c.ctx_ = ctx 1748 return c 1749} 1750 1751// Header returns an http.Header that can be modified by the caller to 1752// add HTTP headers to the request. 1753func (c *CommentsGetCall) Header() http.Header { 1754 if c.header_ == nil { 1755 c.header_ = make(http.Header) 1756 } 1757 return c.header_ 1758} 1759 1760func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { 1761 reqHeaders := make(http.Header) 1762 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1763 for k, v := range c.header_ { 1764 reqHeaders[k] = v 1765 } 1766 reqHeaders.Set("User-Agent", c.s.userAgent()) 1767 if c.ifNoneMatch_ != "" { 1768 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1769 } 1770 var body io.Reader = nil 1771 c.urlParams_.Set("alt", alt) 1772 c.urlParams_.Set("prettyPrint", "false") 1773 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments/{commentId}") 1774 urls += "?" + c.urlParams_.Encode() 1775 req, err := http.NewRequest("GET", urls, body) 1776 if err != nil { 1777 return nil, err 1778 } 1779 req.Header = reqHeaders 1780 googleapi.Expand(req.URL, map[string]string{ 1781 "blogId": c.blogId, 1782 "postId": c.postId, 1783 "commentId": c.commentId, 1784 }) 1785 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1786} 1787 1788// Do executes the "blogger.comments.get" call. 1789// Exactly one of *Comment or error will be non-nil. Any non-2xx status 1790// code is an error. Response headers are in either 1791// *Comment.ServerResponse.Header or (if a response was returned at all) 1792// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1793// check whether the returned error was because http.StatusNotModified 1794// was returned. 1795func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 1796 gensupport.SetOptions(c.urlParams_, opts...) 1797 res, err := c.doRequest("json") 1798 if res != nil && res.StatusCode == http.StatusNotModified { 1799 if res.Body != nil { 1800 res.Body.Close() 1801 } 1802 return nil, &googleapi.Error{ 1803 Code: res.StatusCode, 1804 Header: res.Header, 1805 } 1806 } 1807 if err != nil { 1808 return nil, err 1809 } 1810 defer googleapi.CloseBody(res) 1811 if err := googleapi.CheckResponse(res); err != nil { 1812 return nil, err 1813 } 1814 ret := &Comment{ 1815 ServerResponse: googleapi.ServerResponse{ 1816 Header: res.Header, 1817 HTTPStatusCode: res.StatusCode, 1818 }, 1819 } 1820 target := &ret 1821 if err := gensupport.DecodeResponse(target, res); err != nil { 1822 return nil, err 1823 } 1824 return ret, nil 1825 // { 1826 // "description": "Gets a comment by blog id, post id and comment id.", 1827 // "flatPath": "v2/blogs/{blogId}/posts/{postId}/comments/{commentId}", 1828 // "httpMethod": "GET", 1829 // "id": "blogger.comments.get", 1830 // "parameterOrder": [ 1831 // "blogId", 1832 // "postId", 1833 // "commentId" 1834 // ], 1835 // "parameters": { 1836 // "blogId": { 1837 // "location": "path", 1838 // "required": true, 1839 // "type": "string" 1840 // }, 1841 // "commentId": { 1842 // "location": "path", 1843 // "required": true, 1844 // "type": "string" 1845 // }, 1846 // "postId": { 1847 // "location": "path", 1848 // "required": true, 1849 // "type": "string" 1850 // } 1851 // }, 1852 // "path": "v2/blogs/{blogId}/posts/{postId}/comments/{commentId}", 1853 // "response": { 1854 // "$ref": "Comment" 1855 // }, 1856 // "scopes": [ 1857 // "https://www.googleapis.com/auth/blogger" 1858 // ] 1859 // } 1860 1861} 1862 1863// method id "blogger.comments.list": 1864 1865type CommentsListCall struct { 1866 s *Service 1867 blogId string 1868 postId string 1869 urlParams_ gensupport.URLParams 1870 ifNoneMatch_ string 1871 ctx_ context.Context 1872 header_ http.Header 1873} 1874 1875// List: Lists comments. 1876func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { 1877 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1878 c.blogId = blogId 1879 c.postId = postId 1880 return c 1881} 1882 1883// FetchBodies sets the optional parameter "fetchBodies": 1884func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { 1885 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 1886 return c 1887} 1888 1889// MaxResults sets the optional parameter "maxResults": 1890func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { 1891 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 1892 return c 1893} 1894 1895// PageToken sets the optional parameter "pageToken": 1896func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { 1897 c.urlParams_.Set("pageToken", pageToken) 1898 return c 1899} 1900 1901// StartDate sets the optional parameter "startDate": 1902func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { 1903 c.urlParams_.Set("startDate", startDate) 1904 return c 1905} 1906 1907// Fields allows partial responses to be retrieved. See 1908// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1909// for more information. 1910func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { 1911 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1912 return c 1913} 1914 1915// IfNoneMatch sets the optional parameter which makes the operation 1916// fail if the object's ETag matches the given value. This is useful for 1917// getting updates only after the object has changed since the last 1918// request. Use googleapi.IsNotModified to check whether the response 1919// error from Do is the result of In-None-Match. 1920func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { 1921 c.ifNoneMatch_ = entityTag 1922 return c 1923} 1924 1925// Context sets the context to be used in this call's Do method. Any 1926// pending HTTP request will be aborted if the provided context is 1927// canceled. 1928func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { 1929 c.ctx_ = ctx 1930 return c 1931} 1932 1933// Header returns an http.Header that can be modified by the caller to 1934// add HTTP headers to the request. 1935func (c *CommentsListCall) Header() http.Header { 1936 if c.header_ == nil { 1937 c.header_ = make(http.Header) 1938 } 1939 return c.header_ 1940} 1941 1942func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { 1943 reqHeaders := make(http.Header) 1944 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1945 for k, v := range c.header_ { 1946 reqHeaders[k] = v 1947 } 1948 reqHeaders.Set("User-Agent", c.s.userAgent()) 1949 if c.ifNoneMatch_ != "" { 1950 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1951 } 1952 var body io.Reader = nil 1953 c.urlParams_.Set("alt", alt) 1954 c.urlParams_.Set("prettyPrint", "false") 1955 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments") 1956 urls += "?" + c.urlParams_.Encode() 1957 req, err := http.NewRequest("GET", urls, body) 1958 if err != nil { 1959 return nil, err 1960 } 1961 req.Header = reqHeaders 1962 googleapi.Expand(req.URL, map[string]string{ 1963 "blogId": c.blogId, 1964 "postId": c.postId, 1965 }) 1966 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1967} 1968 1969// Do executes the "blogger.comments.list" call. 1970// Exactly one of *CommentList or error will be non-nil. Any non-2xx 1971// status code is an error. Response headers are in either 1972// *CommentList.ServerResponse.Header or (if a response was returned at 1973// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1974// to check whether the returned error was because 1975// http.StatusNotModified was returned. 1976func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 1977 gensupport.SetOptions(c.urlParams_, opts...) 1978 res, err := c.doRequest("json") 1979 if res != nil && res.StatusCode == http.StatusNotModified { 1980 if res.Body != nil { 1981 res.Body.Close() 1982 } 1983 return nil, &googleapi.Error{ 1984 Code: res.StatusCode, 1985 Header: res.Header, 1986 } 1987 } 1988 if err != nil { 1989 return nil, err 1990 } 1991 defer googleapi.CloseBody(res) 1992 if err := googleapi.CheckResponse(res); err != nil { 1993 return nil, err 1994 } 1995 ret := &CommentList{ 1996 ServerResponse: googleapi.ServerResponse{ 1997 Header: res.Header, 1998 HTTPStatusCode: res.StatusCode, 1999 }, 2000 } 2001 target := &ret 2002 if err := gensupport.DecodeResponse(target, res); err != nil { 2003 return nil, err 2004 } 2005 return ret, nil 2006 // { 2007 // "description": "Lists comments.", 2008 // "flatPath": "v2/blogs/{blogId}/posts/{postId}/comments", 2009 // "httpMethod": "GET", 2010 // "id": "blogger.comments.list", 2011 // "parameterOrder": [ 2012 // "blogId", 2013 // "postId" 2014 // ], 2015 // "parameters": { 2016 // "blogId": { 2017 // "location": "path", 2018 // "required": true, 2019 // "type": "string" 2020 // }, 2021 // "fetchBodies": { 2022 // "location": "query", 2023 // "type": "boolean" 2024 // }, 2025 // "maxResults": { 2026 // "format": "uint32", 2027 // "location": "query", 2028 // "type": "integer" 2029 // }, 2030 // "pageToken": { 2031 // "location": "query", 2032 // "type": "string" 2033 // }, 2034 // "postId": { 2035 // "location": "path", 2036 // "required": true, 2037 // "type": "string" 2038 // }, 2039 // "startDate": { 2040 // "location": "query", 2041 // "type": "string" 2042 // } 2043 // }, 2044 // "path": "v2/blogs/{blogId}/posts/{postId}/comments", 2045 // "response": { 2046 // "$ref": "CommentList" 2047 // }, 2048 // "scopes": [ 2049 // "https://www.googleapis.com/auth/blogger" 2050 // ] 2051 // } 2052 2053} 2054 2055// Pages invokes f for each page of results. 2056// A non-nil error returned from f will halt the iteration. 2057// The provided context supersedes any context provided to the Context method. 2058func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error { 2059 c.ctx_ = ctx 2060 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2061 for { 2062 x, err := c.Do() 2063 if err != nil { 2064 return err 2065 } 2066 if err := f(x); err != nil { 2067 return err 2068 } 2069 if x.NextPageToken == "" { 2070 return nil 2071 } 2072 c.PageToken(x.NextPageToken) 2073 } 2074} 2075 2076// method id "blogger.pages.get": 2077 2078type PagesGetCall struct { 2079 s *Service 2080 blogId string 2081 pageId string 2082 urlParams_ gensupport.URLParams 2083 ifNoneMatch_ string 2084 ctx_ context.Context 2085 header_ http.Header 2086} 2087 2088// Get: Gets a page by blog id and page id. 2089func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { 2090 c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2091 c.blogId = blogId 2092 c.pageId = pageId 2093 return c 2094} 2095 2096// Fields allows partial responses to be retrieved. See 2097// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2098// for more information. 2099func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { 2100 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2101 return c 2102} 2103 2104// IfNoneMatch sets the optional parameter which makes the operation 2105// fail if the object's ETag matches the given value. This is useful for 2106// getting updates only after the object has changed since the last 2107// request. Use googleapi.IsNotModified to check whether the response 2108// error from Do is the result of In-None-Match. 2109func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { 2110 c.ifNoneMatch_ = entityTag 2111 return c 2112} 2113 2114// Context sets the context to be used in this call's Do method. Any 2115// pending HTTP request will be aborted if the provided context is 2116// canceled. 2117func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { 2118 c.ctx_ = ctx 2119 return c 2120} 2121 2122// Header returns an http.Header that can be modified by the caller to 2123// add HTTP headers to the request. 2124func (c *PagesGetCall) Header() http.Header { 2125 if c.header_ == nil { 2126 c.header_ = make(http.Header) 2127 } 2128 return c.header_ 2129} 2130 2131func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { 2132 reqHeaders := make(http.Header) 2133 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2134 for k, v := range c.header_ { 2135 reqHeaders[k] = v 2136 } 2137 reqHeaders.Set("User-Agent", c.s.userAgent()) 2138 if c.ifNoneMatch_ != "" { 2139 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2140 } 2141 var body io.Reader = nil 2142 c.urlParams_.Set("alt", alt) 2143 c.urlParams_.Set("prettyPrint", "false") 2144 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages/{pageId}") 2145 urls += "?" + c.urlParams_.Encode() 2146 req, err := http.NewRequest("GET", urls, body) 2147 if err != nil { 2148 return nil, err 2149 } 2150 req.Header = reqHeaders 2151 googleapi.Expand(req.URL, map[string]string{ 2152 "blogId": c.blogId, 2153 "pageId": c.pageId, 2154 }) 2155 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2156} 2157 2158// Do executes the "blogger.pages.get" call. 2159// Exactly one of *Page or error will be non-nil. Any non-2xx status 2160// code is an error. Response headers are in either 2161// *Page.ServerResponse.Header or (if a response was returned at all) in 2162// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2163// whether the returned error was because http.StatusNotModified was 2164// returned. 2165func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*Page, error) { 2166 gensupport.SetOptions(c.urlParams_, opts...) 2167 res, err := c.doRequest("json") 2168 if res != nil && res.StatusCode == http.StatusNotModified { 2169 if res.Body != nil { 2170 res.Body.Close() 2171 } 2172 return nil, &googleapi.Error{ 2173 Code: res.StatusCode, 2174 Header: res.Header, 2175 } 2176 } 2177 if err != nil { 2178 return nil, err 2179 } 2180 defer googleapi.CloseBody(res) 2181 if err := googleapi.CheckResponse(res); err != nil { 2182 return nil, err 2183 } 2184 ret := &Page{ 2185 ServerResponse: googleapi.ServerResponse{ 2186 Header: res.Header, 2187 HTTPStatusCode: res.StatusCode, 2188 }, 2189 } 2190 target := &ret 2191 if err := gensupport.DecodeResponse(target, res); err != nil { 2192 return nil, err 2193 } 2194 return ret, nil 2195 // { 2196 // "description": "Gets a page by blog id and page id.", 2197 // "flatPath": "v2/blogs/{blogId}/pages/{pageId}", 2198 // "httpMethod": "GET", 2199 // "id": "blogger.pages.get", 2200 // "parameterOrder": [ 2201 // "blogId", 2202 // "pageId" 2203 // ], 2204 // "parameters": { 2205 // "blogId": { 2206 // "location": "path", 2207 // "required": true, 2208 // "type": "string" 2209 // }, 2210 // "pageId": { 2211 // "location": "path", 2212 // "required": true, 2213 // "type": "string" 2214 // } 2215 // }, 2216 // "path": "v2/blogs/{blogId}/pages/{pageId}", 2217 // "response": { 2218 // "$ref": "Page" 2219 // }, 2220 // "scopes": [ 2221 // "https://www.googleapis.com/auth/blogger" 2222 // ] 2223 // } 2224 2225} 2226 2227// method id "blogger.pages.list": 2228 2229type PagesListCall struct { 2230 s *Service 2231 blogId string 2232 urlParams_ gensupport.URLParams 2233 ifNoneMatch_ string 2234 ctx_ context.Context 2235 header_ http.Header 2236} 2237 2238// List: Lists pages. 2239func (r *PagesService) List(blogId string) *PagesListCall { 2240 c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2241 c.blogId = blogId 2242 return c 2243} 2244 2245// FetchBodies sets the optional parameter "fetchBodies": 2246func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { 2247 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 2248 return c 2249} 2250 2251// Fields allows partial responses to be retrieved. See 2252// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2253// for more information. 2254func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { 2255 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2256 return c 2257} 2258 2259// IfNoneMatch sets the optional parameter which makes the operation 2260// fail if the object's ETag matches the given value. This is useful for 2261// getting updates only after the object has changed since the last 2262// request. Use googleapi.IsNotModified to check whether the response 2263// error from Do is the result of In-None-Match. 2264func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { 2265 c.ifNoneMatch_ = entityTag 2266 return c 2267} 2268 2269// Context sets the context to be used in this call's Do method. Any 2270// pending HTTP request will be aborted if the provided context is 2271// canceled. 2272func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { 2273 c.ctx_ = ctx 2274 return c 2275} 2276 2277// Header returns an http.Header that can be modified by the caller to 2278// add HTTP headers to the request. 2279func (c *PagesListCall) Header() http.Header { 2280 if c.header_ == nil { 2281 c.header_ = make(http.Header) 2282 } 2283 return c.header_ 2284} 2285 2286func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { 2287 reqHeaders := make(http.Header) 2288 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2289 for k, v := range c.header_ { 2290 reqHeaders[k] = v 2291 } 2292 reqHeaders.Set("User-Agent", c.s.userAgent()) 2293 if c.ifNoneMatch_ != "" { 2294 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2295 } 2296 var body io.Reader = nil 2297 c.urlParams_.Set("alt", alt) 2298 c.urlParams_.Set("prettyPrint", "false") 2299 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages") 2300 urls += "?" + c.urlParams_.Encode() 2301 req, err := http.NewRequest("GET", urls, body) 2302 if err != nil { 2303 return nil, err 2304 } 2305 req.Header = reqHeaders 2306 googleapi.Expand(req.URL, map[string]string{ 2307 "blogId": c.blogId, 2308 }) 2309 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2310} 2311 2312// Do executes the "blogger.pages.list" call. 2313// Exactly one of *PageList or error will be non-nil. Any non-2xx status 2314// code is an error. Response headers are in either 2315// *PageList.ServerResponse.Header or (if a response was returned at 2316// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2317// to check whether the returned error was because 2318// http.StatusNotModified was returned. 2319func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*PageList, error) { 2320 gensupport.SetOptions(c.urlParams_, opts...) 2321 res, err := c.doRequest("json") 2322 if res != nil && res.StatusCode == http.StatusNotModified { 2323 if res.Body != nil { 2324 res.Body.Close() 2325 } 2326 return nil, &googleapi.Error{ 2327 Code: res.StatusCode, 2328 Header: res.Header, 2329 } 2330 } 2331 if err != nil { 2332 return nil, err 2333 } 2334 defer googleapi.CloseBody(res) 2335 if err := googleapi.CheckResponse(res); err != nil { 2336 return nil, err 2337 } 2338 ret := &PageList{ 2339 ServerResponse: googleapi.ServerResponse{ 2340 Header: res.Header, 2341 HTTPStatusCode: res.StatusCode, 2342 }, 2343 } 2344 target := &ret 2345 if err := gensupport.DecodeResponse(target, res); err != nil { 2346 return nil, err 2347 } 2348 return ret, nil 2349 // { 2350 // "description": "Lists pages.", 2351 // "flatPath": "v2/blogs/{blogId}/pages", 2352 // "httpMethod": "GET", 2353 // "id": "blogger.pages.list", 2354 // "parameterOrder": [ 2355 // "blogId" 2356 // ], 2357 // "parameters": { 2358 // "blogId": { 2359 // "location": "path", 2360 // "required": true, 2361 // "type": "string" 2362 // }, 2363 // "fetchBodies": { 2364 // "location": "query", 2365 // "type": "boolean" 2366 // } 2367 // }, 2368 // "path": "v2/blogs/{blogId}/pages", 2369 // "response": { 2370 // "$ref": "PageList" 2371 // }, 2372 // "scopes": [ 2373 // "https://www.googleapis.com/auth/blogger" 2374 // ] 2375 // } 2376 2377} 2378 2379// method id "blogger.posts.get": 2380 2381type PostsGetCall struct { 2382 s *Service 2383 blogId string 2384 postId string 2385 urlParams_ gensupport.URLParams 2386 ifNoneMatch_ string 2387 ctx_ context.Context 2388 header_ http.Header 2389} 2390 2391// Get: Gets a post by blog id and post id 2392func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { 2393 c := &PostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2394 c.blogId = blogId 2395 c.postId = postId 2396 return c 2397} 2398 2399// Fields allows partial responses to be retrieved. See 2400// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2401// for more information. 2402func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { 2403 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2404 return c 2405} 2406 2407// IfNoneMatch sets the optional parameter which makes the operation 2408// fail if the object's ETag matches the given value. This is useful for 2409// getting updates only after the object has changed since the last 2410// request. Use googleapi.IsNotModified to check whether the response 2411// error from Do is the result of In-None-Match. 2412func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { 2413 c.ifNoneMatch_ = entityTag 2414 return c 2415} 2416 2417// Context sets the context to be used in this call's Do method. Any 2418// pending HTTP request will be aborted if the provided context is 2419// canceled. 2420func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { 2421 c.ctx_ = ctx 2422 return c 2423} 2424 2425// Header returns an http.Header that can be modified by the caller to 2426// add HTTP headers to the request. 2427func (c *PostsGetCall) Header() http.Header { 2428 if c.header_ == nil { 2429 c.header_ = make(http.Header) 2430 } 2431 return c.header_ 2432} 2433 2434func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { 2435 reqHeaders := make(http.Header) 2436 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2437 for k, v := range c.header_ { 2438 reqHeaders[k] = v 2439 } 2440 reqHeaders.Set("User-Agent", c.s.userAgent()) 2441 if c.ifNoneMatch_ != "" { 2442 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2443 } 2444 var body io.Reader = nil 2445 c.urlParams_.Set("alt", alt) 2446 c.urlParams_.Set("prettyPrint", "false") 2447 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}") 2448 urls += "?" + c.urlParams_.Encode() 2449 req, err := http.NewRequest("GET", urls, body) 2450 if err != nil { 2451 return nil, err 2452 } 2453 req.Header = reqHeaders 2454 googleapi.Expand(req.URL, map[string]string{ 2455 "blogId": c.blogId, 2456 "postId": c.postId, 2457 }) 2458 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2459} 2460 2461// Do executes the "blogger.posts.get" call. 2462// Exactly one of *Post or error will be non-nil. Any non-2xx status 2463// code is an error. Response headers are in either 2464// *Post.ServerResponse.Header or (if a response was returned at all) in 2465// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2466// whether the returned error was because http.StatusNotModified was 2467// returned. 2468func (c *PostsGetCall) Do(opts ...googleapi.CallOption) (*Post, error) { 2469 gensupport.SetOptions(c.urlParams_, opts...) 2470 res, err := c.doRequest("json") 2471 if res != nil && res.StatusCode == http.StatusNotModified { 2472 if res.Body != nil { 2473 res.Body.Close() 2474 } 2475 return nil, &googleapi.Error{ 2476 Code: res.StatusCode, 2477 Header: res.Header, 2478 } 2479 } 2480 if err != nil { 2481 return nil, err 2482 } 2483 defer googleapi.CloseBody(res) 2484 if err := googleapi.CheckResponse(res); err != nil { 2485 return nil, err 2486 } 2487 ret := &Post{ 2488 ServerResponse: googleapi.ServerResponse{ 2489 Header: res.Header, 2490 HTTPStatusCode: res.StatusCode, 2491 }, 2492 } 2493 target := &ret 2494 if err := gensupport.DecodeResponse(target, res); err != nil { 2495 return nil, err 2496 } 2497 return ret, nil 2498 // { 2499 // "description": "Gets a post by blog id and post id", 2500 // "flatPath": "v2/blogs/{blogId}/posts/{postId}", 2501 // "httpMethod": "GET", 2502 // "id": "blogger.posts.get", 2503 // "parameterOrder": [ 2504 // "blogId", 2505 // "postId" 2506 // ], 2507 // "parameters": { 2508 // "blogId": { 2509 // "location": "path", 2510 // "required": true, 2511 // "type": "string" 2512 // }, 2513 // "postId": { 2514 // "location": "path", 2515 // "required": true, 2516 // "type": "string" 2517 // } 2518 // }, 2519 // "path": "v2/blogs/{blogId}/posts/{postId}", 2520 // "response": { 2521 // "$ref": "Post" 2522 // }, 2523 // "scopes": [ 2524 // "https://www.googleapis.com/auth/blogger" 2525 // ] 2526 // } 2527 2528} 2529 2530// method id "blogger.posts.list": 2531 2532type PostsListCall struct { 2533 s *Service 2534 blogId string 2535 urlParams_ gensupport.URLParams 2536 ifNoneMatch_ string 2537 ctx_ context.Context 2538 header_ http.Header 2539} 2540 2541// List: Lists posts. 2542func (r *PostsService) List(blogId string) *PostsListCall { 2543 c := &PostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2544 c.blogId = blogId 2545 return c 2546} 2547 2548// FetchBodies sets the optional parameter "fetchBodies": 2549func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { 2550 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 2551 return c 2552} 2553 2554// MaxResults sets the optional parameter "maxResults": 2555func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { 2556 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 2557 return c 2558} 2559 2560// PageToken sets the optional parameter "pageToken": 2561func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { 2562 c.urlParams_.Set("pageToken", pageToken) 2563 return c 2564} 2565 2566// StartDate sets the optional parameter "startDate": 2567func (c *PostsListCall) StartDate(startDate string) *PostsListCall { 2568 c.urlParams_.Set("startDate", startDate) 2569 return c 2570} 2571 2572// Fields allows partial responses to be retrieved. See 2573// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2574// for more information. 2575func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { 2576 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2577 return c 2578} 2579 2580// IfNoneMatch sets the optional parameter which makes the operation 2581// fail if the object's ETag matches the given value. This is useful for 2582// getting updates only after the object has changed since the last 2583// request. Use googleapi.IsNotModified to check whether the response 2584// error from Do is the result of In-None-Match. 2585func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { 2586 c.ifNoneMatch_ = entityTag 2587 return c 2588} 2589 2590// Context sets the context to be used in this call's Do method. Any 2591// pending HTTP request will be aborted if the provided context is 2592// canceled. 2593func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { 2594 c.ctx_ = ctx 2595 return c 2596} 2597 2598// Header returns an http.Header that can be modified by the caller to 2599// add HTTP headers to the request. 2600func (c *PostsListCall) Header() http.Header { 2601 if c.header_ == nil { 2602 c.header_ = make(http.Header) 2603 } 2604 return c.header_ 2605} 2606 2607func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { 2608 reqHeaders := make(http.Header) 2609 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2610 for k, v := range c.header_ { 2611 reqHeaders[k] = v 2612 } 2613 reqHeaders.Set("User-Agent", c.s.userAgent()) 2614 if c.ifNoneMatch_ != "" { 2615 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2616 } 2617 var body io.Reader = nil 2618 c.urlParams_.Set("alt", alt) 2619 c.urlParams_.Set("prettyPrint", "false") 2620 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts") 2621 urls += "?" + c.urlParams_.Encode() 2622 req, err := http.NewRequest("GET", urls, body) 2623 if err != nil { 2624 return nil, err 2625 } 2626 req.Header = reqHeaders 2627 googleapi.Expand(req.URL, map[string]string{ 2628 "blogId": c.blogId, 2629 }) 2630 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2631} 2632 2633// Do executes the "blogger.posts.list" call. 2634// Exactly one of *PostList or error will be non-nil. Any non-2xx status 2635// code is an error. Response headers are in either 2636// *PostList.ServerResponse.Header or (if a response was returned at 2637// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2638// to check whether the returned error was because 2639// http.StatusNotModified was returned. 2640func (c *PostsListCall) Do(opts ...googleapi.CallOption) (*PostList, error) { 2641 gensupport.SetOptions(c.urlParams_, opts...) 2642 res, err := c.doRequest("json") 2643 if res != nil && res.StatusCode == http.StatusNotModified { 2644 if res.Body != nil { 2645 res.Body.Close() 2646 } 2647 return nil, &googleapi.Error{ 2648 Code: res.StatusCode, 2649 Header: res.Header, 2650 } 2651 } 2652 if err != nil { 2653 return nil, err 2654 } 2655 defer googleapi.CloseBody(res) 2656 if err := googleapi.CheckResponse(res); err != nil { 2657 return nil, err 2658 } 2659 ret := &PostList{ 2660 ServerResponse: googleapi.ServerResponse{ 2661 Header: res.Header, 2662 HTTPStatusCode: res.StatusCode, 2663 }, 2664 } 2665 target := &ret 2666 if err := gensupport.DecodeResponse(target, res); err != nil { 2667 return nil, err 2668 } 2669 return ret, nil 2670 // { 2671 // "description": "Lists posts.", 2672 // "flatPath": "v2/blogs/{blogId}/posts", 2673 // "httpMethod": "GET", 2674 // "id": "blogger.posts.list", 2675 // "parameterOrder": [ 2676 // "blogId" 2677 // ], 2678 // "parameters": { 2679 // "blogId": { 2680 // "location": "path", 2681 // "required": true, 2682 // "type": "string" 2683 // }, 2684 // "fetchBodies": { 2685 // "location": "query", 2686 // "type": "boolean" 2687 // }, 2688 // "maxResults": { 2689 // "format": "uint32", 2690 // "location": "query", 2691 // "type": "integer" 2692 // }, 2693 // "pageToken": { 2694 // "location": "query", 2695 // "type": "string" 2696 // }, 2697 // "startDate": { 2698 // "location": "query", 2699 // "type": "string" 2700 // } 2701 // }, 2702 // "path": "v2/blogs/{blogId}/posts", 2703 // "response": { 2704 // "$ref": "PostList" 2705 // }, 2706 // "scopes": [ 2707 // "https://www.googleapis.com/auth/blogger" 2708 // ] 2709 // } 2710 2711} 2712 2713// Pages invokes f for each page of results. 2714// A non-nil error returned from f will halt the iteration. 2715// The provided context supersedes any context provided to the Context method. 2716func (c *PostsListCall) Pages(ctx context.Context, f func(*PostList) error) error { 2717 c.ctx_ = ctx 2718 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2719 for { 2720 x, err := c.Do() 2721 if err != nil { 2722 return err 2723 } 2724 if err := f(x); err != nil { 2725 return err 2726 } 2727 if x.NextPageToken == "" { 2728 return nil 2729 } 2730 c.PageToken(x.NextPageToken) 2731 } 2732} 2733 2734// method id "blogger.users.get": 2735 2736type UsersGetCall struct { 2737 s *Service 2738 userId string 2739 urlParams_ gensupport.URLParams 2740 ifNoneMatch_ string 2741 ctx_ context.Context 2742 header_ http.Header 2743} 2744 2745// Get: Gets a user by user id. 2746func (r *UsersService) Get(userId string) *UsersGetCall { 2747 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2748 c.userId = userId 2749 return c 2750} 2751 2752// Fields allows partial responses to be retrieved. See 2753// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2754// for more information. 2755func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 2756 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2757 return c 2758} 2759 2760// IfNoneMatch sets the optional parameter which makes the operation 2761// fail if the object's ETag matches the given value. This is useful for 2762// getting updates only after the object has changed since the last 2763// request. Use googleapi.IsNotModified to check whether the response 2764// error from Do is the result of In-None-Match. 2765func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 2766 c.ifNoneMatch_ = entityTag 2767 return c 2768} 2769 2770// Context sets the context to be used in this call's Do method. Any 2771// pending HTTP request will be aborted if the provided context is 2772// canceled. 2773func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 2774 c.ctx_ = ctx 2775 return c 2776} 2777 2778// Header returns an http.Header that can be modified by the caller to 2779// add HTTP headers to the request. 2780func (c *UsersGetCall) Header() http.Header { 2781 if c.header_ == nil { 2782 c.header_ = make(http.Header) 2783 } 2784 return c.header_ 2785} 2786 2787func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 2788 reqHeaders := make(http.Header) 2789 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2790 for k, v := range c.header_ { 2791 reqHeaders[k] = v 2792 } 2793 reqHeaders.Set("User-Agent", c.s.userAgent()) 2794 if c.ifNoneMatch_ != "" { 2795 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2796 } 2797 var body io.Reader = nil 2798 c.urlParams_.Set("alt", alt) 2799 c.urlParams_.Set("prettyPrint", "false") 2800 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}") 2801 urls += "?" + c.urlParams_.Encode() 2802 req, err := http.NewRequest("GET", urls, body) 2803 if err != nil { 2804 return nil, err 2805 } 2806 req.Header = reqHeaders 2807 googleapi.Expand(req.URL, map[string]string{ 2808 "userId": c.userId, 2809 }) 2810 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2811} 2812 2813// Do executes the "blogger.users.get" call. 2814// Exactly one of *User or error will be non-nil. Any non-2xx status 2815// code is an error. Response headers are in either 2816// *User.ServerResponse.Header or (if a response was returned at all) in 2817// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2818// whether the returned error was because http.StatusNotModified was 2819// returned. 2820func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 2821 gensupport.SetOptions(c.urlParams_, opts...) 2822 res, err := c.doRequest("json") 2823 if res != nil && res.StatusCode == http.StatusNotModified { 2824 if res.Body != nil { 2825 res.Body.Close() 2826 } 2827 return nil, &googleapi.Error{ 2828 Code: res.StatusCode, 2829 Header: res.Header, 2830 } 2831 } 2832 if err != nil { 2833 return nil, err 2834 } 2835 defer googleapi.CloseBody(res) 2836 if err := googleapi.CheckResponse(res); err != nil { 2837 return nil, err 2838 } 2839 ret := &User{ 2840 ServerResponse: googleapi.ServerResponse{ 2841 Header: res.Header, 2842 HTTPStatusCode: res.StatusCode, 2843 }, 2844 } 2845 target := &ret 2846 if err := gensupport.DecodeResponse(target, res); err != nil { 2847 return nil, err 2848 } 2849 return ret, nil 2850 // { 2851 // "description": "Gets a user by user id.", 2852 // "flatPath": "v2/users/{userId}", 2853 // "httpMethod": "GET", 2854 // "id": "blogger.users.get", 2855 // "parameterOrder": [ 2856 // "userId" 2857 // ], 2858 // "parameters": { 2859 // "userId": { 2860 // "location": "path", 2861 // "required": true, 2862 // "type": "string" 2863 // } 2864 // }, 2865 // "path": "v2/users/{userId}", 2866 // "response": { 2867 // "$ref": "User" 2868 // }, 2869 // "scopes": [ 2870 // "https://www.googleapis.com/auth/blogger" 2871 // ] 2872 // } 2873 2874} 2875