1// Copyright 2019 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package blogger provides access to the Blogger API. 8// 9// For product documentation, see: https://developers.google.com/blogger/docs/3.0/getting_started 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/blogger/v3" 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// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// bloggerService, err := blogger.NewService(ctx, option.WithScopes(blogger.BloggerReadonlyScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// bloggerService, err := blogger.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// bloggerService, err := blogger.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package blogger // import "google.golang.org/api/blogger/v3" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 htransport "google.golang.org/api/transport/http" 60) 61 62// Always reference these packages, just in case the auto-generated code 63// below doesn't. 64var _ = bytes.NewBuffer 65var _ = strconv.Itoa 66var _ = fmt.Sprintf 67var _ = json.NewDecoder 68var _ = io.Copy 69var _ = url.Parse 70var _ = gensupport.MarshalJSON 71var _ = googleapi.Version 72var _ = errors.New 73var _ = strings.Replace 74var _ = context.Canceled 75 76const apiId = "blogger:v3" 77const apiName = "blogger" 78const apiVersion = "v3" 79const basePath = "https://www.googleapis.com/blogger/v3/" 80 81// OAuth2 scopes used by this API. 82const ( 83 // Manage your Blogger account 84 BloggerScope = "https://www.googleapis.com/auth/blogger" 85 86 // View your Blogger account 87 BloggerReadonlyScope = "https://www.googleapis.com/auth/blogger.readonly" 88) 89 90// NewService creates a new Service. 91func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 92 scopesOption := option.WithScopes( 93 "https://www.googleapis.com/auth/blogger", 94 "https://www.googleapis.com/auth/blogger.readonly", 95 ) 96 // NOTE: prepend, so we don't override user-specified scopes. 97 opts = append([]option.ClientOption{scopesOption}, opts...) 98 client, endpoint, err := htransport.NewClient(ctx, opts...) 99 if err != nil { 100 return nil, err 101 } 102 s, err := New(client) 103 if err != nil { 104 return nil, err 105 } 106 if endpoint != "" { 107 s.BasePath = endpoint 108 } 109 return s, nil 110} 111 112// New creates a new Service. It uses the provided http.Client for requests. 113// 114// Deprecated: please use NewService instead. 115// To provide a custom HTTP client, use option.WithHTTPClient. 116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 117func New(client *http.Client) (*Service, error) { 118 if client == nil { 119 return nil, errors.New("client is nil") 120 } 121 s := &Service{client: client, BasePath: basePath} 122 s.BlogUserInfos = NewBlogUserInfosService(s) 123 s.Blogs = NewBlogsService(s) 124 s.Comments = NewCommentsService(s) 125 s.PageViews = NewPageViewsService(s) 126 s.Pages = NewPagesService(s) 127 s.PostUserInfos = NewPostUserInfosService(s) 128 s.Posts = NewPostsService(s) 129 s.Users = NewUsersService(s) 130 return s, nil 131} 132 133type Service struct { 134 client *http.Client 135 BasePath string // API endpoint base URL 136 UserAgent string // optional additional User-Agent fragment 137 138 BlogUserInfos *BlogUserInfosService 139 140 Blogs *BlogsService 141 142 Comments *CommentsService 143 144 PageViews *PageViewsService 145 146 Pages *PagesService 147 148 PostUserInfos *PostUserInfosService 149 150 Posts *PostsService 151 152 Users *UsersService 153} 154 155func (s *Service) userAgent() string { 156 if s.UserAgent == "" { 157 return googleapi.UserAgent 158 } 159 return googleapi.UserAgent + " " + s.UserAgent 160} 161 162func NewBlogUserInfosService(s *Service) *BlogUserInfosService { 163 rs := &BlogUserInfosService{s: s} 164 return rs 165} 166 167type BlogUserInfosService struct { 168 s *Service 169} 170 171func NewBlogsService(s *Service) *BlogsService { 172 rs := &BlogsService{s: s} 173 return rs 174} 175 176type BlogsService struct { 177 s *Service 178} 179 180func NewCommentsService(s *Service) *CommentsService { 181 rs := &CommentsService{s: s} 182 return rs 183} 184 185type CommentsService struct { 186 s *Service 187} 188 189func NewPageViewsService(s *Service) *PageViewsService { 190 rs := &PageViewsService{s: s} 191 return rs 192} 193 194type PageViewsService struct { 195 s *Service 196} 197 198func NewPagesService(s *Service) *PagesService { 199 rs := &PagesService{s: s} 200 return rs 201} 202 203type PagesService struct { 204 s *Service 205} 206 207func NewPostUserInfosService(s *Service) *PostUserInfosService { 208 rs := &PostUserInfosService{s: s} 209 return rs 210} 211 212type PostUserInfosService struct { 213 s *Service 214} 215 216func NewPostsService(s *Service) *PostsService { 217 rs := &PostsService{s: s} 218 return rs 219} 220 221type PostsService struct { 222 s *Service 223} 224 225func NewUsersService(s *Service) *UsersService { 226 rs := &UsersService{s: s} 227 return rs 228} 229 230type UsersService struct { 231 s *Service 232} 233 234type Blog struct { 235 // CustomMetaData: The JSON custom meta-data for the Blog 236 CustomMetaData string `json:"customMetaData,omitempty"` 237 238 // Description: The description of this blog. This is displayed 239 // underneath the title. 240 Description string `json:"description,omitempty"` 241 242 // Id: The identifier for this resource. 243 Id string `json:"id,omitempty"` 244 245 // Kind: The kind of this entry. Always blogger#blog 246 Kind string `json:"kind,omitempty"` 247 248 // Locale: The locale this Blog is set to. 249 Locale *BlogLocale `json:"locale,omitempty"` 250 251 // Name: The name of this blog. This is displayed as the title. 252 Name string `json:"name,omitempty"` 253 254 // Pages: The container of pages in this blog. 255 Pages *BlogPages `json:"pages,omitempty"` 256 257 // Posts: The container of posts in this blog. 258 Posts *BlogPosts `json:"posts,omitempty"` 259 260 // Published: RFC 3339 date-time when this blog was published. 261 Published string `json:"published,omitempty"` 262 263 // SelfLink: The API REST URL to fetch this resource from. 264 SelfLink string `json:"selfLink,omitempty"` 265 266 // Status: The status of the blog. 267 Status string `json:"status,omitempty"` 268 269 // Updated: RFC 3339 date-time when this blog was last updated. 270 Updated string `json:"updated,omitempty"` 271 272 // Url: The URL where this blog is published. 273 Url string `json:"url,omitempty"` 274 275 // ServerResponse contains the HTTP response code and headers from the 276 // server. 277 googleapi.ServerResponse `json:"-"` 278 279 // ForceSendFields is a list of field names (e.g. "CustomMetaData") to 280 // unconditionally include in API requests. By default, fields with 281 // empty values are omitted from API requests. However, any non-pointer, 282 // non-interface field appearing in ForceSendFields will be sent to the 283 // server regardless of whether the field is empty or not. This may be 284 // used to include empty fields in Patch requests. 285 ForceSendFields []string `json:"-"` 286 287 // NullFields is a list of field names (e.g. "CustomMetaData") to 288 // include in API requests with the JSON null value. By default, fields 289 // with empty values are omitted from API requests. However, any field 290 // with an empty value appearing in NullFields will be sent to the 291 // server as null. It is an error if a field in this list has a 292 // non-empty value. This may be used to include null fields in Patch 293 // requests. 294 NullFields []string `json:"-"` 295} 296 297func (s *Blog) MarshalJSON() ([]byte, error) { 298 type NoMethod Blog 299 raw := NoMethod(*s) 300 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 301} 302 303// BlogLocale: The locale this Blog is set to. 304type BlogLocale struct { 305 // Country: The country this blog's locale is set to. 306 Country string `json:"country,omitempty"` 307 308 // Language: The language this blog is authored in. 309 Language string `json:"language,omitempty"` 310 311 // Variant: The language variant this blog is authored in. 312 Variant string `json:"variant,omitempty"` 313 314 // ForceSendFields is a list of field names (e.g. "Country") to 315 // unconditionally include in API requests. By default, fields with 316 // empty values are omitted from API requests. However, any non-pointer, 317 // non-interface field appearing in ForceSendFields will be sent to the 318 // server regardless of whether the field is empty or not. This may be 319 // used to include empty fields in Patch requests. 320 ForceSendFields []string `json:"-"` 321 322 // NullFields is a list of field names (e.g. "Country") to include in 323 // API requests with the JSON null value. By default, fields with empty 324 // values are omitted from API requests. However, any field with an 325 // empty value appearing in NullFields will be sent to the server as 326 // null. It is an error if a field in this list has a non-empty value. 327 // This may be used to include null fields in Patch requests. 328 NullFields []string `json:"-"` 329} 330 331func (s *BlogLocale) MarshalJSON() ([]byte, error) { 332 type NoMethod BlogLocale 333 raw := NoMethod(*s) 334 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 335} 336 337// BlogPages: The container of pages in this blog. 338type BlogPages struct { 339 // SelfLink: The URL of the container for pages in this blog. 340 SelfLink string `json:"selfLink,omitempty"` 341 342 // TotalItems: The count of pages in this blog. 343 TotalItems int64 `json:"totalItems,omitempty"` 344 345 // ForceSendFields is a list of field names (e.g. "SelfLink") to 346 // unconditionally include in API requests. By default, fields with 347 // empty values are omitted from API requests. However, any non-pointer, 348 // non-interface field appearing in ForceSendFields will be sent to the 349 // server regardless of whether the field is empty or not. This may be 350 // used to include empty fields in Patch requests. 351 ForceSendFields []string `json:"-"` 352 353 // NullFields is a list of field names (e.g. "SelfLink") to include in 354 // API requests with the JSON null value. By default, fields with empty 355 // values are omitted from API requests. However, any field with an 356 // empty value appearing in NullFields will be sent to the server as 357 // null. It is an error if a field in this list has a non-empty value. 358 // This may be used to include null fields in Patch requests. 359 NullFields []string `json:"-"` 360} 361 362func (s *BlogPages) MarshalJSON() ([]byte, error) { 363 type NoMethod BlogPages 364 raw := NoMethod(*s) 365 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 366} 367 368// BlogPosts: The container of posts in this blog. 369type BlogPosts struct { 370 // Items: The List of Posts for this Blog. 371 Items []*Post `json:"items,omitempty"` 372 373 // SelfLink: The URL of the container for posts in this blog. 374 SelfLink string `json:"selfLink,omitempty"` 375 376 // TotalItems: The count of posts in this blog. 377 TotalItems int64 `json:"totalItems,omitempty"` 378 379 // ForceSendFields is a list of field names (e.g. "Items") to 380 // unconditionally include in API requests. By default, fields with 381 // empty values are omitted from API requests. However, any non-pointer, 382 // non-interface field appearing in ForceSendFields will be sent to the 383 // server regardless of whether the field is empty or not. This may be 384 // used to include empty fields in Patch requests. 385 ForceSendFields []string `json:"-"` 386 387 // NullFields is a list of field names (e.g. "Items") to include in API 388 // requests with the JSON null value. By default, fields with empty 389 // values are omitted from API requests. However, any field with an 390 // empty value appearing in NullFields will be sent to the server as 391 // null. It is an error if a field in this list has a non-empty value. 392 // This may be used to include null fields in Patch requests. 393 NullFields []string `json:"-"` 394} 395 396func (s *BlogPosts) MarshalJSON() ([]byte, error) { 397 type NoMethod BlogPosts 398 raw := NoMethod(*s) 399 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 400} 401 402type BlogList struct { 403 // BlogUserInfos: Admin level list of blog per-user information 404 BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"` 405 406 // Items: The list of Blogs this user has Authorship or Admin rights 407 // over. 408 Items []*Blog `json:"items,omitempty"` 409 410 // Kind: The kind of this entity. Always blogger#blogList 411 Kind string `json:"kind,omitempty"` 412 413 // ServerResponse contains the HTTP response code and headers from the 414 // server. 415 googleapi.ServerResponse `json:"-"` 416 417 // ForceSendFields is a list of field names (e.g. "BlogUserInfos") to 418 // unconditionally include in API requests. By default, fields with 419 // empty values are omitted from API requests. However, any non-pointer, 420 // non-interface field appearing in ForceSendFields will be sent to the 421 // server regardless of whether the field is empty or not. This may be 422 // used to include empty fields in Patch requests. 423 ForceSendFields []string `json:"-"` 424 425 // NullFields is a list of field names (e.g. "BlogUserInfos") to include 426 // in API requests with the JSON null value. By default, fields with 427 // empty values are omitted from API requests. However, any field with 428 // an empty value appearing in NullFields will be sent to the server as 429 // null. It is an error if a field in this list has a non-empty value. 430 // This may be used to include null fields in Patch requests. 431 NullFields []string `json:"-"` 432} 433 434func (s *BlogList) MarshalJSON() ([]byte, error) { 435 type NoMethod BlogList 436 raw := NoMethod(*s) 437 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 438} 439 440type BlogPerUserInfo struct { 441 // BlogId: ID of the Blog resource 442 BlogId string `json:"blogId,omitempty"` 443 444 // HasAdminAccess: True if the user has Admin level access to the blog. 445 HasAdminAccess bool `json:"hasAdminAccess,omitempty"` 446 447 // Kind: The kind of this entity. Always blogger#blogPerUserInfo 448 Kind string `json:"kind,omitempty"` 449 450 // PhotosAlbumKey: The Photo Album Key for the user when adding photos 451 // to the blog 452 PhotosAlbumKey string `json:"photosAlbumKey,omitempty"` 453 454 // Role: Access permissions that the user has for the blog (ADMIN, 455 // AUTHOR, or READER). 456 Role string `json:"role,omitempty"` 457 458 // UserId: ID of the User 459 UserId string `json:"userId,omitempty"` 460 461 // ForceSendFields is a list of field names (e.g. "BlogId") to 462 // unconditionally include in API requests. By default, fields with 463 // empty values are omitted from API requests. However, any non-pointer, 464 // non-interface field appearing in ForceSendFields will be sent to the 465 // server regardless of whether the field is empty or not. This may be 466 // used to include empty fields in Patch requests. 467 ForceSendFields []string `json:"-"` 468 469 // NullFields is a list of field names (e.g. "BlogId") to include in API 470 // requests with the JSON null value. By default, fields with empty 471 // values are omitted from API requests. However, any field with an 472 // empty value appearing in NullFields will be sent to the server as 473 // null. It is an error if a field in this list has a non-empty value. 474 // This may be used to include null fields in Patch requests. 475 NullFields []string `json:"-"` 476} 477 478func (s *BlogPerUserInfo) MarshalJSON() ([]byte, error) { 479 type NoMethod BlogPerUserInfo 480 raw := NoMethod(*s) 481 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 482} 483 484type BlogUserInfo struct { 485 // Blog: The Blog resource. 486 Blog *Blog `json:"blog,omitempty"` 487 488 // BlogUserInfo: Information about a User for the Blog. 489 BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"` 490 491 // Kind: The kind of this entity. Always blogger#blogUserInfo 492 Kind string `json:"kind,omitempty"` 493 494 // ServerResponse contains the HTTP response code and headers from the 495 // server. 496 googleapi.ServerResponse `json:"-"` 497 498 // ForceSendFields is a list of field names (e.g. "Blog") to 499 // unconditionally include in API requests. By default, fields with 500 // empty values are omitted from API requests. However, any non-pointer, 501 // non-interface field appearing in ForceSendFields will be sent to the 502 // server regardless of whether the field is empty or not. This may be 503 // used to include empty fields in Patch requests. 504 ForceSendFields []string `json:"-"` 505 506 // NullFields is a list of field names (e.g. "Blog") to include in API 507 // requests with the JSON null value. By default, fields with empty 508 // values are omitted from API requests. However, any field with an 509 // empty value appearing in NullFields will be sent to the server as 510 // null. It is an error if a field in this list has a non-empty value. 511 // This may be used to include null fields in Patch requests. 512 NullFields []string `json:"-"` 513} 514 515func (s *BlogUserInfo) MarshalJSON() ([]byte, error) { 516 type NoMethod BlogUserInfo 517 raw := NoMethod(*s) 518 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 519} 520 521type Comment struct { 522 // Author: The author of this Comment. 523 Author *CommentAuthor `json:"author,omitempty"` 524 525 // Blog: Data about the blog containing this comment. 526 Blog *CommentBlog `json:"blog,omitempty"` 527 528 // Content: The actual content of the comment. May include HTML markup. 529 Content string `json:"content,omitempty"` 530 531 // Id: The identifier for this resource. 532 Id string `json:"id,omitempty"` 533 534 // InReplyTo: Data about the comment this is in reply to. 535 InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` 536 537 // Kind: The kind of this entry. Always blogger#comment 538 Kind string `json:"kind,omitempty"` 539 540 // Post: Data about the post containing this comment. 541 Post *CommentPost `json:"post,omitempty"` 542 543 // Published: RFC 3339 date-time when this comment was published. 544 Published string `json:"published,omitempty"` 545 546 // SelfLink: The API REST URL to fetch this resource from. 547 SelfLink string `json:"selfLink,omitempty"` 548 549 // Status: The status of the comment (only populated for admin users) 550 Status string `json:"status,omitempty"` 551 552 // Updated: RFC 3339 date-time when this comment was last updated. 553 Updated string `json:"updated,omitempty"` 554 555 // ServerResponse contains the HTTP response code and headers from the 556 // server. 557 googleapi.ServerResponse `json:"-"` 558 559 // ForceSendFields is a list of field names (e.g. "Author") to 560 // unconditionally include in API requests. By default, fields with 561 // empty values are omitted from API requests. However, any non-pointer, 562 // non-interface field appearing in ForceSendFields will be sent to the 563 // server regardless of whether the field is empty or not. This may be 564 // used to include empty fields in Patch requests. 565 ForceSendFields []string `json:"-"` 566 567 // NullFields is a list of field names (e.g. "Author") to include in API 568 // requests with the JSON null value. By default, fields with empty 569 // values are omitted from API requests. However, any field with an 570 // empty value appearing in NullFields will be sent to the server as 571 // null. It is an error if a field in this list has a non-empty value. 572 // This may be used to include null fields in Patch requests. 573 NullFields []string `json:"-"` 574} 575 576func (s *Comment) MarshalJSON() ([]byte, error) { 577 type NoMethod Comment 578 raw := NoMethod(*s) 579 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 580} 581 582// CommentAuthor: The author of this Comment. 583type CommentAuthor struct { 584 // DisplayName: The display name. 585 DisplayName string `json:"displayName,omitempty"` 586 587 // Id: The identifier of the Comment creator. 588 Id string `json:"id,omitempty"` 589 590 // Image: The comment creator's avatar. 591 Image *CommentAuthorImage `json:"image,omitempty"` 592 593 // Url: The URL of the Comment creator's Profile page. 594 Url string `json:"url,omitempty"` 595 596 // ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") to include 605 // in API requests with the JSON null value. By default, fields with 606 // empty values are omitted from API requests. However, any field with 607 // an 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 *CommentAuthor) MarshalJSON() ([]byte, error) { 614 type NoMethod CommentAuthor 615 raw := NoMethod(*s) 616 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 617} 618 619// CommentAuthorImage: The comment creator's avatar. 620type CommentAuthorImage struct { 621 // Url: The comment creator's avatar URL. 622 Url string `json:"url,omitempty"` 623 624 // ForceSendFields is a list of field names (e.g. "Url") 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. "Url") 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 *CommentAuthorImage) MarshalJSON() ([]byte, error) { 642 type NoMethod CommentAuthorImage 643 raw := NoMethod(*s) 644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 645} 646 647// CommentBlog: Data about the blog containing this comment. 648type CommentBlog struct { 649 // Id: The identifier of the blog containing 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 *CommentBlog) MarshalJSON() ([]byte, error) { 670 type NoMethod CommentBlog 671 raw := NoMethod(*s) 672 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 673} 674 675// CommentInReplyTo: Data about the comment this is in reply to. 676type CommentInReplyTo struct { 677 // Id: The identified of the parent of 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 *CommentInReplyTo) MarshalJSON() ([]byte, error) { 698 type NoMethod CommentInReplyTo 699 raw := NoMethod(*s) 700 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 701} 702 703// CommentPost: Data about the post containing this comment. 704type CommentPost struct { 705 // Id: The identifier of the post containing this comment. 706 Id string `json:"id,omitempty"` 707 708 // ForceSendFields is a list of field names (e.g. "Id") to 709 // unconditionally include in API requests. By default, fields with 710 // empty values are omitted from API requests. However, any non-pointer, 711 // non-interface field appearing in ForceSendFields will be sent to the 712 // server regardless of whether the field is empty or not. This may be 713 // used to include empty fields in Patch requests. 714 ForceSendFields []string `json:"-"` 715 716 // NullFields is a list of field names (e.g. "Id") to include in API 717 // requests with the JSON null value. By default, fields with empty 718 // values are omitted from API requests. However, any field with an 719 // empty value appearing in NullFields will be sent to the server as 720 // null. It is an error if a field in this list has a non-empty value. 721 // This may be used to include null fields in Patch requests. 722 NullFields []string `json:"-"` 723} 724 725func (s *CommentPost) MarshalJSON() ([]byte, error) { 726 type NoMethod CommentPost 727 raw := NoMethod(*s) 728 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 729} 730 731type CommentList struct { 732 // Etag: Etag of the response. 733 Etag string `json:"etag,omitempty"` 734 735 // Items: The List of Comments for a Post. 736 Items []*Comment `json:"items,omitempty"` 737 738 // Kind: The kind of this entry. Always blogger#commentList 739 Kind string `json:"kind,omitempty"` 740 741 // NextPageToken: Pagination token to fetch the next page, if one 742 // exists. 743 NextPageToken string `json:"nextPageToken,omitempty"` 744 745 // PrevPageToken: Pagination token to fetch the previous page, if one 746 // exists. 747 PrevPageToken string `json:"prevPageToken,omitempty"` 748 749 // ServerResponse contains the HTTP response code and headers from the 750 // server. 751 googleapi.ServerResponse `json:"-"` 752 753 // ForceSendFields is a list of field names (e.g. "Etag") to 754 // unconditionally include in API requests. By default, fields with 755 // empty values are omitted from API requests. However, any non-pointer, 756 // non-interface field appearing in ForceSendFields will be sent to the 757 // server regardless of whether the field is empty or not. This may be 758 // used to include empty fields in Patch requests. 759 ForceSendFields []string `json:"-"` 760 761 // NullFields is a list of field names (e.g. "Etag") to include in API 762 // requests with the JSON null value. By default, fields with empty 763 // values are omitted from API requests. However, any field with an 764 // empty value appearing in NullFields will be sent to the server as 765 // null. It is an error if a field in this list has a non-empty value. 766 // This may be used to include null fields in Patch requests. 767 NullFields []string `json:"-"` 768} 769 770func (s *CommentList) MarshalJSON() ([]byte, error) { 771 type NoMethod CommentList 772 raw := NoMethod(*s) 773 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 774} 775 776type Page struct { 777 // Author: The author of this Page. 778 Author *PageAuthor `json:"author,omitempty"` 779 780 // Blog: Data about the blog containing this Page. 781 Blog *PageBlog `json:"blog,omitempty"` 782 783 // Content: The body content of this Page, in HTML. 784 Content string `json:"content,omitempty"` 785 786 // Etag: Etag of the resource. 787 Etag string `json:"etag,omitempty"` 788 789 // Id: The identifier for this resource. 790 Id string `json:"id,omitempty"` 791 792 // Kind: The kind of this entity. Always blogger#page 793 Kind string `json:"kind,omitempty"` 794 795 // Published: RFC 3339 date-time when this Page was published. 796 Published string `json:"published,omitempty"` 797 798 // SelfLink: The API REST URL to fetch this resource from. 799 SelfLink string `json:"selfLink,omitempty"` 800 801 // Status: The status of the page for admin resources (either LIVE or 802 // DRAFT). 803 Status string `json:"status,omitempty"` 804 805 // Title: The title of this entity. This is the name displayed in the 806 // Admin user interface. 807 Title string `json:"title,omitempty"` 808 809 // Updated: RFC 3339 date-time when this Page was last updated. 810 Updated string `json:"updated,omitempty"` 811 812 // Url: The URL that this Page is displayed at. 813 Url string `json:"url,omitempty"` 814 815 // ServerResponse contains the HTTP response code and headers from the 816 // server. 817 googleapi.ServerResponse `json:"-"` 818 819 // ForceSendFields is a list of field names (e.g. "Author") to 820 // unconditionally include in API requests. By default, fields with 821 // empty values are omitted from API requests. However, any non-pointer, 822 // non-interface field appearing in ForceSendFields will be sent to the 823 // server regardless of whether the field is empty or not. This may be 824 // used to include empty fields in Patch requests. 825 ForceSendFields []string `json:"-"` 826 827 // NullFields is a list of field names (e.g. "Author") to include in API 828 // requests with the JSON null value. By default, fields with empty 829 // values are omitted from API requests. However, any field with an 830 // empty value appearing in NullFields will be sent to the server as 831 // null. It is an error if a field in this list has a non-empty value. 832 // This may be used to include null fields in Patch requests. 833 NullFields []string `json:"-"` 834} 835 836func (s *Page) MarshalJSON() ([]byte, error) { 837 type NoMethod Page 838 raw := NoMethod(*s) 839 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 840} 841 842// PageAuthor: The author of this Page. 843type PageAuthor struct { 844 // DisplayName: The display name. 845 DisplayName string `json:"displayName,omitempty"` 846 847 // Id: The identifier of the Page creator. 848 Id string `json:"id,omitempty"` 849 850 // Image: The page author's avatar. 851 Image *PageAuthorImage `json:"image,omitempty"` 852 853 // Url: The URL of the Page creator's Profile page. 854 Url string `json:"url,omitempty"` 855 856 // ForceSendFields is a list of field names (e.g. "DisplayName") to 857 // unconditionally include in API requests. By default, fields with 858 // empty values are omitted from API requests. However, any non-pointer, 859 // non-interface field appearing in ForceSendFields will be sent to the 860 // server regardless of whether the field is empty or not. This may be 861 // used to include empty fields in Patch requests. 862 ForceSendFields []string `json:"-"` 863 864 // NullFields is a list of field names (e.g. "DisplayName") to include 865 // in API requests with the JSON null value. By default, fields with 866 // empty values are omitted from API requests. However, any field with 867 // an empty value appearing in NullFields will be sent to the server as 868 // null. It is an error if a field in this list has a non-empty value. 869 // This may be used to include null fields in Patch requests. 870 NullFields []string `json:"-"` 871} 872 873func (s *PageAuthor) MarshalJSON() ([]byte, error) { 874 type NoMethod PageAuthor 875 raw := NoMethod(*s) 876 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 877} 878 879// PageAuthorImage: The page author's avatar. 880type PageAuthorImage struct { 881 // Url: The page author's avatar URL. 882 Url string `json:"url,omitempty"` 883 884 // ForceSendFields is a list of field names (e.g. "Url") to 885 // unconditionally include in API requests. By default, fields with 886 // empty values are omitted from API requests. However, any non-pointer, 887 // non-interface field appearing in ForceSendFields will be sent to the 888 // server regardless of whether the field is empty or not. This may be 889 // used to include empty fields in Patch requests. 890 ForceSendFields []string `json:"-"` 891 892 // NullFields is a list of field names (e.g. "Url") to include in API 893 // requests with the JSON null value. By default, fields with empty 894 // values are omitted from API requests. However, any field with an 895 // empty value appearing in NullFields will be sent to the server as 896 // null. It is an error if a field in this list has a non-empty value. 897 // This may be used to include null fields in Patch requests. 898 NullFields []string `json:"-"` 899} 900 901func (s *PageAuthorImage) MarshalJSON() ([]byte, error) { 902 type NoMethod PageAuthorImage 903 raw := NoMethod(*s) 904 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 905} 906 907// PageBlog: Data about the blog containing this Page. 908type PageBlog struct { 909 // Id: The identifier of the blog containing this page. 910 Id string `json:"id,omitempty"` 911 912 // ForceSendFields is a list of field names (e.g. "Id") to 913 // unconditionally include in API requests. By default, fields with 914 // empty values are omitted from API requests. However, any non-pointer, 915 // non-interface field appearing in ForceSendFields will be sent to the 916 // server regardless of whether the field is empty or not. This may be 917 // used to include empty fields in Patch requests. 918 ForceSendFields []string `json:"-"` 919 920 // NullFields is a list of field names (e.g. "Id") to include in API 921 // requests with the JSON null value. By default, fields with empty 922 // values are omitted from API requests. However, any field with an 923 // empty value appearing in NullFields will be sent to the server as 924 // null. It is an error if a field in this list has a non-empty value. 925 // This may be used to include null fields in Patch requests. 926 NullFields []string `json:"-"` 927} 928 929func (s *PageBlog) MarshalJSON() ([]byte, error) { 930 type NoMethod PageBlog 931 raw := NoMethod(*s) 932 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 933} 934 935type PageList struct { 936 // Etag: Etag of the response. 937 Etag string `json:"etag,omitempty"` 938 939 // Items: The list of Pages for a Blog. 940 Items []*Page `json:"items,omitempty"` 941 942 // Kind: The kind of this entity. Always blogger#pageList 943 Kind string `json:"kind,omitempty"` 944 945 // NextPageToken: Pagination token to fetch the next page, if one 946 // exists. 947 NextPageToken string `json:"nextPageToken,omitempty"` 948 949 // ServerResponse contains the HTTP response code and headers from the 950 // server. 951 googleapi.ServerResponse `json:"-"` 952 953 // ForceSendFields is a list of field names (e.g. "Etag") to 954 // unconditionally include in API requests. By default, fields with 955 // empty values are omitted from API requests. However, any non-pointer, 956 // non-interface field appearing in ForceSendFields will be sent to the 957 // server regardless of whether the field is empty or not. This may be 958 // used to include empty fields in Patch requests. 959 ForceSendFields []string `json:"-"` 960 961 // NullFields is a list of field names (e.g. "Etag") to include in API 962 // requests with the JSON null value. By default, fields with empty 963 // values are omitted from API requests. However, any field with an 964 // empty value appearing in NullFields will be sent to the server as 965 // null. It is an error if a field in this list has a non-empty value. 966 // This may be used to include null fields in Patch requests. 967 NullFields []string `json:"-"` 968} 969 970func (s *PageList) MarshalJSON() ([]byte, error) { 971 type NoMethod PageList 972 raw := NoMethod(*s) 973 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 974} 975 976type Pageviews struct { 977 // BlogId: Blog Id 978 BlogId string `json:"blogId,omitempty"` 979 980 // Counts: The container of posts in this blog. 981 Counts []*PageviewsCounts `json:"counts,omitempty"` 982 983 // Kind: The kind of this entry. Always blogger#page_views 984 Kind string `json:"kind,omitempty"` 985 986 // ServerResponse contains the HTTP response code and headers from the 987 // server. 988 googleapi.ServerResponse `json:"-"` 989 990 // ForceSendFields is a list of field names (e.g. "BlogId") to 991 // unconditionally include in API requests. By default, fields with 992 // empty values are omitted from API requests. However, any non-pointer, 993 // non-interface field appearing in ForceSendFields will be sent to the 994 // server regardless of whether the field is empty or not. This may be 995 // used to include empty fields in Patch requests. 996 ForceSendFields []string `json:"-"` 997 998 // NullFields is a list of field names (e.g. "BlogId") to include in API 999 // requests with the JSON null value. By default, fields with empty 1000 // values are omitted from API requests. However, any field with an 1001 // empty value appearing in NullFields will be sent to the server as 1002 // null. It is an error if a field in this list has a non-empty value. 1003 // This may be used to include null fields in Patch requests. 1004 NullFields []string `json:"-"` 1005} 1006 1007func (s *Pageviews) MarshalJSON() ([]byte, error) { 1008 type NoMethod Pageviews 1009 raw := NoMethod(*s) 1010 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1011} 1012 1013type PageviewsCounts struct { 1014 // Count: Count of page views for the given time range 1015 Count int64 `json:"count,omitempty,string"` 1016 1017 // TimeRange: Time range the given count applies to 1018 TimeRange string `json:"timeRange,omitempty"` 1019 1020 // ForceSendFields is a list of field names (e.g. "Count") to 1021 // unconditionally include in API requests. By default, fields with 1022 // empty values are omitted from API requests. However, any non-pointer, 1023 // non-interface field appearing in ForceSendFields will be sent to the 1024 // server regardless of whether the field is empty or not. This may be 1025 // used to include empty fields in Patch requests. 1026 ForceSendFields []string `json:"-"` 1027 1028 // NullFields is a list of field names (e.g. "Count") to include in API 1029 // requests with the JSON null value. By default, fields with empty 1030 // values are omitted from API requests. However, any field with an 1031 // empty value appearing in NullFields will be sent to the server as 1032 // null. It is an error if a field in this list has a non-empty value. 1033 // This may be used to include null fields in Patch requests. 1034 NullFields []string `json:"-"` 1035} 1036 1037func (s *PageviewsCounts) MarshalJSON() ([]byte, error) { 1038 type NoMethod PageviewsCounts 1039 raw := NoMethod(*s) 1040 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1041} 1042 1043type Post struct { 1044 // Author: The author of this Post. 1045 Author *PostAuthor `json:"author,omitempty"` 1046 1047 // Blog: Data about the blog containing this Post. 1048 Blog *PostBlog `json:"blog,omitempty"` 1049 1050 // Content: The content of the Post. May contain HTML markup. 1051 Content string `json:"content,omitempty"` 1052 1053 // CustomMetaData: The JSON meta-data for the Post. 1054 CustomMetaData string `json:"customMetaData,omitempty"` 1055 1056 // Etag: Etag of the resource. 1057 Etag string `json:"etag,omitempty"` 1058 1059 // Id: The identifier of this Post. 1060 Id string `json:"id,omitempty"` 1061 1062 // Images: Display image for the Post. 1063 Images []*PostImages `json:"images,omitempty"` 1064 1065 // Kind: The kind of this entity. Always blogger#post 1066 Kind string `json:"kind,omitempty"` 1067 1068 // Labels: The list of labels this Post was tagged with. 1069 Labels []string `json:"labels,omitempty"` 1070 1071 // Location: The location for geotagged posts. 1072 Location *PostLocation `json:"location,omitempty"` 1073 1074 // Published: RFC 3339 date-time when this Post was published. 1075 Published string `json:"published,omitempty"` 1076 1077 // ReaderComments: Comment control and display setting for readers of 1078 // this post. 1079 ReaderComments string `json:"readerComments,omitempty"` 1080 1081 // Replies: The container of comments on this Post. 1082 Replies *PostReplies `json:"replies,omitempty"` 1083 1084 // SelfLink: The API REST URL to fetch this resource from. 1085 SelfLink string `json:"selfLink,omitempty"` 1086 1087 // Status: Status of the post. Only set for admin-level requests 1088 Status string `json:"status,omitempty"` 1089 1090 // Title: The title of the Post. 1091 Title string `json:"title,omitempty"` 1092 1093 // TitleLink: The title link URL, similar to atom's related link. 1094 TitleLink string `json:"titleLink,omitempty"` 1095 1096 // Updated: RFC 3339 date-time when this Post was last updated. 1097 Updated string `json:"updated,omitempty"` 1098 1099 // Url: The URL where this Post is displayed. 1100 Url string `json:"url,omitempty"` 1101 1102 // ServerResponse contains the HTTP response code and headers from the 1103 // server. 1104 googleapi.ServerResponse `json:"-"` 1105 1106 // ForceSendFields is a list of field names (e.g. "Author") to 1107 // unconditionally include in API requests. By default, fields with 1108 // empty values are omitted from API requests. However, any non-pointer, 1109 // non-interface field appearing in ForceSendFields will be sent to the 1110 // server regardless of whether the field is empty or not. This may be 1111 // used to include empty fields in Patch requests. 1112 ForceSendFields []string `json:"-"` 1113 1114 // NullFields is a list of field names (e.g. "Author") to include in API 1115 // requests with the JSON null value. By default, fields with empty 1116 // values are omitted from API requests. However, any field with an 1117 // empty value appearing in NullFields will be sent to the server as 1118 // null. It is an error if a field in this list has a non-empty value. 1119 // This may be used to include null fields in Patch requests. 1120 NullFields []string `json:"-"` 1121} 1122 1123func (s *Post) MarshalJSON() ([]byte, error) { 1124 type NoMethod Post 1125 raw := NoMethod(*s) 1126 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1127} 1128 1129// PostAuthor: The author of this Post. 1130type PostAuthor struct { 1131 // DisplayName: The display name. 1132 DisplayName string `json:"displayName,omitempty"` 1133 1134 // Id: The identifier of the Post creator. 1135 Id string `json:"id,omitempty"` 1136 1137 // Image: The Post author's avatar. 1138 Image *PostAuthorImage `json:"image,omitempty"` 1139 1140 // Url: The URL of the Post creator's Profile page. 1141 Url string `json:"url,omitempty"` 1142 1143 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1144 // unconditionally include in API requests. By default, fields with 1145 // empty values are omitted from API requests. However, any non-pointer, 1146 // non-interface field appearing in ForceSendFields will be sent to the 1147 // server regardless of whether the field is empty or not. This may be 1148 // used to include empty fields in Patch requests. 1149 ForceSendFields []string `json:"-"` 1150 1151 // NullFields is a list of field names (e.g. "DisplayName") to include 1152 // in API requests with the JSON null value. By default, fields with 1153 // empty values are omitted from API requests. However, any field with 1154 // an empty value appearing in NullFields will be sent to the server as 1155 // null. It is an error if a field in this list has a non-empty value. 1156 // This may be used to include null fields in Patch requests. 1157 NullFields []string `json:"-"` 1158} 1159 1160func (s *PostAuthor) MarshalJSON() ([]byte, error) { 1161 type NoMethod PostAuthor 1162 raw := NoMethod(*s) 1163 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1164} 1165 1166// PostAuthorImage: The Post author's avatar. 1167type PostAuthorImage struct { 1168 // Url: The Post author's avatar URL. 1169 Url string `json:"url,omitempty"` 1170 1171 // ForceSendFields is a list of field names (e.g. "Url") to 1172 // unconditionally include in API requests. By default, fields with 1173 // empty values are omitted from API requests. However, any non-pointer, 1174 // non-interface field appearing in ForceSendFields will be sent to the 1175 // server regardless of whether the field is empty or not. This may be 1176 // used to include empty fields in Patch requests. 1177 ForceSendFields []string `json:"-"` 1178 1179 // NullFields is a list of field names (e.g. "Url") to include in API 1180 // requests with the JSON null value. By default, fields with empty 1181 // values are omitted from API requests. However, any field with an 1182 // empty value appearing in NullFields will be sent to the server as 1183 // null. It is an error if a field in this list has a non-empty value. 1184 // This may be used to include null fields in Patch requests. 1185 NullFields []string `json:"-"` 1186} 1187 1188func (s *PostAuthorImage) MarshalJSON() ([]byte, error) { 1189 type NoMethod PostAuthorImage 1190 raw := NoMethod(*s) 1191 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1192} 1193 1194// PostBlog: Data about the blog containing this Post. 1195type PostBlog struct { 1196 // Id: The identifier of the Blog that contains this Post. 1197 Id string `json:"id,omitempty"` 1198 1199 // ForceSendFields is a list of field names (e.g. "Id") to 1200 // unconditionally include in API requests. By default, fields with 1201 // empty values are omitted from API requests. However, any non-pointer, 1202 // non-interface field appearing in ForceSendFields will be sent to the 1203 // server regardless of whether the field is empty or not. This may be 1204 // used to include empty fields in Patch requests. 1205 ForceSendFields []string `json:"-"` 1206 1207 // NullFields is a list of field names (e.g. "Id") to include in API 1208 // requests with the JSON null value. By default, fields with empty 1209 // values are omitted from API requests. However, any field with an 1210 // empty value appearing in NullFields will be sent to the server as 1211 // null. It is an error if a field in this list has a non-empty value. 1212 // This may be used to include null fields in Patch requests. 1213 NullFields []string `json:"-"` 1214} 1215 1216func (s *PostBlog) MarshalJSON() ([]byte, error) { 1217 type NoMethod PostBlog 1218 raw := NoMethod(*s) 1219 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1220} 1221 1222type PostImages struct { 1223 Url string `json:"url,omitempty"` 1224 1225 // ForceSendFields is a list of field names (e.g. "Url") to 1226 // unconditionally include in API requests. By default, fields with 1227 // empty values are omitted from API requests. However, any non-pointer, 1228 // non-interface field appearing in ForceSendFields will be sent to the 1229 // server regardless of whether the field is empty or not. This may be 1230 // used to include empty fields in Patch requests. 1231 ForceSendFields []string `json:"-"` 1232 1233 // NullFields is a list of field names (e.g. "Url") to include in API 1234 // requests with the JSON null value. By default, fields with empty 1235 // values are omitted from API requests. However, any field with an 1236 // empty value appearing in NullFields will be sent to the server as 1237 // null. It is an error if a field in this list has a non-empty value. 1238 // This may be used to include null fields in Patch requests. 1239 NullFields []string `json:"-"` 1240} 1241 1242func (s *PostImages) MarshalJSON() ([]byte, error) { 1243 type NoMethod PostImages 1244 raw := NoMethod(*s) 1245 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1246} 1247 1248// PostLocation: The location for geotagged posts. 1249type PostLocation struct { 1250 // Lat: Location's latitude. 1251 Lat float64 `json:"lat,omitempty"` 1252 1253 // Lng: Location's longitude. 1254 Lng float64 `json:"lng,omitempty"` 1255 1256 // Name: Location name. 1257 Name string `json:"name,omitempty"` 1258 1259 // Span: Location's viewport span. Can be used when rendering a map 1260 // preview. 1261 Span string `json:"span,omitempty"` 1262 1263 // ForceSendFields is a list of field names (e.g. "Lat") to 1264 // unconditionally include in API requests. By default, fields with 1265 // empty values are omitted from API requests. However, any non-pointer, 1266 // non-interface field appearing in ForceSendFields will be sent to the 1267 // server regardless of whether the field is empty or not. This may be 1268 // used to include empty fields in Patch requests. 1269 ForceSendFields []string `json:"-"` 1270 1271 // NullFields is a list of field names (e.g. "Lat") to include in API 1272 // requests with the JSON null value. By default, fields with empty 1273 // values are omitted from API requests. However, any field with an 1274 // empty value appearing in NullFields will be sent to the server as 1275 // null. It is an error if a field in this list has a non-empty value. 1276 // This may be used to include null fields in Patch requests. 1277 NullFields []string `json:"-"` 1278} 1279 1280func (s *PostLocation) MarshalJSON() ([]byte, error) { 1281 type NoMethod PostLocation 1282 raw := NoMethod(*s) 1283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1284} 1285 1286func (s *PostLocation) UnmarshalJSON(data []byte) error { 1287 type NoMethod PostLocation 1288 var s1 struct { 1289 Lat gensupport.JSONFloat64 `json:"lat"` 1290 Lng gensupport.JSONFloat64 `json:"lng"` 1291 *NoMethod 1292 } 1293 s1.NoMethod = (*NoMethod)(s) 1294 if err := json.Unmarshal(data, &s1); err != nil { 1295 return err 1296 } 1297 s.Lat = float64(s1.Lat) 1298 s.Lng = float64(s1.Lng) 1299 return nil 1300} 1301 1302// PostReplies: The container of comments on this Post. 1303type PostReplies struct { 1304 // Items: The List of Comments for this Post. 1305 Items []*Comment `json:"items,omitempty"` 1306 1307 // SelfLink: The URL of the comments on this post. 1308 SelfLink string `json:"selfLink,omitempty"` 1309 1310 // TotalItems: The count of comments on this post. 1311 TotalItems int64 `json:"totalItems,omitempty,string"` 1312 1313 // ForceSendFields is a list of field names (e.g. "Items") to 1314 // unconditionally include in API requests. By default, fields with 1315 // empty values are omitted from API requests. However, any non-pointer, 1316 // non-interface field appearing in ForceSendFields will be sent to the 1317 // server regardless of whether the field is empty or not. This may be 1318 // used to include empty fields in Patch requests. 1319 ForceSendFields []string `json:"-"` 1320 1321 // NullFields is a list of field names (e.g. "Items") to include in API 1322 // requests with the JSON null value. By default, fields with empty 1323 // values are omitted from API requests. However, any field with an 1324 // empty value appearing in NullFields will be sent to the server as 1325 // null. It is an error if a field in this list has a non-empty value. 1326 // This may be used to include null fields in Patch requests. 1327 NullFields []string `json:"-"` 1328} 1329 1330func (s *PostReplies) MarshalJSON() ([]byte, error) { 1331 type NoMethod PostReplies 1332 raw := NoMethod(*s) 1333 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1334} 1335 1336type PostList struct { 1337 // Etag: Etag of the response. 1338 Etag string `json:"etag,omitempty"` 1339 1340 // Items: The list of Posts for this Blog. 1341 Items []*Post `json:"items,omitempty"` 1342 1343 // Kind: The kind of this entity. Always blogger#postList 1344 Kind string `json:"kind,omitempty"` 1345 1346 // NextPageToken: Pagination token to fetch the next page, if one 1347 // exists. 1348 NextPageToken string `json:"nextPageToken,omitempty"` 1349 1350 // ServerResponse contains the HTTP response code and headers from the 1351 // server. 1352 googleapi.ServerResponse `json:"-"` 1353 1354 // ForceSendFields is a list of field names (e.g. "Etag") to 1355 // unconditionally include in API requests. By default, fields with 1356 // empty values are omitted from API requests. However, any non-pointer, 1357 // non-interface field appearing in ForceSendFields will be sent to the 1358 // server regardless of whether the field is empty or not. This may be 1359 // used to include empty fields in Patch requests. 1360 ForceSendFields []string `json:"-"` 1361 1362 // NullFields is a list of field names (e.g. "Etag") to include in API 1363 // requests with the JSON null value. By default, fields with empty 1364 // values are omitted from API requests. However, any field with an 1365 // empty value appearing in NullFields will be sent to the server as 1366 // null. It is an error if a field in this list has a non-empty value. 1367 // This may be used to include null fields in Patch requests. 1368 NullFields []string `json:"-"` 1369} 1370 1371func (s *PostList) MarshalJSON() ([]byte, error) { 1372 type NoMethod PostList 1373 raw := NoMethod(*s) 1374 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1375} 1376 1377type PostPerUserInfo struct { 1378 // BlogId: ID of the Blog that the post resource belongs to. 1379 BlogId string `json:"blogId,omitempty"` 1380 1381 // HasEditAccess: True if the user has Author level access to the post. 1382 HasEditAccess bool `json:"hasEditAccess,omitempty"` 1383 1384 // Kind: The kind of this entity. Always blogger#postPerUserInfo 1385 Kind string `json:"kind,omitempty"` 1386 1387 // PostId: ID of the Post resource. 1388 PostId string `json:"postId,omitempty"` 1389 1390 // UserId: ID of the User. 1391 UserId string `json:"userId,omitempty"` 1392 1393 // ForceSendFields is a list of field names (e.g. "BlogId") to 1394 // unconditionally include in API requests. By default, fields with 1395 // empty values are omitted from API requests. However, any non-pointer, 1396 // non-interface field appearing in ForceSendFields will be sent to the 1397 // server regardless of whether the field is empty or not. This may be 1398 // used to include empty fields in Patch requests. 1399 ForceSendFields []string `json:"-"` 1400 1401 // NullFields is a list of field names (e.g. "BlogId") to include in API 1402 // requests with the JSON null value. By default, fields with empty 1403 // values are omitted from API requests. However, any field with an 1404 // empty value appearing in NullFields will be sent to the server as 1405 // null. It is an error if a field in this list has a non-empty value. 1406 // This may be used to include null fields in Patch requests. 1407 NullFields []string `json:"-"` 1408} 1409 1410func (s *PostPerUserInfo) MarshalJSON() ([]byte, error) { 1411 type NoMethod PostPerUserInfo 1412 raw := NoMethod(*s) 1413 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1414} 1415 1416type PostUserInfo struct { 1417 // Kind: The kind of this entity. Always blogger#postUserInfo 1418 Kind string `json:"kind,omitempty"` 1419 1420 // Post: The Post resource. 1421 Post *Post `json:"post,omitempty"` 1422 1423 // PostUserInfo: Information about a User for the Post. 1424 PostUserInfo *PostPerUserInfo `json:"post_user_info,omitempty"` 1425 1426 // ServerResponse contains the HTTP response code and headers from the 1427 // server. 1428 googleapi.ServerResponse `json:"-"` 1429 1430 // ForceSendFields is a list of field names (e.g. "Kind") to 1431 // unconditionally include in API requests. By default, fields with 1432 // empty values are omitted from API requests. However, any non-pointer, 1433 // non-interface field appearing in ForceSendFields will be sent to the 1434 // server regardless of whether the field is empty or not. This may be 1435 // used to include empty fields in Patch requests. 1436 ForceSendFields []string `json:"-"` 1437 1438 // NullFields is a list of field names (e.g. "Kind") to include in API 1439 // requests with the JSON null value. By default, fields with empty 1440 // values are omitted from API requests. However, any field with an 1441 // empty value appearing in NullFields will be sent to the server as 1442 // null. It is an error if a field in this list has a non-empty value. 1443 // This may be used to include null fields in Patch requests. 1444 NullFields []string `json:"-"` 1445} 1446 1447func (s *PostUserInfo) MarshalJSON() ([]byte, error) { 1448 type NoMethod PostUserInfo 1449 raw := NoMethod(*s) 1450 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1451} 1452 1453type PostUserInfosList struct { 1454 // Items: The list of Posts with User information for the post, for this 1455 // Blog. 1456 Items []*PostUserInfo `json:"items,omitempty"` 1457 1458 // Kind: The kind of this entity. Always blogger#postList 1459 Kind string `json:"kind,omitempty"` 1460 1461 // NextPageToken: Pagination token to fetch the next page, if one 1462 // exists. 1463 NextPageToken string `json:"nextPageToken,omitempty"` 1464 1465 // ServerResponse contains the HTTP response code and headers from the 1466 // server. 1467 googleapi.ServerResponse `json:"-"` 1468 1469 // ForceSendFields is a list of field names (e.g. "Items") to 1470 // unconditionally include in API requests. By default, fields with 1471 // empty values are omitted from API requests. However, any non-pointer, 1472 // non-interface field appearing in ForceSendFields will be sent to the 1473 // server regardless of whether the field is empty or not. This may be 1474 // used to include empty fields in Patch requests. 1475 ForceSendFields []string `json:"-"` 1476 1477 // NullFields is a list of field names (e.g. "Items") to include in API 1478 // requests with the JSON null value. By default, fields with empty 1479 // values are omitted from API requests. However, any field with an 1480 // empty value appearing in NullFields will be sent to the server as 1481 // null. It is an error if a field in this list has a non-empty value. 1482 // This may be used to include null fields in Patch requests. 1483 NullFields []string `json:"-"` 1484} 1485 1486func (s *PostUserInfosList) MarshalJSON() ([]byte, error) { 1487 type NoMethod PostUserInfosList 1488 raw := NoMethod(*s) 1489 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1490} 1491 1492type User struct { 1493 // About: Profile summary information. 1494 About string `json:"about,omitempty"` 1495 1496 // Blogs: The container of blogs for this user. 1497 Blogs *UserBlogs `json:"blogs,omitempty"` 1498 1499 // Created: The timestamp of when this profile was created, in seconds 1500 // since epoch. 1501 Created string `json:"created,omitempty"` 1502 1503 // DisplayName: The display name. 1504 DisplayName string `json:"displayName,omitempty"` 1505 1506 // Id: The identifier for this User. 1507 Id string `json:"id,omitempty"` 1508 1509 // Kind: The kind of this entity. Always blogger#user 1510 Kind string `json:"kind,omitempty"` 1511 1512 // Locale: This user's locale 1513 Locale *UserLocale `json:"locale,omitempty"` 1514 1515 // SelfLink: The API REST URL to fetch this resource from. 1516 SelfLink string `json:"selfLink,omitempty"` 1517 1518 // Url: The user's profile page. 1519 Url string `json:"url,omitempty"` 1520 1521 // ServerResponse contains the HTTP response code and headers from the 1522 // server. 1523 googleapi.ServerResponse `json:"-"` 1524 1525 // ForceSendFields is a list of field names (e.g. "About") to 1526 // unconditionally include in API requests. By default, fields with 1527 // empty values are omitted from API requests. However, any non-pointer, 1528 // non-interface field appearing in ForceSendFields will be sent to the 1529 // server regardless of whether the field is empty or not. This may be 1530 // used to include empty fields in Patch requests. 1531 ForceSendFields []string `json:"-"` 1532 1533 // NullFields is a list of field names (e.g. "About") to include in API 1534 // requests with the JSON null value. By default, fields with empty 1535 // values are omitted from API requests. However, any field with an 1536 // empty value appearing in NullFields will be sent to the server as 1537 // null. It is an error if a field in this list has a non-empty value. 1538 // This may be used to include null fields in Patch requests. 1539 NullFields []string `json:"-"` 1540} 1541 1542func (s *User) MarshalJSON() ([]byte, error) { 1543 type NoMethod User 1544 raw := NoMethod(*s) 1545 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1546} 1547 1548// UserBlogs: The container of blogs for this user. 1549type UserBlogs struct { 1550 // SelfLink: The URL of the Blogs for this user. 1551 SelfLink string `json:"selfLink,omitempty"` 1552 1553 // ForceSendFields is a list of field names (e.g. "SelfLink") to 1554 // unconditionally include in API requests. By default, fields with 1555 // empty values are omitted from API requests. However, any non-pointer, 1556 // non-interface field appearing in ForceSendFields will be sent to the 1557 // server regardless of whether the field is empty or not. This may be 1558 // used to include empty fields in Patch requests. 1559 ForceSendFields []string `json:"-"` 1560 1561 // NullFields is a list of field names (e.g. "SelfLink") to include in 1562 // API requests with the JSON null value. By default, fields with empty 1563 // values are omitted from API requests. However, any field with an 1564 // empty value appearing in NullFields will be sent to the server as 1565 // null. It is an error if a field in this list has a non-empty value. 1566 // This may be used to include null fields in Patch requests. 1567 NullFields []string `json:"-"` 1568} 1569 1570func (s *UserBlogs) MarshalJSON() ([]byte, error) { 1571 type NoMethod UserBlogs 1572 raw := NoMethod(*s) 1573 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1574} 1575 1576// UserLocale: This user's locale 1577type UserLocale struct { 1578 // Country: The user's country setting. 1579 Country string `json:"country,omitempty"` 1580 1581 // Language: The user's language setting. 1582 Language string `json:"language,omitempty"` 1583 1584 // Variant: The user's language variant setting. 1585 Variant string `json:"variant,omitempty"` 1586 1587 // ForceSendFields is a list of field names (e.g. "Country") to 1588 // unconditionally include in API requests. By default, fields with 1589 // empty values are omitted from API requests. However, any non-pointer, 1590 // non-interface field appearing in ForceSendFields will be sent to the 1591 // server regardless of whether the field is empty or not. This may be 1592 // used to include empty fields in Patch requests. 1593 ForceSendFields []string `json:"-"` 1594 1595 // NullFields is a list of field names (e.g. "Country") to include in 1596 // API requests with the JSON null value. By default, fields with empty 1597 // values are omitted from API requests. However, any field with an 1598 // empty value appearing in NullFields will be sent to the server as 1599 // null. It is an error if a field in this list has a non-empty value. 1600 // This may be used to include null fields in Patch requests. 1601 NullFields []string `json:"-"` 1602} 1603 1604func (s *UserLocale) MarshalJSON() ([]byte, error) { 1605 type NoMethod UserLocale 1606 raw := NoMethod(*s) 1607 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1608} 1609 1610// method id "blogger.blogUserInfos.get": 1611 1612type BlogUserInfosGetCall struct { 1613 s *Service 1614 userId string 1615 blogId string 1616 urlParams_ gensupport.URLParams 1617 ifNoneMatch_ string 1618 ctx_ context.Context 1619 header_ http.Header 1620} 1621 1622// Get: Gets one blog and user info pair by blogId and userId. 1623func (r *BlogUserInfosService) Get(userId string, blogId string) *BlogUserInfosGetCall { 1624 c := &BlogUserInfosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1625 c.userId = userId 1626 c.blogId = blogId 1627 return c 1628} 1629 1630// MaxPosts sets the optional parameter "maxPosts": Maximum number of 1631// posts to pull back with the blog. 1632func (c *BlogUserInfosGetCall) MaxPosts(maxPosts int64) *BlogUserInfosGetCall { 1633 c.urlParams_.Set("maxPosts", fmt.Sprint(maxPosts)) 1634 return c 1635} 1636 1637// Fields allows partial responses to be retrieved. See 1638// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1639// for more information. 1640func (c *BlogUserInfosGetCall) Fields(s ...googleapi.Field) *BlogUserInfosGetCall { 1641 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1642 return c 1643} 1644 1645// IfNoneMatch sets the optional parameter which makes the operation 1646// fail if the object's ETag matches the given value. This is useful for 1647// getting updates only after the object has changed since the last 1648// request. Use googleapi.IsNotModified to check whether the response 1649// error from Do is the result of In-None-Match. 1650func (c *BlogUserInfosGetCall) IfNoneMatch(entityTag string) *BlogUserInfosGetCall { 1651 c.ifNoneMatch_ = entityTag 1652 return c 1653} 1654 1655// Context sets the context to be used in this call's Do method. Any 1656// pending HTTP request will be aborted if the provided context is 1657// canceled. 1658func (c *BlogUserInfosGetCall) Context(ctx context.Context) *BlogUserInfosGetCall { 1659 c.ctx_ = ctx 1660 return c 1661} 1662 1663// Header returns an http.Header that can be modified by the caller to 1664// add HTTP headers to the request. 1665func (c *BlogUserInfosGetCall) Header() http.Header { 1666 if c.header_ == nil { 1667 c.header_ = make(http.Header) 1668 } 1669 return c.header_ 1670} 1671 1672func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) { 1673 reqHeaders := make(http.Header) 1674 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 1675 for k, v := range c.header_ { 1676 reqHeaders[k] = v 1677 } 1678 reqHeaders.Set("User-Agent", c.s.userAgent()) 1679 if c.ifNoneMatch_ != "" { 1680 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1681 } 1682 var body io.Reader = nil 1683 c.urlParams_.Set("alt", alt) 1684 c.urlParams_.Set("prettyPrint", "false") 1685 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") 1686 urls += "?" + c.urlParams_.Encode() 1687 req, err := http.NewRequest("GET", urls, body) 1688 if err != nil { 1689 return nil, err 1690 } 1691 req.Header = reqHeaders 1692 googleapi.Expand(req.URL, map[string]string{ 1693 "userId": c.userId, 1694 "blogId": c.blogId, 1695 }) 1696 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1697} 1698 1699// Do executes the "blogger.blogUserInfos.get" call. 1700// Exactly one of *BlogUserInfo or error will be non-nil. Any non-2xx 1701// status code is an error. Response headers are in either 1702// *BlogUserInfo.ServerResponse.Header or (if a response was returned at 1703// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1704// to check whether the returned error was because 1705// http.StatusNotModified was returned. 1706func (c *BlogUserInfosGetCall) Do(opts ...googleapi.CallOption) (*BlogUserInfo, error) { 1707 gensupport.SetOptions(c.urlParams_, opts...) 1708 res, err := c.doRequest("json") 1709 if res != nil && res.StatusCode == http.StatusNotModified { 1710 if res.Body != nil { 1711 res.Body.Close() 1712 } 1713 return nil, &googleapi.Error{ 1714 Code: res.StatusCode, 1715 Header: res.Header, 1716 } 1717 } 1718 if err != nil { 1719 return nil, err 1720 } 1721 defer googleapi.CloseBody(res) 1722 if err := googleapi.CheckResponse(res); err != nil { 1723 return nil, err 1724 } 1725 ret := &BlogUserInfo{ 1726 ServerResponse: googleapi.ServerResponse{ 1727 Header: res.Header, 1728 HTTPStatusCode: res.StatusCode, 1729 }, 1730 } 1731 target := &ret 1732 if err := gensupport.DecodeResponse(target, res); err != nil { 1733 return nil, err 1734 } 1735 return ret, nil 1736 // { 1737 // "description": "Gets one blog and user info pair by blogId and userId.", 1738 // "httpMethod": "GET", 1739 // "id": "blogger.blogUserInfos.get", 1740 // "parameterOrder": [ 1741 // "userId", 1742 // "blogId" 1743 // ], 1744 // "parameters": { 1745 // "blogId": { 1746 // "description": "The ID of the blog to get.", 1747 // "location": "path", 1748 // "required": true, 1749 // "type": "string" 1750 // }, 1751 // "maxPosts": { 1752 // "description": "Maximum number of posts to pull back with the blog.", 1753 // "format": "uint32", 1754 // "location": "query", 1755 // "type": "integer" 1756 // }, 1757 // "userId": { 1758 // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' or the user's profile identifier.", 1759 // "location": "path", 1760 // "required": true, 1761 // "type": "string" 1762 // } 1763 // }, 1764 // "path": "users/{userId}/blogs/{blogId}", 1765 // "response": { 1766 // "$ref": "BlogUserInfo" 1767 // }, 1768 // "scopes": [ 1769 // "https://www.googleapis.com/auth/blogger", 1770 // "https://www.googleapis.com/auth/blogger.readonly" 1771 // ] 1772 // } 1773 1774} 1775 1776// method id "blogger.blogs.get": 1777 1778type BlogsGetCall struct { 1779 s *Service 1780 blogId string 1781 urlParams_ gensupport.URLParams 1782 ifNoneMatch_ string 1783 ctx_ context.Context 1784 header_ http.Header 1785} 1786 1787// Get: Gets one blog by ID. 1788func (r *BlogsService) Get(blogId string) *BlogsGetCall { 1789 c := &BlogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1790 c.blogId = blogId 1791 return c 1792} 1793 1794// MaxPosts sets the optional parameter "maxPosts": Maximum number of 1795// posts to pull back with the blog. 1796func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall { 1797 c.urlParams_.Set("maxPosts", fmt.Sprint(maxPosts)) 1798 return c 1799} 1800 1801// View sets the optional parameter "view": Access level with which to 1802// view the blog. Note that some fields require elevated access. 1803// 1804// Possible values: 1805// "ADMIN" - Admin level detail. 1806// "AUTHOR" - Author level detail. 1807// "READER" - Reader level detail. 1808func (c *BlogsGetCall) View(view string) *BlogsGetCall { 1809 c.urlParams_.Set("view", view) 1810 return c 1811} 1812 1813// Fields allows partial responses to be retrieved. See 1814// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1815// for more information. 1816func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { 1817 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1818 return c 1819} 1820 1821// IfNoneMatch sets the optional parameter which makes the operation 1822// fail if the object's ETag matches the given value. This is useful for 1823// getting updates only after the object has changed since the last 1824// request. Use googleapi.IsNotModified to check whether the response 1825// error from Do is the result of In-None-Match. 1826func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { 1827 c.ifNoneMatch_ = entityTag 1828 return c 1829} 1830 1831// Context sets the context to be used in this call's Do method. Any 1832// pending HTTP request will be aborted if the provided context is 1833// canceled. 1834func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { 1835 c.ctx_ = ctx 1836 return c 1837} 1838 1839// Header returns an http.Header that can be modified by the caller to 1840// add HTTP headers to the request. 1841func (c *BlogsGetCall) Header() http.Header { 1842 if c.header_ == nil { 1843 c.header_ = make(http.Header) 1844 } 1845 return c.header_ 1846} 1847 1848func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { 1849 reqHeaders := make(http.Header) 1850 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 1851 for k, v := range c.header_ { 1852 reqHeaders[k] = v 1853 } 1854 reqHeaders.Set("User-Agent", c.s.userAgent()) 1855 if c.ifNoneMatch_ != "" { 1856 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1857 } 1858 var body io.Reader = nil 1859 c.urlParams_.Set("alt", alt) 1860 c.urlParams_.Set("prettyPrint", "false") 1861 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") 1862 urls += "?" + c.urlParams_.Encode() 1863 req, err := http.NewRequest("GET", urls, body) 1864 if err != nil { 1865 return nil, err 1866 } 1867 req.Header = reqHeaders 1868 googleapi.Expand(req.URL, map[string]string{ 1869 "blogId": c.blogId, 1870 }) 1871 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1872} 1873 1874// Do executes the "blogger.blogs.get" call. 1875// Exactly one of *Blog or error will be non-nil. Any non-2xx status 1876// code is an error. Response headers are in either 1877// *Blog.ServerResponse.Header or (if a response was returned at all) in 1878// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1879// whether the returned error was because http.StatusNotModified was 1880// returned. 1881func (c *BlogsGetCall) Do(opts ...googleapi.CallOption) (*Blog, error) { 1882 gensupport.SetOptions(c.urlParams_, opts...) 1883 res, err := c.doRequest("json") 1884 if res != nil && res.StatusCode == http.StatusNotModified { 1885 if res.Body != nil { 1886 res.Body.Close() 1887 } 1888 return nil, &googleapi.Error{ 1889 Code: res.StatusCode, 1890 Header: res.Header, 1891 } 1892 } 1893 if err != nil { 1894 return nil, err 1895 } 1896 defer googleapi.CloseBody(res) 1897 if err := googleapi.CheckResponse(res); err != nil { 1898 return nil, err 1899 } 1900 ret := &Blog{ 1901 ServerResponse: googleapi.ServerResponse{ 1902 Header: res.Header, 1903 HTTPStatusCode: res.StatusCode, 1904 }, 1905 } 1906 target := &ret 1907 if err := gensupport.DecodeResponse(target, res); err != nil { 1908 return nil, err 1909 } 1910 return ret, nil 1911 // { 1912 // "description": "Gets one blog by ID.", 1913 // "httpMethod": "GET", 1914 // "id": "blogger.blogs.get", 1915 // "parameterOrder": [ 1916 // "blogId" 1917 // ], 1918 // "parameters": { 1919 // "blogId": { 1920 // "description": "The ID of the blog to get.", 1921 // "location": "path", 1922 // "required": true, 1923 // "type": "string" 1924 // }, 1925 // "maxPosts": { 1926 // "description": "Maximum number of posts to pull back with the blog.", 1927 // "format": "uint32", 1928 // "location": "query", 1929 // "type": "integer" 1930 // }, 1931 // "view": { 1932 // "description": "Access level with which to view the blog. Note that some fields require elevated access.", 1933 // "enum": [ 1934 // "ADMIN", 1935 // "AUTHOR", 1936 // "READER" 1937 // ], 1938 // "enumDescriptions": [ 1939 // "Admin level detail.", 1940 // "Author level detail.", 1941 // "Reader level detail." 1942 // ], 1943 // "location": "query", 1944 // "type": "string" 1945 // } 1946 // }, 1947 // "path": "blogs/{blogId}", 1948 // "response": { 1949 // "$ref": "Blog" 1950 // }, 1951 // "scopes": [ 1952 // "https://www.googleapis.com/auth/blogger", 1953 // "https://www.googleapis.com/auth/blogger.readonly" 1954 // ] 1955 // } 1956 1957} 1958 1959// method id "blogger.blogs.getByUrl": 1960 1961type BlogsGetByUrlCall struct { 1962 s *Service 1963 urlParams_ gensupport.URLParams 1964 ifNoneMatch_ string 1965 ctx_ context.Context 1966 header_ http.Header 1967} 1968 1969// GetByUrl: Retrieve a Blog by URL. 1970func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall { 1971 c := &BlogsGetByUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1972 c.urlParams_.Set("url", url) 1973 return c 1974} 1975 1976// View sets the optional parameter "view": Access level with which to 1977// view the blog. Note that some fields require elevated access. 1978// 1979// Possible values: 1980// "ADMIN" - Admin level detail. 1981// "AUTHOR" - Author level detail. 1982// "READER" - Reader level detail. 1983func (c *BlogsGetByUrlCall) View(view string) *BlogsGetByUrlCall { 1984 c.urlParams_.Set("view", view) 1985 return c 1986} 1987 1988// Fields allows partial responses to be retrieved. See 1989// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1990// for more information. 1991func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall { 1992 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1993 return c 1994} 1995 1996// IfNoneMatch sets the optional parameter which makes the operation 1997// fail if the object's ETag matches the given value. This is useful for 1998// getting updates only after the object has changed since the last 1999// request. Use googleapi.IsNotModified to check whether the response 2000// error from Do is the result of In-None-Match. 2001func (c *BlogsGetByUrlCall) IfNoneMatch(entityTag string) *BlogsGetByUrlCall { 2002 c.ifNoneMatch_ = entityTag 2003 return c 2004} 2005 2006// Context sets the context to be used in this call's Do method. Any 2007// pending HTTP request will be aborted if the provided context is 2008// canceled. 2009func (c *BlogsGetByUrlCall) Context(ctx context.Context) *BlogsGetByUrlCall { 2010 c.ctx_ = ctx 2011 return c 2012} 2013 2014// Header returns an http.Header that can be modified by the caller to 2015// add HTTP headers to the request. 2016func (c *BlogsGetByUrlCall) Header() http.Header { 2017 if c.header_ == nil { 2018 c.header_ = make(http.Header) 2019 } 2020 return c.header_ 2021} 2022 2023func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) { 2024 reqHeaders := make(http.Header) 2025 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 2026 for k, v := range c.header_ { 2027 reqHeaders[k] = v 2028 } 2029 reqHeaders.Set("User-Agent", c.s.userAgent()) 2030 if c.ifNoneMatch_ != "" { 2031 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2032 } 2033 var body io.Reader = nil 2034 c.urlParams_.Set("alt", alt) 2035 c.urlParams_.Set("prettyPrint", "false") 2036 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl") 2037 urls += "?" + c.urlParams_.Encode() 2038 req, err := http.NewRequest("GET", urls, body) 2039 if err != nil { 2040 return nil, err 2041 } 2042 req.Header = reqHeaders 2043 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2044} 2045 2046// Do executes the "blogger.blogs.getByUrl" call. 2047// Exactly one of *Blog or error will be non-nil. Any non-2xx status 2048// code is an error. Response headers are in either 2049// *Blog.ServerResponse.Header or (if a response was returned at all) in 2050// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2051// whether the returned error was because http.StatusNotModified was 2052// returned. 2053func (c *BlogsGetByUrlCall) Do(opts ...googleapi.CallOption) (*Blog, error) { 2054 gensupport.SetOptions(c.urlParams_, opts...) 2055 res, err := c.doRequest("json") 2056 if res != nil && res.StatusCode == http.StatusNotModified { 2057 if res.Body != nil { 2058 res.Body.Close() 2059 } 2060 return nil, &googleapi.Error{ 2061 Code: res.StatusCode, 2062 Header: res.Header, 2063 } 2064 } 2065 if err != nil { 2066 return nil, err 2067 } 2068 defer googleapi.CloseBody(res) 2069 if err := googleapi.CheckResponse(res); err != nil { 2070 return nil, err 2071 } 2072 ret := &Blog{ 2073 ServerResponse: googleapi.ServerResponse{ 2074 Header: res.Header, 2075 HTTPStatusCode: res.StatusCode, 2076 }, 2077 } 2078 target := &ret 2079 if err := gensupport.DecodeResponse(target, res); err != nil { 2080 return nil, err 2081 } 2082 return ret, nil 2083 // { 2084 // "description": "Retrieve a Blog by URL.", 2085 // "httpMethod": "GET", 2086 // "id": "blogger.blogs.getByUrl", 2087 // "parameterOrder": [ 2088 // "url" 2089 // ], 2090 // "parameters": { 2091 // "url": { 2092 // "description": "The URL of the blog to retrieve.", 2093 // "location": "query", 2094 // "required": true, 2095 // "type": "string" 2096 // }, 2097 // "view": { 2098 // "description": "Access level with which to view the blog. Note that some fields require elevated access.", 2099 // "enum": [ 2100 // "ADMIN", 2101 // "AUTHOR", 2102 // "READER" 2103 // ], 2104 // "enumDescriptions": [ 2105 // "Admin level detail.", 2106 // "Author level detail.", 2107 // "Reader level detail." 2108 // ], 2109 // "location": "query", 2110 // "type": "string" 2111 // } 2112 // }, 2113 // "path": "blogs/byurl", 2114 // "response": { 2115 // "$ref": "Blog" 2116 // }, 2117 // "scopes": [ 2118 // "https://www.googleapis.com/auth/blogger", 2119 // "https://www.googleapis.com/auth/blogger.readonly" 2120 // ] 2121 // } 2122 2123} 2124 2125// method id "blogger.blogs.listByUser": 2126 2127type BlogsListByUserCall struct { 2128 s *Service 2129 userId string 2130 urlParams_ gensupport.URLParams 2131 ifNoneMatch_ string 2132 ctx_ context.Context 2133 header_ http.Header 2134} 2135 2136// ListByUser: Retrieves a list of blogs, possibly filtered. 2137func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall { 2138 c := &BlogsListByUserCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2139 c.userId = userId 2140 return c 2141} 2142 2143// FetchUserInfo sets the optional parameter "fetchUserInfo": Whether 2144// the response is a list of blogs with per-user information instead of 2145// just blogs. 2146func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall { 2147 c.urlParams_.Set("fetchUserInfo", fmt.Sprint(fetchUserInfo)) 2148 return c 2149} 2150 2151// Role sets the optional parameter "role": User access types for blogs 2152// to include in the results, e.g. AUTHOR will return blogs where the 2153// user has author level access. If no roles are specified, defaults to 2154// ADMIN and AUTHOR roles. 2155// 2156// Possible values: 2157// "ADMIN" - Admin role - Blogs where the user has Admin level access. 2158// "AUTHOR" - Author role - Blogs where the user has Author level 2159// access. 2160// "READER" - Reader role - Blogs where the user has Reader level 2161// access (to a private blog). 2162func (c *BlogsListByUserCall) Role(role ...string) *BlogsListByUserCall { 2163 c.urlParams_.SetMulti("role", append([]string{}, role...)) 2164 return c 2165} 2166 2167// Status sets the optional parameter "status": Blog statuses to include 2168// in the result (default: Live blogs only). Note that ADMIN access is 2169// required to view deleted blogs. 2170// 2171// Possible values: 2172// "DELETED" - Blog has been deleted by an administrator. 2173// "LIVE" (default) - Blog is currently live. 2174func (c *BlogsListByUserCall) Status(status ...string) *BlogsListByUserCall { 2175 c.urlParams_.SetMulti("status", append([]string{}, status...)) 2176 return c 2177} 2178 2179// View sets the optional parameter "view": Access level with which to 2180// view the blogs. Note that some fields require elevated access. 2181// 2182// Possible values: 2183// "ADMIN" - Admin level detail. 2184// "AUTHOR" - Author level detail. 2185// "READER" - Reader level detail. 2186func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { 2187 c.urlParams_.Set("view", view) 2188 return c 2189} 2190 2191// Fields allows partial responses to be retrieved. See 2192// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2193// for more information. 2194func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall { 2195 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2196 return c 2197} 2198 2199// IfNoneMatch sets the optional parameter which makes the operation 2200// fail if the object's ETag matches the given value. This is useful for 2201// getting updates only after the object has changed since the last 2202// request. Use googleapi.IsNotModified to check whether the response 2203// error from Do is the result of In-None-Match. 2204func (c *BlogsListByUserCall) IfNoneMatch(entityTag string) *BlogsListByUserCall { 2205 c.ifNoneMatch_ = entityTag 2206 return c 2207} 2208 2209// Context sets the context to be used in this call's Do method. Any 2210// pending HTTP request will be aborted if the provided context is 2211// canceled. 2212func (c *BlogsListByUserCall) Context(ctx context.Context) *BlogsListByUserCall { 2213 c.ctx_ = ctx 2214 return c 2215} 2216 2217// Header returns an http.Header that can be modified by the caller to 2218// add HTTP headers to the request. 2219func (c *BlogsListByUserCall) Header() http.Header { 2220 if c.header_ == nil { 2221 c.header_ = make(http.Header) 2222 } 2223 return c.header_ 2224} 2225 2226func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) { 2227 reqHeaders := make(http.Header) 2228 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 2229 for k, v := range c.header_ { 2230 reqHeaders[k] = v 2231 } 2232 reqHeaders.Set("User-Agent", c.s.userAgent()) 2233 if c.ifNoneMatch_ != "" { 2234 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2235 } 2236 var body io.Reader = nil 2237 c.urlParams_.Set("alt", alt) 2238 c.urlParams_.Set("prettyPrint", "false") 2239 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") 2240 urls += "?" + c.urlParams_.Encode() 2241 req, err := http.NewRequest("GET", urls, body) 2242 if err != nil { 2243 return nil, err 2244 } 2245 req.Header = reqHeaders 2246 googleapi.Expand(req.URL, map[string]string{ 2247 "userId": c.userId, 2248 }) 2249 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2250} 2251 2252// Do executes the "blogger.blogs.listByUser" call. 2253// Exactly one of *BlogList or error will be non-nil. Any non-2xx status 2254// code is an error. Response headers are in either 2255// *BlogList.ServerResponse.Header or (if a response was returned at 2256// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2257// to check whether the returned error was because 2258// http.StatusNotModified was returned. 2259func (c *BlogsListByUserCall) Do(opts ...googleapi.CallOption) (*BlogList, error) { 2260 gensupport.SetOptions(c.urlParams_, opts...) 2261 res, err := c.doRequest("json") 2262 if res != nil && res.StatusCode == http.StatusNotModified { 2263 if res.Body != nil { 2264 res.Body.Close() 2265 } 2266 return nil, &googleapi.Error{ 2267 Code: res.StatusCode, 2268 Header: res.Header, 2269 } 2270 } 2271 if err != nil { 2272 return nil, err 2273 } 2274 defer googleapi.CloseBody(res) 2275 if err := googleapi.CheckResponse(res); err != nil { 2276 return nil, err 2277 } 2278 ret := &BlogList{ 2279 ServerResponse: googleapi.ServerResponse{ 2280 Header: res.Header, 2281 HTTPStatusCode: res.StatusCode, 2282 }, 2283 } 2284 target := &ret 2285 if err := gensupport.DecodeResponse(target, res); err != nil { 2286 return nil, err 2287 } 2288 return ret, nil 2289 // { 2290 // "description": "Retrieves a list of blogs, possibly filtered.", 2291 // "httpMethod": "GET", 2292 // "id": "blogger.blogs.listByUser", 2293 // "parameterOrder": [ 2294 // "userId" 2295 // ], 2296 // "parameters": { 2297 // "fetchUserInfo": { 2298 // "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", 2299 // "location": "query", 2300 // "type": "boolean" 2301 // }, 2302 // "role": { 2303 // "description": "User access types for blogs to include in the results, e.g. AUTHOR will return blogs where the user has author level access. If no roles are specified, defaults to ADMIN and AUTHOR roles.", 2304 // "enum": [ 2305 // "ADMIN", 2306 // "AUTHOR", 2307 // "READER" 2308 // ], 2309 // "enumDescriptions": [ 2310 // "Admin role - Blogs where the user has Admin level access.", 2311 // "Author role - Blogs where the user has Author level access.", 2312 // "Reader role - Blogs where the user has Reader level access (to a private blog)." 2313 // ], 2314 // "location": "query", 2315 // "repeated": true, 2316 // "type": "string" 2317 // }, 2318 // "status": { 2319 // "default": "LIVE", 2320 // "description": "Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs.", 2321 // "enum": [ 2322 // "DELETED", 2323 // "LIVE" 2324 // ], 2325 // "enumDescriptions": [ 2326 // "Blog has been deleted by an administrator.", 2327 // "Blog is currently live." 2328 // ], 2329 // "location": "query", 2330 // "repeated": true, 2331 // "type": "string" 2332 // }, 2333 // "userId": { 2334 // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' or the user's profile identifier.", 2335 // "location": "path", 2336 // "required": true, 2337 // "type": "string" 2338 // }, 2339 // "view": { 2340 // "description": "Access level with which to view the blogs. Note that some fields require elevated access.", 2341 // "enum": [ 2342 // "ADMIN", 2343 // "AUTHOR", 2344 // "READER" 2345 // ], 2346 // "enumDescriptions": [ 2347 // "Admin level detail.", 2348 // "Author level detail.", 2349 // "Reader level detail." 2350 // ], 2351 // "location": "query", 2352 // "type": "string" 2353 // } 2354 // }, 2355 // "path": "users/{userId}/blogs", 2356 // "response": { 2357 // "$ref": "BlogList" 2358 // }, 2359 // "scopes": [ 2360 // "https://www.googleapis.com/auth/blogger", 2361 // "https://www.googleapis.com/auth/blogger.readonly" 2362 // ] 2363 // } 2364 2365} 2366 2367// method id "blogger.comments.approve": 2368 2369type CommentsApproveCall struct { 2370 s *Service 2371 blogId string 2372 postId string 2373 commentId string 2374 urlParams_ gensupport.URLParams 2375 ctx_ context.Context 2376 header_ http.Header 2377} 2378 2379// Approve: Marks a comment as not spam. 2380func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall { 2381 c := &CommentsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2382 c.blogId = blogId 2383 c.postId = postId 2384 c.commentId = commentId 2385 return c 2386} 2387 2388// Fields allows partial responses to be retrieved. See 2389// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2390// for more information. 2391func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall { 2392 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2393 return c 2394} 2395 2396// Context sets the context to be used in this call's Do method. Any 2397// pending HTTP request will be aborted if the provided context is 2398// canceled. 2399func (c *CommentsApproveCall) Context(ctx context.Context) *CommentsApproveCall { 2400 c.ctx_ = ctx 2401 return c 2402} 2403 2404// Header returns an http.Header that can be modified by the caller to 2405// add HTTP headers to the request. 2406func (c *CommentsApproveCall) Header() http.Header { 2407 if c.header_ == nil { 2408 c.header_ = make(http.Header) 2409 } 2410 return c.header_ 2411} 2412 2413func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) { 2414 reqHeaders := make(http.Header) 2415 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 2416 for k, v := range c.header_ { 2417 reqHeaders[k] = v 2418 } 2419 reqHeaders.Set("User-Agent", c.s.userAgent()) 2420 var body io.Reader = nil 2421 c.urlParams_.Set("alt", alt) 2422 c.urlParams_.Set("prettyPrint", "false") 2423 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") 2424 urls += "?" + c.urlParams_.Encode() 2425 req, err := http.NewRequest("POST", urls, body) 2426 if err != nil { 2427 return nil, err 2428 } 2429 req.Header = reqHeaders 2430 googleapi.Expand(req.URL, map[string]string{ 2431 "blogId": c.blogId, 2432 "postId": c.postId, 2433 "commentId": c.commentId, 2434 }) 2435 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2436} 2437 2438// Do executes the "blogger.comments.approve" call. 2439// Exactly one of *Comment or error will be non-nil. Any non-2xx status 2440// code is an error. Response headers are in either 2441// *Comment.ServerResponse.Header or (if a response was returned at all) 2442// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2443// check whether the returned error was because http.StatusNotModified 2444// was returned. 2445func (c *CommentsApproveCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 2446 gensupport.SetOptions(c.urlParams_, opts...) 2447 res, err := c.doRequest("json") 2448 if res != nil && res.StatusCode == http.StatusNotModified { 2449 if res.Body != nil { 2450 res.Body.Close() 2451 } 2452 return nil, &googleapi.Error{ 2453 Code: res.StatusCode, 2454 Header: res.Header, 2455 } 2456 } 2457 if err != nil { 2458 return nil, err 2459 } 2460 defer googleapi.CloseBody(res) 2461 if err := googleapi.CheckResponse(res); err != nil { 2462 return nil, err 2463 } 2464 ret := &Comment{ 2465 ServerResponse: googleapi.ServerResponse{ 2466 Header: res.Header, 2467 HTTPStatusCode: res.StatusCode, 2468 }, 2469 } 2470 target := &ret 2471 if err := gensupport.DecodeResponse(target, res); err != nil { 2472 return nil, err 2473 } 2474 return ret, nil 2475 // { 2476 // "description": "Marks a comment as not spam.", 2477 // "httpMethod": "POST", 2478 // "id": "blogger.comments.approve", 2479 // "parameterOrder": [ 2480 // "blogId", 2481 // "postId", 2482 // "commentId" 2483 // ], 2484 // "parameters": { 2485 // "blogId": { 2486 // "description": "The ID of the Blog.", 2487 // "location": "path", 2488 // "required": true, 2489 // "type": "string" 2490 // }, 2491 // "commentId": { 2492 // "description": "The ID of the comment to mark as not spam.", 2493 // "location": "path", 2494 // "required": true, 2495 // "type": "string" 2496 // }, 2497 // "postId": { 2498 // "description": "The ID of the Post.", 2499 // "location": "path", 2500 // "required": true, 2501 // "type": "string" 2502 // } 2503 // }, 2504 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", 2505 // "response": { 2506 // "$ref": "Comment" 2507 // }, 2508 // "scopes": [ 2509 // "https://www.googleapis.com/auth/blogger" 2510 // ] 2511 // } 2512 2513} 2514 2515// method id "blogger.comments.delete": 2516 2517type CommentsDeleteCall struct { 2518 s *Service 2519 blogId string 2520 postId string 2521 commentId string 2522 urlParams_ gensupport.URLParams 2523 ctx_ context.Context 2524 header_ http.Header 2525} 2526 2527// Delete: Delete a comment by ID. 2528func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall { 2529 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2530 c.blogId = blogId 2531 c.postId = postId 2532 c.commentId = commentId 2533 return c 2534} 2535 2536// Fields allows partial responses to be retrieved. See 2537// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2538// for more information. 2539func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { 2540 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2541 return c 2542} 2543 2544// Context sets the context to be used in this call's Do method. Any 2545// pending HTTP request will be aborted if the provided context is 2546// canceled. 2547func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { 2548 c.ctx_ = ctx 2549 return c 2550} 2551 2552// Header returns an http.Header that can be modified by the caller to 2553// add HTTP headers to the request. 2554func (c *CommentsDeleteCall) Header() http.Header { 2555 if c.header_ == nil { 2556 c.header_ = make(http.Header) 2557 } 2558 return c.header_ 2559} 2560 2561func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { 2562 reqHeaders := make(http.Header) 2563 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 2564 for k, v := range c.header_ { 2565 reqHeaders[k] = v 2566 } 2567 reqHeaders.Set("User-Agent", c.s.userAgent()) 2568 var body io.Reader = nil 2569 c.urlParams_.Set("alt", alt) 2570 c.urlParams_.Set("prettyPrint", "false") 2571 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") 2572 urls += "?" + c.urlParams_.Encode() 2573 req, err := http.NewRequest("DELETE", urls, body) 2574 if err != nil { 2575 return nil, err 2576 } 2577 req.Header = reqHeaders 2578 googleapi.Expand(req.URL, map[string]string{ 2579 "blogId": c.blogId, 2580 "postId": c.postId, 2581 "commentId": c.commentId, 2582 }) 2583 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2584} 2585 2586// Do executes the "blogger.comments.delete" call. 2587func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error { 2588 gensupport.SetOptions(c.urlParams_, opts...) 2589 res, err := c.doRequest("json") 2590 if err != nil { 2591 return err 2592 } 2593 defer googleapi.CloseBody(res) 2594 if err := googleapi.CheckResponse(res); err != nil { 2595 return err 2596 } 2597 return nil 2598 // { 2599 // "description": "Delete a comment by ID.", 2600 // "httpMethod": "DELETE", 2601 // "id": "blogger.comments.delete", 2602 // "parameterOrder": [ 2603 // "blogId", 2604 // "postId", 2605 // "commentId" 2606 // ], 2607 // "parameters": { 2608 // "blogId": { 2609 // "description": "The ID of the Blog.", 2610 // "location": "path", 2611 // "required": true, 2612 // "type": "string" 2613 // }, 2614 // "commentId": { 2615 // "description": "The ID of the comment to delete.", 2616 // "location": "path", 2617 // "required": true, 2618 // "type": "string" 2619 // }, 2620 // "postId": { 2621 // "description": "The ID of the Post.", 2622 // "location": "path", 2623 // "required": true, 2624 // "type": "string" 2625 // } 2626 // }, 2627 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", 2628 // "scopes": [ 2629 // "https://www.googleapis.com/auth/blogger" 2630 // ] 2631 // } 2632 2633} 2634 2635// method id "blogger.comments.get": 2636 2637type CommentsGetCall struct { 2638 s *Service 2639 blogId string 2640 postId string 2641 commentId string 2642 urlParams_ gensupport.URLParams 2643 ifNoneMatch_ string 2644 ctx_ context.Context 2645 header_ http.Header 2646} 2647 2648// Get: Gets one comment by ID. 2649func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { 2650 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2651 c.blogId = blogId 2652 c.postId = postId 2653 c.commentId = commentId 2654 return c 2655} 2656 2657// View sets the optional parameter "view": Access level for the 2658// requested comment (default: READER). Note that some comments will 2659// require elevated permissions, for example comments where the parent 2660// posts which is in a draft state, or comments that are pending 2661// moderation. 2662// 2663// Possible values: 2664// "ADMIN" - Admin level detail 2665// "AUTHOR" - Author level detail 2666// "READER" - Admin level detail 2667func (c *CommentsGetCall) View(view string) *CommentsGetCall { 2668 c.urlParams_.Set("view", view) 2669 return c 2670} 2671 2672// Fields allows partial responses to be retrieved. See 2673// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2674// for more information. 2675func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { 2676 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2677 return c 2678} 2679 2680// IfNoneMatch sets the optional parameter which makes the operation 2681// fail if the object's ETag matches the given value. This is useful for 2682// getting updates only after the object has changed since the last 2683// request. Use googleapi.IsNotModified to check whether the response 2684// error from Do is the result of In-None-Match. 2685func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { 2686 c.ifNoneMatch_ = entityTag 2687 return c 2688} 2689 2690// Context sets the context to be used in this call's Do method. Any 2691// pending HTTP request will be aborted if the provided context is 2692// canceled. 2693func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { 2694 c.ctx_ = ctx 2695 return c 2696} 2697 2698// Header returns an http.Header that can be modified by the caller to 2699// add HTTP headers to the request. 2700func (c *CommentsGetCall) Header() http.Header { 2701 if c.header_ == nil { 2702 c.header_ = make(http.Header) 2703 } 2704 return c.header_ 2705} 2706 2707func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { 2708 reqHeaders := make(http.Header) 2709 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 2710 for k, v := range c.header_ { 2711 reqHeaders[k] = v 2712 } 2713 reqHeaders.Set("User-Agent", c.s.userAgent()) 2714 if c.ifNoneMatch_ != "" { 2715 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2716 } 2717 var body io.Reader = nil 2718 c.urlParams_.Set("alt", alt) 2719 c.urlParams_.Set("prettyPrint", "false") 2720 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") 2721 urls += "?" + c.urlParams_.Encode() 2722 req, err := http.NewRequest("GET", urls, body) 2723 if err != nil { 2724 return nil, err 2725 } 2726 req.Header = reqHeaders 2727 googleapi.Expand(req.URL, map[string]string{ 2728 "blogId": c.blogId, 2729 "postId": c.postId, 2730 "commentId": c.commentId, 2731 }) 2732 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2733} 2734 2735// Do executes the "blogger.comments.get" call. 2736// Exactly one of *Comment or error will be non-nil. Any non-2xx status 2737// code is an error. Response headers are in either 2738// *Comment.ServerResponse.Header or (if a response was returned at all) 2739// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2740// check whether the returned error was because http.StatusNotModified 2741// was returned. 2742func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 2743 gensupport.SetOptions(c.urlParams_, opts...) 2744 res, err := c.doRequest("json") 2745 if res != nil && res.StatusCode == http.StatusNotModified { 2746 if res.Body != nil { 2747 res.Body.Close() 2748 } 2749 return nil, &googleapi.Error{ 2750 Code: res.StatusCode, 2751 Header: res.Header, 2752 } 2753 } 2754 if err != nil { 2755 return nil, err 2756 } 2757 defer googleapi.CloseBody(res) 2758 if err := googleapi.CheckResponse(res); err != nil { 2759 return nil, err 2760 } 2761 ret := &Comment{ 2762 ServerResponse: googleapi.ServerResponse{ 2763 Header: res.Header, 2764 HTTPStatusCode: res.StatusCode, 2765 }, 2766 } 2767 target := &ret 2768 if err := gensupport.DecodeResponse(target, res); err != nil { 2769 return nil, err 2770 } 2771 return ret, nil 2772 // { 2773 // "description": "Gets one comment by ID.", 2774 // "httpMethod": "GET", 2775 // "id": "blogger.comments.get", 2776 // "parameterOrder": [ 2777 // "blogId", 2778 // "postId", 2779 // "commentId" 2780 // ], 2781 // "parameters": { 2782 // "blogId": { 2783 // "description": "ID of the blog to containing the comment.", 2784 // "location": "path", 2785 // "required": true, 2786 // "type": "string" 2787 // }, 2788 // "commentId": { 2789 // "description": "The ID of the comment to get.", 2790 // "location": "path", 2791 // "required": true, 2792 // "type": "string" 2793 // }, 2794 // "postId": { 2795 // "description": "ID of the post to fetch posts from.", 2796 // "location": "path", 2797 // "required": true, 2798 // "type": "string" 2799 // }, 2800 // "view": { 2801 // "description": "Access level for the requested comment (default: READER). Note that some comments will require elevated permissions, for example comments where the parent posts which is in a draft state, or comments that are pending moderation.", 2802 // "enum": [ 2803 // "ADMIN", 2804 // "AUTHOR", 2805 // "READER" 2806 // ], 2807 // "enumDescriptions": [ 2808 // "Admin level detail", 2809 // "Author level detail", 2810 // "Admin level detail" 2811 // ], 2812 // "location": "query", 2813 // "type": "string" 2814 // } 2815 // }, 2816 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", 2817 // "response": { 2818 // "$ref": "Comment" 2819 // }, 2820 // "scopes": [ 2821 // "https://www.googleapis.com/auth/blogger", 2822 // "https://www.googleapis.com/auth/blogger.readonly" 2823 // ] 2824 // } 2825 2826} 2827 2828// method id "blogger.comments.list": 2829 2830type CommentsListCall struct { 2831 s *Service 2832 blogId string 2833 postId string 2834 urlParams_ gensupport.URLParams 2835 ifNoneMatch_ string 2836 ctx_ context.Context 2837 header_ http.Header 2838} 2839 2840// List: Retrieves the comments for a post, possibly filtered. 2841func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { 2842 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2843 c.blogId = blogId 2844 c.postId = postId 2845 return c 2846} 2847 2848// EndDate sets the optional parameter "endDate": Latest date of comment 2849// to fetch, a date-time with RFC 3339 formatting. 2850func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall { 2851 c.urlParams_.Set("endDate", endDate) 2852 return c 2853} 2854 2855// FetchBodies sets the optional parameter "fetchBodies": Whether the 2856// body content of the comments is included. 2857func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { 2858 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 2859 return c 2860} 2861 2862// MaxResults sets the optional parameter "maxResults": Maximum number 2863// of comments to include in the result. 2864func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { 2865 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 2866 return c 2867} 2868 2869// PageToken sets the optional parameter "pageToken": Continuation token 2870// if request is paged. 2871func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { 2872 c.urlParams_.Set("pageToken", pageToken) 2873 return c 2874} 2875 2876// StartDate sets the optional parameter "startDate": Earliest date of 2877// comment to fetch, a date-time with RFC 3339 formatting. 2878func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { 2879 c.urlParams_.Set("startDate", startDate) 2880 return c 2881} 2882 2883// Status sets the optional parameter "status": 2884// 2885// Possible values: 2886// "emptied" - Comments that have had their content removed 2887// "live" - Comments that are publicly visible 2888// "pending" - Comments that are awaiting administrator approval 2889// "spam" - Comments marked as spam by the administrator 2890func (c *CommentsListCall) Status(status ...string) *CommentsListCall { 2891 c.urlParams_.SetMulti("status", append([]string{}, status...)) 2892 return c 2893} 2894 2895// View sets the optional parameter "view": Access level with which to 2896// view the returned result. Note that some fields require elevated 2897// access. 2898// 2899// Possible values: 2900// "ADMIN" - Admin level detail 2901// "AUTHOR" - Author level detail 2902// "READER" - Reader level detail 2903func (c *CommentsListCall) View(view string) *CommentsListCall { 2904 c.urlParams_.Set("view", view) 2905 return c 2906} 2907 2908// Fields allows partial responses to be retrieved. See 2909// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2910// for more information. 2911func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { 2912 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2913 return c 2914} 2915 2916// IfNoneMatch sets the optional parameter which makes the operation 2917// fail if the object's ETag matches the given value. This is useful for 2918// getting updates only after the object has changed since the last 2919// request. Use googleapi.IsNotModified to check whether the response 2920// error from Do is the result of In-None-Match. 2921func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { 2922 c.ifNoneMatch_ = entityTag 2923 return c 2924} 2925 2926// Context sets the context to be used in this call's Do method. Any 2927// pending HTTP request will be aborted if the provided context is 2928// canceled. 2929func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { 2930 c.ctx_ = ctx 2931 return c 2932} 2933 2934// Header returns an http.Header that can be modified by the caller to 2935// add HTTP headers to the request. 2936func (c *CommentsListCall) Header() http.Header { 2937 if c.header_ == nil { 2938 c.header_ = make(http.Header) 2939 } 2940 return c.header_ 2941} 2942 2943func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { 2944 reqHeaders := make(http.Header) 2945 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 2946 for k, v := range c.header_ { 2947 reqHeaders[k] = v 2948 } 2949 reqHeaders.Set("User-Agent", c.s.userAgent()) 2950 if c.ifNoneMatch_ != "" { 2951 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2952 } 2953 var body io.Reader = nil 2954 c.urlParams_.Set("alt", alt) 2955 c.urlParams_.Set("prettyPrint", "false") 2956 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") 2957 urls += "?" + c.urlParams_.Encode() 2958 req, err := http.NewRequest("GET", urls, body) 2959 if err != nil { 2960 return nil, err 2961 } 2962 req.Header = reqHeaders 2963 googleapi.Expand(req.URL, map[string]string{ 2964 "blogId": c.blogId, 2965 "postId": c.postId, 2966 }) 2967 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2968} 2969 2970// Do executes the "blogger.comments.list" call. 2971// Exactly one of *CommentList or error will be non-nil. Any non-2xx 2972// status code is an error. Response headers are in either 2973// *CommentList.ServerResponse.Header or (if a response was returned at 2974// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2975// to check whether the returned error was because 2976// http.StatusNotModified was returned. 2977func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 2978 gensupport.SetOptions(c.urlParams_, opts...) 2979 res, err := c.doRequest("json") 2980 if res != nil && res.StatusCode == http.StatusNotModified { 2981 if res.Body != nil { 2982 res.Body.Close() 2983 } 2984 return nil, &googleapi.Error{ 2985 Code: res.StatusCode, 2986 Header: res.Header, 2987 } 2988 } 2989 if err != nil { 2990 return nil, err 2991 } 2992 defer googleapi.CloseBody(res) 2993 if err := googleapi.CheckResponse(res); err != nil { 2994 return nil, err 2995 } 2996 ret := &CommentList{ 2997 ServerResponse: googleapi.ServerResponse{ 2998 Header: res.Header, 2999 HTTPStatusCode: res.StatusCode, 3000 }, 3001 } 3002 target := &ret 3003 if err := gensupport.DecodeResponse(target, res); err != nil { 3004 return nil, err 3005 } 3006 return ret, nil 3007 // { 3008 // "description": "Retrieves the comments for a post, possibly filtered.", 3009 // "httpMethod": "GET", 3010 // "id": "blogger.comments.list", 3011 // "parameterOrder": [ 3012 // "blogId", 3013 // "postId" 3014 // ], 3015 // "parameters": { 3016 // "blogId": { 3017 // "description": "ID of the blog to fetch comments from.", 3018 // "location": "path", 3019 // "required": true, 3020 // "type": "string" 3021 // }, 3022 // "endDate": { 3023 // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", 3024 // "format": "date-time", 3025 // "location": "query", 3026 // "type": "string" 3027 // }, 3028 // "fetchBodies": { 3029 // "description": "Whether the body content of the comments is included.", 3030 // "location": "query", 3031 // "type": "boolean" 3032 // }, 3033 // "maxResults": { 3034 // "description": "Maximum number of comments to include in the result.", 3035 // "format": "uint32", 3036 // "location": "query", 3037 // "type": "integer" 3038 // }, 3039 // "pageToken": { 3040 // "description": "Continuation token if request is paged.", 3041 // "location": "query", 3042 // "type": "string" 3043 // }, 3044 // "postId": { 3045 // "description": "ID of the post to fetch posts from.", 3046 // "location": "path", 3047 // "required": true, 3048 // "type": "string" 3049 // }, 3050 // "startDate": { 3051 // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", 3052 // "format": "date-time", 3053 // "location": "query", 3054 // "type": "string" 3055 // }, 3056 // "status": { 3057 // "enum": [ 3058 // "emptied", 3059 // "live", 3060 // "pending", 3061 // "spam" 3062 // ], 3063 // "enumDescriptions": [ 3064 // "Comments that have had their content removed", 3065 // "Comments that are publicly visible", 3066 // "Comments that are awaiting administrator approval", 3067 // "Comments marked as spam by the administrator" 3068 // ], 3069 // "location": "query", 3070 // "repeated": true, 3071 // "type": "string" 3072 // }, 3073 // "view": { 3074 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 3075 // "enum": [ 3076 // "ADMIN", 3077 // "AUTHOR", 3078 // "READER" 3079 // ], 3080 // "enumDescriptions": [ 3081 // "Admin level detail", 3082 // "Author level detail", 3083 // "Reader level detail" 3084 // ], 3085 // "location": "query", 3086 // "type": "string" 3087 // } 3088 // }, 3089 // "path": "blogs/{blogId}/posts/{postId}/comments", 3090 // "response": { 3091 // "$ref": "CommentList" 3092 // }, 3093 // "scopes": [ 3094 // "https://www.googleapis.com/auth/blogger", 3095 // "https://www.googleapis.com/auth/blogger.readonly" 3096 // ] 3097 // } 3098 3099} 3100 3101// Pages invokes f for each page of results. 3102// A non-nil error returned from f will halt the iteration. 3103// The provided context supersedes any context provided to the Context method. 3104func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error { 3105 c.ctx_ = ctx 3106 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3107 for { 3108 x, err := c.Do() 3109 if err != nil { 3110 return err 3111 } 3112 if err := f(x); err != nil { 3113 return err 3114 } 3115 if x.NextPageToken == "" { 3116 return nil 3117 } 3118 c.PageToken(x.NextPageToken) 3119 } 3120} 3121 3122// method id "blogger.comments.listByBlog": 3123 3124type CommentsListByBlogCall struct { 3125 s *Service 3126 blogId string 3127 urlParams_ gensupport.URLParams 3128 ifNoneMatch_ string 3129 ctx_ context.Context 3130 header_ http.Header 3131} 3132 3133// ListByBlog: Retrieves the comments for a blog, across all posts, 3134// possibly filtered. 3135func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall { 3136 c := &CommentsListByBlogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3137 c.blogId = blogId 3138 return c 3139} 3140 3141// EndDate sets the optional parameter "endDate": Latest date of comment 3142// to fetch, a date-time with RFC 3339 formatting. 3143func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall { 3144 c.urlParams_.Set("endDate", endDate) 3145 return c 3146} 3147 3148// FetchBodies sets the optional parameter "fetchBodies": Whether the 3149// body content of the comments is included. 3150func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall { 3151 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 3152 return c 3153} 3154 3155// MaxResults sets the optional parameter "maxResults": Maximum number 3156// of comments to include in the result. 3157func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall { 3158 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 3159 return c 3160} 3161 3162// PageToken sets the optional parameter "pageToken": Continuation token 3163// if request is paged. 3164func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall { 3165 c.urlParams_.Set("pageToken", pageToken) 3166 return c 3167} 3168 3169// StartDate sets the optional parameter "startDate": Earliest date of 3170// comment to fetch, a date-time with RFC 3339 formatting. 3171func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall { 3172 c.urlParams_.Set("startDate", startDate) 3173 return c 3174} 3175 3176// Status sets the optional parameter "status": 3177// 3178// Possible values: 3179// "emptied" - Comments that have had their content removed 3180// "live" - Comments that are publicly visible 3181// "pending" - Comments that are awaiting administrator approval 3182// "spam" - Comments marked as spam by the administrator 3183func (c *CommentsListByBlogCall) Status(status ...string) *CommentsListByBlogCall { 3184 c.urlParams_.SetMulti("status", append([]string{}, status...)) 3185 return c 3186} 3187 3188// Fields allows partial responses to be retrieved. See 3189// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3190// for more information. 3191func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall { 3192 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3193 return c 3194} 3195 3196// IfNoneMatch sets the optional parameter which makes the operation 3197// fail if the object's ETag matches the given value. This is useful for 3198// getting updates only after the object has changed since the last 3199// request. Use googleapi.IsNotModified to check whether the response 3200// error from Do is the result of In-None-Match. 3201func (c *CommentsListByBlogCall) IfNoneMatch(entityTag string) *CommentsListByBlogCall { 3202 c.ifNoneMatch_ = entityTag 3203 return c 3204} 3205 3206// Context sets the context to be used in this call's Do method. Any 3207// pending HTTP request will be aborted if the provided context is 3208// canceled. 3209func (c *CommentsListByBlogCall) Context(ctx context.Context) *CommentsListByBlogCall { 3210 c.ctx_ = ctx 3211 return c 3212} 3213 3214// Header returns an http.Header that can be modified by the caller to 3215// add HTTP headers to the request. 3216func (c *CommentsListByBlogCall) Header() http.Header { 3217 if c.header_ == nil { 3218 c.header_ = make(http.Header) 3219 } 3220 return c.header_ 3221} 3222 3223func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) { 3224 reqHeaders := make(http.Header) 3225 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 3226 for k, v := range c.header_ { 3227 reqHeaders[k] = v 3228 } 3229 reqHeaders.Set("User-Agent", c.s.userAgent()) 3230 if c.ifNoneMatch_ != "" { 3231 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3232 } 3233 var body io.Reader = nil 3234 c.urlParams_.Set("alt", alt) 3235 c.urlParams_.Set("prettyPrint", "false") 3236 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") 3237 urls += "?" + c.urlParams_.Encode() 3238 req, err := http.NewRequest("GET", urls, body) 3239 if err != nil { 3240 return nil, err 3241 } 3242 req.Header = reqHeaders 3243 googleapi.Expand(req.URL, map[string]string{ 3244 "blogId": c.blogId, 3245 }) 3246 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3247} 3248 3249// Do executes the "blogger.comments.listByBlog" call. 3250// Exactly one of *CommentList or error will be non-nil. Any non-2xx 3251// status code is an error. Response headers are in either 3252// *CommentList.ServerResponse.Header or (if a response was returned at 3253// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3254// to check whether the returned error was because 3255// http.StatusNotModified was returned. 3256func (c *CommentsListByBlogCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 3257 gensupport.SetOptions(c.urlParams_, opts...) 3258 res, err := c.doRequest("json") 3259 if res != nil && res.StatusCode == http.StatusNotModified { 3260 if res.Body != nil { 3261 res.Body.Close() 3262 } 3263 return nil, &googleapi.Error{ 3264 Code: res.StatusCode, 3265 Header: res.Header, 3266 } 3267 } 3268 if err != nil { 3269 return nil, err 3270 } 3271 defer googleapi.CloseBody(res) 3272 if err := googleapi.CheckResponse(res); err != nil { 3273 return nil, err 3274 } 3275 ret := &CommentList{ 3276 ServerResponse: googleapi.ServerResponse{ 3277 Header: res.Header, 3278 HTTPStatusCode: res.StatusCode, 3279 }, 3280 } 3281 target := &ret 3282 if err := gensupport.DecodeResponse(target, res); err != nil { 3283 return nil, err 3284 } 3285 return ret, nil 3286 // { 3287 // "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", 3288 // "httpMethod": "GET", 3289 // "id": "blogger.comments.listByBlog", 3290 // "parameterOrder": [ 3291 // "blogId" 3292 // ], 3293 // "parameters": { 3294 // "blogId": { 3295 // "description": "ID of the blog to fetch comments from.", 3296 // "location": "path", 3297 // "required": true, 3298 // "type": "string" 3299 // }, 3300 // "endDate": { 3301 // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", 3302 // "format": "date-time", 3303 // "location": "query", 3304 // "type": "string" 3305 // }, 3306 // "fetchBodies": { 3307 // "description": "Whether the body content of the comments is included.", 3308 // "location": "query", 3309 // "type": "boolean" 3310 // }, 3311 // "maxResults": { 3312 // "description": "Maximum number of comments to include in the result.", 3313 // "format": "uint32", 3314 // "location": "query", 3315 // "type": "integer" 3316 // }, 3317 // "pageToken": { 3318 // "description": "Continuation token if request is paged.", 3319 // "location": "query", 3320 // "type": "string" 3321 // }, 3322 // "startDate": { 3323 // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", 3324 // "format": "date-time", 3325 // "location": "query", 3326 // "type": "string" 3327 // }, 3328 // "status": { 3329 // "enum": [ 3330 // "emptied", 3331 // "live", 3332 // "pending", 3333 // "spam" 3334 // ], 3335 // "enumDescriptions": [ 3336 // "Comments that have had their content removed", 3337 // "Comments that are publicly visible", 3338 // "Comments that are awaiting administrator approval", 3339 // "Comments marked as spam by the administrator" 3340 // ], 3341 // "location": "query", 3342 // "repeated": true, 3343 // "type": "string" 3344 // } 3345 // }, 3346 // "path": "blogs/{blogId}/comments", 3347 // "response": { 3348 // "$ref": "CommentList" 3349 // }, 3350 // "scopes": [ 3351 // "https://www.googleapis.com/auth/blogger", 3352 // "https://www.googleapis.com/auth/blogger.readonly" 3353 // ] 3354 // } 3355 3356} 3357 3358// Pages invokes f for each page of results. 3359// A non-nil error returned from f will halt the iteration. 3360// The provided context supersedes any context provided to the Context method. 3361func (c *CommentsListByBlogCall) Pages(ctx context.Context, f func(*CommentList) error) error { 3362 c.ctx_ = ctx 3363 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3364 for { 3365 x, err := c.Do() 3366 if err != nil { 3367 return err 3368 } 3369 if err := f(x); err != nil { 3370 return err 3371 } 3372 if x.NextPageToken == "" { 3373 return nil 3374 } 3375 c.PageToken(x.NextPageToken) 3376 } 3377} 3378 3379// method id "blogger.comments.markAsSpam": 3380 3381type CommentsMarkAsSpamCall struct { 3382 s *Service 3383 blogId string 3384 postId string 3385 commentId string 3386 urlParams_ gensupport.URLParams 3387 ctx_ context.Context 3388 header_ http.Header 3389} 3390 3391// MarkAsSpam: Marks a comment as spam. 3392func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall { 3393 c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3394 c.blogId = blogId 3395 c.postId = postId 3396 c.commentId = commentId 3397 return c 3398} 3399 3400// Fields allows partial responses to be retrieved. See 3401// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3402// for more information. 3403func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall { 3404 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3405 return c 3406} 3407 3408// Context sets the context to be used in this call's Do method. Any 3409// pending HTTP request will be aborted if the provided context is 3410// canceled. 3411func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall { 3412 c.ctx_ = ctx 3413 return c 3414} 3415 3416// Header returns an http.Header that can be modified by the caller to 3417// add HTTP headers to the request. 3418func (c *CommentsMarkAsSpamCall) Header() http.Header { 3419 if c.header_ == nil { 3420 c.header_ = make(http.Header) 3421 } 3422 return c.header_ 3423} 3424 3425func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { 3426 reqHeaders := make(http.Header) 3427 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 3428 for k, v := range c.header_ { 3429 reqHeaders[k] = v 3430 } 3431 reqHeaders.Set("User-Agent", c.s.userAgent()) 3432 var body io.Reader = nil 3433 c.urlParams_.Set("alt", alt) 3434 c.urlParams_.Set("prettyPrint", "false") 3435 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") 3436 urls += "?" + c.urlParams_.Encode() 3437 req, err := http.NewRequest("POST", urls, body) 3438 if err != nil { 3439 return nil, err 3440 } 3441 req.Header = reqHeaders 3442 googleapi.Expand(req.URL, map[string]string{ 3443 "blogId": c.blogId, 3444 "postId": c.postId, 3445 "commentId": c.commentId, 3446 }) 3447 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3448} 3449 3450// Do executes the "blogger.comments.markAsSpam" call. 3451// Exactly one of *Comment or error will be non-nil. Any non-2xx status 3452// code is an error. Response headers are in either 3453// *Comment.ServerResponse.Header or (if a response was returned at all) 3454// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3455// check whether the returned error was because http.StatusNotModified 3456// was returned. 3457func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 3458 gensupport.SetOptions(c.urlParams_, opts...) 3459 res, err := c.doRequest("json") 3460 if res != nil && res.StatusCode == http.StatusNotModified { 3461 if res.Body != nil { 3462 res.Body.Close() 3463 } 3464 return nil, &googleapi.Error{ 3465 Code: res.StatusCode, 3466 Header: res.Header, 3467 } 3468 } 3469 if err != nil { 3470 return nil, err 3471 } 3472 defer googleapi.CloseBody(res) 3473 if err := googleapi.CheckResponse(res); err != nil { 3474 return nil, err 3475 } 3476 ret := &Comment{ 3477 ServerResponse: googleapi.ServerResponse{ 3478 Header: res.Header, 3479 HTTPStatusCode: res.StatusCode, 3480 }, 3481 } 3482 target := &ret 3483 if err := gensupport.DecodeResponse(target, res); err != nil { 3484 return nil, err 3485 } 3486 return ret, nil 3487 // { 3488 // "description": "Marks a comment as spam.", 3489 // "httpMethod": "POST", 3490 // "id": "blogger.comments.markAsSpam", 3491 // "parameterOrder": [ 3492 // "blogId", 3493 // "postId", 3494 // "commentId" 3495 // ], 3496 // "parameters": { 3497 // "blogId": { 3498 // "description": "The ID of the Blog.", 3499 // "location": "path", 3500 // "required": true, 3501 // "type": "string" 3502 // }, 3503 // "commentId": { 3504 // "description": "The ID of the comment to mark as spam.", 3505 // "location": "path", 3506 // "required": true, 3507 // "type": "string" 3508 // }, 3509 // "postId": { 3510 // "description": "The ID of the Post.", 3511 // "location": "path", 3512 // "required": true, 3513 // "type": "string" 3514 // } 3515 // }, 3516 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", 3517 // "response": { 3518 // "$ref": "Comment" 3519 // }, 3520 // "scopes": [ 3521 // "https://www.googleapis.com/auth/blogger" 3522 // ] 3523 // } 3524 3525} 3526 3527// method id "blogger.comments.removeContent": 3528 3529type CommentsRemoveContentCall struct { 3530 s *Service 3531 blogId string 3532 postId string 3533 commentId string 3534 urlParams_ gensupport.URLParams 3535 ctx_ context.Context 3536 header_ http.Header 3537} 3538 3539// RemoveContent: Removes the content of a comment. 3540func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall { 3541 c := &CommentsRemoveContentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3542 c.blogId = blogId 3543 c.postId = postId 3544 c.commentId = commentId 3545 return c 3546} 3547 3548// Fields allows partial responses to be retrieved. See 3549// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3550// for more information. 3551func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall { 3552 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3553 return c 3554} 3555 3556// Context sets the context to be used in this call's Do method. Any 3557// pending HTTP request will be aborted if the provided context is 3558// canceled. 3559func (c *CommentsRemoveContentCall) Context(ctx context.Context) *CommentsRemoveContentCall { 3560 c.ctx_ = ctx 3561 return c 3562} 3563 3564// Header returns an http.Header that can be modified by the caller to 3565// add HTTP headers to the request. 3566func (c *CommentsRemoveContentCall) Header() http.Header { 3567 if c.header_ == nil { 3568 c.header_ = make(http.Header) 3569 } 3570 return c.header_ 3571} 3572 3573func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) { 3574 reqHeaders := make(http.Header) 3575 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 3576 for k, v := range c.header_ { 3577 reqHeaders[k] = v 3578 } 3579 reqHeaders.Set("User-Agent", c.s.userAgent()) 3580 var body io.Reader = nil 3581 c.urlParams_.Set("alt", alt) 3582 c.urlParams_.Set("prettyPrint", "false") 3583 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") 3584 urls += "?" + c.urlParams_.Encode() 3585 req, err := http.NewRequest("POST", urls, body) 3586 if err != nil { 3587 return nil, err 3588 } 3589 req.Header = reqHeaders 3590 googleapi.Expand(req.URL, map[string]string{ 3591 "blogId": c.blogId, 3592 "postId": c.postId, 3593 "commentId": c.commentId, 3594 }) 3595 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3596} 3597 3598// Do executes the "blogger.comments.removeContent" call. 3599// Exactly one of *Comment or error will be non-nil. Any non-2xx status 3600// code is an error. Response headers are in either 3601// *Comment.ServerResponse.Header or (if a response was returned at all) 3602// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3603// check whether the returned error was because http.StatusNotModified 3604// was returned. 3605func (c *CommentsRemoveContentCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 3606 gensupport.SetOptions(c.urlParams_, opts...) 3607 res, err := c.doRequest("json") 3608 if res != nil && res.StatusCode == http.StatusNotModified { 3609 if res.Body != nil { 3610 res.Body.Close() 3611 } 3612 return nil, &googleapi.Error{ 3613 Code: res.StatusCode, 3614 Header: res.Header, 3615 } 3616 } 3617 if err != nil { 3618 return nil, err 3619 } 3620 defer googleapi.CloseBody(res) 3621 if err := googleapi.CheckResponse(res); err != nil { 3622 return nil, err 3623 } 3624 ret := &Comment{ 3625 ServerResponse: googleapi.ServerResponse{ 3626 Header: res.Header, 3627 HTTPStatusCode: res.StatusCode, 3628 }, 3629 } 3630 target := &ret 3631 if err := gensupport.DecodeResponse(target, res); err != nil { 3632 return nil, err 3633 } 3634 return ret, nil 3635 // { 3636 // "description": "Removes the content of a comment.", 3637 // "httpMethod": "POST", 3638 // "id": "blogger.comments.removeContent", 3639 // "parameterOrder": [ 3640 // "blogId", 3641 // "postId", 3642 // "commentId" 3643 // ], 3644 // "parameters": { 3645 // "blogId": { 3646 // "description": "The ID of the Blog.", 3647 // "location": "path", 3648 // "required": true, 3649 // "type": "string" 3650 // }, 3651 // "commentId": { 3652 // "description": "The ID of the comment to delete content from.", 3653 // "location": "path", 3654 // "required": true, 3655 // "type": "string" 3656 // }, 3657 // "postId": { 3658 // "description": "The ID of the Post.", 3659 // "location": "path", 3660 // "required": true, 3661 // "type": "string" 3662 // } 3663 // }, 3664 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", 3665 // "response": { 3666 // "$ref": "Comment" 3667 // }, 3668 // "scopes": [ 3669 // "https://www.googleapis.com/auth/blogger" 3670 // ] 3671 // } 3672 3673} 3674 3675// method id "blogger.pageViews.get": 3676 3677type PageViewsGetCall struct { 3678 s *Service 3679 blogId string 3680 urlParams_ gensupport.URLParams 3681 ifNoneMatch_ string 3682 ctx_ context.Context 3683 header_ http.Header 3684} 3685 3686// Get: Retrieve pageview stats for a Blog. 3687func (r *PageViewsService) Get(blogId string) *PageViewsGetCall { 3688 c := &PageViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3689 c.blogId = blogId 3690 return c 3691} 3692 3693// Range sets the optional parameter "range": 3694// 3695// Possible values: 3696// "30DAYS" - Page view counts from the last thirty days. 3697// "7DAYS" - Page view counts from the last seven days. 3698// "all" - Total page view counts from all time. 3699func (c *PageViewsGetCall) Range(range_ ...string) *PageViewsGetCall { 3700 c.urlParams_.SetMulti("range", append([]string{}, range_...)) 3701 return c 3702} 3703 3704// Fields allows partial responses to be retrieved. See 3705// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3706// for more information. 3707func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall { 3708 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3709 return c 3710} 3711 3712// IfNoneMatch sets the optional parameter which makes the operation 3713// fail if the object's ETag matches the given value. This is useful for 3714// getting updates only after the object has changed since the last 3715// request. Use googleapi.IsNotModified to check whether the response 3716// error from Do is the result of In-None-Match. 3717func (c *PageViewsGetCall) IfNoneMatch(entityTag string) *PageViewsGetCall { 3718 c.ifNoneMatch_ = entityTag 3719 return c 3720} 3721 3722// Context sets the context to be used in this call's Do method. Any 3723// pending HTTP request will be aborted if the provided context is 3724// canceled. 3725func (c *PageViewsGetCall) Context(ctx context.Context) *PageViewsGetCall { 3726 c.ctx_ = ctx 3727 return c 3728} 3729 3730// Header returns an http.Header that can be modified by the caller to 3731// add HTTP headers to the request. 3732func (c *PageViewsGetCall) Header() http.Header { 3733 if c.header_ == nil { 3734 c.header_ = make(http.Header) 3735 } 3736 return c.header_ 3737} 3738 3739func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) { 3740 reqHeaders := make(http.Header) 3741 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 3742 for k, v := range c.header_ { 3743 reqHeaders[k] = v 3744 } 3745 reqHeaders.Set("User-Agent", c.s.userAgent()) 3746 if c.ifNoneMatch_ != "" { 3747 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3748 } 3749 var body io.Reader = nil 3750 c.urlParams_.Set("alt", alt) 3751 c.urlParams_.Set("prettyPrint", "false") 3752 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") 3753 urls += "?" + c.urlParams_.Encode() 3754 req, err := http.NewRequest("GET", urls, body) 3755 if err != nil { 3756 return nil, err 3757 } 3758 req.Header = reqHeaders 3759 googleapi.Expand(req.URL, map[string]string{ 3760 "blogId": c.blogId, 3761 }) 3762 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3763} 3764 3765// Do executes the "blogger.pageViews.get" call. 3766// Exactly one of *Pageviews or error will be non-nil. Any non-2xx 3767// status code is an error. Response headers are in either 3768// *Pageviews.ServerResponse.Header or (if a response was returned at 3769// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3770// to check whether the returned error was because 3771// http.StatusNotModified was returned. 3772func (c *PageViewsGetCall) Do(opts ...googleapi.CallOption) (*Pageviews, error) { 3773 gensupport.SetOptions(c.urlParams_, opts...) 3774 res, err := c.doRequest("json") 3775 if res != nil && res.StatusCode == http.StatusNotModified { 3776 if res.Body != nil { 3777 res.Body.Close() 3778 } 3779 return nil, &googleapi.Error{ 3780 Code: res.StatusCode, 3781 Header: res.Header, 3782 } 3783 } 3784 if err != nil { 3785 return nil, err 3786 } 3787 defer googleapi.CloseBody(res) 3788 if err := googleapi.CheckResponse(res); err != nil { 3789 return nil, err 3790 } 3791 ret := &Pageviews{ 3792 ServerResponse: googleapi.ServerResponse{ 3793 Header: res.Header, 3794 HTTPStatusCode: res.StatusCode, 3795 }, 3796 } 3797 target := &ret 3798 if err := gensupport.DecodeResponse(target, res); err != nil { 3799 return nil, err 3800 } 3801 return ret, nil 3802 // { 3803 // "description": "Retrieve pageview stats for a Blog.", 3804 // "httpMethod": "GET", 3805 // "id": "blogger.pageViews.get", 3806 // "parameterOrder": [ 3807 // "blogId" 3808 // ], 3809 // "parameters": { 3810 // "blogId": { 3811 // "description": "The ID of the blog to get.", 3812 // "location": "path", 3813 // "required": true, 3814 // "type": "string" 3815 // }, 3816 // "range": { 3817 // "enum": [ 3818 // "30DAYS", 3819 // "7DAYS", 3820 // "all" 3821 // ], 3822 // "enumDescriptions": [ 3823 // "Page view counts from the last thirty days.", 3824 // "Page view counts from the last seven days.", 3825 // "Total page view counts from all time." 3826 // ], 3827 // "location": "query", 3828 // "repeated": true, 3829 // "type": "string" 3830 // } 3831 // }, 3832 // "path": "blogs/{blogId}/pageviews", 3833 // "response": { 3834 // "$ref": "Pageviews" 3835 // }, 3836 // "scopes": [ 3837 // "https://www.googleapis.com/auth/blogger" 3838 // ] 3839 // } 3840 3841} 3842 3843// method id "blogger.pages.delete": 3844 3845type PagesDeleteCall struct { 3846 s *Service 3847 blogId string 3848 pageId string 3849 urlParams_ gensupport.URLParams 3850 ctx_ context.Context 3851 header_ http.Header 3852} 3853 3854// Delete: Delete a page by ID. 3855func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall { 3856 c := &PagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3857 c.blogId = blogId 3858 c.pageId = pageId 3859 return c 3860} 3861 3862// Fields allows partial responses to be retrieved. See 3863// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3864// for more information. 3865func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall { 3866 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3867 return c 3868} 3869 3870// Context sets the context to be used in this call's Do method. Any 3871// pending HTTP request will be aborted if the provided context is 3872// canceled. 3873func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall { 3874 c.ctx_ = ctx 3875 return c 3876} 3877 3878// Header returns an http.Header that can be modified by the caller to 3879// add HTTP headers to the request. 3880func (c *PagesDeleteCall) Header() http.Header { 3881 if c.header_ == nil { 3882 c.header_ = make(http.Header) 3883 } 3884 return c.header_ 3885} 3886 3887func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { 3888 reqHeaders := make(http.Header) 3889 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 3890 for k, v := range c.header_ { 3891 reqHeaders[k] = v 3892 } 3893 reqHeaders.Set("User-Agent", c.s.userAgent()) 3894 var body io.Reader = nil 3895 c.urlParams_.Set("alt", alt) 3896 c.urlParams_.Set("prettyPrint", "false") 3897 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 3898 urls += "?" + c.urlParams_.Encode() 3899 req, err := http.NewRequest("DELETE", urls, body) 3900 if err != nil { 3901 return nil, err 3902 } 3903 req.Header = reqHeaders 3904 googleapi.Expand(req.URL, map[string]string{ 3905 "blogId": c.blogId, 3906 "pageId": c.pageId, 3907 }) 3908 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3909} 3910 3911// Do executes the "blogger.pages.delete" call. 3912func (c *PagesDeleteCall) Do(opts ...googleapi.CallOption) error { 3913 gensupport.SetOptions(c.urlParams_, opts...) 3914 res, err := c.doRequest("json") 3915 if err != nil { 3916 return err 3917 } 3918 defer googleapi.CloseBody(res) 3919 if err := googleapi.CheckResponse(res); err != nil { 3920 return err 3921 } 3922 return nil 3923 // { 3924 // "description": "Delete a page by ID.", 3925 // "httpMethod": "DELETE", 3926 // "id": "blogger.pages.delete", 3927 // "parameterOrder": [ 3928 // "blogId", 3929 // "pageId" 3930 // ], 3931 // "parameters": { 3932 // "blogId": { 3933 // "description": "The ID of the Blog.", 3934 // "location": "path", 3935 // "required": true, 3936 // "type": "string" 3937 // }, 3938 // "pageId": { 3939 // "description": "The ID of the Page.", 3940 // "location": "path", 3941 // "required": true, 3942 // "type": "string" 3943 // } 3944 // }, 3945 // "path": "blogs/{blogId}/pages/{pageId}", 3946 // "scopes": [ 3947 // "https://www.googleapis.com/auth/blogger" 3948 // ] 3949 // } 3950 3951} 3952 3953// method id "blogger.pages.get": 3954 3955type PagesGetCall struct { 3956 s *Service 3957 blogId string 3958 pageId string 3959 urlParams_ gensupport.URLParams 3960 ifNoneMatch_ string 3961 ctx_ context.Context 3962 header_ http.Header 3963} 3964 3965// Get: Gets one blog page by ID. 3966func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { 3967 c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3968 c.blogId = blogId 3969 c.pageId = pageId 3970 return c 3971} 3972 3973// View sets the optional parameter "view": 3974// 3975// Possible values: 3976// "ADMIN" - Admin level detail 3977// "AUTHOR" - Author level detail 3978// "READER" - Reader level detail 3979func (c *PagesGetCall) View(view string) *PagesGetCall { 3980 c.urlParams_.Set("view", view) 3981 return c 3982} 3983 3984// Fields allows partial responses to be retrieved. See 3985// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3986// for more information. 3987func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { 3988 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3989 return c 3990} 3991 3992// IfNoneMatch sets the optional parameter which makes the operation 3993// fail if the object's ETag matches the given value. This is useful for 3994// getting updates only after the object has changed since the last 3995// request. Use googleapi.IsNotModified to check whether the response 3996// error from Do is the result of In-None-Match. 3997func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { 3998 c.ifNoneMatch_ = entityTag 3999 return c 4000} 4001 4002// Context sets the context to be used in this call's Do method. Any 4003// pending HTTP request will be aborted if the provided context is 4004// canceled. 4005func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { 4006 c.ctx_ = ctx 4007 return c 4008} 4009 4010// Header returns an http.Header that can be modified by the caller to 4011// add HTTP headers to the request. 4012func (c *PagesGetCall) Header() http.Header { 4013 if c.header_ == nil { 4014 c.header_ = make(http.Header) 4015 } 4016 return c.header_ 4017} 4018 4019func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { 4020 reqHeaders := make(http.Header) 4021 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 4022 for k, v := range c.header_ { 4023 reqHeaders[k] = v 4024 } 4025 reqHeaders.Set("User-Agent", c.s.userAgent()) 4026 if c.ifNoneMatch_ != "" { 4027 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4028 } 4029 var body io.Reader = nil 4030 c.urlParams_.Set("alt", alt) 4031 c.urlParams_.Set("prettyPrint", "false") 4032 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 4033 urls += "?" + c.urlParams_.Encode() 4034 req, err := http.NewRequest("GET", urls, body) 4035 if err != nil { 4036 return nil, err 4037 } 4038 req.Header = reqHeaders 4039 googleapi.Expand(req.URL, map[string]string{ 4040 "blogId": c.blogId, 4041 "pageId": c.pageId, 4042 }) 4043 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4044} 4045 4046// Do executes the "blogger.pages.get" call. 4047// Exactly one of *Page or error will be non-nil. Any non-2xx status 4048// code is an error. Response headers are in either 4049// *Page.ServerResponse.Header or (if a response was returned at all) in 4050// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4051// whether the returned error was because http.StatusNotModified was 4052// returned. 4053func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4054 gensupport.SetOptions(c.urlParams_, opts...) 4055 res, err := c.doRequest("json") 4056 if res != nil && res.StatusCode == http.StatusNotModified { 4057 if res.Body != nil { 4058 res.Body.Close() 4059 } 4060 return nil, &googleapi.Error{ 4061 Code: res.StatusCode, 4062 Header: res.Header, 4063 } 4064 } 4065 if err != nil { 4066 return nil, err 4067 } 4068 defer googleapi.CloseBody(res) 4069 if err := googleapi.CheckResponse(res); err != nil { 4070 return nil, err 4071 } 4072 ret := &Page{ 4073 ServerResponse: googleapi.ServerResponse{ 4074 Header: res.Header, 4075 HTTPStatusCode: res.StatusCode, 4076 }, 4077 } 4078 target := &ret 4079 if err := gensupport.DecodeResponse(target, res); err != nil { 4080 return nil, err 4081 } 4082 return ret, nil 4083 // { 4084 // "description": "Gets one blog page by ID.", 4085 // "httpMethod": "GET", 4086 // "id": "blogger.pages.get", 4087 // "parameterOrder": [ 4088 // "blogId", 4089 // "pageId" 4090 // ], 4091 // "parameters": { 4092 // "blogId": { 4093 // "description": "ID of the blog containing the page.", 4094 // "location": "path", 4095 // "required": true, 4096 // "type": "string" 4097 // }, 4098 // "pageId": { 4099 // "description": "The ID of the page to get.", 4100 // "location": "path", 4101 // "required": true, 4102 // "type": "string" 4103 // }, 4104 // "view": { 4105 // "enum": [ 4106 // "ADMIN", 4107 // "AUTHOR", 4108 // "READER" 4109 // ], 4110 // "enumDescriptions": [ 4111 // "Admin level detail", 4112 // "Author level detail", 4113 // "Reader level detail" 4114 // ], 4115 // "location": "query", 4116 // "type": "string" 4117 // } 4118 // }, 4119 // "path": "blogs/{blogId}/pages/{pageId}", 4120 // "response": { 4121 // "$ref": "Page" 4122 // }, 4123 // "scopes": [ 4124 // "https://www.googleapis.com/auth/blogger", 4125 // "https://www.googleapis.com/auth/blogger.readonly" 4126 // ] 4127 // } 4128 4129} 4130 4131// method id "blogger.pages.insert": 4132 4133type PagesInsertCall struct { 4134 s *Service 4135 blogId string 4136 page *Page 4137 urlParams_ gensupport.URLParams 4138 ctx_ context.Context 4139 header_ http.Header 4140} 4141 4142// Insert: Add a page. 4143func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall { 4144 c := &PagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4145 c.blogId = blogId 4146 c.page = page 4147 return c 4148} 4149 4150// IsDraft sets the optional parameter "isDraft": Whether to create the 4151// page as a draft (default: false). 4152func (c *PagesInsertCall) IsDraft(isDraft bool) *PagesInsertCall { 4153 c.urlParams_.Set("isDraft", fmt.Sprint(isDraft)) 4154 return c 4155} 4156 4157// Fields allows partial responses to be retrieved. See 4158// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4159// for more information. 4160func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall { 4161 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4162 return c 4163} 4164 4165// Context sets the context to be used in this call's Do method. Any 4166// pending HTTP request will be aborted if the provided context is 4167// canceled. 4168func (c *PagesInsertCall) Context(ctx context.Context) *PagesInsertCall { 4169 c.ctx_ = ctx 4170 return c 4171} 4172 4173// Header returns an http.Header that can be modified by the caller to 4174// add HTTP headers to the request. 4175func (c *PagesInsertCall) Header() http.Header { 4176 if c.header_ == nil { 4177 c.header_ = make(http.Header) 4178 } 4179 return c.header_ 4180} 4181 4182func (c *PagesInsertCall) doRequest(alt string) (*http.Response, error) { 4183 reqHeaders := make(http.Header) 4184 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 4185 for k, v := range c.header_ { 4186 reqHeaders[k] = v 4187 } 4188 reqHeaders.Set("User-Agent", c.s.userAgent()) 4189 var body io.Reader = nil 4190 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) 4191 if err != nil { 4192 return nil, err 4193 } 4194 reqHeaders.Set("Content-Type", "application/json") 4195 c.urlParams_.Set("alt", alt) 4196 c.urlParams_.Set("prettyPrint", "false") 4197 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") 4198 urls += "?" + c.urlParams_.Encode() 4199 req, err := http.NewRequest("POST", urls, body) 4200 if err != nil { 4201 return nil, err 4202 } 4203 req.Header = reqHeaders 4204 googleapi.Expand(req.URL, map[string]string{ 4205 "blogId": c.blogId, 4206 }) 4207 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4208} 4209 4210// Do executes the "blogger.pages.insert" call. 4211// Exactly one of *Page or error will be non-nil. Any non-2xx status 4212// code is an error. Response headers are in either 4213// *Page.ServerResponse.Header or (if a response was returned at all) in 4214// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4215// whether the returned error was because http.StatusNotModified was 4216// returned. 4217func (c *PagesInsertCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4218 gensupport.SetOptions(c.urlParams_, opts...) 4219 res, err := c.doRequest("json") 4220 if res != nil && res.StatusCode == http.StatusNotModified { 4221 if res.Body != nil { 4222 res.Body.Close() 4223 } 4224 return nil, &googleapi.Error{ 4225 Code: res.StatusCode, 4226 Header: res.Header, 4227 } 4228 } 4229 if err != nil { 4230 return nil, err 4231 } 4232 defer googleapi.CloseBody(res) 4233 if err := googleapi.CheckResponse(res); err != nil { 4234 return nil, err 4235 } 4236 ret := &Page{ 4237 ServerResponse: googleapi.ServerResponse{ 4238 Header: res.Header, 4239 HTTPStatusCode: res.StatusCode, 4240 }, 4241 } 4242 target := &ret 4243 if err := gensupport.DecodeResponse(target, res); err != nil { 4244 return nil, err 4245 } 4246 return ret, nil 4247 // { 4248 // "description": "Add a page.", 4249 // "httpMethod": "POST", 4250 // "id": "blogger.pages.insert", 4251 // "parameterOrder": [ 4252 // "blogId" 4253 // ], 4254 // "parameters": { 4255 // "blogId": { 4256 // "description": "ID of the blog to add the page to.", 4257 // "location": "path", 4258 // "required": true, 4259 // "type": "string" 4260 // }, 4261 // "isDraft": { 4262 // "description": "Whether to create the page as a draft (default: false).", 4263 // "location": "query", 4264 // "type": "boolean" 4265 // } 4266 // }, 4267 // "path": "blogs/{blogId}/pages", 4268 // "request": { 4269 // "$ref": "Page" 4270 // }, 4271 // "response": { 4272 // "$ref": "Page" 4273 // }, 4274 // "scopes": [ 4275 // "https://www.googleapis.com/auth/blogger" 4276 // ] 4277 // } 4278 4279} 4280 4281// method id "blogger.pages.list": 4282 4283type PagesListCall struct { 4284 s *Service 4285 blogId string 4286 urlParams_ gensupport.URLParams 4287 ifNoneMatch_ string 4288 ctx_ context.Context 4289 header_ http.Header 4290} 4291 4292// List: Retrieves the pages for a blog, optionally including non-LIVE 4293// statuses. 4294func (r *PagesService) List(blogId string) *PagesListCall { 4295 c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4296 c.blogId = blogId 4297 return c 4298} 4299 4300// FetchBodies sets the optional parameter "fetchBodies": Whether to 4301// retrieve the Page bodies. 4302func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { 4303 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 4304 return c 4305} 4306 4307// MaxResults sets the optional parameter "maxResults": Maximum number 4308// of Pages to fetch. 4309func (c *PagesListCall) MaxResults(maxResults int64) *PagesListCall { 4310 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4311 return c 4312} 4313 4314// PageToken sets the optional parameter "pageToken": Continuation token 4315// if the request is paged. 4316func (c *PagesListCall) PageToken(pageToken string) *PagesListCall { 4317 c.urlParams_.Set("pageToken", pageToken) 4318 return c 4319} 4320 4321// Status sets the optional parameter "status": 4322// 4323// Possible values: 4324// "draft" - Draft (unpublished) Pages 4325// "live" - Pages that are publicly visible 4326func (c *PagesListCall) Status(status ...string) *PagesListCall { 4327 c.urlParams_.SetMulti("status", append([]string{}, status...)) 4328 return c 4329} 4330 4331// View sets the optional parameter "view": Access level with which to 4332// view the returned result. Note that some fields require elevated 4333// access. 4334// 4335// Possible values: 4336// "ADMIN" - Admin level detail 4337// "AUTHOR" - Author level detail 4338// "READER" - Reader level detail 4339func (c *PagesListCall) View(view string) *PagesListCall { 4340 c.urlParams_.Set("view", view) 4341 return c 4342} 4343 4344// Fields allows partial responses to be retrieved. See 4345// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4346// for more information. 4347func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { 4348 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4349 return c 4350} 4351 4352// IfNoneMatch sets the optional parameter which makes the operation 4353// fail if the object's ETag matches the given value. This is useful for 4354// getting updates only after the object has changed since the last 4355// request. Use googleapi.IsNotModified to check whether the response 4356// error from Do is the result of In-None-Match. 4357func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { 4358 c.ifNoneMatch_ = entityTag 4359 return c 4360} 4361 4362// Context sets the context to be used in this call's Do method. Any 4363// pending HTTP request will be aborted if the provided context is 4364// canceled. 4365func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { 4366 c.ctx_ = ctx 4367 return c 4368} 4369 4370// Header returns an http.Header that can be modified by the caller to 4371// add HTTP headers to the request. 4372func (c *PagesListCall) Header() http.Header { 4373 if c.header_ == nil { 4374 c.header_ = make(http.Header) 4375 } 4376 return c.header_ 4377} 4378 4379func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { 4380 reqHeaders := make(http.Header) 4381 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 4382 for k, v := range c.header_ { 4383 reqHeaders[k] = v 4384 } 4385 reqHeaders.Set("User-Agent", c.s.userAgent()) 4386 if c.ifNoneMatch_ != "" { 4387 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4388 } 4389 var body io.Reader = nil 4390 c.urlParams_.Set("alt", alt) 4391 c.urlParams_.Set("prettyPrint", "false") 4392 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") 4393 urls += "?" + c.urlParams_.Encode() 4394 req, err := http.NewRequest("GET", urls, body) 4395 if err != nil { 4396 return nil, err 4397 } 4398 req.Header = reqHeaders 4399 googleapi.Expand(req.URL, map[string]string{ 4400 "blogId": c.blogId, 4401 }) 4402 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4403} 4404 4405// Do executes the "blogger.pages.list" call. 4406// Exactly one of *PageList or error will be non-nil. Any non-2xx status 4407// code is an error. Response headers are in either 4408// *PageList.ServerResponse.Header or (if a response was returned at 4409// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4410// to check whether the returned error was because 4411// http.StatusNotModified was returned. 4412func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*PageList, error) { 4413 gensupport.SetOptions(c.urlParams_, opts...) 4414 res, err := c.doRequest("json") 4415 if res != nil && res.StatusCode == http.StatusNotModified { 4416 if res.Body != nil { 4417 res.Body.Close() 4418 } 4419 return nil, &googleapi.Error{ 4420 Code: res.StatusCode, 4421 Header: res.Header, 4422 } 4423 } 4424 if err != nil { 4425 return nil, err 4426 } 4427 defer googleapi.CloseBody(res) 4428 if err := googleapi.CheckResponse(res); err != nil { 4429 return nil, err 4430 } 4431 ret := &PageList{ 4432 ServerResponse: googleapi.ServerResponse{ 4433 Header: res.Header, 4434 HTTPStatusCode: res.StatusCode, 4435 }, 4436 } 4437 target := &ret 4438 if err := gensupport.DecodeResponse(target, res); err != nil { 4439 return nil, err 4440 } 4441 return ret, nil 4442 // { 4443 // "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", 4444 // "httpMethod": "GET", 4445 // "id": "blogger.pages.list", 4446 // "parameterOrder": [ 4447 // "blogId" 4448 // ], 4449 // "parameters": { 4450 // "blogId": { 4451 // "description": "ID of the blog to fetch Pages from.", 4452 // "location": "path", 4453 // "required": true, 4454 // "type": "string" 4455 // }, 4456 // "fetchBodies": { 4457 // "description": "Whether to retrieve the Page bodies.", 4458 // "location": "query", 4459 // "type": "boolean" 4460 // }, 4461 // "maxResults": { 4462 // "description": "Maximum number of Pages to fetch.", 4463 // "format": "uint32", 4464 // "location": "query", 4465 // "type": "integer" 4466 // }, 4467 // "pageToken": { 4468 // "description": "Continuation token if the request is paged.", 4469 // "location": "query", 4470 // "type": "string" 4471 // }, 4472 // "status": { 4473 // "enum": [ 4474 // "draft", 4475 // "live" 4476 // ], 4477 // "enumDescriptions": [ 4478 // "Draft (unpublished) Pages", 4479 // "Pages that are publicly visible" 4480 // ], 4481 // "location": "query", 4482 // "repeated": true, 4483 // "type": "string" 4484 // }, 4485 // "view": { 4486 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 4487 // "enum": [ 4488 // "ADMIN", 4489 // "AUTHOR", 4490 // "READER" 4491 // ], 4492 // "enumDescriptions": [ 4493 // "Admin level detail", 4494 // "Author level detail", 4495 // "Reader level detail" 4496 // ], 4497 // "location": "query", 4498 // "type": "string" 4499 // } 4500 // }, 4501 // "path": "blogs/{blogId}/pages", 4502 // "response": { 4503 // "$ref": "PageList" 4504 // }, 4505 // "scopes": [ 4506 // "https://www.googleapis.com/auth/blogger", 4507 // "https://www.googleapis.com/auth/blogger.readonly" 4508 // ] 4509 // } 4510 4511} 4512 4513// Pages invokes f for each page of results. 4514// A non-nil error returned from f will halt the iteration. 4515// The provided context supersedes any context provided to the Context method. 4516func (c *PagesListCall) Pages(ctx context.Context, f func(*PageList) error) error { 4517 c.ctx_ = ctx 4518 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4519 for { 4520 x, err := c.Do() 4521 if err != nil { 4522 return err 4523 } 4524 if err := f(x); err != nil { 4525 return err 4526 } 4527 if x.NextPageToken == "" { 4528 return nil 4529 } 4530 c.PageToken(x.NextPageToken) 4531 } 4532} 4533 4534// method id "blogger.pages.patch": 4535 4536type PagesPatchCall struct { 4537 s *Service 4538 blogId string 4539 pageId string 4540 page *Page 4541 urlParams_ gensupport.URLParams 4542 ctx_ context.Context 4543 header_ http.Header 4544} 4545 4546// Patch: Update a page. This method supports patch semantics. 4547func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall { 4548 c := &PagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4549 c.blogId = blogId 4550 c.pageId = pageId 4551 c.page = page 4552 return c 4553} 4554 4555// Publish sets the optional parameter "publish": Whether a publish 4556// action should be performed when the page is updated (default: false). 4557func (c *PagesPatchCall) Publish(publish bool) *PagesPatchCall { 4558 c.urlParams_.Set("publish", fmt.Sprint(publish)) 4559 return c 4560} 4561 4562// Revert sets the optional parameter "revert": Whether a revert action 4563// should be performed when the page is updated (default: false). 4564func (c *PagesPatchCall) Revert(revert bool) *PagesPatchCall { 4565 c.urlParams_.Set("revert", fmt.Sprint(revert)) 4566 return c 4567} 4568 4569// Fields allows partial responses to be retrieved. See 4570// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4571// for more information. 4572func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall { 4573 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4574 return c 4575} 4576 4577// Context sets the context to be used in this call's Do method. Any 4578// pending HTTP request will be aborted if the provided context is 4579// canceled. 4580func (c *PagesPatchCall) Context(ctx context.Context) *PagesPatchCall { 4581 c.ctx_ = ctx 4582 return c 4583} 4584 4585// Header returns an http.Header that can be modified by the caller to 4586// add HTTP headers to the request. 4587func (c *PagesPatchCall) Header() http.Header { 4588 if c.header_ == nil { 4589 c.header_ = make(http.Header) 4590 } 4591 return c.header_ 4592} 4593 4594func (c *PagesPatchCall) doRequest(alt string) (*http.Response, error) { 4595 reqHeaders := make(http.Header) 4596 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 4597 for k, v := range c.header_ { 4598 reqHeaders[k] = v 4599 } 4600 reqHeaders.Set("User-Agent", c.s.userAgent()) 4601 var body io.Reader = nil 4602 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) 4603 if err != nil { 4604 return nil, err 4605 } 4606 reqHeaders.Set("Content-Type", "application/json") 4607 c.urlParams_.Set("alt", alt) 4608 c.urlParams_.Set("prettyPrint", "false") 4609 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 4610 urls += "?" + c.urlParams_.Encode() 4611 req, err := http.NewRequest("PATCH", urls, body) 4612 if err != nil { 4613 return nil, err 4614 } 4615 req.Header = reqHeaders 4616 googleapi.Expand(req.URL, map[string]string{ 4617 "blogId": c.blogId, 4618 "pageId": c.pageId, 4619 }) 4620 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4621} 4622 4623// Do executes the "blogger.pages.patch" call. 4624// Exactly one of *Page or error will be non-nil. Any non-2xx status 4625// code is an error. Response headers are in either 4626// *Page.ServerResponse.Header or (if a response was returned at all) in 4627// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4628// whether the returned error was because http.StatusNotModified was 4629// returned. 4630func (c *PagesPatchCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4631 gensupport.SetOptions(c.urlParams_, opts...) 4632 res, err := c.doRequest("json") 4633 if res != nil && res.StatusCode == http.StatusNotModified { 4634 if res.Body != nil { 4635 res.Body.Close() 4636 } 4637 return nil, &googleapi.Error{ 4638 Code: res.StatusCode, 4639 Header: res.Header, 4640 } 4641 } 4642 if err != nil { 4643 return nil, err 4644 } 4645 defer googleapi.CloseBody(res) 4646 if err := googleapi.CheckResponse(res); err != nil { 4647 return nil, err 4648 } 4649 ret := &Page{ 4650 ServerResponse: googleapi.ServerResponse{ 4651 Header: res.Header, 4652 HTTPStatusCode: res.StatusCode, 4653 }, 4654 } 4655 target := &ret 4656 if err := gensupport.DecodeResponse(target, res); err != nil { 4657 return nil, err 4658 } 4659 return ret, nil 4660 // { 4661 // "description": "Update a page. This method supports patch semantics.", 4662 // "httpMethod": "PATCH", 4663 // "id": "blogger.pages.patch", 4664 // "parameterOrder": [ 4665 // "blogId", 4666 // "pageId" 4667 // ], 4668 // "parameters": { 4669 // "blogId": { 4670 // "description": "The ID of the Blog.", 4671 // "location": "path", 4672 // "required": true, 4673 // "type": "string" 4674 // }, 4675 // "pageId": { 4676 // "description": "The ID of the Page.", 4677 // "location": "path", 4678 // "required": true, 4679 // "type": "string" 4680 // }, 4681 // "publish": { 4682 // "description": "Whether a publish action should be performed when the page is updated (default: false).", 4683 // "location": "query", 4684 // "type": "boolean" 4685 // }, 4686 // "revert": { 4687 // "description": "Whether a revert action should be performed when the page is updated (default: false).", 4688 // "location": "query", 4689 // "type": "boolean" 4690 // } 4691 // }, 4692 // "path": "blogs/{blogId}/pages/{pageId}", 4693 // "request": { 4694 // "$ref": "Page" 4695 // }, 4696 // "response": { 4697 // "$ref": "Page" 4698 // }, 4699 // "scopes": [ 4700 // "https://www.googleapis.com/auth/blogger" 4701 // ] 4702 // } 4703 4704} 4705 4706// method id "blogger.pages.publish": 4707 4708type PagesPublishCall struct { 4709 s *Service 4710 blogId string 4711 pageId string 4712 urlParams_ gensupport.URLParams 4713 ctx_ context.Context 4714 header_ http.Header 4715} 4716 4717// Publish: Publishes a draft page. 4718func (r *PagesService) Publish(blogId string, pageId string) *PagesPublishCall { 4719 c := &PagesPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4720 c.blogId = blogId 4721 c.pageId = pageId 4722 return c 4723} 4724 4725// Fields allows partial responses to be retrieved. See 4726// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4727// for more information. 4728func (c *PagesPublishCall) Fields(s ...googleapi.Field) *PagesPublishCall { 4729 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4730 return c 4731} 4732 4733// Context sets the context to be used in this call's Do method. Any 4734// pending HTTP request will be aborted if the provided context is 4735// canceled. 4736func (c *PagesPublishCall) Context(ctx context.Context) *PagesPublishCall { 4737 c.ctx_ = ctx 4738 return c 4739} 4740 4741// Header returns an http.Header that can be modified by the caller to 4742// add HTTP headers to the request. 4743func (c *PagesPublishCall) Header() http.Header { 4744 if c.header_ == nil { 4745 c.header_ = make(http.Header) 4746 } 4747 return c.header_ 4748} 4749 4750func (c *PagesPublishCall) doRequest(alt string) (*http.Response, error) { 4751 reqHeaders := make(http.Header) 4752 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 4753 for k, v := range c.header_ { 4754 reqHeaders[k] = v 4755 } 4756 reqHeaders.Set("User-Agent", c.s.userAgent()) 4757 var body io.Reader = nil 4758 c.urlParams_.Set("alt", alt) 4759 c.urlParams_.Set("prettyPrint", "false") 4760 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}/publish") 4761 urls += "?" + c.urlParams_.Encode() 4762 req, err := http.NewRequest("POST", urls, body) 4763 if err != nil { 4764 return nil, err 4765 } 4766 req.Header = reqHeaders 4767 googleapi.Expand(req.URL, map[string]string{ 4768 "blogId": c.blogId, 4769 "pageId": c.pageId, 4770 }) 4771 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4772} 4773 4774// Do executes the "blogger.pages.publish" call. 4775// Exactly one of *Page or error will be non-nil. Any non-2xx status 4776// code is an error. Response headers are in either 4777// *Page.ServerResponse.Header or (if a response was returned at all) in 4778// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4779// whether the returned error was because http.StatusNotModified was 4780// returned. 4781func (c *PagesPublishCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4782 gensupport.SetOptions(c.urlParams_, opts...) 4783 res, err := c.doRequest("json") 4784 if res != nil && res.StatusCode == http.StatusNotModified { 4785 if res.Body != nil { 4786 res.Body.Close() 4787 } 4788 return nil, &googleapi.Error{ 4789 Code: res.StatusCode, 4790 Header: res.Header, 4791 } 4792 } 4793 if err != nil { 4794 return nil, err 4795 } 4796 defer googleapi.CloseBody(res) 4797 if err := googleapi.CheckResponse(res); err != nil { 4798 return nil, err 4799 } 4800 ret := &Page{ 4801 ServerResponse: googleapi.ServerResponse{ 4802 Header: res.Header, 4803 HTTPStatusCode: res.StatusCode, 4804 }, 4805 } 4806 target := &ret 4807 if err := gensupport.DecodeResponse(target, res); err != nil { 4808 return nil, err 4809 } 4810 return ret, nil 4811 // { 4812 // "description": "Publishes a draft page.", 4813 // "httpMethod": "POST", 4814 // "id": "blogger.pages.publish", 4815 // "parameterOrder": [ 4816 // "blogId", 4817 // "pageId" 4818 // ], 4819 // "parameters": { 4820 // "blogId": { 4821 // "description": "The ID of the blog.", 4822 // "location": "path", 4823 // "required": true, 4824 // "type": "string" 4825 // }, 4826 // "pageId": { 4827 // "description": "The ID of the page.", 4828 // "location": "path", 4829 // "required": true, 4830 // "type": "string" 4831 // } 4832 // }, 4833 // "path": "blogs/{blogId}/pages/{pageId}/publish", 4834 // "response": { 4835 // "$ref": "Page" 4836 // }, 4837 // "scopes": [ 4838 // "https://www.googleapis.com/auth/blogger" 4839 // ] 4840 // } 4841 4842} 4843 4844// method id "blogger.pages.revert": 4845 4846type PagesRevertCall struct { 4847 s *Service 4848 blogId string 4849 pageId string 4850 urlParams_ gensupport.URLParams 4851 ctx_ context.Context 4852 header_ http.Header 4853} 4854 4855// Revert: Revert a published or scheduled page to draft state. 4856func (r *PagesService) Revert(blogId string, pageId string) *PagesRevertCall { 4857 c := &PagesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4858 c.blogId = blogId 4859 c.pageId = pageId 4860 return c 4861} 4862 4863// Fields allows partial responses to be retrieved. See 4864// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4865// for more information. 4866func (c *PagesRevertCall) Fields(s ...googleapi.Field) *PagesRevertCall { 4867 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4868 return c 4869} 4870 4871// Context sets the context to be used in this call's Do method. Any 4872// pending HTTP request will be aborted if the provided context is 4873// canceled. 4874func (c *PagesRevertCall) Context(ctx context.Context) *PagesRevertCall { 4875 c.ctx_ = ctx 4876 return c 4877} 4878 4879// Header returns an http.Header that can be modified by the caller to 4880// add HTTP headers to the request. 4881func (c *PagesRevertCall) Header() http.Header { 4882 if c.header_ == nil { 4883 c.header_ = make(http.Header) 4884 } 4885 return c.header_ 4886} 4887 4888func (c *PagesRevertCall) doRequest(alt string) (*http.Response, error) { 4889 reqHeaders := make(http.Header) 4890 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 4891 for k, v := range c.header_ { 4892 reqHeaders[k] = v 4893 } 4894 reqHeaders.Set("User-Agent", c.s.userAgent()) 4895 var body io.Reader = nil 4896 c.urlParams_.Set("alt", alt) 4897 c.urlParams_.Set("prettyPrint", "false") 4898 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}/revert") 4899 urls += "?" + c.urlParams_.Encode() 4900 req, err := http.NewRequest("POST", urls, body) 4901 if err != nil { 4902 return nil, err 4903 } 4904 req.Header = reqHeaders 4905 googleapi.Expand(req.URL, map[string]string{ 4906 "blogId": c.blogId, 4907 "pageId": c.pageId, 4908 }) 4909 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4910} 4911 4912// Do executes the "blogger.pages.revert" call. 4913// Exactly one of *Page or error will be non-nil. Any non-2xx status 4914// code is an error. Response headers are in either 4915// *Page.ServerResponse.Header or (if a response was returned at all) in 4916// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4917// whether the returned error was because http.StatusNotModified was 4918// returned. 4919func (c *PagesRevertCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4920 gensupport.SetOptions(c.urlParams_, opts...) 4921 res, err := c.doRequest("json") 4922 if res != nil && res.StatusCode == http.StatusNotModified { 4923 if res.Body != nil { 4924 res.Body.Close() 4925 } 4926 return nil, &googleapi.Error{ 4927 Code: res.StatusCode, 4928 Header: res.Header, 4929 } 4930 } 4931 if err != nil { 4932 return nil, err 4933 } 4934 defer googleapi.CloseBody(res) 4935 if err := googleapi.CheckResponse(res); err != nil { 4936 return nil, err 4937 } 4938 ret := &Page{ 4939 ServerResponse: googleapi.ServerResponse{ 4940 Header: res.Header, 4941 HTTPStatusCode: res.StatusCode, 4942 }, 4943 } 4944 target := &ret 4945 if err := gensupport.DecodeResponse(target, res); err != nil { 4946 return nil, err 4947 } 4948 return ret, nil 4949 // { 4950 // "description": "Revert a published or scheduled page to draft state.", 4951 // "httpMethod": "POST", 4952 // "id": "blogger.pages.revert", 4953 // "parameterOrder": [ 4954 // "blogId", 4955 // "pageId" 4956 // ], 4957 // "parameters": { 4958 // "blogId": { 4959 // "description": "The ID of the blog.", 4960 // "location": "path", 4961 // "required": true, 4962 // "type": "string" 4963 // }, 4964 // "pageId": { 4965 // "description": "The ID of the page.", 4966 // "location": "path", 4967 // "required": true, 4968 // "type": "string" 4969 // } 4970 // }, 4971 // "path": "blogs/{blogId}/pages/{pageId}/revert", 4972 // "response": { 4973 // "$ref": "Page" 4974 // }, 4975 // "scopes": [ 4976 // "https://www.googleapis.com/auth/blogger" 4977 // ] 4978 // } 4979 4980} 4981 4982// method id "blogger.pages.update": 4983 4984type PagesUpdateCall struct { 4985 s *Service 4986 blogId string 4987 pageId string 4988 page *Page 4989 urlParams_ gensupport.URLParams 4990 ctx_ context.Context 4991 header_ http.Header 4992} 4993 4994// Update: Update a page. 4995func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall { 4996 c := &PagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4997 c.blogId = blogId 4998 c.pageId = pageId 4999 c.page = page 5000 return c 5001} 5002 5003// Publish sets the optional parameter "publish": Whether a publish 5004// action should be performed when the page is updated (default: false). 5005func (c *PagesUpdateCall) Publish(publish bool) *PagesUpdateCall { 5006 c.urlParams_.Set("publish", fmt.Sprint(publish)) 5007 return c 5008} 5009 5010// Revert sets the optional parameter "revert": Whether a revert action 5011// should be performed when the page is updated (default: false). 5012func (c *PagesUpdateCall) Revert(revert bool) *PagesUpdateCall { 5013 c.urlParams_.Set("revert", fmt.Sprint(revert)) 5014 return c 5015} 5016 5017// Fields allows partial responses to be retrieved. See 5018// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5019// for more information. 5020func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall { 5021 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5022 return c 5023} 5024 5025// Context sets the context to be used in this call's Do method. Any 5026// pending HTTP request will be aborted if the provided context is 5027// canceled. 5028func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall { 5029 c.ctx_ = ctx 5030 return c 5031} 5032 5033// Header returns an http.Header that can be modified by the caller to 5034// add HTTP headers to the request. 5035func (c *PagesUpdateCall) Header() http.Header { 5036 if c.header_ == nil { 5037 c.header_ = make(http.Header) 5038 } 5039 return c.header_ 5040} 5041 5042func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) { 5043 reqHeaders := make(http.Header) 5044 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5045 for k, v := range c.header_ { 5046 reqHeaders[k] = v 5047 } 5048 reqHeaders.Set("User-Agent", c.s.userAgent()) 5049 var body io.Reader = nil 5050 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) 5051 if err != nil { 5052 return nil, err 5053 } 5054 reqHeaders.Set("Content-Type", "application/json") 5055 c.urlParams_.Set("alt", alt) 5056 c.urlParams_.Set("prettyPrint", "false") 5057 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 5058 urls += "?" + c.urlParams_.Encode() 5059 req, err := http.NewRequest("PUT", urls, body) 5060 if err != nil { 5061 return nil, err 5062 } 5063 req.Header = reqHeaders 5064 googleapi.Expand(req.URL, map[string]string{ 5065 "blogId": c.blogId, 5066 "pageId": c.pageId, 5067 }) 5068 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5069} 5070 5071// Do executes the "blogger.pages.update" call. 5072// Exactly one of *Page or error will be non-nil. Any non-2xx status 5073// code is an error. Response headers are in either 5074// *Page.ServerResponse.Header or (if a response was returned at all) in 5075// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5076// whether the returned error was because http.StatusNotModified was 5077// returned. 5078func (c *PagesUpdateCall) Do(opts ...googleapi.CallOption) (*Page, error) { 5079 gensupport.SetOptions(c.urlParams_, opts...) 5080 res, err := c.doRequest("json") 5081 if res != nil && res.StatusCode == http.StatusNotModified { 5082 if res.Body != nil { 5083 res.Body.Close() 5084 } 5085 return nil, &googleapi.Error{ 5086 Code: res.StatusCode, 5087 Header: res.Header, 5088 } 5089 } 5090 if err != nil { 5091 return nil, err 5092 } 5093 defer googleapi.CloseBody(res) 5094 if err := googleapi.CheckResponse(res); err != nil { 5095 return nil, err 5096 } 5097 ret := &Page{ 5098 ServerResponse: googleapi.ServerResponse{ 5099 Header: res.Header, 5100 HTTPStatusCode: res.StatusCode, 5101 }, 5102 } 5103 target := &ret 5104 if err := gensupport.DecodeResponse(target, res); err != nil { 5105 return nil, err 5106 } 5107 return ret, nil 5108 // { 5109 // "description": "Update a page.", 5110 // "httpMethod": "PUT", 5111 // "id": "blogger.pages.update", 5112 // "parameterOrder": [ 5113 // "blogId", 5114 // "pageId" 5115 // ], 5116 // "parameters": { 5117 // "blogId": { 5118 // "description": "The ID of the Blog.", 5119 // "location": "path", 5120 // "required": true, 5121 // "type": "string" 5122 // }, 5123 // "pageId": { 5124 // "description": "The ID of the Page.", 5125 // "location": "path", 5126 // "required": true, 5127 // "type": "string" 5128 // }, 5129 // "publish": { 5130 // "description": "Whether a publish action should be performed when the page is updated (default: false).", 5131 // "location": "query", 5132 // "type": "boolean" 5133 // }, 5134 // "revert": { 5135 // "description": "Whether a revert action should be performed when the page is updated (default: false).", 5136 // "location": "query", 5137 // "type": "boolean" 5138 // } 5139 // }, 5140 // "path": "blogs/{blogId}/pages/{pageId}", 5141 // "request": { 5142 // "$ref": "Page" 5143 // }, 5144 // "response": { 5145 // "$ref": "Page" 5146 // }, 5147 // "scopes": [ 5148 // "https://www.googleapis.com/auth/blogger" 5149 // ] 5150 // } 5151 5152} 5153 5154// method id "blogger.postUserInfos.get": 5155 5156type PostUserInfosGetCall struct { 5157 s *Service 5158 userId string 5159 blogId string 5160 postId string 5161 urlParams_ gensupport.URLParams 5162 ifNoneMatch_ string 5163 ctx_ context.Context 5164 header_ http.Header 5165} 5166 5167// Get: Gets one post and user info pair, by post ID and user ID. The 5168// post user info contains per-user information about the post, such as 5169// access rights, specific to the user. 5170func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall { 5171 c := &PostUserInfosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5172 c.userId = userId 5173 c.blogId = blogId 5174 c.postId = postId 5175 return c 5176} 5177 5178// MaxComments sets the optional parameter "maxComments": Maximum number 5179// of comments to pull back on a post. 5180func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall { 5181 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 5182 return c 5183} 5184 5185// Fields allows partial responses to be retrieved. See 5186// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5187// for more information. 5188func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall { 5189 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5190 return c 5191} 5192 5193// IfNoneMatch sets the optional parameter which makes the operation 5194// fail if the object's ETag matches the given value. This is useful for 5195// getting updates only after the object has changed since the last 5196// request. Use googleapi.IsNotModified to check whether the response 5197// error from Do is the result of In-None-Match. 5198func (c *PostUserInfosGetCall) IfNoneMatch(entityTag string) *PostUserInfosGetCall { 5199 c.ifNoneMatch_ = entityTag 5200 return c 5201} 5202 5203// Context sets the context to be used in this call's Do method. Any 5204// pending HTTP request will be aborted if the provided context is 5205// canceled. 5206func (c *PostUserInfosGetCall) Context(ctx context.Context) *PostUserInfosGetCall { 5207 c.ctx_ = ctx 5208 return c 5209} 5210 5211// Header returns an http.Header that can be modified by the caller to 5212// add HTTP headers to the request. 5213func (c *PostUserInfosGetCall) Header() http.Header { 5214 if c.header_ == nil { 5215 c.header_ = make(http.Header) 5216 } 5217 return c.header_ 5218} 5219 5220func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) { 5221 reqHeaders := make(http.Header) 5222 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5223 for k, v := range c.header_ { 5224 reqHeaders[k] = v 5225 } 5226 reqHeaders.Set("User-Agent", c.s.userAgent()) 5227 if c.ifNoneMatch_ != "" { 5228 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5229 } 5230 var body io.Reader = nil 5231 c.urlParams_.Set("alt", alt) 5232 c.urlParams_.Set("prettyPrint", "false") 5233 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") 5234 urls += "?" + c.urlParams_.Encode() 5235 req, err := http.NewRequest("GET", urls, body) 5236 if err != nil { 5237 return nil, err 5238 } 5239 req.Header = reqHeaders 5240 googleapi.Expand(req.URL, map[string]string{ 5241 "userId": c.userId, 5242 "blogId": c.blogId, 5243 "postId": c.postId, 5244 }) 5245 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5246} 5247 5248// Do executes the "blogger.postUserInfos.get" call. 5249// Exactly one of *PostUserInfo or error will be non-nil. Any non-2xx 5250// status code is an error. Response headers are in either 5251// *PostUserInfo.ServerResponse.Header or (if a response was returned at 5252// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5253// to check whether the returned error was because 5254// http.StatusNotModified was returned. 5255func (c *PostUserInfosGetCall) Do(opts ...googleapi.CallOption) (*PostUserInfo, error) { 5256 gensupport.SetOptions(c.urlParams_, opts...) 5257 res, err := c.doRequest("json") 5258 if res != nil && res.StatusCode == http.StatusNotModified { 5259 if res.Body != nil { 5260 res.Body.Close() 5261 } 5262 return nil, &googleapi.Error{ 5263 Code: res.StatusCode, 5264 Header: res.Header, 5265 } 5266 } 5267 if err != nil { 5268 return nil, err 5269 } 5270 defer googleapi.CloseBody(res) 5271 if err := googleapi.CheckResponse(res); err != nil { 5272 return nil, err 5273 } 5274 ret := &PostUserInfo{ 5275 ServerResponse: googleapi.ServerResponse{ 5276 Header: res.Header, 5277 HTTPStatusCode: res.StatusCode, 5278 }, 5279 } 5280 target := &ret 5281 if err := gensupport.DecodeResponse(target, res); err != nil { 5282 return nil, err 5283 } 5284 return ret, nil 5285 // { 5286 // "description": "Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, specific to the user.", 5287 // "httpMethod": "GET", 5288 // "id": "blogger.postUserInfos.get", 5289 // "parameterOrder": [ 5290 // "userId", 5291 // "blogId", 5292 // "postId" 5293 // ], 5294 // "parameters": { 5295 // "blogId": { 5296 // "description": "The ID of the blog.", 5297 // "location": "path", 5298 // "required": true, 5299 // "type": "string" 5300 // }, 5301 // "maxComments": { 5302 // "description": "Maximum number of comments to pull back on a post.", 5303 // "format": "uint32", 5304 // "location": "query", 5305 // "type": "integer" 5306 // }, 5307 // "postId": { 5308 // "description": "The ID of the post to get.", 5309 // "location": "path", 5310 // "required": true, 5311 // "type": "string" 5312 // }, 5313 // "userId": { 5314 // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' or the user's profile identifier.", 5315 // "location": "path", 5316 // "required": true, 5317 // "type": "string" 5318 // } 5319 // }, 5320 // "path": "users/{userId}/blogs/{blogId}/posts/{postId}", 5321 // "response": { 5322 // "$ref": "PostUserInfo" 5323 // }, 5324 // "scopes": [ 5325 // "https://www.googleapis.com/auth/blogger", 5326 // "https://www.googleapis.com/auth/blogger.readonly" 5327 // ] 5328 // } 5329 5330} 5331 5332// method id "blogger.postUserInfos.list": 5333 5334type PostUserInfosListCall struct { 5335 s *Service 5336 userId string 5337 blogId string 5338 urlParams_ gensupport.URLParams 5339 ifNoneMatch_ string 5340 ctx_ context.Context 5341 header_ http.Header 5342} 5343 5344// List: Retrieves a list of post and post user info pairs, possibly 5345// filtered. The post user info contains per-user information about the 5346// post, such as access rights, specific to the user. 5347func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall { 5348 c := &PostUserInfosListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5349 c.userId = userId 5350 c.blogId = blogId 5351 return c 5352} 5353 5354// EndDate sets the optional parameter "endDate": Latest post date to 5355// fetch, a date-time with RFC 3339 formatting. 5356func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall { 5357 c.urlParams_.Set("endDate", endDate) 5358 return c 5359} 5360 5361// FetchBodies sets the optional parameter "fetchBodies": Whether the 5362// body content of posts is included. Default is false. 5363func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall { 5364 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 5365 return c 5366} 5367 5368// Labels sets the optional parameter "labels": Comma-separated list of 5369// labels to search for. 5370func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall { 5371 c.urlParams_.Set("labels", labels) 5372 return c 5373} 5374 5375// MaxResults sets the optional parameter "maxResults": Maximum number 5376// of posts to fetch. 5377func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall { 5378 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5379 return c 5380} 5381 5382// OrderBy sets the optional parameter "orderBy": Sort order applied to 5383// search results. Default is published. 5384// 5385// Possible values: 5386// "published" - Order by the date the post was published 5387// "updated" - Order by the date the post was last updated 5388func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall { 5389 c.urlParams_.Set("orderBy", orderBy) 5390 return c 5391} 5392 5393// PageToken sets the optional parameter "pageToken": Continuation token 5394// if the request is paged. 5395func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall { 5396 c.urlParams_.Set("pageToken", pageToken) 5397 return c 5398} 5399 5400// StartDate sets the optional parameter "startDate": Earliest post date 5401// to fetch, a date-time with RFC 3339 formatting. 5402func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall { 5403 c.urlParams_.Set("startDate", startDate) 5404 return c 5405} 5406 5407// Status sets the optional parameter "status": 5408// 5409// Possible values: 5410// "draft" - Draft posts 5411// "live" - Published posts 5412// "scheduled" - Posts that are scheduled to publish in future. 5413func (c *PostUserInfosListCall) Status(status ...string) *PostUserInfosListCall { 5414 c.urlParams_.SetMulti("status", append([]string{}, status...)) 5415 return c 5416} 5417 5418// View sets the optional parameter "view": Access level with which to 5419// view the returned result. Note that some fields require elevated 5420// access. 5421// 5422// Possible values: 5423// "ADMIN" - Admin level detail 5424// "AUTHOR" - Author level detail 5425// "READER" - Reader level detail 5426func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { 5427 c.urlParams_.Set("view", view) 5428 return c 5429} 5430 5431// Fields allows partial responses to be retrieved. See 5432// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5433// for more information. 5434func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall { 5435 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5436 return c 5437} 5438 5439// IfNoneMatch sets the optional parameter which makes the operation 5440// fail if the object's ETag matches the given value. This is useful for 5441// getting updates only after the object has changed since the last 5442// request. Use googleapi.IsNotModified to check whether the response 5443// error from Do is the result of In-None-Match. 5444func (c *PostUserInfosListCall) IfNoneMatch(entityTag string) *PostUserInfosListCall { 5445 c.ifNoneMatch_ = entityTag 5446 return c 5447} 5448 5449// Context sets the context to be used in this call's Do method. Any 5450// pending HTTP request will be aborted if the provided context is 5451// canceled. 5452func (c *PostUserInfosListCall) Context(ctx context.Context) *PostUserInfosListCall { 5453 c.ctx_ = ctx 5454 return c 5455} 5456 5457// Header returns an http.Header that can be modified by the caller to 5458// add HTTP headers to the request. 5459func (c *PostUserInfosListCall) Header() http.Header { 5460 if c.header_ == nil { 5461 c.header_ = make(http.Header) 5462 } 5463 return c.header_ 5464} 5465 5466func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) { 5467 reqHeaders := make(http.Header) 5468 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5469 for k, v := range c.header_ { 5470 reqHeaders[k] = v 5471 } 5472 reqHeaders.Set("User-Agent", c.s.userAgent()) 5473 if c.ifNoneMatch_ != "" { 5474 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5475 } 5476 var body io.Reader = nil 5477 c.urlParams_.Set("alt", alt) 5478 c.urlParams_.Set("prettyPrint", "false") 5479 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") 5480 urls += "?" + c.urlParams_.Encode() 5481 req, err := http.NewRequest("GET", urls, body) 5482 if err != nil { 5483 return nil, err 5484 } 5485 req.Header = reqHeaders 5486 googleapi.Expand(req.URL, map[string]string{ 5487 "userId": c.userId, 5488 "blogId": c.blogId, 5489 }) 5490 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5491} 5492 5493// Do executes the "blogger.postUserInfos.list" call. 5494// Exactly one of *PostUserInfosList or error will be non-nil. Any 5495// non-2xx status code is an error. Response headers are in either 5496// *PostUserInfosList.ServerResponse.Header or (if a response was 5497// returned at all) in error.(*googleapi.Error).Header. Use 5498// googleapi.IsNotModified to check whether the returned error was 5499// because http.StatusNotModified was returned. 5500func (c *PostUserInfosListCall) Do(opts ...googleapi.CallOption) (*PostUserInfosList, error) { 5501 gensupport.SetOptions(c.urlParams_, opts...) 5502 res, err := c.doRequest("json") 5503 if res != nil && res.StatusCode == http.StatusNotModified { 5504 if res.Body != nil { 5505 res.Body.Close() 5506 } 5507 return nil, &googleapi.Error{ 5508 Code: res.StatusCode, 5509 Header: res.Header, 5510 } 5511 } 5512 if err != nil { 5513 return nil, err 5514 } 5515 defer googleapi.CloseBody(res) 5516 if err := googleapi.CheckResponse(res); err != nil { 5517 return nil, err 5518 } 5519 ret := &PostUserInfosList{ 5520 ServerResponse: googleapi.ServerResponse{ 5521 Header: res.Header, 5522 HTTPStatusCode: res.StatusCode, 5523 }, 5524 } 5525 target := &ret 5526 if err := gensupport.DecodeResponse(target, res); err != nil { 5527 return nil, err 5528 } 5529 return ret, nil 5530 // { 5531 // "description": "Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access rights, specific to the user.", 5532 // "httpMethod": "GET", 5533 // "id": "blogger.postUserInfos.list", 5534 // "parameterOrder": [ 5535 // "userId", 5536 // "blogId" 5537 // ], 5538 // "parameters": { 5539 // "blogId": { 5540 // "description": "ID of the blog to fetch posts from.", 5541 // "location": "path", 5542 // "required": true, 5543 // "type": "string" 5544 // }, 5545 // "endDate": { 5546 // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", 5547 // "format": "date-time", 5548 // "location": "query", 5549 // "type": "string" 5550 // }, 5551 // "fetchBodies": { 5552 // "default": "false", 5553 // "description": "Whether the body content of posts is included. Default is false.", 5554 // "location": "query", 5555 // "type": "boolean" 5556 // }, 5557 // "labels": { 5558 // "description": "Comma-separated list of labels to search for.", 5559 // "location": "query", 5560 // "type": "string" 5561 // }, 5562 // "maxResults": { 5563 // "description": "Maximum number of posts to fetch.", 5564 // "format": "uint32", 5565 // "location": "query", 5566 // "type": "integer" 5567 // }, 5568 // "orderBy": { 5569 // "default": "PUBLISHED", 5570 // "description": "Sort order applied to search results. Default is published.", 5571 // "enum": [ 5572 // "published", 5573 // "updated" 5574 // ], 5575 // "enumDescriptions": [ 5576 // "Order by the date the post was published", 5577 // "Order by the date the post was last updated" 5578 // ], 5579 // "location": "query", 5580 // "type": "string" 5581 // }, 5582 // "pageToken": { 5583 // "description": "Continuation token if the request is paged.", 5584 // "location": "query", 5585 // "type": "string" 5586 // }, 5587 // "startDate": { 5588 // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", 5589 // "format": "date-time", 5590 // "location": "query", 5591 // "type": "string" 5592 // }, 5593 // "status": { 5594 // "enum": [ 5595 // "draft", 5596 // "live", 5597 // "scheduled" 5598 // ], 5599 // "enumDescriptions": [ 5600 // "Draft posts", 5601 // "Published posts", 5602 // "Posts that are scheduled to publish in future." 5603 // ], 5604 // "location": "query", 5605 // "repeated": true, 5606 // "type": "string" 5607 // }, 5608 // "userId": { 5609 // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' or the user's profile identifier.", 5610 // "location": "path", 5611 // "required": true, 5612 // "type": "string" 5613 // }, 5614 // "view": { 5615 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 5616 // "enum": [ 5617 // "ADMIN", 5618 // "AUTHOR", 5619 // "READER" 5620 // ], 5621 // "enumDescriptions": [ 5622 // "Admin level detail", 5623 // "Author level detail", 5624 // "Reader level detail" 5625 // ], 5626 // "location": "query", 5627 // "type": "string" 5628 // } 5629 // }, 5630 // "path": "users/{userId}/blogs/{blogId}/posts", 5631 // "response": { 5632 // "$ref": "PostUserInfosList" 5633 // }, 5634 // "scopes": [ 5635 // "https://www.googleapis.com/auth/blogger", 5636 // "https://www.googleapis.com/auth/blogger.readonly" 5637 // ] 5638 // } 5639 5640} 5641 5642// Pages invokes f for each page of results. 5643// A non-nil error returned from f will halt the iteration. 5644// The provided context supersedes any context provided to the Context method. 5645func (c *PostUserInfosListCall) Pages(ctx context.Context, f func(*PostUserInfosList) error) error { 5646 c.ctx_ = ctx 5647 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5648 for { 5649 x, err := c.Do() 5650 if err != nil { 5651 return err 5652 } 5653 if err := f(x); err != nil { 5654 return err 5655 } 5656 if x.NextPageToken == "" { 5657 return nil 5658 } 5659 c.PageToken(x.NextPageToken) 5660 } 5661} 5662 5663// method id "blogger.posts.delete": 5664 5665type PostsDeleteCall struct { 5666 s *Service 5667 blogId string 5668 postId string 5669 urlParams_ gensupport.URLParams 5670 ctx_ context.Context 5671 header_ http.Header 5672} 5673 5674// Delete: Delete a post by ID. 5675func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall { 5676 c := &PostsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5677 c.blogId = blogId 5678 c.postId = postId 5679 return c 5680} 5681 5682// Fields allows partial responses to be retrieved. See 5683// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5684// for more information. 5685func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall { 5686 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5687 return c 5688} 5689 5690// Context sets the context to be used in this call's Do method. Any 5691// pending HTTP request will be aborted if the provided context is 5692// canceled. 5693func (c *PostsDeleteCall) Context(ctx context.Context) *PostsDeleteCall { 5694 c.ctx_ = ctx 5695 return c 5696} 5697 5698// Header returns an http.Header that can be modified by the caller to 5699// add HTTP headers to the request. 5700func (c *PostsDeleteCall) Header() http.Header { 5701 if c.header_ == nil { 5702 c.header_ = make(http.Header) 5703 } 5704 return c.header_ 5705} 5706 5707func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) { 5708 reqHeaders := make(http.Header) 5709 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5710 for k, v := range c.header_ { 5711 reqHeaders[k] = v 5712 } 5713 reqHeaders.Set("User-Agent", c.s.userAgent()) 5714 var body io.Reader = nil 5715 c.urlParams_.Set("alt", alt) 5716 c.urlParams_.Set("prettyPrint", "false") 5717 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 5718 urls += "?" + c.urlParams_.Encode() 5719 req, err := http.NewRequest("DELETE", urls, body) 5720 if err != nil { 5721 return nil, err 5722 } 5723 req.Header = reqHeaders 5724 googleapi.Expand(req.URL, map[string]string{ 5725 "blogId": c.blogId, 5726 "postId": c.postId, 5727 }) 5728 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5729} 5730 5731// Do executes the "blogger.posts.delete" call. 5732func (c *PostsDeleteCall) Do(opts ...googleapi.CallOption) error { 5733 gensupport.SetOptions(c.urlParams_, opts...) 5734 res, err := c.doRequest("json") 5735 if err != nil { 5736 return err 5737 } 5738 defer googleapi.CloseBody(res) 5739 if err := googleapi.CheckResponse(res); err != nil { 5740 return err 5741 } 5742 return nil 5743 // { 5744 // "description": "Delete a post by ID.", 5745 // "httpMethod": "DELETE", 5746 // "id": "blogger.posts.delete", 5747 // "parameterOrder": [ 5748 // "blogId", 5749 // "postId" 5750 // ], 5751 // "parameters": { 5752 // "blogId": { 5753 // "description": "The ID of the Blog.", 5754 // "location": "path", 5755 // "required": true, 5756 // "type": "string" 5757 // }, 5758 // "postId": { 5759 // "description": "The ID of the Post.", 5760 // "location": "path", 5761 // "required": true, 5762 // "type": "string" 5763 // } 5764 // }, 5765 // "path": "blogs/{blogId}/posts/{postId}", 5766 // "scopes": [ 5767 // "https://www.googleapis.com/auth/blogger" 5768 // ] 5769 // } 5770 5771} 5772 5773// method id "blogger.posts.get": 5774 5775type PostsGetCall struct { 5776 s *Service 5777 blogId string 5778 postId string 5779 urlParams_ gensupport.URLParams 5780 ifNoneMatch_ string 5781 ctx_ context.Context 5782 header_ http.Header 5783} 5784 5785// Get: Get a post by ID. 5786func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { 5787 c := &PostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5788 c.blogId = blogId 5789 c.postId = postId 5790 return c 5791} 5792 5793// FetchBody sets the optional parameter "fetchBody": Whether the body 5794// content of the post is included (default: true). This should be set 5795// to false when the post bodies are not required, to help minimize 5796// traffic. 5797func (c *PostsGetCall) FetchBody(fetchBody bool) *PostsGetCall { 5798 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 5799 return c 5800} 5801 5802// FetchImages sets the optional parameter "fetchImages": Whether image 5803// URL metadata for each post is included (default: false). 5804func (c *PostsGetCall) FetchImages(fetchImages bool) *PostsGetCall { 5805 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 5806 return c 5807} 5808 5809// MaxComments sets the optional parameter "maxComments": Maximum number 5810// of comments to pull back on a post. 5811func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall { 5812 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 5813 return c 5814} 5815 5816// View sets the optional parameter "view": Access level with which to 5817// view the returned result. Note that some fields require elevated 5818// access. 5819// 5820// Possible values: 5821// "ADMIN" - Admin level detail 5822// "AUTHOR" - Author level detail 5823// "READER" - Reader level detail 5824func (c *PostsGetCall) View(view string) *PostsGetCall { 5825 c.urlParams_.Set("view", view) 5826 return c 5827} 5828 5829// Fields allows partial responses to be retrieved. See 5830// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5831// for more information. 5832func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { 5833 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5834 return c 5835} 5836 5837// IfNoneMatch sets the optional parameter which makes the operation 5838// fail if the object's ETag matches the given value. This is useful for 5839// getting updates only after the object has changed since the last 5840// request. Use googleapi.IsNotModified to check whether the response 5841// error from Do is the result of In-None-Match. 5842func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { 5843 c.ifNoneMatch_ = entityTag 5844 return c 5845} 5846 5847// Context sets the context to be used in this call's Do method. Any 5848// pending HTTP request will be aborted if the provided context is 5849// canceled. 5850func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { 5851 c.ctx_ = ctx 5852 return c 5853} 5854 5855// Header returns an http.Header that can be modified by the caller to 5856// add HTTP headers to the request. 5857func (c *PostsGetCall) Header() http.Header { 5858 if c.header_ == nil { 5859 c.header_ = make(http.Header) 5860 } 5861 return c.header_ 5862} 5863 5864func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { 5865 reqHeaders := make(http.Header) 5866 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5867 for k, v := range c.header_ { 5868 reqHeaders[k] = v 5869 } 5870 reqHeaders.Set("User-Agent", c.s.userAgent()) 5871 if c.ifNoneMatch_ != "" { 5872 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5873 } 5874 var body io.Reader = nil 5875 c.urlParams_.Set("alt", alt) 5876 c.urlParams_.Set("prettyPrint", "false") 5877 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 5878 urls += "?" + c.urlParams_.Encode() 5879 req, err := http.NewRequest("GET", urls, body) 5880 if err != nil { 5881 return nil, err 5882 } 5883 req.Header = reqHeaders 5884 googleapi.Expand(req.URL, map[string]string{ 5885 "blogId": c.blogId, 5886 "postId": c.postId, 5887 }) 5888 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5889} 5890 5891// Do executes the "blogger.posts.get" call. 5892// Exactly one of *Post or error will be non-nil. Any non-2xx status 5893// code is an error. Response headers are in either 5894// *Post.ServerResponse.Header or (if a response was returned at all) in 5895// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5896// whether the returned error was because http.StatusNotModified was 5897// returned. 5898func (c *PostsGetCall) Do(opts ...googleapi.CallOption) (*Post, error) { 5899 gensupport.SetOptions(c.urlParams_, opts...) 5900 res, err := c.doRequest("json") 5901 if res != nil && res.StatusCode == http.StatusNotModified { 5902 if res.Body != nil { 5903 res.Body.Close() 5904 } 5905 return nil, &googleapi.Error{ 5906 Code: res.StatusCode, 5907 Header: res.Header, 5908 } 5909 } 5910 if err != nil { 5911 return nil, err 5912 } 5913 defer googleapi.CloseBody(res) 5914 if err := googleapi.CheckResponse(res); err != nil { 5915 return nil, err 5916 } 5917 ret := &Post{ 5918 ServerResponse: googleapi.ServerResponse{ 5919 Header: res.Header, 5920 HTTPStatusCode: res.StatusCode, 5921 }, 5922 } 5923 target := &ret 5924 if err := gensupport.DecodeResponse(target, res); err != nil { 5925 return nil, err 5926 } 5927 return ret, nil 5928 // { 5929 // "description": "Get a post by ID.", 5930 // "httpMethod": "GET", 5931 // "id": "blogger.posts.get", 5932 // "parameterOrder": [ 5933 // "blogId", 5934 // "postId" 5935 // ], 5936 // "parameters": { 5937 // "blogId": { 5938 // "description": "ID of the blog to fetch the post from.", 5939 // "location": "path", 5940 // "required": true, 5941 // "type": "string" 5942 // }, 5943 // "fetchBody": { 5944 // "default": "true", 5945 // "description": "Whether the body content of the post is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", 5946 // "location": "query", 5947 // "type": "boolean" 5948 // }, 5949 // "fetchImages": { 5950 // "description": "Whether image URL metadata for each post is included (default: false).", 5951 // "location": "query", 5952 // "type": "boolean" 5953 // }, 5954 // "maxComments": { 5955 // "description": "Maximum number of comments to pull back on a post.", 5956 // "format": "uint32", 5957 // "location": "query", 5958 // "type": "integer" 5959 // }, 5960 // "postId": { 5961 // "description": "The ID of the post", 5962 // "location": "path", 5963 // "required": true, 5964 // "type": "string" 5965 // }, 5966 // "view": { 5967 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 5968 // "enum": [ 5969 // "ADMIN", 5970 // "AUTHOR", 5971 // "READER" 5972 // ], 5973 // "enumDescriptions": [ 5974 // "Admin level detail", 5975 // "Author level detail", 5976 // "Reader level detail" 5977 // ], 5978 // "location": "query", 5979 // "type": "string" 5980 // } 5981 // }, 5982 // "path": "blogs/{blogId}/posts/{postId}", 5983 // "response": { 5984 // "$ref": "Post" 5985 // }, 5986 // "scopes": [ 5987 // "https://www.googleapis.com/auth/blogger", 5988 // "https://www.googleapis.com/auth/blogger.readonly" 5989 // ] 5990 // } 5991 5992} 5993 5994// method id "blogger.posts.getByPath": 5995 5996type PostsGetByPathCall struct { 5997 s *Service 5998 blogId string 5999 urlParams_ gensupport.URLParams 6000 ifNoneMatch_ string 6001 ctx_ context.Context 6002 header_ http.Header 6003} 6004 6005// GetByPath: Retrieve a Post by Path. 6006func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall { 6007 c := &PostsGetByPathCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6008 c.blogId = blogId 6009 c.urlParams_.Set("path", path) 6010 return c 6011} 6012 6013// MaxComments sets the optional parameter "maxComments": Maximum number 6014// of comments to pull back on a post. 6015func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall { 6016 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 6017 return c 6018} 6019 6020// View sets the optional parameter "view": Access level with which to 6021// view the returned result. Note that some fields require elevated 6022// access. 6023// 6024// Possible values: 6025// "ADMIN" - Admin level detail 6026// "AUTHOR" - Author level detail 6027// "READER" - Reader level detail 6028func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { 6029 c.urlParams_.Set("view", view) 6030 return c 6031} 6032 6033// Fields allows partial responses to be retrieved. See 6034// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6035// for more information. 6036func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall { 6037 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6038 return c 6039} 6040 6041// IfNoneMatch sets the optional parameter which makes the operation 6042// fail if the object's ETag matches the given value. This is useful for 6043// getting updates only after the object has changed since the last 6044// request. Use googleapi.IsNotModified to check whether the response 6045// error from Do is the result of In-None-Match. 6046func (c *PostsGetByPathCall) IfNoneMatch(entityTag string) *PostsGetByPathCall { 6047 c.ifNoneMatch_ = entityTag 6048 return c 6049} 6050 6051// Context sets the context to be used in this call's Do method. Any 6052// pending HTTP request will be aborted if the provided context is 6053// canceled. 6054func (c *PostsGetByPathCall) Context(ctx context.Context) *PostsGetByPathCall { 6055 c.ctx_ = ctx 6056 return c 6057} 6058 6059// Header returns an http.Header that can be modified by the caller to 6060// add HTTP headers to the request. 6061func (c *PostsGetByPathCall) Header() http.Header { 6062 if c.header_ == nil { 6063 c.header_ = make(http.Header) 6064 } 6065 return c.header_ 6066} 6067 6068func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) { 6069 reqHeaders := make(http.Header) 6070 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6071 for k, v := range c.header_ { 6072 reqHeaders[k] = v 6073 } 6074 reqHeaders.Set("User-Agent", c.s.userAgent()) 6075 if c.ifNoneMatch_ != "" { 6076 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6077 } 6078 var body io.Reader = nil 6079 c.urlParams_.Set("alt", alt) 6080 c.urlParams_.Set("prettyPrint", "false") 6081 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") 6082 urls += "?" + c.urlParams_.Encode() 6083 req, err := http.NewRequest("GET", urls, body) 6084 if err != nil { 6085 return nil, err 6086 } 6087 req.Header = reqHeaders 6088 googleapi.Expand(req.URL, map[string]string{ 6089 "blogId": c.blogId, 6090 }) 6091 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6092} 6093 6094// Do executes the "blogger.posts.getByPath" call. 6095// Exactly one of *Post or error will be non-nil. Any non-2xx status 6096// code is an error. Response headers are in either 6097// *Post.ServerResponse.Header or (if a response was returned at all) in 6098// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6099// whether the returned error was because http.StatusNotModified was 6100// returned. 6101func (c *PostsGetByPathCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6102 gensupport.SetOptions(c.urlParams_, opts...) 6103 res, err := c.doRequest("json") 6104 if res != nil && res.StatusCode == http.StatusNotModified { 6105 if res.Body != nil { 6106 res.Body.Close() 6107 } 6108 return nil, &googleapi.Error{ 6109 Code: res.StatusCode, 6110 Header: res.Header, 6111 } 6112 } 6113 if err != nil { 6114 return nil, err 6115 } 6116 defer googleapi.CloseBody(res) 6117 if err := googleapi.CheckResponse(res); err != nil { 6118 return nil, err 6119 } 6120 ret := &Post{ 6121 ServerResponse: googleapi.ServerResponse{ 6122 Header: res.Header, 6123 HTTPStatusCode: res.StatusCode, 6124 }, 6125 } 6126 target := &ret 6127 if err := gensupport.DecodeResponse(target, res); err != nil { 6128 return nil, err 6129 } 6130 return ret, nil 6131 // { 6132 // "description": "Retrieve a Post by Path.", 6133 // "httpMethod": "GET", 6134 // "id": "blogger.posts.getByPath", 6135 // "parameterOrder": [ 6136 // "blogId", 6137 // "path" 6138 // ], 6139 // "parameters": { 6140 // "blogId": { 6141 // "description": "ID of the blog to fetch the post from.", 6142 // "location": "path", 6143 // "required": true, 6144 // "type": "string" 6145 // }, 6146 // "maxComments": { 6147 // "description": "Maximum number of comments to pull back on a post.", 6148 // "format": "uint32", 6149 // "location": "query", 6150 // "type": "integer" 6151 // }, 6152 // "path": { 6153 // "description": "Path of the Post to retrieve.", 6154 // "location": "query", 6155 // "required": true, 6156 // "type": "string" 6157 // }, 6158 // "view": { 6159 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 6160 // "enum": [ 6161 // "ADMIN", 6162 // "AUTHOR", 6163 // "READER" 6164 // ], 6165 // "enumDescriptions": [ 6166 // "Admin level detail", 6167 // "Author level detail", 6168 // "Reader level detail" 6169 // ], 6170 // "location": "query", 6171 // "type": "string" 6172 // } 6173 // }, 6174 // "path": "blogs/{blogId}/posts/bypath", 6175 // "response": { 6176 // "$ref": "Post" 6177 // }, 6178 // "scopes": [ 6179 // "https://www.googleapis.com/auth/blogger", 6180 // "https://www.googleapis.com/auth/blogger.readonly" 6181 // ] 6182 // } 6183 6184} 6185 6186// method id "blogger.posts.insert": 6187 6188type PostsInsertCall struct { 6189 s *Service 6190 blogId string 6191 post *Post 6192 urlParams_ gensupport.URLParams 6193 ctx_ context.Context 6194 header_ http.Header 6195} 6196 6197// Insert: Add a post. 6198func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall { 6199 c := &PostsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6200 c.blogId = blogId 6201 c.post = post 6202 return c 6203} 6204 6205// FetchBody sets the optional parameter "fetchBody": Whether the body 6206// content of the post is included with the result (default: true). 6207func (c *PostsInsertCall) FetchBody(fetchBody bool) *PostsInsertCall { 6208 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 6209 return c 6210} 6211 6212// FetchImages sets the optional parameter "fetchImages": Whether image 6213// URL metadata for each post is included in the returned result 6214// (default: false). 6215func (c *PostsInsertCall) FetchImages(fetchImages bool) *PostsInsertCall { 6216 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 6217 return c 6218} 6219 6220// IsDraft sets the optional parameter "isDraft": Whether to create the 6221// post as a draft (default: false). 6222func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall { 6223 c.urlParams_.Set("isDraft", fmt.Sprint(isDraft)) 6224 return c 6225} 6226 6227// Fields allows partial responses to be retrieved. See 6228// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6229// for more information. 6230func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall { 6231 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6232 return c 6233} 6234 6235// Context sets the context to be used in this call's Do method. Any 6236// pending HTTP request will be aborted if the provided context is 6237// canceled. 6238func (c *PostsInsertCall) Context(ctx context.Context) *PostsInsertCall { 6239 c.ctx_ = ctx 6240 return c 6241} 6242 6243// Header returns an http.Header that can be modified by the caller to 6244// add HTTP headers to the request. 6245func (c *PostsInsertCall) Header() http.Header { 6246 if c.header_ == nil { 6247 c.header_ = make(http.Header) 6248 } 6249 return c.header_ 6250} 6251 6252func (c *PostsInsertCall) doRequest(alt string) (*http.Response, error) { 6253 reqHeaders := make(http.Header) 6254 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6255 for k, v := range c.header_ { 6256 reqHeaders[k] = v 6257 } 6258 reqHeaders.Set("User-Agent", c.s.userAgent()) 6259 var body io.Reader = nil 6260 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) 6261 if err != nil { 6262 return nil, err 6263 } 6264 reqHeaders.Set("Content-Type", "application/json") 6265 c.urlParams_.Set("alt", alt) 6266 c.urlParams_.Set("prettyPrint", "false") 6267 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") 6268 urls += "?" + c.urlParams_.Encode() 6269 req, err := http.NewRequest("POST", urls, body) 6270 if err != nil { 6271 return nil, err 6272 } 6273 req.Header = reqHeaders 6274 googleapi.Expand(req.URL, map[string]string{ 6275 "blogId": c.blogId, 6276 }) 6277 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6278} 6279 6280// Do executes the "blogger.posts.insert" call. 6281// Exactly one of *Post or error will be non-nil. Any non-2xx status 6282// code is an error. Response headers are in either 6283// *Post.ServerResponse.Header or (if a response was returned at all) in 6284// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6285// whether the returned error was because http.StatusNotModified was 6286// returned. 6287func (c *PostsInsertCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6288 gensupport.SetOptions(c.urlParams_, opts...) 6289 res, err := c.doRequest("json") 6290 if res != nil && res.StatusCode == http.StatusNotModified { 6291 if res.Body != nil { 6292 res.Body.Close() 6293 } 6294 return nil, &googleapi.Error{ 6295 Code: res.StatusCode, 6296 Header: res.Header, 6297 } 6298 } 6299 if err != nil { 6300 return nil, err 6301 } 6302 defer googleapi.CloseBody(res) 6303 if err := googleapi.CheckResponse(res); err != nil { 6304 return nil, err 6305 } 6306 ret := &Post{ 6307 ServerResponse: googleapi.ServerResponse{ 6308 Header: res.Header, 6309 HTTPStatusCode: res.StatusCode, 6310 }, 6311 } 6312 target := &ret 6313 if err := gensupport.DecodeResponse(target, res); err != nil { 6314 return nil, err 6315 } 6316 return ret, nil 6317 // { 6318 // "description": "Add a post.", 6319 // "httpMethod": "POST", 6320 // "id": "blogger.posts.insert", 6321 // "parameterOrder": [ 6322 // "blogId" 6323 // ], 6324 // "parameters": { 6325 // "blogId": { 6326 // "description": "ID of the blog to add the post to.", 6327 // "location": "path", 6328 // "required": true, 6329 // "type": "string" 6330 // }, 6331 // "fetchBody": { 6332 // "default": "true", 6333 // "description": "Whether the body content of the post is included with the result (default: true).", 6334 // "location": "query", 6335 // "type": "boolean" 6336 // }, 6337 // "fetchImages": { 6338 // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", 6339 // "location": "query", 6340 // "type": "boolean" 6341 // }, 6342 // "isDraft": { 6343 // "description": "Whether to create the post as a draft (default: false).", 6344 // "location": "query", 6345 // "type": "boolean" 6346 // } 6347 // }, 6348 // "path": "blogs/{blogId}/posts", 6349 // "request": { 6350 // "$ref": "Post" 6351 // }, 6352 // "response": { 6353 // "$ref": "Post" 6354 // }, 6355 // "scopes": [ 6356 // "https://www.googleapis.com/auth/blogger" 6357 // ] 6358 // } 6359 6360} 6361 6362// method id "blogger.posts.list": 6363 6364type PostsListCall struct { 6365 s *Service 6366 blogId string 6367 urlParams_ gensupport.URLParams 6368 ifNoneMatch_ string 6369 ctx_ context.Context 6370 header_ http.Header 6371} 6372 6373// List: Retrieves a list of posts, possibly filtered. 6374func (r *PostsService) List(blogId string) *PostsListCall { 6375 c := &PostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6376 c.blogId = blogId 6377 return c 6378} 6379 6380// EndDate sets the optional parameter "endDate": Latest post date to 6381// fetch, a date-time with RFC 3339 formatting. 6382func (c *PostsListCall) EndDate(endDate string) *PostsListCall { 6383 c.urlParams_.Set("endDate", endDate) 6384 return c 6385} 6386 6387// FetchBodies sets the optional parameter "fetchBodies": Whether the 6388// body content of posts is included (default: true). This should be set 6389// to false when the post bodies are not required, to help minimize 6390// traffic. 6391func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { 6392 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 6393 return c 6394} 6395 6396// FetchImages sets the optional parameter "fetchImages": Whether image 6397// URL metadata for each post is included. 6398func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall { 6399 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 6400 return c 6401} 6402 6403// Labels sets the optional parameter "labels": Comma-separated list of 6404// labels to search for. 6405func (c *PostsListCall) Labels(labels string) *PostsListCall { 6406 c.urlParams_.Set("labels", labels) 6407 return c 6408} 6409 6410// MaxResults sets the optional parameter "maxResults": Maximum number 6411// of posts to fetch. 6412func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { 6413 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6414 return c 6415} 6416 6417// OrderBy sets the optional parameter "orderBy": Sort search results 6418// 6419// Possible values: 6420// "published" - Order by the date the post was published 6421// "updated" - Order by the date the post was last updated 6422func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall { 6423 c.urlParams_.Set("orderBy", orderBy) 6424 return c 6425} 6426 6427// PageToken sets the optional parameter "pageToken": Continuation token 6428// if the request is paged. 6429func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { 6430 c.urlParams_.Set("pageToken", pageToken) 6431 return c 6432} 6433 6434// StartDate sets the optional parameter "startDate": Earliest post date 6435// to fetch, a date-time with RFC 3339 formatting. 6436func (c *PostsListCall) StartDate(startDate string) *PostsListCall { 6437 c.urlParams_.Set("startDate", startDate) 6438 return c 6439} 6440 6441// Status sets the optional parameter "status": Statuses to include in 6442// the results. 6443// 6444// Possible values: 6445// "draft" - Draft (non-published) posts. 6446// "live" - Published posts 6447// "scheduled" - Posts that are scheduled to publish in the future. 6448func (c *PostsListCall) Status(status ...string) *PostsListCall { 6449 c.urlParams_.SetMulti("status", append([]string{}, status...)) 6450 return c 6451} 6452 6453// View sets the optional parameter "view": Access level with which to 6454// view the returned result. Note that some fields require escalated 6455// access. 6456// 6457// Possible values: 6458// "ADMIN" - Admin level detail 6459// "AUTHOR" - Author level detail 6460// "READER" - Reader level detail 6461func (c *PostsListCall) View(view string) *PostsListCall { 6462 c.urlParams_.Set("view", view) 6463 return c 6464} 6465 6466// Fields allows partial responses to be retrieved. See 6467// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6468// for more information. 6469func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { 6470 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6471 return c 6472} 6473 6474// IfNoneMatch sets the optional parameter which makes the operation 6475// fail if the object's ETag matches the given value. This is useful for 6476// getting updates only after the object has changed since the last 6477// request. Use googleapi.IsNotModified to check whether the response 6478// error from Do is the result of In-None-Match. 6479func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { 6480 c.ifNoneMatch_ = entityTag 6481 return c 6482} 6483 6484// Context sets the context to be used in this call's Do method. Any 6485// pending HTTP request will be aborted if the provided context is 6486// canceled. 6487func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { 6488 c.ctx_ = ctx 6489 return c 6490} 6491 6492// Header returns an http.Header that can be modified by the caller to 6493// add HTTP headers to the request. 6494func (c *PostsListCall) Header() http.Header { 6495 if c.header_ == nil { 6496 c.header_ = make(http.Header) 6497 } 6498 return c.header_ 6499} 6500 6501func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { 6502 reqHeaders := make(http.Header) 6503 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6504 for k, v := range c.header_ { 6505 reqHeaders[k] = v 6506 } 6507 reqHeaders.Set("User-Agent", c.s.userAgent()) 6508 if c.ifNoneMatch_ != "" { 6509 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6510 } 6511 var body io.Reader = nil 6512 c.urlParams_.Set("alt", alt) 6513 c.urlParams_.Set("prettyPrint", "false") 6514 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") 6515 urls += "?" + c.urlParams_.Encode() 6516 req, err := http.NewRequest("GET", urls, body) 6517 if err != nil { 6518 return nil, err 6519 } 6520 req.Header = reqHeaders 6521 googleapi.Expand(req.URL, map[string]string{ 6522 "blogId": c.blogId, 6523 }) 6524 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6525} 6526 6527// Do executes the "blogger.posts.list" call. 6528// Exactly one of *PostList or error will be non-nil. Any non-2xx status 6529// code is an error. Response headers are in either 6530// *PostList.ServerResponse.Header or (if a response was returned at 6531// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6532// to check whether the returned error was because 6533// http.StatusNotModified was returned. 6534func (c *PostsListCall) Do(opts ...googleapi.CallOption) (*PostList, error) { 6535 gensupport.SetOptions(c.urlParams_, opts...) 6536 res, err := c.doRequest("json") 6537 if res != nil && res.StatusCode == http.StatusNotModified { 6538 if res.Body != nil { 6539 res.Body.Close() 6540 } 6541 return nil, &googleapi.Error{ 6542 Code: res.StatusCode, 6543 Header: res.Header, 6544 } 6545 } 6546 if err != nil { 6547 return nil, err 6548 } 6549 defer googleapi.CloseBody(res) 6550 if err := googleapi.CheckResponse(res); err != nil { 6551 return nil, err 6552 } 6553 ret := &PostList{ 6554 ServerResponse: googleapi.ServerResponse{ 6555 Header: res.Header, 6556 HTTPStatusCode: res.StatusCode, 6557 }, 6558 } 6559 target := &ret 6560 if err := gensupport.DecodeResponse(target, res); err != nil { 6561 return nil, err 6562 } 6563 return ret, nil 6564 // { 6565 // "description": "Retrieves a list of posts, possibly filtered.", 6566 // "httpMethod": "GET", 6567 // "id": "blogger.posts.list", 6568 // "parameterOrder": [ 6569 // "blogId" 6570 // ], 6571 // "parameters": { 6572 // "blogId": { 6573 // "description": "ID of the blog to fetch posts from.", 6574 // "location": "path", 6575 // "required": true, 6576 // "type": "string" 6577 // }, 6578 // "endDate": { 6579 // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", 6580 // "format": "date-time", 6581 // "location": "query", 6582 // "type": "string" 6583 // }, 6584 // "fetchBodies": { 6585 // "default": "true", 6586 // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", 6587 // "location": "query", 6588 // "type": "boolean" 6589 // }, 6590 // "fetchImages": { 6591 // "description": "Whether image URL metadata for each post is included.", 6592 // "location": "query", 6593 // "type": "boolean" 6594 // }, 6595 // "labels": { 6596 // "description": "Comma-separated list of labels to search for.", 6597 // "location": "query", 6598 // "type": "string" 6599 // }, 6600 // "maxResults": { 6601 // "description": "Maximum number of posts to fetch.", 6602 // "format": "uint32", 6603 // "location": "query", 6604 // "type": "integer" 6605 // }, 6606 // "orderBy": { 6607 // "default": "PUBLISHED", 6608 // "description": "Sort search results", 6609 // "enum": [ 6610 // "published", 6611 // "updated" 6612 // ], 6613 // "enumDescriptions": [ 6614 // "Order by the date the post was published", 6615 // "Order by the date the post was last updated" 6616 // ], 6617 // "location": "query", 6618 // "type": "string" 6619 // }, 6620 // "pageToken": { 6621 // "description": "Continuation token if the request is paged.", 6622 // "location": "query", 6623 // "type": "string" 6624 // }, 6625 // "startDate": { 6626 // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", 6627 // "format": "date-time", 6628 // "location": "query", 6629 // "type": "string" 6630 // }, 6631 // "status": { 6632 // "description": "Statuses to include in the results.", 6633 // "enum": [ 6634 // "draft", 6635 // "live", 6636 // "scheduled" 6637 // ], 6638 // "enumDescriptions": [ 6639 // "Draft (non-published) posts.", 6640 // "Published posts", 6641 // "Posts that are scheduled to publish in the future." 6642 // ], 6643 // "location": "query", 6644 // "repeated": true, 6645 // "type": "string" 6646 // }, 6647 // "view": { 6648 // "description": "Access level with which to view the returned result. Note that some fields require escalated access.", 6649 // "enum": [ 6650 // "ADMIN", 6651 // "AUTHOR", 6652 // "READER" 6653 // ], 6654 // "enumDescriptions": [ 6655 // "Admin level detail", 6656 // "Author level detail", 6657 // "Reader level detail" 6658 // ], 6659 // "location": "query", 6660 // "type": "string" 6661 // } 6662 // }, 6663 // "path": "blogs/{blogId}/posts", 6664 // "response": { 6665 // "$ref": "PostList" 6666 // }, 6667 // "scopes": [ 6668 // "https://www.googleapis.com/auth/blogger", 6669 // "https://www.googleapis.com/auth/blogger.readonly" 6670 // ] 6671 // } 6672 6673} 6674 6675// Pages invokes f for each page of results. 6676// A non-nil error returned from f will halt the iteration. 6677// The provided context supersedes any context provided to the Context method. 6678func (c *PostsListCall) Pages(ctx context.Context, f func(*PostList) error) error { 6679 c.ctx_ = ctx 6680 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6681 for { 6682 x, err := c.Do() 6683 if err != nil { 6684 return err 6685 } 6686 if err := f(x); err != nil { 6687 return err 6688 } 6689 if x.NextPageToken == "" { 6690 return nil 6691 } 6692 c.PageToken(x.NextPageToken) 6693 } 6694} 6695 6696// method id "blogger.posts.patch": 6697 6698type PostsPatchCall struct { 6699 s *Service 6700 blogId string 6701 postId string 6702 post *Post 6703 urlParams_ gensupport.URLParams 6704 ctx_ context.Context 6705 header_ http.Header 6706} 6707 6708// Patch: Update a post. This method supports patch semantics. 6709func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall { 6710 c := &PostsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6711 c.blogId = blogId 6712 c.postId = postId 6713 c.post = post 6714 return c 6715} 6716 6717// FetchBody sets the optional parameter "fetchBody": Whether the body 6718// content of the post is included with the result (default: true). 6719func (c *PostsPatchCall) FetchBody(fetchBody bool) *PostsPatchCall { 6720 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 6721 return c 6722} 6723 6724// FetchImages sets the optional parameter "fetchImages": Whether image 6725// URL metadata for each post is included in the returned result 6726// (default: false). 6727func (c *PostsPatchCall) FetchImages(fetchImages bool) *PostsPatchCall { 6728 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 6729 return c 6730} 6731 6732// MaxComments sets the optional parameter "maxComments": Maximum number 6733// of comments to retrieve with the returned post. 6734func (c *PostsPatchCall) MaxComments(maxComments int64) *PostsPatchCall { 6735 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 6736 return c 6737} 6738 6739// Publish sets the optional parameter "publish": Whether a publish 6740// action should be performed when the post is updated (default: false). 6741func (c *PostsPatchCall) Publish(publish bool) *PostsPatchCall { 6742 c.urlParams_.Set("publish", fmt.Sprint(publish)) 6743 return c 6744} 6745 6746// Revert sets the optional parameter "revert": Whether a revert action 6747// should be performed when the post is updated (default: false). 6748func (c *PostsPatchCall) Revert(revert bool) *PostsPatchCall { 6749 c.urlParams_.Set("revert", fmt.Sprint(revert)) 6750 return c 6751} 6752 6753// Fields allows partial responses to be retrieved. See 6754// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6755// for more information. 6756func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall { 6757 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6758 return c 6759} 6760 6761// Context sets the context to be used in this call's Do method. Any 6762// pending HTTP request will be aborted if the provided context is 6763// canceled. 6764func (c *PostsPatchCall) Context(ctx context.Context) *PostsPatchCall { 6765 c.ctx_ = ctx 6766 return c 6767} 6768 6769// Header returns an http.Header that can be modified by the caller to 6770// add HTTP headers to the request. 6771func (c *PostsPatchCall) Header() http.Header { 6772 if c.header_ == nil { 6773 c.header_ = make(http.Header) 6774 } 6775 return c.header_ 6776} 6777 6778func (c *PostsPatchCall) doRequest(alt string) (*http.Response, error) { 6779 reqHeaders := make(http.Header) 6780 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6781 for k, v := range c.header_ { 6782 reqHeaders[k] = v 6783 } 6784 reqHeaders.Set("User-Agent", c.s.userAgent()) 6785 var body io.Reader = nil 6786 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) 6787 if err != nil { 6788 return nil, err 6789 } 6790 reqHeaders.Set("Content-Type", "application/json") 6791 c.urlParams_.Set("alt", alt) 6792 c.urlParams_.Set("prettyPrint", "false") 6793 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 6794 urls += "?" + c.urlParams_.Encode() 6795 req, err := http.NewRequest("PATCH", urls, body) 6796 if err != nil { 6797 return nil, err 6798 } 6799 req.Header = reqHeaders 6800 googleapi.Expand(req.URL, map[string]string{ 6801 "blogId": c.blogId, 6802 "postId": c.postId, 6803 }) 6804 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6805} 6806 6807// Do executes the "blogger.posts.patch" call. 6808// Exactly one of *Post or error will be non-nil. Any non-2xx status 6809// code is an error. Response headers are in either 6810// *Post.ServerResponse.Header or (if a response was returned at all) in 6811// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6812// whether the returned error was because http.StatusNotModified was 6813// returned. 6814func (c *PostsPatchCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6815 gensupport.SetOptions(c.urlParams_, opts...) 6816 res, err := c.doRequest("json") 6817 if res != nil && res.StatusCode == http.StatusNotModified { 6818 if res.Body != nil { 6819 res.Body.Close() 6820 } 6821 return nil, &googleapi.Error{ 6822 Code: res.StatusCode, 6823 Header: res.Header, 6824 } 6825 } 6826 if err != nil { 6827 return nil, err 6828 } 6829 defer googleapi.CloseBody(res) 6830 if err := googleapi.CheckResponse(res); err != nil { 6831 return nil, err 6832 } 6833 ret := &Post{ 6834 ServerResponse: googleapi.ServerResponse{ 6835 Header: res.Header, 6836 HTTPStatusCode: res.StatusCode, 6837 }, 6838 } 6839 target := &ret 6840 if err := gensupport.DecodeResponse(target, res); err != nil { 6841 return nil, err 6842 } 6843 return ret, nil 6844 // { 6845 // "description": "Update a post. This method supports patch semantics.", 6846 // "httpMethod": "PATCH", 6847 // "id": "blogger.posts.patch", 6848 // "parameterOrder": [ 6849 // "blogId", 6850 // "postId" 6851 // ], 6852 // "parameters": { 6853 // "blogId": { 6854 // "description": "The ID of the Blog.", 6855 // "location": "path", 6856 // "required": true, 6857 // "type": "string" 6858 // }, 6859 // "fetchBody": { 6860 // "default": "true", 6861 // "description": "Whether the body content of the post is included with the result (default: true).", 6862 // "location": "query", 6863 // "type": "boolean" 6864 // }, 6865 // "fetchImages": { 6866 // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", 6867 // "location": "query", 6868 // "type": "boolean" 6869 // }, 6870 // "maxComments": { 6871 // "description": "Maximum number of comments to retrieve with the returned post.", 6872 // "format": "uint32", 6873 // "location": "query", 6874 // "type": "integer" 6875 // }, 6876 // "postId": { 6877 // "description": "The ID of the Post.", 6878 // "location": "path", 6879 // "required": true, 6880 // "type": "string" 6881 // }, 6882 // "publish": { 6883 // "description": "Whether a publish action should be performed when the post is updated (default: false).", 6884 // "location": "query", 6885 // "type": "boolean" 6886 // }, 6887 // "revert": { 6888 // "description": "Whether a revert action should be performed when the post is updated (default: false).", 6889 // "location": "query", 6890 // "type": "boolean" 6891 // } 6892 // }, 6893 // "path": "blogs/{blogId}/posts/{postId}", 6894 // "request": { 6895 // "$ref": "Post" 6896 // }, 6897 // "response": { 6898 // "$ref": "Post" 6899 // }, 6900 // "scopes": [ 6901 // "https://www.googleapis.com/auth/blogger" 6902 // ] 6903 // } 6904 6905} 6906 6907// method id "blogger.posts.publish": 6908 6909type PostsPublishCall struct { 6910 s *Service 6911 blogId string 6912 postId string 6913 urlParams_ gensupport.URLParams 6914 ctx_ context.Context 6915 header_ http.Header 6916} 6917 6918// Publish: Publishes a draft post, optionally at the specific time of 6919// the given publishDate parameter. 6920func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall { 6921 c := &PostsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6922 c.blogId = blogId 6923 c.postId = postId 6924 return c 6925} 6926 6927// PublishDate sets the optional parameter "publishDate": Optional date 6928// and time to schedule the publishing of the Blog. If no publishDate 6929// parameter is given, the post is either published at the a previously 6930// saved schedule date (if present), or the current time. If a future 6931// date is given, the post will be scheduled to be published. 6932func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall { 6933 c.urlParams_.Set("publishDate", publishDate) 6934 return c 6935} 6936 6937// Fields allows partial responses to be retrieved. See 6938// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6939// for more information. 6940func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall { 6941 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6942 return c 6943} 6944 6945// Context sets the context to be used in this call's Do method. Any 6946// pending HTTP request will be aborted if the provided context is 6947// canceled. 6948func (c *PostsPublishCall) Context(ctx context.Context) *PostsPublishCall { 6949 c.ctx_ = ctx 6950 return c 6951} 6952 6953// Header returns an http.Header that can be modified by the caller to 6954// add HTTP headers to the request. 6955func (c *PostsPublishCall) Header() http.Header { 6956 if c.header_ == nil { 6957 c.header_ = make(http.Header) 6958 } 6959 return c.header_ 6960} 6961 6962func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) { 6963 reqHeaders := make(http.Header) 6964 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6965 for k, v := range c.header_ { 6966 reqHeaders[k] = v 6967 } 6968 reqHeaders.Set("User-Agent", c.s.userAgent()) 6969 var body io.Reader = nil 6970 c.urlParams_.Set("alt", alt) 6971 c.urlParams_.Set("prettyPrint", "false") 6972 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") 6973 urls += "?" + c.urlParams_.Encode() 6974 req, err := http.NewRequest("POST", urls, body) 6975 if err != nil { 6976 return nil, err 6977 } 6978 req.Header = reqHeaders 6979 googleapi.Expand(req.URL, map[string]string{ 6980 "blogId": c.blogId, 6981 "postId": c.postId, 6982 }) 6983 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6984} 6985 6986// Do executes the "blogger.posts.publish" call. 6987// Exactly one of *Post or error will be non-nil. Any non-2xx status 6988// code is an error. Response headers are in either 6989// *Post.ServerResponse.Header or (if a response was returned at all) in 6990// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6991// whether the returned error was because http.StatusNotModified was 6992// returned. 6993func (c *PostsPublishCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6994 gensupport.SetOptions(c.urlParams_, opts...) 6995 res, err := c.doRequest("json") 6996 if res != nil && res.StatusCode == http.StatusNotModified { 6997 if res.Body != nil { 6998 res.Body.Close() 6999 } 7000 return nil, &googleapi.Error{ 7001 Code: res.StatusCode, 7002 Header: res.Header, 7003 } 7004 } 7005 if err != nil { 7006 return nil, err 7007 } 7008 defer googleapi.CloseBody(res) 7009 if err := googleapi.CheckResponse(res); err != nil { 7010 return nil, err 7011 } 7012 ret := &Post{ 7013 ServerResponse: googleapi.ServerResponse{ 7014 Header: res.Header, 7015 HTTPStatusCode: res.StatusCode, 7016 }, 7017 } 7018 target := &ret 7019 if err := gensupport.DecodeResponse(target, res); err != nil { 7020 return nil, err 7021 } 7022 return ret, nil 7023 // { 7024 // "description": "Publishes a draft post, optionally at the specific time of the given publishDate parameter.", 7025 // "httpMethod": "POST", 7026 // "id": "blogger.posts.publish", 7027 // "parameterOrder": [ 7028 // "blogId", 7029 // "postId" 7030 // ], 7031 // "parameters": { 7032 // "blogId": { 7033 // "description": "The ID of the Blog.", 7034 // "location": "path", 7035 // "required": true, 7036 // "type": "string" 7037 // }, 7038 // "postId": { 7039 // "description": "The ID of the Post.", 7040 // "location": "path", 7041 // "required": true, 7042 // "type": "string" 7043 // }, 7044 // "publishDate": { 7045 // "description": "Optional date and time to schedule the publishing of the Blog. If no publishDate parameter is given, the post is either published at the a previously saved schedule date (if present), or the current time. If a future date is given, the post will be scheduled to be published.", 7046 // "format": "date-time", 7047 // "location": "query", 7048 // "type": "string" 7049 // } 7050 // }, 7051 // "path": "blogs/{blogId}/posts/{postId}/publish", 7052 // "response": { 7053 // "$ref": "Post" 7054 // }, 7055 // "scopes": [ 7056 // "https://www.googleapis.com/auth/blogger" 7057 // ] 7058 // } 7059 7060} 7061 7062// method id "blogger.posts.revert": 7063 7064type PostsRevertCall struct { 7065 s *Service 7066 blogId string 7067 postId string 7068 urlParams_ gensupport.URLParams 7069 ctx_ context.Context 7070 header_ http.Header 7071} 7072 7073// Revert: Revert a published or scheduled post to draft state. 7074func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall { 7075 c := &PostsRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7076 c.blogId = blogId 7077 c.postId = postId 7078 return c 7079} 7080 7081// Fields allows partial responses to be retrieved. See 7082// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7083// for more information. 7084func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall { 7085 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7086 return c 7087} 7088 7089// Context sets the context to be used in this call's Do method. Any 7090// pending HTTP request will be aborted if the provided context is 7091// canceled. 7092func (c *PostsRevertCall) Context(ctx context.Context) *PostsRevertCall { 7093 c.ctx_ = ctx 7094 return c 7095} 7096 7097// Header returns an http.Header that can be modified by the caller to 7098// add HTTP headers to the request. 7099func (c *PostsRevertCall) Header() http.Header { 7100 if c.header_ == nil { 7101 c.header_ = make(http.Header) 7102 } 7103 return c.header_ 7104} 7105 7106func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) { 7107 reqHeaders := make(http.Header) 7108 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7109 for k, v := range c.header_ { 7110 reqHeaders[k] = v 7111 } 7112 reqHeaders.Set("User-Agent", c.s.userAgent()) 7113 var body io.Reader = nil 7114 c.urlParams_.Set("alt", alt) 7115 c.urlParams_.Set("prettyPrint", "false") 7116 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") 7117 urls += "?" + c.urlParams_.Encode() 7118 req, err := http.NewRequest("POST", urls, body) 7119 if err != nil { 7120 return nil, err 7121 } 7122 req.Header = reqHeaders 7123 googleapi.Expand(req.URL, map[string]string{ 7124 "blogId": c.blogId, 7125 "postId": c.postId, 7126 }) 7127 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7128} 7129 7130// Do executes the "blogger.posts.revert" call. 7131// Exactly one of *Post or error will be non-nil. Any non-2xx status 7132// code is an error. Response headers are in either 7133// *Post.ServerResponse.Header or (if a response was returned at all) in 7134// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7135// whether the returned error was because http.StatusNotModified was 7136// returned. 7137func (c *PostsRevertCall) Do(opts ...googleapi.CallOption) (*Post, error) { 7138 gensupport.SetOptions(c.urlParams_, opts...) 7139 res, err := c.doRequest("json") 7140 if res != nil && res.StatusCode == http.StatusNotModified { 7141 if res.Body != nil { 7142 res.Body.Close() 7143 } 7144 return nil, &googleapi.Error{ 7145 Code: res.StatusCode, 7146 Header: res.Header, 7147 } 7148 } 7149 if err != nil { 7150 return nil, err 7151 } 7152 defer googleapi.CloseBody(res) 7153 if err := googleapi.CheckResponse(res); err != nil { 7154 return nil, err 7155 } 7156 ret := &Post{ 7157 ServerResponse: googleapi.ServerResponse{ 7158 Header: res.Header, 7159 HTTPStatusCode: res.StatusCode, 7160 }, 7161 } 7162 target := &ret 7163 if err := gensupport.DecodeResponse(target, res); err != nil { 7164 return nil, err 7165 } 7166 return ret, nil 7167 // { 7168 // "description": "Revert a published or scheduled post to draft state.", 7169 // "httpMethod": "POST", 7170 // "id": "blogger.posts.revert", 7171 // "parameterOrder": [ 7172 // "blogId", 7173 // "postId" 7174 // ], 7175 // "parameters": { 7176 // "blogId": { 7177 // "description": "The ID of the Blog.", 7178 // "location": "path", 7179 // "required": true, 7180 // "type": "string" 7181 // }, 7182 // "postId": { 7183 // "description": "The ID of the Post.", 7184 // "location": "path", 7185 // "required": true, 7186 // "type": "string" 7187 // } 7188 // }, 7189 // "path": "blogs/{blogId}/posts/{postId}/revert", 7190 // "response": { 7191 // "$ref": "Post" 7192 // }, 7193 // "scopes": [ 7194 // "https://www.googleapis.com/auth/blogger" 7195 // ] 7196 // } 7197 7198} 7199 7200// method id "blogger.posts.search": 7201 7202type PostsSearchCall struct { 7203 s *Service 7204 blogId string 7205 urlParams_ gensupport.URLParams 7206 ifNoneMatch_ string 7207 ctx_ context.Context 7208 header_ http.Header 7209} 7210 7211// Search: Search for a post. 7212func (r *PostsService) Search(blogId string, q string) *PostsSearchCall { 7213 c := &PostsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7214 c.blogId = blogId 7215 c.urlParams_.Set("q", q) 7216 return c 7217} 7218 7219// FetchBodies sets the optional parameter "fetchBodies": Whether the 7220// body content of posts is included (default: true). This should be set 7221// to false when the post bodies are not required, to help minimize 7222// traffic. 7223func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall { 7224 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 7225 return c 7226} 7227 7228// OrderBy sets the optional parameter "orderBy": Sort search results 7229// 7230// Possible values: 7231// "published" - Order by the date the post was published 7232// "updated" - Order by the date the post was last updated 7233func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { 7234 c.urlParams_.Set("orderBy", orderBy) 7235 return c 7236} 7237 7238// Fields allows partial responses to be retrieved. See 7239// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7240// for more information. 7241func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall { 7242 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7243 return c 7244} 7245 7246// IfNoneMatch sets the optional parameter which makes the operation 7247// fail if the object's ETag matches the given value. This is useful for 7248// getting updates only after the object has changed since the last 7249// request. Use googleapi.IsNotModified to check whether the response 7250// error from Do is the result of In-None-Match. 7251func (c *PostsSearchCall) IfNoneMatch(entityTag string) *PostsSearchCall { 7252 c.ifNoneMatch_ = entityTag 7253 return c 7254} 7255 7256// Context sets the context to be used in this call's Do method. Any 7257// pending HTTP request will be aborted if the provided context is 7258// canceled. 7259func (c *PostsSearchCall) Context(ctx context.Context) *PostsSearchCall { 7260 c.ctx_ = ctx 7261 return c 7262} 7263 7264// Header returns an http.Header that can be modified by the caller to 7265// add HTTP headers to the request. 7266func (c *PostsSearchCall) Header() http.Header { 7267 if c.header_ == nil { 7268 c.header_ = make(http.Header) 7269 } 7270 return c.header_ 7271} 7272 7273func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) { 7274 reqHeaders := make(http.Header) 7275 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7276 for k, v := range c.header_ { 7277 reqHeaders[k] = v 7278 } 7279 reqHeaders.Set("User-Agent", c.s.userAgent()) 7280 if c.ifNoneMatch_ != "" { 7281 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7282 } 7283 var body io.Reader = nil 7284 c.urlParams_.Set("alt", alt) 7285 c.urlParams_.Set("prettyPrint", "false") 7286 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") 7287 urls += "?" + c.urlParams_.Encode() 7288 req, err := http.NewRequest("GET", urls, body) 7289 if err != nil { 7290 return nil, err 7291 } 7292 req.Header = reqHeaders 7293 googleapi.Expand(req.URL, map[string]string{ 7294 "blogId": c.blogId, 7295 }) 7296 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7297} 7298 7299// Do executes the "blogger.posts.search" call. 7300// Exactly one of *PostList or error will be non-nil. Any non-2xx status 7301// code is an error. Response headers are in either 7302// *PostList.ServerResponse.Header or (if a response was returned at 7303// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7304// to check whether the returned error was because 7305// http.StatusNotModified was returned. 7306func (c *PostsSearchCall) Do(opts ...googleapi.CallOption) (*PostList, error) { 7307 gensupport.SetOptions(c.urlParams_, opts...) 7308 res, err := c.doRequest("json") 7309 if res != nil && res.StatusCode == http.StatusNotModified { 7310 if res.Body != nil { 7311 res.Body.Close() 7312 } 7313 return nil, &googleapi.Error{ 7314 Code: res.StatusCode, 7315 Header: res.Header, 7316 } 7317 } 7318 if err != nil { 7319 return nil, err 7320 } 7321 defer googleapi.CloseBody(res) 7322 if err := googleapi.CheckResponse(res); err != nil { 7323 return nil, err 7324 } 7325 ret := &PostList{ 7326 ServerResponse: googleapi.ServerResponse{ 7327 Header: res.Header, 7328 HTTPStatusCode: res.StatusCode, 7329 }, 7330 } 7331 target := &ret 7332 if err := gensupport.DecodeResponse(target, res); err != nil { 7333 return nil, err 7334 } 7335 return ret, nil 7336 // { 7337 // "description": "Search for a post.", 7338 // "httpMethod": "GET", 7339 // "id": "blogger.posts.search", 7340 // "parameterOrder": [ 7341 // "blogId", 7342 // "q" 7343 // ], 7344 // "parameters": { 7345 // "blogId": { 7346 // "description": "ID of the blog to fetch the post from.", 7347 // "location": "path", 7348 // "required": true, 7349 // "type": "string" 7350 // }, 7351 // "fetchBodies": { 7352 // "default": "true", 7353 // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.", 7354 // "location": "query", 7355 // "type": "boolean" 7356 // }, 7357 // "orderBy": { 7358 // "default": "PUBLISHED", 7359 // "description": "Sort search results", 7360 // "enum": [ 7361 // "published", 7362 // "updated" 7363 // ], 7364 // "enumDescriptions": [ 7365 // "Order by the date the post was published", 7366 // "Order by the date the post was last updated" 7367 // ], 7368 // "location": "query", 7369 // "type": "string" 7370 // }, 7371 // "q": { 7372 // "description": "Query terms to search this blog for matching posts.", 7373 // "location": "query", 7374 // "required": true, 7375 // "type": "string" 7376 // } 7377 // }, 7378 // "path": "blogs/{blogId}/posts/search", 7379 // "response": { 7380 // "$ref": "PostList" 7381 // }, 7382 // "scopes": [ 7383 // "https://www.googleapis.com/auth/blogger", 7384 // "https://www.googleapis.com/auth/blogger.readonly" 7385 // ] 7386 // } 7387 7388} 7389 7390// method id "blogger.posts.update": 7391 7392type PostsUpdateCall struct { 7393 s *Service 7394 blogId string 7395 postId string 7396 post *Post 7397 urlParams_ gensupport.URLParams 7398 ctx_ context.Context 7399 header_ http.Header 7400} 7401 7402// Update: Update a post. 7403func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall { 7404 c := &PostsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7405 c.blogId = blogId 7406 c.postId = postId 7407 c.post = post 7408 return c 7409} 7410 7411// FetchBody sets the optional parameter "fetchBody": Whether the body 7412// content of the post is included with the result (default: true). 7413func (c *PostsUpdateCall) FetchBody(fetchBody bool) *PostsUpdateCall { 7414 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 7415 return c 7416} 7417 7418// FetchImages sets the optional parameter "fetchImages": Whether image 7419// URL metadata for each post is included in the returned result 7420// (default: false). 7421func (c *PostsUpdateCall) FetchImages(fetchImages bool) *PostsUpdateCall { 7422 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 7423 return c 7424} 7425 7426// MaxComments sets the optional parameter "maxComments": Maximum number 7427// of comments to retrieve with the returned post. 7428func (c *PostsUpdateCall) MaxComments(maxComments int64) *PostsUpdateCall { 7429 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 7430 return c 7431} 7432 7433// Publish sets the optional parameter "publish": Whether a publish 7434// action should be performed when the post is updated (default: false). 7435func (c *PostsUpdateCall) Publish(publish bool) *PostsUpdateCall { 7436 c.urlParams_.Set("publish", fmt.Sprint(publish)) 7437 return c 7438} 7439 7440// Revert sets the optional parameter "revert": Whether a revert action 7441// should be performed when the post is updated (default: false). 7442func (c *PostsUpdateCall) Revert(revert bool) *PostsUpdateCall { 7443 c.urlParams_.Set("revert", fmt.Sprint(revert)) 7444 return c 7445} 7446 7447// Fields allows partial responses to be retrieved. See 7448// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7449// for more information. 7450func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall { 7451 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7452 return c 7453} 7454 7455// Context sets the context to be used in this call's Do method. Any 7456// pending HTTP request will be aborted if the provided context is 7457// canceled. 7458func (c *PostsUpdateCall) Context(ctx context.Context) *PostsUpdateCall { 7459 c.ctx_ = ctx 7460 return c 7461} 7462 7463// Header returns an http.Header that can be modified by the caller to 7464// add HTTP headers to the request. 7465func (c *PostsUpdateCall) Header() http.Header { 7466 if c.header_ == nil { 7467 c.header_ = make(http.Header) 7468 } 7469 return c.header_ 7470} 7471 7472func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, error) { 7473 reqHeaders := make(http.Header) 7474 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7475 for k, v := range c.header_ { 7476 reqHeaders[k] = v 7477 } 7478 reqHeaders.Set("User-Agent", c.s.userAgent()) 7479 var body io.Reader = nil 7480 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) 7481 if err != nil { 7482 return nil, err 7483 } 7484 reqHeaders.Set("Content-Type", "application/json") 7485 c.urlParams_.Set("alt", alt) 7486 c.urlParams_.Set("prettyPrint", "false") 7487 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 7488 urls += "?" + c.urlParams_.Encode() 7489 req, err := http.NewRequest("PUT", urls, body) 7490 if err != nil { 7491 return nil, err 7492 } 7493 req.Header = reqHeaders 7494 googleapi.Expand(req.URL, map[string]string{ 7495 "blogId": c.blogId, 7496 "postId": c.postId, 7497 }) 7498 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7499} 7500 7501// Do executes the "blogger.posts.update" call. 7502// Exactly one of *Post or error will be non-nil. Any non-2xx status 7503// code is an error. Response headers are in either 7504// *Post.ServerResponse.Header or (if a response was returned at all) in 7505// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7506// whether the returned error was because http.StatusNotModified was 7507// returned. 7508func (c *PostsUpdateCall) Do(opts ...googleapi.CallOption) (*Post, error) { 7509 gensupport.SetOptions(c.urlParams_, opts...) 7510 res, err := c.doRequest("json") 7511 if res != nil && res.StatusCode == http.StatusNotModified { 7512 if res.Body != nil { 7513 res.Body.Close() 7514 } 7515 return nil, &googleapi.Error{ 7516 Code: res.StatusCode, 7517 Header: res.Header, 7518 } 7519 } 7520 if err != nil { 7521 return nil, err 7522 } 7523 defer googleapi.CloseBody(res) 7524 if err := googleapi.CheckResponse(res); err != nil { 7525 return nil, err 7526 } 7527 ret := &Post{ 7528 ServerResponse: googleapi.ServerResponse{ 7529 Header: res.Header, 7530 HTTPStatusCode: res.StatusCode, 7531 }, 7532 } 7533 target := &ret 7534 if err := gensupport.DecodeResponse(target, res); err != nil { 7535 return nil, err 7536 } 7537 return ret, nil 7538 // { 7539 // "description": "Update a post.", 7540 // "httpMethod": "PUT", 7541 // "id": "blogger.posts.update", 7542 // "parameterOrder": [ 7543 // "blogId", 7544 // "postId" 7545 // ], 7546 // "parameters": { 7547 // "blogId": { 7548 // "description": "The ID of the Blog.", 7549 // "location": "path", 7550 // "required": true, 7551 // "type": "string" 7552 // }, 7553 // "fetchBody": { 7554 // "default": "true", 7555 // "description": "Whether the body content of the post is included with the result (default: true).", 7556 // "location": "query", 7557 // "type": "boolean" 7558 // }, 7559 // "fetchImages": { 7560 // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", 7561 // "location": "query", 7562 // "type": "boolean" 7563 // }, 7564 // "maxComments": { 7565 // "description": "Maximum number of comments to retrieve with the returned post.", 7566 // "format": "uint32", 7567 // "location": "query", 7568 // "type": "integer" 7569 // }, 7570 // "postId": { 7571 // "description": "The ID of the Post.", 7572 // "location": "path", 7573 // "required": true, 7574 // "type": "string" 7575 // }, 7576 // "publish": { 7577 // "description": "Whether a publish action should be performed when the post is updated (default: false).", 7578 // "location": "query", 7579 // "type": "boolean" 7580 // }, 7581 // "revert": { 7582 // "description": "Whether a revert action should be performed when the post is updated (default: false).", 7583 // "location": "query", 7584 // "type": "boolean" 7585 // } 7586 // }, 7587 // "path": "blogs/{blogId}/posts/{postId}", 7588 // "request": { 7589 // "$ref": "Post" 7590 // }, 7591 // "response": { 7592 // "$ref": "Post" 7593 // }, 7594 // "scopes": [ 7595 // "https://www.googleapis.com/auth/blogger" 7596 // ] 7597 // } 7598 7599} 7600 7601// method id "blogger.users.get": 7602 7603type UsersGetCall struct { 7604 s *Service 7605 userId string 7606 urlParams_ gensupport.URLParams 7607 ifNoneMatch_ string 7608 ctx_ context.Context 7609 header_ http.Header 7610} 7611 7612// Get: Gets one user by ID. 7613func (r *UsersService) Get(userId string) *UsersGetCall { 7614 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7615 c.userId = userId 7616 return c 7617} 7618 7619// Fields allows partial responses to be retrieved. See 7620// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7621// for more information. 7622func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 7623 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7624 return c 7625} 7626 7627// IfNoneMatch sets the optional parameter which makes the operation 7628// fail if the object's ETag matches the given value. This is useful for 7629// getting updates only after the object has changed since the last 7630// request. Use googleapi.IsNotModified to check whether the response 7631// error from Do is the result of In-None-Match. 7632func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 7633 c.ifNoneMatch_ = entityTag 7634 return c 7635} 7636 7637// Context sets the context to be used in this call's Do method. Any 7638// pending HTTP request will be aborted if the provided context is 7639// canceled. 7640func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 7641 c.ctx_ = ctx 7642 return c 7643} 7644 7645// Header returns an http.Header that can be modified by the caller to 7646// add HTTP headers to the request. 7647func (c *UsersGetCall) Header() http.Header { 7648 if c.header_ == nil { 7649 c.header_ = make(http.Header) 7650 } 7651 return c.header_ 7652} 7653 7654func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 7655 reqHeaders := make(http.Header) 7656 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7657 for k, v := range c.header_ { 7658 reqHeaders[k] = v 7659 } 7660 reqHeaders.Set("User-Agent", c.s.userAgent()) 7661 if c.ifNoneMatch_ != "" { 7662 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7663 } 7664 var body io.Reader = nil 7665 c.urlParams_.Set("alt", alt) 7666 c.urlParams_.Set("prettyPrint", "false") 7667 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") 7668 urls += "?" + c.urlParams_.Encode() 7669 req, err := http.NewRequest("GET", urls, body) 7670 if err != nil { 7671 return nil, err 7672 } 7673 req.Header = reqHeaders 7674 googleapi.Expand(req.URL, map[string]string{ 7675 "userId": c.userId, 7676 }) 7677 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7678} 7679 7680// Do executes the "blogger.users.get" call. 7681// Exactly one of *User or error will be non-nil. Any non-2xx status 7682// code is an error. Response headers are in either 7683// *User.ServerResponse.Header or (if a response was returned at all) in 7684// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7685// whether the returned error was because http.StatusNotModified was 7686// returned. 7687func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 7688 gensupport.SetOptions(c.urlParams_, opts...) 7689 res, err := c.doRequest("json") 7690 if res != nil && res.StatusCode == http.StatusNotModified { 7691 if res.Body != nil { 7692 res.Body.Close() 7693 } 7694 return nil, &googleapi.Error{ 7695 Code: res.StatusCode, 7696 Header: res.Header, 7697 } 7698 } 7699 if err != nil { 7700 return nil, err 7701 } 7702 defer googleapi.CloseBody(res) 7703 if err := googleapi.CheckResponse(res); err != nil { 7704 return nil, err 7705 } 7706 ret := &User{ 7707 ServerResponse: googleapi.ServerResponse{ 7708 Header: res.Header, 7709 HTTPStatusCode: res.StatusCode, 7710 }, 7711 } 7712 target := &ret 7713 if err := gensupport.DecodeResponse(target, res); err != nil { 7714 return nil, err 7715 } 7716 return ret, nil 7717 // { 7718 // "description": "Gets one user by ID.", 7719 // "httpMethod": "GET", 7720 // "id": "blogger.users.get", 7721 // "parameterOrder": [ 7722 // "userId" 7723 // ], 7724 // "parameters": { 7725 // "userId": { 7726 // "description": "The ID of the user to get.", 7727 // "location": "path", 7728 // "required": true, 7729 // "type": "string" 7730 // } 7731 // }, 7732 // "path": "users/{userId}", 7733 // "response": { 7734 // "$ref": "User" 7735 // }, 7736 // "scopes": [ 7737 // "https://www.googleapis.com/auth/blogger", 7738 // "https://www.googleapis.com/auth/blogger.readonly" 7739 // ] 7740 // } 7741 7742} 7743