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 gensupport "google.golang.org/api/gensupport" 57 googleapi "google.golang.org/api/googleapi" 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 for k, v := range c.header_ { 1675 reqHeaders[k] = v 1676 } 1677 reqHeaders.Set("User-Agent", c.s.userAgent()) 1678 if c.ifNoneMatch_ != "" { 1679 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1680 } 1681 var body io.Reader = nil 1682 c.urlParams_.Set("alt", alt) 1683 c.urlParams_.Set("prettyPrint", "false") 1684 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") 1685 urls += "?" + c.urlParams_.Encode() 1686 req, err := http.NewRequest("GET", urls, body) 1687 if err != nil { 1688 return nil, err 1689 } 1690 req.Header = reqHeaders 1691 googleapi.Expand(req.URL, map[string]string{ 1692 "userId": c.userId, 1693 "blogId": c.blogId, 1694 }) 1695 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1696} 1697 1698// Do executes the "blogger.blogUserInfos.get" call. 1699// Exactly one of *BlogUserInfo or error will be non-nil. Any non-2xx 1700// status code is an error. Response headers are in either 1701// *BlogUserInfo.ServerResponse.Header or (if a response was returned at 1702// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1703// to check whether the returned error was because 1704// http.StatusNotModified was returned. 1705func (c *BlogUserInfosGetCall) Do(opts ...googleapi.CallOption) (*BlogUserInfo, error) { 1706 gensupport.SetOptions(c.urlParams_, opts...) 1707 res, err := c.doRequest("json") 1708 if res != nil && res.StatusCode == http.StatusNotModified { 1709 if res.Body != nil { 1710 res.Body.Close() 1711 } 1712 return nil, &googleapi.Error{ 1713 Code: res.StatusCode, 1714 Header: res.Header, 1715 } 1716 } 1717 if err != nil { 1718 return nil, err 1719 } 1720 defer googleapi.CloseBody(res) 1721 if err := googleapi.CheckResponse(res); err != nil { 1722 return nil, err 1723 } 1724 ret := &BlogUserInfo{ 1725 ServerResponse: googleapi.ServerResponse{ 1726 Header: res.Header, 1727 HTTPStatusCode: res.StatusCode, 1728 }, 1729 } 1730 target := &ret 1731 if err := gensupport.DecodeResponse(target, res); err != nil { 1732 return nil, err 1733 } 1734 return ret, nil 1735 // { 1736 // "description": "Gets one blog and user info pair by blogId and userId.", 1737 // "httpMethod": "GET", 1738 // "id": "blogger.blogUserInfos.get", 1739 // "parameterOrder": [ 1740 // "userId", 1741 // "blogId" 1742 // ], 1743 // "parameters": { 1744 // "blogId": { 1745 // "description": "The ID of the blog to get.", 1746 // "location": "path", 1747 // "required": true, 1748 // "type": "string" 1749 // }, 1750 // "maxPosts": { 1751 // "description": "Maximum number of posts to pull back with the blog.", 1752 // "format": "uint32", 1753 // "location": "query", 1754 // "type": "integer" 1755 // }, 1756 // "userId": { 1757 // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", 1758 // "location": "path", 1759 // "required": true, 1760 // "type": "string" 1761 // } 1762 // }, 1763 // "path": "users/{userId}/blogs/{blogId}", 1764 // "response": { 1765 // "$ref": "BlogUserInfo" 1766 // }, 1767 // "scopes": [ 1768 // "https://www.googleapis.com/auth/blogger", 1769 // "https://www.googleapis.com/auth/blogger.readonly" 1770 // ] 1771 // } 1772 1773} 1774 1775// method id "blogger.blogs.get": 1776 1777type BlogsGetCall struct { 1778 s *Service 1779 blogId string 1780 urlParams_ gensupport.URLParams 1781 ifNoneMatch_ string 1782 ctx_ context.Context 1783 header_ http.Header 1784} 1785 1786// Get: Gets one blog by ID. 1787func (r *BlogsService) Get(blogId string) *BlogsGetCall { 1788 c := &BlogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1789 c.blogId = blogId 1790 return c 1791} 1792 1793// MaxPosts sets the optional parameter "maxPosts": Maximum number of 1794// posts to pull back with the blog. 1795func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall { 1796 c.urlParams_.Set("maxPosts", fmt.Sprint(maxPosts)) 1797 return c 1798} 1799 1800// View sets the optional parameter "view": Access level with which to 1801// view the blog. Note that some fields require elevated access. 1802// 1803// Possible values: 1804// "ADMIN" - Admin level detail. 1805// "AUTHOR" - Author level detail. 1806// "READER" - Reader level detail. 1807func (c *BlogsGetCall) View(view string) *BlogsGetCall { 1808 c.urlParams_.Set("view", view) 1809 return c 1810} 1811 1812// Fields allows partial responses to be retrieved. See 1813// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1814// for more information. 1815func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { 1816 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1817 return c 1818} 1819 1820// IfNoneMatch sets the optional parameter which makes the operation 1821// fail if the object's ETag matches the given value. This is useful for 1822// getting updates only after the object has changed since the last 1823// request. Use googleapi.IsNotModified to check whether the response 1824// error from Do is the result of In-None-Match. 1825func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { 1826 c.ifNoneMatch_ = entityTag 1827 return c 1828} 1829 1830// Context sets the context to be used in this call's Do method. Any 1831// pending HTTP request will be aborted if the provided context is 1832// canceled. 1833func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { 1834 c.ctx_ = ctx 1835 return c 1836} 1837 1838// Header returns an http.Header that can be modified by the caller to 1839// add HTTP headers to the request. 1840func (c *BlogsGetCall) Header() http.Header { 1841 if c.header_ == nil { 1842 c.header_ = make(http.Header) 1843 } 1844 return c.header_ 1845} 1846 1847func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { 1848 reqHeaders := make(http.Header) 1849 for k, v := range c.header_ { 1850 reqHeaders[k] = v 1851 } 1852 reqHeaders.Set("User-Agent", c.s.userAgent()) 1853 if c.ifNoneMatch_ != "" { 1854 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1855 } 1856 var body io.Reader = nil 1857 c.urlParams_.Set("alt", alt) 1858 c.urlParams_.Set("prettyPrint", "false") 1859 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") 1860 urls += "?" + c.urlParams_.Encode() 1861 req, err := http.NewRequest("GET", urls, body) 1862 if err != nil { 1863 return nil, err 1864 } 1865 req.Header = reqHeaders 1866 googleapi.Expand(req.URL, map[string]string{ 1867 "blogId": c.blogId, 1868 }) 1869 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1870} 1871 1872// Do executes the "blogger.blogs.get" call. 1873// Exactly one of *Blog or error will be non-nil. Any non-2xx status 1874// code is an error. Response headers are in either 1875// *Blog.ServerResponse.Header or (if a response was returned at all) in 1876// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1877// whether the returned error was because http.StatusNotModified was 1878// returned. 1879func (c *BlogsGetCall) Do(opts ...googleapi.CallOption) (*Blog, error) { 1880 gensupport.SetOptions(c.urlParams_, opts...) 1881 res, err := c.doRequest("json") 1882 if res != nil && res.StatusCode == http.StatusNotModified { 1883 if res.Body != nil { 1884 res.Body.Close() 1885 } 1886 return nil, &googleapi.Error{ 1887 Code: res.StatusCode, 1888 Header: res.Header, 1889 } 1890 } 1891 if err != nil { 1892 return nil, err 1893 } 1894 defer googleapi.CloseBody(res) 1895 if err := googleapi.CheckResponse(res); err != nil { 1896 return nil, err 1897 } 1898 ret := &Blog{ 1899 ServerResponse: googleapi.ServerResponse{ 1900 Header: res.Header, 1901 HTTPStatusCode: res.StatusCode, 1902 }, 1903 } 1904 target := &ret 1905 if err := gensupport.DecodeResponse(target, res); err != nil { 1906 return nil, err 1907 } 1908 return ret, nil 1909 // { 1910 // "description": "Gets one blog by ID.", 1911 // "httpMethod": "GET", 1912 // "id": "blogger.blogs.get", 1913 // "parameterOrder": [ 1914 // "blogId" 1915 // ], 1916 // "parameters": { 1917 // "blogId": { 1918 // "description": "The ID of the blog to get.", 1919 // "location": "path", 1920 // "required": true, 1921 // "type": "string" 1922 // }, 1923 // "maxPosts": { 1924 // "description": "Maximum number of posts to pull back with the blog.", 1925 // "format": "uint32", 1926 // "location": "query", 1927 // "type": "integer" 1928 // }, 1929 // "view": { 1930 // "description": "Access level with which to view the blog. Note that some fields require elevated access.", 1931 // "enum": [ 1932 // "ADMIN", 1933 // "AUTHOR", 1934 // "READER" 1935 // ], 1936 // "enumDescriptions": [ 1937 // "Admin level detail.", 1938 // "Author level detail.", 1939 // "Reader level detail." 1940 // ], 1941 // "location": "query", 1942 // "type": "string" 1943 // } 1944 // }, 1945 // "path": "blogs/{blogId}", 1946 // "response": { 1947 // "$ref": "Blog" 1948 // }, 1949 // "scopes": [ 1950 // "https://www.googleapis.com/auth/blogger", 1951 // "https://www.googleapis.com/auth/blogger.readonly" 1952 // ] 1953 // } 1954 1955} 1956 1957// method id "blogger.blogs.getByUrl": 1958 1959type BlogsGetByUrlCall struct { 1960 s *Service 1961 urlParams_ gensupport.URLParams 1962 ifNoneMatch_ string 1963 ctx_ context.Context 1964 header_ http.Header 1965} 1966 1967// GetByUrl: Retrieve a Blog by URL. 1968func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall { 1969 c := &BlogsGetByUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1970 c.urlParams_.Set("url", url) 1971 return c 1972} 1973 1974// View sets the optional parameter "view": Access level with which to 1975// view the blog. Note that some fields require elevated access. 1976// 1977// Possible values: 1978// "ADMIN" - Admin level detail. 1979// "AUTHOR" - Author level detail. 1980// "READER" - Reader level detail. 1981func (c *BlogsGetByUrlCall) View(view string) *BlogsGetByUrlCall { 1982 c.urlParams_.Set("view", view) 1983 return c 1984} 1985 1986// Fields allows partial responses to be retrieved. See 1987// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1988// for more information. 1989func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall { 1990 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1991 return c 1992} 1993 1994// IfNoneMatch sets the optional parameter which makes the operation 1995// fail if the object's ETag matches the given value. This is useful for 1996// getting updates only after the object has changed since the last 1997// request. Use googleapi.IsNotModified to check whether the response 1998// error from Do is the result of In-None-Match. 1999func (c *BlogsGetByUrlCall) IfNoneMatch(entityTag string) *BlogsGetByUrlCall { 2000 c.ifNoneMatch_ = entityTag 2001 return c 2002} 2003 2004// Context sets the context to be used in this call's Do method. Any 2005// pending HTTP request will be aborted if the provided context is 2006// canceled. 2007func (c *BlogsGetByUrlCall) Context(ctx context.Context) *BlogsGetByUrlCall { 2008 c.ctx_ = ctx 2009 return c 2010} 2011 2012// Header returns an http.Header that can be modified by the caller to 2013// add HTTP headers to the request. 2014func (c *BlogsGetByUrlCall) Header() http.Header { 2015 if c.header_ == nil { 2016 c.header_ = make(http.Header) 2017 } 2018 return c.header_ 2019} 2020 2021func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) { 2022 reqHeaders := make(http.Header) 2023 for k, v := range c.header_ { 2024 reqHeaders[k] = v 2025 } 2026 reqHeaders.Set("User-Agent", c.s.userAgent()) 2027 if c.ifNoneMatch_ != "" { 2028 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2029 } 2030 var body io.Reader = nil 2031 c.urlParams_.Set("alt", alt) 2032 c.urlParams_.Set("prettyPrint", "false") 2033 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl") 2034 urls += "?" + c.urlParams_.Encode() 2035 req, err := http.NewRequest("GET", urls, body) 2036 if err != nil { 2037 return nil, err 2038 } 2039 req.Header = reqHeaders 2040 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2041} 2042 2043// Do executes the "blogger.blogs.getByUrl" call. 2044// Exactly one of *Blog or error will be non-nil. Any non-2xx status 2045// code is an error. Response headers are in either 2046// *Blog.ServerResponse.Header or (if a response was returned at all) in 2047// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2048// whether the returned error was because http.StatusNotModified was 2049// returned. 2050func (c *BlogsGetByUrlCall) Do(opts ...googleapi.CallOption) (*Blog, error) { 2051 gensupport.SetOptions(c.urlParams_, opts...) 2052 res, err := c.doRequest("json") 2053 if res != nil && res.StatusCode == http.StatusNotModified { 2054 if res.Body != nil { 2055 res.Body.Close() 2056 } 2057 return nil, &googleapi.Error{ 2058 Code: res.StatusCode, 2059 Header: res.Header, 2060 } 2061 } 2062 if err != nil { 2063 return nil, err 2064 } 2065 defer googleapi.CloseBody(res) 2066 if err := googleapi.CheckResponse(res); err != nil { 2067 return nil, err 2068 } 2069 ret := &Blog{ 2070 ServerResponse: googleapi.ServerResponse{ 2071 Header: res.Header, 2072 HTTPStatusCode: res.StatusCode, 2073 }, 2074 } 2075 target := &ret 2076 if err := gensupport.DecodeResponse(target, res); err != nil { 2077 return nil, err 2078 } 2079 return ret, nil 2080 // { 2081 // "description": "Retrieve a Blog by URL.", 2082 // "httpMethod": "GET", 2083 // "id": "blogger.blogs.getByUrl", 2084 // "parameterOrder": [ 2085 // "url" 2086 // ], 2087 // "parameters": { 2088 // "url": { 2089 // "description": "The URL of the blog to retrieve.", 2090 // "location": "query", 2091 // "required": true, 2092 // "type": "string" 2093 // }, 2094 // "view": { 2095 // "description": "Access level with which to view the blog. Note that some fields require elevated access.", 2096 // "enum": [ 2097 // "ADMIN", 2098 // "AUTHOR", 2099 // "READER" 2100 // ], 2101 // "enumDescriptions": [ 2102 // "Admin level detail.", 2103 // "Author level detail.", 2104 // "Reader level detail." 2105 // ], 2106 // "location": "query", 2107 // "type": "string" 2108 // } 2109 // }, 2110 // "path": "blogs/byurl", 2111 // "response": { 2112 // "$ref": "Blog" 2113 // }, 2114 // "scopes": [ 2115 // "https://www.googleapis.com/auth/blogger", 2116 // "https://www.googleapis.com/auth/blogger.readonly" 2117 // ] 2118 // } 2119 2120} 2121 2122// method id "blogger.blogs.listByUser": 2123 2124type BlogsListByUserCall struct { 2125 s *Service 2126 userId string 2127 urlParams_ gensupport.URLParams 2128 ifNoneMatch_ string 2129 ctx_ context.Context 2130 header_ http.Header 2131} 2132 2133// ListByUser: Retrieves a list of blogs, possibly filtered. 2134func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall { 2135 c := &BlogsListByUserCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2136 c.userId = userId 2137 return c 2138} 2139 2140// FetchUserInfo sets the optional parameter "fetchUserInfo": Whether 2141// the response is a list of blogs with per-user information instead of 2142// just blogs. 2143func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall { 2144 c.urlParams_.Set("fetchUserInfo", fmt.Sprint(fetchUserInfo)) 2145 return c 2146} 2147 2148// Role sets the optional parameter "role": User access types for blogs 2149// to include in the results, e.g. AUTHOR will return blogs where the 2150// user has author level access. If no roles are specified, defaults to 2151// ADMIN and AUTHOR roles. 2152// 2153// Possible values: 2154// "ADMIN" - Admin role - Blogs where the user has Admin level access. 2155// "AUTHOR" - Author role - Blogs where the user has Author level 2156// access. 2157// "READER" - Reader role - Blogs where the user has Reader level 2158// access (to a private blog). 2159func (c *BlogsListByUserCall) Role(role ...string) *BlogsListByUserCall { 2160 c.urlParams_.SetMulti("role", append([]string{}, role...)) 2161 return c 2162} 2163 2164// Status sets the optional parameter "status": Blog statuses to include 2165// in the result (default: Live blogs only). Note that ADMIN access is 2166// required to view deleted blogs. 2167// 2168// Possible values: 2169// "DELETED" - Blog has been deleted by an administrator. 2170// "LIVE" (default) - Blog is currently live. 2171func (c *BlogsListByUserCall) Status(status ...string) *BlogsListByUserCall { 2172 c.urlParams_.SetMulti("status", append([]string{}, status...)) 2173 return c 2174} 2175 2176// View sets the optional parameter "view": Access level with which to 2177// view the blogs. Note that some fields require elevated access. 2178// 2179// Possible values: 2180// "ADMIN" - Admin level detail. 2181// "AUTHOR" - Author level detail. 2182// "READER" - Reader level detail. 2183func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { 2184 c.urlParams_.Set("view", view) 2185 return c 2186} 2187 2188// Fields allows partial responses to be retrieved. See 2189// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2190// for more information. 2191func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall { 2192 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2193 return c 2194} 2195 2196// IfNoneMatch sets the optional parameter which makes the operation 2197// fail if the object's ETag matches the given value. This is useful for 2198// getting updates only after the object has changed since the last 2199// request. Use googleapi.IsNotModified to check whether the response 2200// error from Do is the result of In-None-Match. 2201func (c *BlogsListByUserCall) IfNoneMatch(entityTag string) *BlogsListByUserCall { 2202 c.ifNoneMatch_ = entityTag 2203 return c 2204} 2205 2206// Context sets the context to be used in this call's Do method. Any 2207// pending HTTP request will be aborted if the provided context is 2208// canceled. 2209func (c *BlogsListByUserCall) Context(ctx context.Context) *BlogsListByUserCall { 2210 c.ctx_ = ctx 2211 return c 2212} 2213 2214// Header returns an http.Header that can be modified by the caller to 2215// add HTTP headers to the request. 2216func (c *BlogsListByUserCall) Header() http.Header { 2217 if c.header_ == nil { 2218 c.header_ = make(http.Header) 2219 } 2220 return c.header_ 2221} 2222 2223func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) { 2224 reqHeaders := make(http.Header) 2225 for k, v := range c.header_ { 2226 reqHeaders[k] = v 2227 } 2228 reqHeaders.Set("User-Agent", c.s.userAgent()) 2229 if c.ifNoneMatch_ != "" { 2230 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2231 } 2232 var body io.Reader = nil 2233 c.urlParams_.Set("alt", alt) 2234 c.urlParams_.Set("prettyPrint", "false") 2235 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") 2236 urls += "?" + c.urlParams_.Encode() 2237 req, err := http.NewRequest("GET", urls, body) 2238 if err != nil { 2239 return nil, err 2240 } 2241 req.Header = reqHeaders 2242 googleapi.Expand(req.URL, map[string]string{ 2243 "userId": c.userId, 2244 }) 2245 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2246} 2247 2248// Do executes the "blogger.blogs.listByUser" call. 2249// Exactly one of *BlogList or error will be non-nil. Any non-2xx status 2250// code is an error. Response headers are in either 2251// *BlogList.ServerResponse.Header or (if a response was returned at 2252// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2253// to check whether the returned error was because 2254// http.StatusNotModified was returned. 2255func (c *BlogsListByUserCall) Do(opts ...googleapi.CallOption) (*BlogList, error) { 2256 gensupport.SetOptions(c.urlParams_, opts...) 2257 res, err := c.doRequest("json") 2258 if res != nil && res.StatusCode == http.StatusNotModified { 2259 if res.Body != nil { 2260 res.Body.Close() 2261 } 2262 return nil, &googleapi.Error{ 2263 Code: res.StatusCode, 2264 Header: res.Header, 2265 } 2266 } 2267 if err != nil { 2268 return nil, err 2269 } 2270 defer googleapi.CloseBody(res) 2271 if err := googleapi.CheckResponse(res); err != nil { 2272 return nil, err 2273 } 2274 ret := &BlogList{ 2275 ServerResponse: googleapi.ServerResponse{ 2276 Header: res.Header, 2277 HTTPStatusCode: res.StatusCode, 2278 }, 2279 } 2280 target := &ret 2281 if err := gensupport.DecodeResponse(target, res); err != nil { 2282 return nil, err 2283 } 2284 return ret, nil 2285 // { 2286 // "description": "Retrieves a list of blogs, possibly filtered.", 2287 // "httpMethod": "GET", 2288 // "id": "blogger.blogs.listByUser", 2289 // "parameterOrder": [ 2290 // "userId" 2291 // ], 2292 // "parameters": { 2293 // "fetchUserInfo": { 2294 // "description": "Whether the response is a list of blogs with per-user information instead of just blogs.", 2295 // "location": "query", 2296 // "type": "boolean" 2297 // }, 2298 // "role": { 2299 // "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.", 2300 // "enum": [ 2301 // "ADMIN", 2302 // "AUTHOR", 2303 // "READER" 2304 // ], 2305 // "enumDescriptions": [ 2306 // "Admin role - Blogs where the user has Admin level access.", 2307 // "Author role - Blogs where the user has Author level access.", 2308 // "Reader role - Blogs where the user has Reader level access (to a private blog)." 2309 // ], 2310 // "location": "query", 2311 // "repeated": true, 2312 // "type": "string" 2313 // }, 2314 // "status": { 2315 // "default": "LIVE", 2316 // "description": "Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs.", 2317 // "enum": [ 2318 // "DELETED", 2319 // "LIVE" 2320 // ], 2321 // "enumDescriptions": [ 2322 // "Blog has been deleted by an administrator.", 2323 // "Blog is currently live." 2324 // ], 2325 // "location": "query", 2326 // "repeated": true, 2327 // "type": "string" 2328 // }, 2329 // "userId": { 2330 // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", 2331 // "location": "path", 2332 // "required": true, 2333 // "type": "string" 2334 // }, 2335 // "view": { 2336 // "description": "Access level with which to view the blogs. Note that some fields require elevated access.", 2337 // "enum": [ 2338 // "ADMIN", 2339 // "AUTHOR", 2340 // "READER" 2341 // ], 2342 // "enumDescriptions": [ 2343 // "Admin level detail.", 2344 // "Author level detail.", 2345 // "Reader level detail." 2346 // ], 2347 // "location": "query", 2348 // "type": "string" 2349 // } 2350 // }, 2351 // "path": "users/{userId}/blogs", 2352 // "response": { 2353 // "$ref": "BlogList" 2354 // }, 2355 // "scopes": [ 2356 // "https://www.googleapis.com/auth/blogger", 2357 // "https://www.googleapis.com/auth/blogger.readonly" 2358 // ] 2359 // } 2360 2361} 2362 2363// method id "blogger.comments.approve": 2364 2365type CommentsApproveCall struct { 2366 s *Service 2367 blogId string 2368 postId string 2369 commentId string 2370 urlParams_ gensupport.URLParams 2371 ctx_ context.Context 2372 header_ http.Header 2373} 2374 2375// Approve: Marks a comment as not spam. 2376func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall { 2377 c := &CommentsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2378 c.blogId = blogId 2379 c.postId = postId 2380 c.commentId = commentId 2381 return c 2382} 2383 2384// Fields allows partial responses to be retrieved. See 2385// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2386// for more information. 2387func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall { 2388 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2389 return c 2390} 2391 2392// Context sets the context to be used in this call's Do method. Any 2393// pending HTTP request will be aborted if the provided context is 2394// canceled. 2395func (c *CommentsApproveCall) Context(ctx context.Context) *CommentsApproveCall { 2396 c.ctx_ = ctx 2397 return c 2398} 2399 2400// Header returns an http.Header that can be modified by the caller to 2401// add HTTP headers to the request. 2402func (c *CommentsApproveCall) Header() http.Header { 2403 if c.header_ == nil { 2404 c.header_ = make(http.Header) 2405 } 2406 return c.header_ 2407} 2408 2409func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) { 2410 reqHeaders := make(http.Header) 2411 for k, v := range c.header_ { 2412 reqHeaders[k] = v 2413 } 2414 reqHeaders.Set("User-Agent", c.s.userAgent()) 2415 var body io.Reader = nil 2416 c.urlParams_.Set("alt", alt) 2417 c.urlParams_.Set("prettyPrint", "false") 2418 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") 2419 urls += "?" + c.urlParams_.Encode() 2420 req, err := http.NewRequest("POST", urls, body) 2421 if err != nil { 2422 return nil, err 2423 } 2424 req.Header = reqHeaders 2425 googleapi.Expand(req.URL, map[string]string{ 2426 "blogId": c.blogId, 2427 "postId": c.postId, 2428 "commentId": c.commentId, 2429 }) 2430 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2431} 2432 2433// Do executes the "blogger.comments.approve" call. 2434// Exactly one of *Comment or error will be non-nil. Any non-2xx status 2435// code is an error. Response headers are in either 2436// *Comment.ServerResponse.Header or (if a response was returned at all) 2437// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2438// check whether the returned error was because http.StatusNotModified 2439// was returned. 2440func (c *CommentsApproveCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 2441 gensupport.SetOptions(c.urlParams_, opts...) 2442 res, err := c.doRequest("json") 2443 if res != nil && res.StatusCode == http.StatusNotModified { 2444 if res.Body != nil { 2445 res.Body.Close() 2446 } 2447 return nil, &googleapi.Error{ 2448 Code: res.StatusCode, 2449 Header: res.Header, 2450 } 2451 } 2452 if err != nil { 2453 return nil, err 2454 } 2455 defer googleapi.CloseBody(res) 2456 if err := googleapi.CheckResponse(res); err != nil { 2457 return nil, err 2458 } 2459 ret := &Comment{ 2460 ServerResponse: googleapi.ServerResponse{ 2461 Header: res.Header, 2462 HTTPStatusCode: res.StatusCode, 2463 }, 2464 } 2465 target := &ret 2466 if err := gensupport.DecodeResponse(target, res); err != nil { 2467 return nil, err 2468 } 2469 return ret, nil 2470 // { 2471 // "description": "Marks a comment as not spam.", 2472 // "httpMethod": "POST", 2473 // "id": "blogger.comments.approve", 2474 // "parameterOrder": [ 2475 // "blogId", 2476 // "postId", 2477 // "commentId" 2478 // ], 2479 // "parameters": { 2480 // "blogId": { 2481 // "description": "The ID of the Blog.", 2482 // "location": "path", 2483 // "required": true, 2484 // "type": "string" 2485 // }, 2486 // "commentId": { 2487 // "description": "The ID of the comment to mark as not spam.", 2488 // "location": "path", 2489 // "required": true, 2490 // "type": "string" 2491 // }, 2492 // "postId": { 2493 // "description": "The ID of the Post.", 2494 // "location": "path", 2495 // "required": true, 2496 // "type": "string" 2497 // } 2498 // }, 2499 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve", 2500 // "response": { 2501 // "$ref": "Comment" 2502 // }, 2503 // "scopes": [ 2504 // "https://www.googleapis.com/auth/blogger" 2505 // ] 2506 // } 2507 2508} 2509 2510// method id "blogger.comments.delete": 2511 2512type CommentsDeleteCall struct { 2513 s *Service 2514 blogId string 2515 postId string 2516 commentId string 2517 urlParams_ gensupport.URLParams 2518 ctx_ context.Context 2519 header_ http.Header 2520} 2521 2522// Delete: Delete a comment by ID. 2523func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall { 2524 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2525 c.blogId = blogId 2526 c.postId = postId 2527 c.commentId = commentId 2528 return c 2529} 2530 2531// Fields allows partial responses to be retrieved. See 2532// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2533// for more information. 2534func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { 2535 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2536 return c 2537} 2538 2539// Context sets the context to be used in this call's Do method. Any 2540// pending HTTP request will be aborted if the provided context is 2541// canceled. 2542func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { 2543 c.ctx_ = ctx 2544 return c 2545} 2546 2547// Header returns an http.Header that can be modified by the caller to 2548// add HTTP headers to the request. 2549func (c *CommentsDeleteCall) Header() http.Header { 2550 if c.header_ == nil { 2551 c.header_ = make(http.Header) 2552 } 2553 return c.header_ 2554} 2555 2556func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { 2557 reqHeaders := make(http.Header) 2558 for k, v := range c.header_ { 2559 reqHeaders[k] = v 2560 } 2561 reqHeaders.Set("User-Agent", c.s.userAgent()) 2562 var body io.Reader = nil 2563 c.urlParams_.Set("alt", alt) 2564 c.urlParams_.Set("prettyPrint", "false") 2565 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") 2566 urls += "?" + c.urlParams_.Encode() 2567 req, err := http.NewRequest("DELETE", urls, body) 2568 if err != nil { 2569 return nil, err 2570 } 2571 req.Header = reqHeaders 2572 googleapi.Expand(req.URL, map[string]string{ 2573 "blogId": c.blogId, 2574 "postId": c.postId, 2575 "commentId": c.commentId, 2576 }) 2577 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2578} 2579 2580// Do executes the "blogger.comments.delete" call. 2581func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error { 2582 gensupport.SetOptions(c.urlParams_, opts...) 2583 res, err := c.doRequest("json") 2584 if err != nil { 2585 return err 2586 } 2587 defer googleapi.CloseBody(res) 2588 if err := googleapi.CheckResponse(res); err != nil { 2589 return err 2590 } 2591 return nil 2592 // { 2593 // "description": "Delete a comment by ID.", 2594 // "httpMethod": "DELETE", 2595 // "id": "blogger.comments.delete", 2596 // "parameterOrder": [ 2597 // "blogId", 2598 // "postId", 2599 // "commentId" 2600 // ], 2601 // "parameters": { 2602 // "blogId": { 2603 // "description": "The ID of the Blog.", 2604 // "location": "path", 2605 // "required": true, 2606 // "type": "string" 2607 // }, 2608 // "commentId": { 2609 // "description": "The ID of the comment to delete.", 2610 // "location": "path", 2611 // "required": true, 2612 // "type": "string" 2613 // }, 2614 // "postId": { 2615 // "description": "The ID of the Post.", 2616 // "location": "path", 2617 // "required": true, 2618 // "type": "string" 2619 // } 2620 // }, 2621 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", 2622 // "scopes": [ 2623 // "https://www.googleapis.com/auth/blogger" 2624 // ] 2625 // } 2626 2627} 2628 2629// method id "blogger.comments.get": 2630 2631type CommentsGetCall struct { 2632 s *Service 2633 blogId string 2634 postId string 2635 commentId string 2636 urlParams_ gensupport.URLParams 2637 ifNoneMatch_ string 2638 ctx_ context.Context 2639 header_ http.Header 2640} 2641 2642// Get: Gets one comment by ID. 2643func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { 2644 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2645 c.blogId = blogId 2646 c.postId = postId 2647 c.commentId = commentId 2648 return c 2649} 2650 2651// View sets the optional parameter "view": Access level for the 2652// requested comment (default: READER). Note that some comments will 2653// require elevated permissions, for example comments where the parent 2654// posts which is in a draft state, or comments that are pending 2655// moderation. 2656// 2657// Possible values: 2658// "ADMIN" - Admin level detail 2659// "AUTHOR" - Author level detail 2660// "READER" - Admin level detail 2661func (c *CommentsGetCall) View(view string) *CommentsGetCall { 2662 c.urlParams_.Set("view", view) 2663 return c 2664} 2665 2666// Fields allows partial responses to be retrieved. See 2667// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2668// for more information. 2669func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { 2670 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2671 return c 2672} 2673 2674// IfNoneMatch sets the optional parameter which makes the operation 2675// fail if the object's ETag matches the given value. This is useful for 2676// getting updates only after the object has changed since the last 2677// request. Use googleapi.IsNotModified to check whether the response 2678// error from Do is the result of In-None-Match. 2679func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { 2680 c.ifNoneMatch_ = entityTag 2681 return c 2682} 2683 2684// Context sets the context to be used in this call's Do method. Any 2685// pending HTTP request will be aborted if the provided context is 2686// canceled. 2687func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { 2688 c.ctx_ = ctx 2689 return c 2690} 2691 2692// Header returns an http.Header that can be modified by the caller to 2693// add HTTP headers to the request. 2694func (c *CommentsGetCall) Header() http.Header { 2695 if c.header_ == nil { 2696 c.header_ = make(http.Header) 2697 } 2698 return c.header_ 2699} 2700 2701func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { 2702 reqHeaders := make(http.Header) 2703 for k, v := range c.header_ { 2704 reqHeaders[k] = v 2705 } 2706 reqHeaders.Set("User-Agent", c.s.userAgent()) 2707 if c.ifNoneMatch_ != "" { 2708 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2709 } 2710 var body io.Reader = nil 2711 c.urlParams_.Set("alt", alt) 2712 c.urlParams_.Set("prettyPrint", "false") 2713 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") 2714 urls += "?" + c.urlParams_.Encode() 2715 req, err := http.NewRequest("GET", urls, body) 2716 if err != nil { 2717 return nil, err 2718 } 2719 req.Header = reqHeaders 2720 googleapi.Expand(req.URL, map[string]string{ 2721 "blogId": c.blogId, 2722 "postId": c.postId, 2723 "commentId": c.commentId, 2724 }) 2725 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2726} 2727 2728// Do executes the "blogger.comments.get" call. 2729// Exactly one of *Comment or error will be non-nil. Any non-2xx status 2730// code is an error. Response headers are in either 2731// *Comment.ServerResponse.Header or (if a response was returned at all) 2732// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2733// check whether the returned error was because http.StatusNotModified 2734// was returned. 2735func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 2736 gensupport.SetOptions(c.urlParams_, opts...) 2737 res, err := c.doRequest("json") 2738 if res != nil && res.StatusCode == http.StatusNotModified { 2739 if res.Body != nil { 2740 res.Body.Close() 2741 } 2742 return nil, &googleapi.Error{ 2743 Code: res.StatusCode, 2744 Header: res.Header, 2745 } 2746 } 2747 if err != nil { 2748 return nil, err 2749 } 2750 defer googleapi.CloseBody(res) 2751 if err := googleapi.CheckResponse(res); err != nil { 2752 return nil, err 2753 } 2754 ret := &Comment{ 2755 ServerResponse: googleapi.ServerResponse{ 2756 Header: res.Header, 2757 HTTPStatusCode: res.StatusCode, 2758 }, 2759 } 2760 target := &ret 2761 if err := gensupport.DecodeResponse(target, res); err != nil { 2762 return nil, err 2763 } 2764 return ret, nil 2765 // { 2766 // "description": "Gets one comment by ID.", 2767 // "httpMethod": "GET", 2768 // "id": "blogger.comments.get", 2769 // "parameterOrder": [ 2770 // "blogId", 2771 // "postId", 2772 // "commentId" 2773 // ], 2774 // "parameters": { 2775 // "blogId": { 2776 // "description": "ID of the blog to containing the comment.", 2777 // "location": "path", 2778 // "required": true, 2779 // "type": "string" 2780 // }, 2781 // "commentId": { 2782 // "description": "The ID of the comment to get.", 2783 // "location": "path", 2784 // "required": true, 2785 // "type": "string" 2786 // }, 2787 // "postId": { 2788 // "description": "ID of the post to fetch posts from.", 2789 // "location": "path", 2790 // "required": true, 2791 // "type": "string" 2792 // }, 2793 // "view": { 2794 // "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.", 2795 // "enum": [ 2796 // "ADMIN", 2797 // "AUTHOR", 2798 // "READER" 2799 // ], 2800 // "enumDescriptions": [ 2801 // "Admin level detail", 2802 // "Author level detail", 2803 // "Admin level detail" 2804 // ], 2805 // "location": "query", 2806 // "type": "string" 2807 // } 2808 // }, 2809 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", 2810 // "response": { 2811 // "$ref": "Comment" 2812 // }, 2813 // "scopes": [ 2814 // "https://www.googleapis.com/auth/blogger", 2815 // "https://www.googleapis.com/auth/blogger.readonly" 2816 // ] 2817 // } 2818 2819} 2820 2821// method id "blogger.comments.list": 2822 2823type CommentsListCall struct { 2824 s *Service 2825 blogId string 2826 postId string 2827 urlParams_ gensupport.URLParams 2828 ifNoneMatch_ string 2829 ctx_ context.Context 2830 header_ http.Header 2831} 2832 2833// List: Retrieves the comments for a post, possibly filtered. 2834func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { 2835 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2836 c.blogId = blogId 2837 c.postId = postId 2838 return c 2839} 2840 2841// EndDate sets the optional parameter "endDate": Latest date of comment 2842// to fetch, a date-time with RFC 3339 formatting. 2843func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall { 2844 c.urlParams_.Set("endDate", endDate) 2845 return c 2846} 2847 2848// FetchBodies sets the optional parameter "fetchBodies": Whether the 2849// body content of the comments is included. 2850func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { 2851 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 2852 return c 2853} 2854 2855// MaxResults sets the optional parameter "maxResults": Maximum number 2856// of comments to include in the result. 2857func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { 2858 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 2859 return c 2860} 2861 2862// PageToken sets the optional parameter "pageToken": Continuation token 2863// if request is paged. 2864func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { 2865 c.urlParams_.Set("pageToken", pageToken) 2866 return c 2867} 2868 2869// StartDate sets the optional parameter "startDate": Earliest date of 2870// comment to fetch, a date-time with RFC 3339 formatting. 2871func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { 2872 c.urlParams_.Set("startDate", startDate) 2873 return c 2874} 2875 2876// Status sets the optional parameter "status": 2877// 2878// Possible values: 2879// "emptied" - Comments that have had their content removed 2880// "live" - Comments that are publicly visible 2881// "pending" - Comments that are awaiting administrator approval 2882// "spam" - Comments marked as spam by the administrator 2883func (c *CommentsListCall) Status(status ...string) *CommentsListCall { 2884 c.urlParams_.SetMulti("status", append([]string{}, status...)) 2885 return c 2886} 2887 2888// View sets the optional parameter "view": Access level with which to 2889// view the returned result. Note that some fields require elevated 2890// access. 2891// 2892// Possible values: 2893// "ADMIN" - Admin level detail 2894// "AUTHOR" - Author level detail 2895// "READER" - Reader level detail 2896func (c *CommentsListCall) View(view string) *CommentsListCall { 2897 c.urlParams_.Set("view", view) 2898 return c 2899} 2900 2901// Fields allows partial responses to be retrieved. See 2902// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2903// for more information. 2904func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { 2905 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2906 return c 2907} 2908 2909// IfNoneMatch sets the optional parameter which makes the operation 2910// fail if the object's ETag matches the given value. This is useful for 2911// getting updates only after the object has changed since the last 2912// request. Use googleapi.IsNotModified to check whether the response 2913// error from Do is the result of In-None-Match. 2914func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { 2915 c.ifNoneMatch_ = entityTag 2916 return c 2917} 2918 2919// Context sets the context to be used in this call's Do method. Any 2920// pending HTTP request will be aborted if the provided context is 2921// canceled. 2922func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { 2923 c.ctx_ = ctx 2924 return c 2925} 2926 2927// Header returns an http.Header that can be modified by the caller to 2928// add HTTP headers to the request. 2929func (c *CommentsListCall) Header() http.Header { 2930 if c.header_ == nil { 2931 c.header_ = make(http.Header) 2932 } 2933 return c.header_ 2934} 2935 2936func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { 2937 reqHeaders := make(http.Header) 2938 for k, v := range c.header_ { 2939 reqHeaders[k] = v 2940 } 2941 reqHeaders.Set("User-Agent", c.s.userAgent()) 2942 if c.ifNoneMatch_ != "" { 2943 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2944 } 2945 var body io.Reader = nil 2946 c.urlParams_.Set("alt", alt) 2947 c.urlParams_.Set("prettyPrint", "false") 2948 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") 2949 urls += "?" + c.urlParams_.Encode() 2950 req, err := http.NewRequest("GET", urls, body) 2951 if err != nil { 2952 return nil, err 2953 } 2954 req.Header = reqHeaders 2955 googleapi.Expand(req.URL, map[string]string{ 2956 "blogId": c.blogId, 2957 "postId": c.postId, 2958 }) 2959 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2960} 2961 2962// Do executes the "blogger.comments.list" call. 2963// Exactly one of *CommentList or error will be non-nil. Any non-2xx 2964// status code is an error. Response headers are in either 2965// *CommentList.ServerResponse.Header or (if a response was returned at 2966// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2967// to check whether the returned error was because 2968// http.StatusNotModified was returned. 2969func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 2970 gensupport.SetOptions(c.urlParams_, opts...) 2971 res, err := c.doRequest("json") 2972 if res != nil && res.StatusCode == http.StatusNotModified { 2973 if res.Body != nil { 2974 res.Body.Close() 2975 } 2976 return nil, &googleapi.Error{ 2977 Code: res.StatusCode, 2978 Header: res.Header, 2979 } 2980 } 2981 if err != nil { 2982 return nil, err 2983 } 2984 defer googleapi.CloseBody(res) 2985 if err := googleapi.CheckResponse(res); err != nil { 2986 return nil, err 2987 } 2988 ret := &CommentList{ 2989 ServerResponse: googleapi.ServerResponse{ 2990 Header: res.Header, 2991 HTTPStatusCode: res.StatusCode, 2992 }, 2993 } 2994 target := &ret 2995 if err := gensupport.DecodeResponse(target, res); err != nil { 2996 return nil, err 2997 } 2998 return ret, nil 2999 // { 3000 // "description": "Retrieves the comments for a post, possibly filtered.", 3001 // "httpMethod": "GET", 3002 // "id": "blogger.comments.list", 3003 // "parameterOrder": [ 3004 // "blogId", 3005 // "postId" 3006 // ], 3007 // "parameters": { 3008 // "blogId": { 3009 // "description": "ID of the blog to fetch comments from.", 3010 // "location": "path", 3011 // "required": true, 3012 // "type": "string" 3013 // }, 3014 // "endDate": { 3015 // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", 3016 // "format": "date-time", 3017 // "location": "query", 3018 // "type": "string" 3019 // }, 3020 // "fetchBodies": { 3021 // "description": "Whether the body content of the comments is included.", 3022 // "location": "query", 3023 // "type": "boolean" 3024 // }, 3025 // "maxResults": { 3026 // "description": "Maximum number of comments to include in the result.", 3027 // "format": "uint32", 3028 // "location": "query", 3029 // "type": "integer" 3030 // }, 3031 // "pageToken": { 3032 // "description": "Continuation token if request is paged.", 3033 // "location": "query", 3034 // "type": "string" 3035 // }, 3036 // "postId": { 3037 // "description": "ID of the post to fetch posts from.", 3038 // "location": "path", 3039 // "required": true, 3040 // "type": "string" 3041 // }, 3042 // "startDate": { 3043 // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", 3044 // "format": "date-time", 3045 // "location": "query", 3046 // "type": "string" 3047 // }, 3048 // "status": { 3049 // "enum": [ 3050 // "emptied", 3051 // "live", 3052 // "pending", 3053 // "spam" 3054 // ], 3055 // "enumDescriptions": [ 3056 // "Comments that have had their content removed", 3057 // "Comments that are publicly visible", 3058 // "Comments that are awaiting administrator approval", 3059 // "Comments marked as spam by the administrator" 3060 // ], 3061 // "location": "query", 3062 // "repeated": true, 3063 // "type": "string" 3064 // }, 3065 // "view": { 3066 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 3067 // "enum": [ 3068 // "ADMIN", 3069 // "AUTHOR", 3070 // "READER" 3071 // ], 3072 // "enumDescriptions": [ 3073 // "Admin level detail", 3074 // "Author level detail", 3075 // "Reader level detail" 3076 // ], 3077 // "location": "query", 3078 // "type": "string" 3079 // } 3080 // }, 3081 // "path": "blogs/{blogId}/posts/{postId}/comments", 3082 // "response": { 3083 // "$ref": "CommentList" 3084 // }, 3085 // "scopes": [ 3086 // "https://www.googleapis.com/auth/blogger", 3087 // "https://www.googleapis.com/auth/blogger.readonly" 3088 // ] 3089 // } 3090 3091} 3092 3093// Pages invokes f for each page of results. 3094// A non-nil error returned from f will halt the iteration. 3095// The provided context supersedes any context provided to the Context method. 3096func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error { 3097 c.ctx_ = ctx 3098 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3099 for { 3100 x, err := c.Do() 3101 if err != nil { 3102 return err 3103 } 3104 if err := f(x); err != nil { 3105 return err 3106 } 3107 if x.NextPageToken == "" { 3108 return nil 3109 } 3110 c.PageToken(x.NextPageToken) 3111 } 3112} 3113 3114// method id "blogger.comments.listByBlog": 3115 3116type CommentsListByBlogCall struct { 3117 s *Service 3118 blogId string 3119 urlParams_ gensupport.URLParams 3120 ifNoneMatch_ string 3121 ctx_ context.Context 3122 header_ http.Header 3123} 3124 3125// ListByBlog: Retrieves the comments for a blog, across all posts, 3126// possibly filtered. 3127func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall { 3128 c := &CommentsListByBlogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3129 c.blogId = blogId 3130 return c 3131} 3132 3133// EndDate sets the optional parameter "endDate": Latest date of comment 3134// to fetch, a date-time with RFC 3339 formatting. 3135func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall { 3136 c.urlParams_.Set("endDate", endDate) 3137 return c 3138} 3139 3140// FetchBodies sets the optional parameter "fetchBodies": Whether the 3141// body content of the comments is included. 3142func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall { 3143 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 3144 return c 3145} 3146 3147// MaxResults sets the optional parameter "maxResults": Maximum number 3148// of comments to include in the result. 3149func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall { 3150 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 3151 return c 3152} 3153 3154// PageToken sets the optional parameter "pageToken": Continuation token 3155// if request is paged. 3156func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall { 3157 c.urlParams_.Set("pageToken", pageToken) 3158 return c 3159} 3160 3161// StartDate sets the optional parameter "startDate": Earliest date of 3162// comment to fetch, a date-time with RFC 3339 formatting. 3163func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall { 3164 c.urlParams_.Set("startDate", startDate) 3165 return c 3166} 3167 3168// Status sets the optional parameter "status": 3169// 3170// Possible values: 3171// "emptied" - Comments that have had their content removed 3172// "live" - Comments that are publicly visible 3173// "pending" - Comments that are awaiting administrator approval 3174// "spam" - Comments marked as spam by the administrator 3175func (c *CommentsListByBlogCall) Status(status ...string) *CommentsListByBlogCall { 3176 c.urlParams_.SetMulti("status", append([]string{}, status...)) 3177 return c 3178} 3179 3180// Fields allows partial responses to be retrieved. See 3181// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3182// for more information. 3183func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall { 3184 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3185 return c 3186} 3187 3188// IfNoneMatch sets the optional parameter which makes the operation 3189// fail if the object's ETag matches the given value. This is useful for 3190// getting updates only after the object has changed since the last 3191// request. Use googleapi.IsNotModified to check whether the response 3192// error from Do is the result of In-None-Match. 3193func (c *CommentsListByBlogCall) IfNoneMatch(entityTag string) *CommentsListByBlogCall { 3194 c.ifNoneMatch_ = entityTag 3195 return c 3196} 3197 3198// Context sets the context to be used in this call's Do method. Any 3199// pending HTTP request will be aborted if the provided context is 3200// canceled. 3201func (c *CommentsListByBlogCall) Context(ctx context.Context) *CommentsListByBlogCall { 3202 c.ctx_ = ctx 3203 return c 3204} 3205 3206// Header returns an http.Header that can be modified by the caller to 3207// add HTTP headers to the request. 3208func (c *CommentsListByBlogCall) Header() http.Header { 3209 if c.header_ == nil { 3210 c.header_ = make(http.Header) 3211 } 3212 return c.header_ 3213} 3214 3215func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) { 3216 reqHeaders := make(http.Header) 3217 for k, v := range c.header_ { 3218 reqHeaders[k] = v 3219 } 3220 reqHeaders.Set("User-Agent", c.s.userAgent()) 3221 if c.ifNoneMatch_ != "" { 3222 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3223 } 3224 var body io.Reader = nil 3225 c.urlParams_.Set("alt", alt) 3226 c.urlParams_.Set("prettyPrint", "false") 3227 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") 3228 urls += "?" + c.urlParams_.Encode() 3229 req, err := http.NewRequest("GET", urls, body) 3230 if err != nil { 3231 return nil, err 3232 } 3233 req.Header = reqHeaders 3234 googleapi.Expand(req.URL, map[string]string{ 3235 "blogId": c.blogId, 3236 }) 3237 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3238} 3239 3240// Do executes the "blogger.comments.listByBlog" call. 3241// Exactly one of *CommentList or error will be non-nil. Any non-2xx 3242// status code is an error. Response headers are in either 3243// *CommentList.ServerResponse.Header or (if a response was returned at 3244// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3245// to check whether the returned error was because 3246// http.StatusNotModified was returned. 3247func (c *CommentsListByBlogCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 3248 gensupport.SetOptions(c.urlParams_, opts...) 3249 res, err := c.doRequest("json") 3250 if res != nil && res.StatusCode == http.StatusNotModified { 3251 if res.Body != nil { 3252 res.Body.Close() 3253 } 3254 return nil, &googleapi.Error{ 3255 Code: res.StatusCode, 3256 Header: res.Header, 3257 } 3258 } 3259 if err != nil { 3260 return nil, err 3261 } 3262 defer googleapi.CloseBody(res) 3263 if err := googleapi.CheckResponse(res); err != nil { 3264 return nil, err 3265 } 3266 ret := &CommentList{ 3267 ServerResponse: googleapi.ServerResponse{ 3268 Header: res.Header, 3269 HTTPStatusCode: res.StatusCode, 3270 }, 3271 } 3272 target := &ret 3273 if err := gensupport.DecodeResponse(target, res); err != nil { 3274 return nil, err 3275 } 3276 return ret, nil 3277 // { 3278 // "description": "Retrieves the comments for a blog, across all posts, possibly filtered.", 3279 // "httpMethod": "GET", 3280 // "id": "blogger.comments.listByBlog", 3281 // "parameterOrder": [ 3282 // "blogId" 3283 // ], 3284 // "parameters": { 3285 // "blogId": { 3286 // "description": "ID of the blog to fetch comments from.", 3287 // "location": "path", 3288 // "required": true, 3289 // "type": "string" 3290 // }, 3291 // "endDate": { 3292 // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.", 3293 // "format": "date-time", 3294 // "location": "query", 3295 // "type": "string" 3296 // }, 3297 // "fetchBodies": { 3298 // "description": "Whether the body content of the comments is included.", 3299 // "location": "query", 3300 // "type": "boolean" 3301 // }, 3302 // "maxResults": { 3303 // "description": "Maximum number of comments to include in the result.", 3304 // "format": "uint32", 3305 // "location": "query", 3306 // "type": "integer" 3307 // }, 3308 // "pageToken": { 3309 // "description": "Continuation token if request is paged.", 3310 // "location": "query", 3311 // "type": "string" 3312 // }, 3313 // "startDate": { 3314 // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", 3315 // "format": "date-time", 3316 // "location": "query", 3317 // "type": "string" 3318 // }, 3319 // "status": { 3320 // "enum": [ 3321 // "emptied", 3322 // "live", 3323 // "pending", 3324 // "spam" 3325 // ], 3326 // "enumDescriptions": [ 3327 // "Comments that have had their content removed", 3328 // "Comments that are publicly visible", 3329 // "Comments that are awaiting administrator approval", 3330 // "Comments marked as spam by the administrator" 3331 // ], 3332 // "location": "query", 3333 // "repeated": true, 3334 // "type": "string" 3335 // } 3336 // }, 3337 // "path": "blogs/{blogId}/comments", 3338 // "response": { 3339 // "$ref": "CommentList" 3340 // }, 3341 // "scopes": [ 3342 // "https://www.googleapis.com/auth/blogger", 3343 // "https://www.googleapis.com/auth/blogger.readonly" 3344 // ] 3345 // } 3346 3347} 3348 3349// Pages invokes f for each page of results. 3350// A non-nil error returned from f will halt the iteration. 3351// The provided context supersedes any context provided to the Context method. 3352func (c *CommentsListByBlogCall) Pages(ctx context.Context, f func(*CommentList) error) error { 3353 c.ctx_ = ctx 3354 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3355 for { 3356 x, err := c.Do() 3357 if err != nil { 3358 return err 3359 } 3360 if err := f(x); err != nil { 3361 return err 3362 } 3363 if x.NextPageToken == "" { 3364 return nil 3365 } 3366 c.PageToken(x.NextPageToken) 3367 } 3368} 3369 3370// method id "blogger.comments.markAsSpam": 3371 3372type CommentsMarkAsSpamCall struct { 3373 s *Service 3374 blogId string 3375 postId string 3376 commentId string 3377 urlParams_ gensupport.URLParams 3378 ctx_ context.Context 3379 header_ http.Header 3380} 3381 3382// MarkAsSpam: Marks a comment as spam. 3383func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall { 3384 c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3385 c.blogId = blogId 3386 c.postId = postId 3387 c.commentId = commentId 3388 return c 3389} 3390 3391// Fields allows partial responses to be retrieved. See 3392// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3393// for more information. 3394func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall { 3395 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3396 return c 3397} 3398 3399// Context sets the context to be used in this call's Do method. Any 3400// pending HTTP request will be aborted if the provided context is 3401// canceled. 3402func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall { 3403 c.ctx_ = ctx 3404 return c 3405} 3406 3407// Header returns an http.Header that can be modified by the caller to 3408// add HTTP headers to the request. 3409func (c *CommentsMarkAsSpamCall) Header() http.Header { 3410 if c.header_ == nil { 3411 c.header_ = make(http.Header) 3412 } 3413 return c.header_ 3414} 3415 3416func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { 3417 reqHeaders := make(http.Header) 3418 for k, v := range c.header_ { 3419 reqHeaders[k] = v 3420 } 3421 reqHeaders.Set("User-Agent", c.s.userAgent()) 3422 var body io.Reader = nil 3423 c.urlParams_.Set("alt", alt) 3424 c.urlParams_.Set("prettyPrint", "false") 3425 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") 3426 urls += "?" + c.urlParams_.Encode() 3427 req, err := http.NewRequest("POST", urls, body) 3428 if err != nil { 3429 return nil, err 3430 } 3431 req.Header = reqHeaders 3432 googleapi.Expand(req.URL, map[string]string{ 3433 "blogId": c.blogId, 3434 "postId": c.postId, 3435 "commentId": c.commentId, 3436 }) 3437 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3438} 3439 3440// Do executes the "blogger.comments.markAsSpam" call. 3441// Exactly one of *Comment or error will be non-nil. Any non-2xx status 3442// code is an error. Response headers are in either 3443// *Comment.ServerResponse.Header or (if a response was returned at all) 3444// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3445// check whether the returned error was because http.StatusNotModified 3446// was returned. 3447func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 3448 gensupport.SetOptions(c.urlParams_, opts...) 3449 res, err := c.doRequest("json") 3450 if res != nil && res.StatusCode == http.StatusNotModified { 3451 if res.Body != nil { 3452 res.Body.Close() 3453 } 3454 return nil, &googleapi.Error{ 3455 Code: res.StatusCode, 3456 Header: res.Header, 3457 } 3458 } 3459 if err != nil { 3460 return nil, err 3461 } 3462 defer googleapi.CloseBody(res) 3463 if err := googleapi.CheckResponse(res); err != nil { 3464 return nil, err 3465 } 3466 ret := &Comment{ 3467 ServerResponse: googleapi.ServerResponse{ 3468 Header: res.Header, 3469 HTTPStatusCode: res.StatusCode, 3470 }, 3471 } 3472 target := &ret 3473 if err := gensupport.DecodeResponse(target, res); err != nil { 3474 return nil, err 3475 } 3476 return ret, nil 3477 // { 3478 // "description": "Marks a comment as spam.", 3479 // "httpMethod": "POST", 3480 // "id": "blogger.comments.markAsSpam", 3481 // "parameterOrder": [ 3482 // "blogId", 3483 // "postId", 3484 // "commentId" 3485 // ], 3486 // "parameters": { 3487 // "blogId": { 3488 // "description": "The ID of the Blog.", 3489 // "location": "path", 3490 // "required": true, 3491 // "type": "string" 3492 // }, 3493 // "commentId": { 3494 // "description": "The ID of the comment to mark as spam.", 3495 // "location": "path", 3496 // "required": true, 3497 // "type": "string" 3498 // }, 3499 // "postId": { 3500 // "description": "The ID of the Post.", 3501 // "location": "path", 3502 // "required": true, 3503 // "type": "string" 3504 // } 3505 // }, 3506 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam", 3507 // "response": { 3508 // "$ref": "Comment" 3509 // }, 3510 // "scopes": [ 3511 // "https://www.googleapis.com/auth/blogger" 3512 // ] 3513 // } 3514 3515} 3516 3517// method id "blogger.comments.removeContent": 3518 3519type CommentsRemoveContentCall struct { 3520 s *Service 3521 blogId string 3522 postId string 3523 commentId string 3524 urlParams_ gensupport.URLParams 3525 ctx_ context.Context 3526 header_ http.Header 3527} 3528 3529// RemoveContent: Removes the content of a comment. 3530func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall { 3531 c := &CommentsRemoveContentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3532 c.blogId = blogId 3533 c.postId = postId 3534 c.commentId = commentId 3535 return c 3536} 3537 3538// Fields allows partial responses to be retrieved. See 3539// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3540// for more information. 3541func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall { 3542 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3543 return c 3544} 3545 3546// Context sets the context to be used in this call's Do method. Any 3547// pending HTTP request will be aborted if the provided context is 3548// canceled. 3549func (c *CommentsRemoveContentCall) Context(ctx context.Context) *CommentsRemoveContentCall { 3550 c.ctx_ = ctx 3551 return c 3552} 3553 3554// Header returns an http.Header that can be modified by the caller to 3555// add HTTP headers to the request. 3556func (c *CommentsRemoveContentCall) Header() http.Header { 3557 if c.header_ == nil { 3558 c.header_ = make(http.Header) 3559 } 3560 return c.header_ 3561} 3562 3563func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) { 3564 reqHeaders := make(http.Header) 3565 for k, v := range c.header_ { 3566 reqHeaders[k] = v 3567 } 3568 reqHeaders.Set("User-Agent", c.s.userAgent()) 3569 var body io.Reader = nil 3570 c.urlParams_.Set("alt", alt) 3571 c.urlParams_.Set("prettyPrint", "false") 3572 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") 3573 urls += "?" + c.urlParams_.Encode() 3574 req, err := http.NewRequest("POST", urls, body) 3575 if err != nil { 3576 return nil, err 3577 } 3578 req.Header = reqHeaders 3579 googleapi.Expand(req.URL, map[string]string{ 3580 "blogId": c.blogId, 3581 "postId": c.postId, 3582 "commentId": c.commentId, 3583 }) 3584 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3585} 3586 3587// Do executes the "blogger.comments.removeContent" call. 3588// Exactly one of *Comment or error will be non-nil. Any non-2xx status 3589// code is an error. Response headers are in either 3590// *Comment.ServerResponse.Header or (if a response was returned at all) 3591// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3592// check whether the returned error was because http.StatusNotModified 3593// was returned. 3594func (c *CommentsRemoveContentCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 3595 gensupport.SetOptions(c.urlParams_, opts...) 3596 res, err := c.doRequest("json") 3597 if res != nil && res.StatusCode == http.StatusNotModified { 3598 if res.Body != nil { 3599 res.Body.Close() 3600 } 3601 return nil, &googleapi.Error{ 3602 Code: res.StatusCode, 3603 Header: res.Header, 3604 } 3605 } 3606 if err != nil { 3607 return nil, err 3608 } 3609 defer googleapi.CloseBody(res) 3610 if err := googleapi.CheckResponse(res); err != nil { 3611 return nil, err 3612 } 3613 ret := &Comment{ 3614 ServerResponse: googleapi.ServerResponse{ 3615 Header: res.Header, 3616 HTTPStatusCode: res.StatusCode, 3617 }, 3618 } 3619 target := &ret 3620 if err := gensupport.DecodeResponse(target, res); err != nil { 3621 return nil, err 3622 } 3623 return ret, nil 3624 // { 3625 // "description": "Removes the content of a comment.", 3626 // "httpMethod": "POST", 3627 // "id": "blogger.comments.removeContent", 3628 // "parameterOrder": [ 3629 // "blogId", 3630 // "postId", 3631 // "commentId" 3632 // ], 3633 // "parameters": { 3634 // "blogId": { 3635 // "description": "The ID of the Blog.", 3636 // "location": "path", 3637 // "required": true, 3638 // "type": "string" 3639 // }, 3640 // "commentId": { 3641 // "description": "The ID of the comment to delete content from.", 3642 // "location": "path", 3643 // "required": true, 3644 // "type": "string" 3645 // }, 3646 // "postId": { 3647 // "description": "The ID of the Post.", 3648 // "location": "path", 3649 // "required": true, 3650 // "type": "string" 3651 // } 3652 // }, 3653 // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent", 3654 // "response": { 3655 // "$ref": "Comment" 3656 // }, 3657 // "scopes": [ 3658 // "https://www.googleapis.com/auth/blogger" 3659 // ] 3660 // } 3661 3662} 3663 3664// method id "blogger.pageViews.get": 3665 3666type PageViewsGetCall struct { 3667 s *Service 3668 blogId string 3669 urlParams_ gensupport.URLParams 3670 ifNoneMatch_ string 3671 ctx_ context.Context 3672 header_ http.Header 3673} 3674 3675// Get: Retrieve pageview stats for a Blog. 3676func (r *PageViewsService) Get(blogId string) *PageViewsGetCall { 3677 c := &PageViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3678 c.blogId = blogId 3679 return c 3680} 3681 3682// Range sets the optional parameter "range": 3683// 3684// Possible values: 3685// "30DAYS" - Page view counts from the last thirty days. 3686// "7DAYS" - Page view counts from the last seven days. 3687// "all" - Total page view counts from all time. 3688func (c *PageViewsGetCall) Range(range_ ...string) *PageViewsGetCall { 3689 c.urlParams_.SetMulti("range", append([]string{}, range_...)) 3690 return c 3691} 3692 3693// Fields allows partial responses to be retrieved. See 3694// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3695// for more information. 3696func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall { 3697 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3698 return c 3699} 3700 3701// IfNoneMatch sets the optional parameter which makes the operation 3702// fail if the object's ETag matches the given value. This is useful for 3703// getting updates only after the object has changed since the last 3704// request. Use googleapi.IsNotModified to check whether the response 3705// error from Do is the result of In-None-Match. 3706func (c *PageViewsGetCall) IfNoneMatch(entityTag string) *PageViewsGetCall { 3707 c.ifNoneMatch_ = entityTag 3708 return c 3709} 3710 3711// Context sets the context to be used in this call's Do method. Any 3712// pending HTTP request will be aborted if the provided context is 3713// canceled. 3714func (c *PageViewsGetCall) Context(ctx context.Context) *PageViewsGetCall { 3715 c.ctx_ = ctx 3716 return c 3717} 3718 3719// Header returns an http.Header that can be modified by the caller to 3720// add HTTP headers to the request. 3721func (c *PageViewsGetCall) Header() http.Header { 3722 if c.header_ == nil { 3723 c.header_ = make(http.Header) 3724 } 3725 return c.header_ 3726} 3727 3728func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) { 3729 reqHeaders := make(http.Header) 3730 for k, v := range c.header_ { 3731 reqHeaders[k] = v 3732 } 3733 reqHeaders.Set("User-Agent", c.s.userAgent()) 3734 if c.ifNoneMatch_ != "" { 3735 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3736 } 3737 var body io.Reader = nil 3738 c.urlParams_.Set("alt", alt) 3739 c.urlParams_.Set("prettyPrint", "false") 3740 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") 3741 urls += "?" + c.urlParams_.Encode() 3742 req, err := http.NewRequest("GET", urls, body) 3743 if err != nil { 3744 return nil, err 3745 } 3746 req.Header = reqHeaders 3747 googleapi.Expand(req.URL, map[string]string{ 3748 "blogId": c.blogId, 3749 }) 3750 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3751} 3752 3753// Do executes the "blogger.pageViews.get" call. 3754// Exactly one of *Pageviews or error will be non-nil. Any non-2xx 3755// status code is an error. Response headers are in either 3756// *Pageviews.ServerResponse.Header or (if a response was returned at 3757// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3758// to check whether the returned error was because 3759// http.StatusNotModified was returned. 3760func (c *PageViewsGetCall) Do(opts ...googleapi.CallOption) (*Pageviews, error) { 3761 gensupport.SetOptions(c.urlParams_, opts...) 3762 res, err := c.doRequest("json") 3763 if res != nil && res.StatusCode == http.StatusNotModified { 3764 if res.Body != nil { 3765 res.Body.Close() 3766 } 3767 return nil, &googleapi.Error{ 3768 Code: res.StatusCode, 3769 Header: res.Header, 3770 } 3771 } 3772 if err != nil { 3773 return nil, err 3774 } 3775 defer googleapi.CloseBody(res) 3776 if err := googleapi.CheckResponse(res); err != nil { 3777 return nil, err 3778 } 3779 ret := &Pageviews{ 3780 ServerResponse: googleapi.ServerResponse{ 3781 Header: res.Header, 3782 HTTPStatusCode: res.StatusCode, 3783 }, 3784 } 3785 target := &ret 3786 if err := gensupport.DecodeResponse(target, res); err != nil { 3787 return nil, err 3788 } 3789 return ret, nil 3790 // { 3791 // "description": "Retrieve pageview stats for a Blog.", 3792 // "httpMethod": "GET", 3793 // "id": "blogger.pageViews.get", 3794 // "parameterOrder": [ 3795 // "blogId" 3796 // ], 3797 // "parameters": { 3798 // "blogId": { 3799 // "description": "The ID of the blog to get.", 3800 // "location": "path", 3801 // "required": true, 3802 // "type": "string" 3803 // }, 3804 // "range": { 3805 // "enum": [ 3806 // "30DAYS", 3807 // "7DAYS", 3808 // "all" 3809 // ], 3810 // "enumDescriptions": [ 3811 // "Page view counts from the last thirty days.", 3812 // "Page view counts from the last seven days.", 3813 // "Total page view counts from all time." 3814 // ], 3815 // "location": "query", 3816 // "repeated": true, 3817 // "type": "string" 3818 // } 3819 // }, 3820 // "path": "blogs/{blogId}/pageviews", 3821 // "response": { 3822 // "$ref": "Pageviews" 3823 // }, 3824 // "scopes": [ 3825 // "https://www.googleapis.com/auth/blogger" 3826 // ] 3827 // } 3828 3829} 3830 3831// method id "blogger.pages.delete": 3832 3833type PagesDeleteCall struct { 3834 s *Service 3835 blogId string 3836 pageId string 3837 urlParams_ gensupport.URLParams 3838 ctx_ context.Context 3839 header_ http.Header 3840} 3841 3842// Delete: Delete a page by ID. 3843func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall { 3844 c := &PagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3845 c.blogId = blogId 3846 c.pageId = pageId 3847 return c 3848} 3849 3850// Fields allows partial responses to be retrieved. See 3851// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3852// for more information. 3853func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall { 3854 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3855 return c 3856} 3857 3858// Context sets the context to be used in this call's Do method. Any 3859// pending HTTP request will be aborted if the provided context is 3860// canceled. 3861func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall { 3862 c.ctx_ = ctx 3863 return c 3864} 3865 3866// Header returns an http.Header that can be modified by the caller to 3867// add HTTP headers to the request. 3868func (c *PagesDeleteCall) Header() http.Header { 3869 if c.header_ == nil { 3870 c.header_ = make(http.Header) 3871 } 3872 return c.header_ 3873} 3874 3875func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { 3876 reqHeaders := make(http.Header) 3877 for k, v := range c.header_ { 3878 reqHeaders[k] = v 3879 } 3880 reqHeaders.Set("User-Agent", c.s.userAgent()) 3881 var body io.Reader = nil 3882 c.urlParams_.Set("alt", alt) 3883 c.urlParams_.Set("prettyPrint", "false") 3884 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 3885 urls += "?" + c.urlParams_.Encode() 3886 req, err := http.NewRequest("DELETE", urls, body) 3887 if err != nil { 3888 return nil, err 3889 } 3890 req.Header = reqHeaders 3891 googleapi.Expand(req.URL, map[string]string{ 3892 "blogId": c.blogId, 3893 "pageId": c.pageId, 3894 }) 3895 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3896} 3897 3898// Do executes the "blogger.pages.delete" call. 3899func (c *PagesDeleteCall) Do(opts ...googleapi.CallOption) error { 3900 gensupport.SetOptions(c.urlParams_, opts...) 3901 res, err := c.doRequest("json") 3902 if err != nil { 3903 return err 3904 } 3905 defer googleapi.CloseBody(res) 3906 if err := googleapi.CheckResponse(res); err != nil { 3907 return err 3908 } 3909 return nil 3910 // { 3911 // "description": "Delete a page by ID.", 3912 // "httpMethod": "DELETE", 3913 // "id": "blogger.pages.delete", 3914 // "parameterOrder": [ 3915 // "blogId", 3916 // "pageId" 3917 // ], 3918 // "parameters": { 3919 // "blogId": { 3920 // "description": "The ID of the Blog.", 3921 // "location": "path", 3922 // "required": true, 3923 // "type": "string" 3924 // }, 3925 // "pageId": { 3926 // "description": "The ID of the Page.", 3927 // "location": "path", 3928 // "required": true, 3929 // "type": "string" 3930 // } 3931 // }, 3932 // "path": "blogs/{blogId}/pages/{pageId}", 3933 // "scopes": [ 3934 // "https://www.googleapis.com/auth/blogger" 3935 // ] 3936 // } 3937 3938} 3939 3940// method id "blogger.pages.get": 3941 3942type PagesGetCall struct { 3943 s *Service 3944 blogId string 3945 pageId string 3946 urlParams_ gensupport.URLParams 3947 ifNoneMatch_ string 3948 ctx_ context.Context 3949 header_ http.Header 3950} 3951 3952// Get: Gets one blog page by ID. 3953func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { 3954 c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3955 c.blogId = blogId 3956 c.pageId = pageId 3957 return c 3958} 3959 3960// View sets the optional parameter "view": 3961// 3962// Possible values: 3963// "ADMIN" - Admin level detail 3964// "AUTHOR" - Author level detail 3965// "READER" - Reader level detail 3966func (c *PagesGetCall) View(view string) *PagesGetCall { 3967 c.urlParams_.Set("view", view) 3968 return c 3969} 3970 3971// Fields allows partial responses to be retrieved. See 3972// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3973// for more information. 3974func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { 3975 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3976 return c 3977} 3978 3979// IfNoneMatch sets the optional parameter which makes the operation 3980// fail if the object's ETag matches the given value. This is useful for 3981// getting updates only after the object has changed since the last 3982// request. Use googleapi.IsNotModified to check whether the response 3983// error from Do is the result of In-None-Match. 3984func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { 3985 c.ifNoneMatch_ = entityTag 3986 return c 3987} 3988 3989// Context sets the context to be used in this call's Do method. Any 3990// pending HTTP request will be aborted if the provided context is 3991// canceled. 3992func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { 3993 c.ctx_ = ctx 3994 return c 3995} 3996 3997// Header returns an http.Header that can be modified by the caller to 3998// add HTTP headers to the request. 3999func (c *PagesGetCall) Header() http.Header { 4000 if c.header_ == nil { 4001 c.header_ = make(http.Header) 4002 } 4003 return c.header_ 4004} 4005 4006func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { 4007 reqHeaders := make(http.Header) 4008 for k, v := range c.header_ { 4009 reqHeaders[k] = v 4010 } 4011 reqHeaders.Set("User-Agent", c.s.userAgent()) 4012 if c.ifNoneMatch_ != "" { 4013 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4014 } 4015 var body io.Reader = nil 4016 c.urlParams_.Set("alt", alt) 4017 c.urlParams_.Set("prettyPrint", "false") 4018 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 4019 urls += "?" + c.urlParams_.Encode() 4020 req, err := http.NewRequest("GET", urls, body) 4021 if err != nil { 4022 return nil, err 4023 } 4024 req.Header = reqHeaders 4025 googleapi.Expand(req.URL, map[string]string{ 4026 "blogId": c.blogId, 4027 "pageId": c.pageId, 4028 }) 4029 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4030} 4031 4032// Do executes the "blogger.pages.get" call. 4033// Exactly one of *Page or error will be non-nil. Any non-2xx status 4034// code is an error. Response headers are in either 4035// *Page.ServerResponse.Header or (if a response was returned at all) in 4036// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4037// whether the returned error was because http.StatusNotModified was 4038// returned. 4039func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4040 gensupport.SetOptions(c.urlParams_, opts...) 4041 res, err := c.doRequest("json") 4042 if res != nil && res.StatusCode == http.StatusNotModified { 4043 if res.Body != nil { 4044 res.Body.Close() 4045 } 4046 return nil, &googleapi.Error{ 4047 Code: res.StatusCode, 4048 Header: res.Header, 4049 } 4050 } 4051 if err != nil { 4052 return nil, err 4053 } 4054 defer googleapi.CloseBody(res) 4055 if err := googleapi.CheckResponse(res); err != nil { 4056 return nil, err 4057 } 4058 ret := &Page{ 4059 ServerResponse: googleapi.ServerResponse{ 4060 Header: res.Header, 4061 HTTPStatusCode: res.StatusCode, 4062 }, 4063 } 4064 target := &ret 4065 if err := gensupport.DecodeResponse(target, res); err != nil { 4066 return nil, err 4067 } 4068 return ret, nil 4069 // { 4070 // "description": "Gets one blog page by ID.", 4071 // "httpMethod": "GET", 4072 // "id": "blogger.pages.get", 4073 // "parameterOrder": [ 4074 // "blogId", 4075 // "pageId" 4076 // ], 4077 // "parameters": { 4078 // "blogId": { 4079 // "description": "ID of the blog containing the page.", 4080 // "location": "path", 4081 // "required": true, 4082 // "type": "string" 4083 // }, 4084 // "pageId": { 4085 // "description": "The ID of the page to get.", 4086 // "location": "path", 4087 // "required": true, 4088 // "type": "string" 4089 // }, 4090 // "view": { 4091 // "enum": [ 4092 // "ADMIN", 4093 // "AUTHOR", 4094 // "READER" 4095 // ], 4096 // "enumDescriptions": [ 4097 // "Admin level detail", 4098 // "Author level detail", 4099 // "Reader level detail" 4100 // ], 4101 // "location": "query", 4102 // "type": "string" 4103 // } 4104 // }, 4105 // "path": "blogs/{blogId}/pages/{pageId}", 4106 // "response": { 4107 // "$ref": "Page" 4108 // }, 4109 // "scopes": [ 4110 // "https://www.googleapis.com/auth/blogger", 4111 // "https://www.googleapis.com/auth/blogger.readonly" 4112 // ] 4113 // } 4114 4115} 4116 4117// method id "blogger.pages.insert": 4118 4119type PagesInsertCall struct { 4120 s *Service 4121 blogId string 4122 page *Page 4123 urlParams_ gensupport.URLParams 4124 ctx_ context.Context 4125 header_ http.Header 4126} 4127 4128// Insert: Add a page. 4129func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall { 4130 c := &PagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4131 c.blogId = blogId 4132 c.page = page 4133 return c 4134} 4135 4136// IsDraft sets the optional parameter "isDraft": Whether to create the 4137// page as a draft (default: false). 4138func (c *PagesInsertCall) IsDraft(isDraft bool) *PagesInsertCall { 4139 c.urlParams_.Set("isDraft", fmt.Sprint(isDraft)) 4140 return c 4141} 4142 4143// Fields allows partial responses to be retrieved. See 4144// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4145// for more information. 4146func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall { 4147 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4148 return c 4149} 4150 4151// Context sets the context to be used in this call's Do method. Any 4152// pending HTTP request will be aborted if the provided context is 4153// canceled. 4154func (c *PagesInsertCall) Context(ctx context.Context) *PagesInsertCall { 4155 c.ctx_ = ctx 4156 return c 4157} 4158 4159// Header returns an http.Header that can be modified by the caller to 4160// add HTTP headers to the request. 4161func (c *PagesInsertCall) Header() http.Header { 4162 if c.header_ == nil { 4163 c.header_ = make(http.Header) 4164 } 4165 return c.header_ 4166} 4167 4168func (c *PagesInsertCall) doRequest(alt string) (*http.Response, error) { 4169 reqHeaders := make(http.Header) 4170 for k, v := range c.header_ { 4171 reqHeaders[k] = v 4172 } 4173 reqHeaders.Set("User-Agent", c.s.userAgent()) 4174 var body io.Reader = nil 4175 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) 4176 if err != nil { 4177 return nil, err 4178 } 4179 reqHeaders.Set("Content-Type", "application/json") 4180 c.urlParams_.Set("alt", alt) 4181 c.urlParams_.Set("prettyPrint", "false") 4182 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") 4183 urls += "?" + c.urlParams_.Encode() 4184 req, err := http.NewRequest("POST", urls, body) 4185 if err != nil { 4186 return nil, err 4187 } 4188 req.Header = reqHeaders 4189 googleapi.Expand(req.URL, map[string]string{ 4190 "blogId": c.blogId, 4191 }) 4192 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4193} 4194 4195// Do executes the "blogger.pages.insert" call. 4196// Exactly one of *Page or error will be non-nil. Any non-2xx status 4197// code is an error. Response headers are in either 4198// *Page.ServerResponse.Header or (if a response was returned at all) in 4199// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4200// whether the returned error was because http.StatusNotModified was 4201// returned. 4202func (c *PagesInsertCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4203 gensupport.SetOptions(c.urlParams_, opts...) 4204 res, err := c.doRequest("json") 4205 if res != nil && res.StatusCode == http.StatusNotModified { 4206 if res.Body != nil { 4207 res.Body.Close() 4208 } 4209 return nil, &googleapi.Error{ 4210 Code: res.StatusCode, 4211 Header: res.Header, 4212 } 4213 } 4214 if err != nil { 4215 return nil, err 4216 } 4217 defer googleapi.CloseBody(res) 4218 if err := googleapi.CheckResponse(res); err != nil { 4219 return nil, err 4220 } 4221 ret := &Page{ 4222 ServerResponse: googleapi.ServerResponse{ 4223 Header: res.Header, 4224 HTTPStatusCode: res.StatusCode, 4225 }, 4226 } 4227 target := &ret 4228 if err := gensupport.DecodeResponse(target, res); err != nil { 4229 return nil, err 4230 } 4231 return ret, nil 4232 // { 4233 // "description": "Add a page.", 4234 // "httpMethod": "POST", 4235 // "id": "blogger.pages.insert", 4236 // "parameterOrder": [ 4237 // "blogId" 4238 // ], 4239 // "parameters": { 4240 // "blogId": { 4241 // "description": "ID of the blog to add the page to.", 4242 // "location": "path", 4243 // "required": true, 4244 // "type": "string" 4245 // }, 4246 // "isDraft": { 4247 // "description": "Whether to create the page as a draft (default: false).", 4248 // "location": "query", 4249 // "type": "boolean" 4250 // } 4251 // }, 4252 // "path": "blogs/{blogId}/pages", 4253 // "request": { 4254 // "$ref": "Page" 4255 // }, 4256 // "response": { 4257 // "$ref": "Page" 4258 // }, 4259 // "scopes": [ 4260 // "https://www.googleapis.com/auth/blogger" 4261 // ] 4262 // } 4263 4264} 4265 4266// method id "blogger.pages.list": 4267 4268type PagesListCall struct { 4269 s *Service 4270 blogId string 4271 urlParams_ gensupport.URLParams 4272 ifNoneMatch_ string 4273 ctx_ context.Context 4274 header_ http.Header 4275} 4276 4277// List: Retrieves the pages for a blog, optionally including non-LIVE 4278// statuses. 4279func (r *PagesService) List(blogId string) *PagesListCall { 4280 c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4281 c.blogId = blogId 4282 return c 4283} 4284 4285// FetchBodies sets the optional parameter "fetchBodies": Whether to 4286// retrieve the Page bodies. 4287func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { 4288 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 4289 return c 4290} 4291 4292// MaxResults sets the optional parameter "maxResults": Maximum number 4293// of Pages to fetch. 4294func (c *PagesListCall) MaxResults(maxResults int64) *PagesListCall { 4295 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4296 return c 4297} 4298 4299// PageToken sets the optional parameter "pageToken": Continuation token 4300// if the request is paged. 4301func (c *PagesListCall) PageToken(pageToken string) *PagesListCall { 4302 c.urlParams_.Set("pageToken", pageToken) 4303 return c 4304} 4305 4306// Status sets the optional parameter "status": 4307// 4308// Possible values: 4309// "draft" - Draft (unpublished) Pages 4310// "live" - Pages that are publicly visible 4311func (c *PagesListCall) Status(status ...string) *PagesListCall { 4312 c.urlParams_.SetMulti("status", append([]string{}, status...)) 4313 return c 4314} 4315 4316// View sets the optional parameter "view": Access level with which to 4317// view the returned result. Note that some fields require elevated 4318// access. 4319// 4320// Possible values: 4321// "ADMIN" - Admin level detail 4322// "AUTHOR" - Author level detail 4323// "READER" - Reader level detail 4324func (c *PagesListCall) View(view string) *PagesListCall { 4325 c.urlParams_.Set("view", view) 4326 return c 4327} 4328 4329// Fields allows partial responses to be retrieved. See 4330// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4331// for more information. 4332func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { 4333 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4334 return c 4335} 4336 4337// IfNoneMatch sets the optional parameter which makes the operation 4338// fail if the object's ETag matches the given value. This is useful for 4339// getting updates only after the object has changed since the last 4340// request. Use googleapi.IsNotModified to check whether the response 4341// error from Do is the result of In-None-Match. 4342func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { 4343 c.ifNoneMatch_ = entityTag 4344 return c 4345} 4346 4347// Context sets the context to be used in this call's Do method. Any 4348// pending HTTP request will be aborted if the provided context is 4349// canceled. 4350func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { 4351 c.ctx_ = ctx 4352 return c 4353} 4354 4355// Header returns an http.Header that can be modified by the caller to 4356// add HTTP headers to the request. 4357func (c *PagesListCall) Header() http.Header { 4358 if c.header_ == nil { 4359 c.header_ = make(http.Header) 4360 } 4361 return c.header_ 4362} 4363 4364func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { 4365 reqHeaders := make(http.Header) 4366 for k, v := range c.header_ { 4367 reqHeaders[k] = v 4368 } 4369 reqHeaders.Set("User-Agent", c.s.userAgent()) 4370 if c.ifNoneMatch_ != "" { 4371 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4372 } 4373 var body io.Reader = nil 4374 c.urlParams_.Set("alt", alt) 4375 c.urlParams_.Set("prettyPrint", "false") 4376 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") 4377 urls += "?" + c.urlParams_.Encode() 4378 req, err := http.NewRequest("GET", urls, body) 4379 if err != nil { 4380 return nil, err 4381 } 4382 req.Header = reqHeaders 4383 googleapi.Expand(req.URL, map[string]string{ 4384 "blogId": c.blogId, 4385 }) 4386 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4387} 4388 4389// Do executes the "blogger.pages.list" call. 4390// Exactly one of *PageList or error will be non-nil. Any non-2xx status 4391// code is an error. Response headers are in either 4392// *PageList.ServerResponse.Header or (if a response was returned at 4393// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4394// to check whether the returned error was because 4395// http.StatusNotModified was returned. 4396func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*PageList, error) { 4397 gensupport.SetOptions(c.urlParams_, opts...) 4398 res, err := c.doRequest("json") 4399 if res != nil && res.StatusCode == http.StatusNotModified { 4400 if res.Body != nil { 4401 res.Body.Close() 4402 } 4403 return nil, &googleapi.Error{ 4404 Code: res.StatusCode, 4405 Header: res.Header, 4406 } 4407 } 4408 if err != nil { 4409 return nil, err 4410 } 4411 defer googleapi.CloseBody(res) 4412 if err := googleapi.CheckResponse(res); err != nil { 4413 return nil, err 4414 } 4415 ret := &PageList{ 4416 ServerResponse: googleapi.ServerResponse{ 4417 Header: res.Header, 4418 HTTPStatusCode: res.StatusCode, 4419 }, 4420 } 4421 target := &ret 4422 if err := gensupport.DecodeResponse(target, res); err != nil { 4423 return nil, err 4424 } 4425 return ret, nil 4426 // { 4427 // "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.", 4428 // "httpMethod": "GET", 4429 // "id": "blogger.pages.list", 4430 // "parameterOrder": [ 4431 // "blogId" 4432 // ], 4433 // "parameters": { 4434 // "blogId": { 4435 // "description": "ID of the blog to fetch Pages from.", 4436 // "location": "path", 4437 // "required": true, 4438 // "type": "string" 4439 // }, 4440 // "fetchBodies": { 4441 // "description": "Whether to retrieve the Page bodies.", 4442 // "location": "query", 4443 // "type": "boolean" 4444 // }, 4445 // "maxResults": { 4446 // "description": "Maximum number of Pages to fetch.", 4447 // "format": "uint32", 4448 // "location": "query", 4449 // "type": "integer" 4450 // }, 4451 // "pageToken": { 4452 // "description": "Continuation token if the request is paged.", 4453 // "location": "query", 4454 // "type": "string" 4455 // }, 4456 // "status": { 4457 // "enum": [ 4458 // "draft", 4459 // "live" 4460 // ], 4461 // "enumDescriptions": [ 4462 // "Draft (unpublished) Pages", 4463 // "Pages that are publicly visible" 4464 // ], 4465 // "location": "query", 4466 // "repeated": true, 4467 // "type": "string" 4468 // }, 4469 // "view": { 4470 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 4471 // "enum": [ 4472 // "ADMIN", 4473 // "AUTHOR", 4474 // "READER" 4475 // ], 4476 // "enumDescriptions": [ 4477 // "Admin level detail", 4478 // "Author level detail", 4479 // "Reader level detail" 4480 // ], 4481 // "location": "query", 4482 // "type": "string" 4483 // } 4484 // }, 4485 // "path": "blogs/{blogId}/pages", 4486 // "response": { 4487 // "$ref": "PageList" 4488 // }, 4489 // "scopes": [ 4490 // "https://www.googleapis.com/auth/blogger", 4491 // "https://www.googleapis.com/auth/blogger.readonly" 4492 // ] 4493 // } 4494 4495} 4496 4497// Pages invokes f for each page of results. 4498// A non-nil error returned from f will halt the iteration. 4499// The provided context supersedes any context provided to the Context method. 4500func (c *PagesListCall) Pages(ctx context.Context, f func(*PageList) error) error { 4501 c.ctx_ = ctx 4502 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4503 for { 4504 x, err := c.Do() 4505 if err != nil { 4506 return err 4507 } 4508 if err := f(x); err != nil { 4509 return err 4510 } 4511 if x.NextPageToken == "" { 4512 return nil 4513 } 4514 c.PageToken(x.NextPageToken) 4515 } 4516} 4517 4518// method id "blogger.pages.patch": 4519 4520type PagesPatchCall struct { 4521 s *Service 4522 blogId string 4523 pageId string 4524 page *Page 4525 urlParams_ gensupport.URLParams 4526 ctx_ context.Context 4527 header_ http.Header 4528} 4529 4530// Patch: Update a page. This method supports patch semantics. 4531func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall { 4532 c := &PagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4533 c.blogId = blogId 4534 c.pageId = pageId 4535 c.page = page 4536 return c 4537} 4538 4539// Publish sets the optional parameter "publish": Whether a publish 4540// action should be performed when the page is updated (default: false). 4541func (c *PagesPatchCall) Publish(publish bool) *PagesPatchCall { 4542 c.urlParams_.Set("publish", fmt.Sprint(publish)) 4543 return c 4544} 4545 4546// Revert sets the optional parameter "revert": Whether a revert action 4547// should be performed when the page is updated (default: false). 4548func (c *PagesPatchCall) Revert(revert bool) *PagesPatchCall { 4549 c.urlParams_.Set("revert", fmt.Sprint(revert)) 4550 return c 4551} 4552 4553// Fields allows partial responses to be retrieved. See 4554// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4555// for more information. 4556func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall { 4557 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4558 return c 4559} 4560 4561// Context sets the context to be used in this call's Do method. Any 4562// pending HTTP request will be aborted if the provided context is 4563// canceled. 4564func (c *PagesPatchCall) Context(ctx context.Context) *PagesPatchCall { 4565 c.ctx_ = ctx 4566 return c 4567} 4568 4569// Header returns an http.Header that can be modified by the caller to 4570// add HTTP headers to the request. 4571func (c *PagesPatchCall) Header() http.Header { 4572 if c.header_ == nil { 4573 c.header_ = make(http.Header) 4574 } 4575 return c.header_ 4576} 4577 4578func (c *PagesPatchCall) doRequest(alt string) (*http.Response, error) { 4579 reqHeaders := make(http.Header) 4580 for k, v := range c.header_ { 4581 reqHeaders[k] = v 4582 } 4583 reqHeaders.Set("User-Agent", c.s.userAgent()) 4584 var body io.Reader = nil 4585 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) 4586 if err != nil { 4587 return nil, err 4588 } 4589 reqHeaders.Set("Content-Type", "application/json") 4590 c.urlParams_.Set("alt", alt) 4591 c.urlParams_.Set("prettyPrint", "false") 4592 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 4593 urls += "?" + c.urlParams_.Encode() 4594 req, err := http.NewRequest("PATCH", urls, body) 4595 if err != nil { 4596 return nil, err 4597 } 4598 req.Header = reqHeaders 4599 googleapi.Expand(req.URL, map[string]string{ 4600 "blogId": c.blogId, 4601 "pageId": c.pageId, 4602 }) 4603 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4604} 4605 4606// Do executes the "blogger.pages.patch" call. 4607// Exactly one of *Page or error will be non-nil. Any non-2xx status 4608// code is an error. Response headers are in either 4609// *Page.ServerResponse.Header or (if a response was returned at all) in 4610// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4611// whether the returned error was because http.StatusNotModified was 4612// returned. 4613func (c *PagesPatchCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4614 gensupport.SetOptions(c.urlParams_, opts...) 4615 res, err := c.doRequest("json") 4616 if res != nil && res.StatusCode == http.StatusNotModified { 4617 if res.Body != nil { 4618 res.Body.Close() 4619 } 4620 return nil, &googleapi.Error{ 4621 Code: res.StatusCode, 4622 Header: res.Header, 4623 } 4624 } 4625 if err != nil { 4626 return nil, err 4627 } 4628 defer googleapi.CloseBody(res) 4629 if err := googleapi.CheckResponse(res); err != nil { 4630 return nil, err 4631 } 4632 ret := &Page{ 4633 ServerResponse: googleapi.ServerResponse{ 4634 Header: res.Header, 4635 HTTPStatusCode: res.StatusCode, 4636 }, 4637 } 4638 target := &ret 4639 if err := gensupport.DecodeResponse(target, res); err != nil { 4640 return nil, err 4641 } 4642 return ret, nil 4643 // { 4644 // "description": "Update a page. This method supports patch semantics.", 4645 // "httpMethod": "PATCH", 4646 // "id": "blogger.pages.patch", 4647 // "parameterOrder": [ 4648 // "blogId", 4649 // "pageId" 4650 // ], 4651 // "parameters": { 4652 // "blogId": { 4653 // "description": "The ID of the Blog.", 4654 // "location": "path", 4655 // "required": true, 4656 // "type": "string" 4657 // }, 4658 // "pageId": { 4659 // "description": "The ID of the Page.", 4660 // "location": "path", 4661 // "required": true, 4662 // "type": "string" 4663 // }, 4664 // "publish": { 4665 // "description": "Whether a publish action should be performed when the page is updated (default: false).", 4666 // "location": "query", 4667 // "type": "boolean" 4668 // }, 4669 // "revert": { 4670 // "description": "Whether a revert action should be performed when the page is updated (default: false).", 4671 // "location": "query", 4672 // "type": "boolean" 4673 // } 4674 // }, 4675 // "path": "blogs/{blogId}/pages/{pageId}", 4676 // "request": { 4677 // "$ref": "Page" 4678 // }, 4679 // "response": { 4680 // "$ref": "Page" 4681 // }, 4682 // "scopes": [ 4683 // "https://www.googleapis.com/auth/blogger" 4684 // ] 4685 // } 4686 4687} 4688 4689// method id "blogger.pages.publish": 4690 4691type PagesPublishCall struct { 4692 s *Service 4693 blogId string 4694 pageId string 4695 urlParams_ gensupport.URLParams 4696 ctx_ context.Context 4697 header_ http.Header 4698} 4699 4700// Publish: Publishes a draft page. 4701func (r *PagesService) Publish(blogId string, pageId string) *PagesPublishCall { 4702 c := &PagesPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4703 c.blogId = blogId 4704 c.pageId = pageId 4705 return c 4706} 4707 4708// Fields allows partial responses to be retrieved. See 4709// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4710// for more information. 4711func (c *PagesPublishCall) Fields(s ...googleapi.Field) *PagesPublishCall { 4712 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4713 return c 4714} 4715 4716// Context sets the context to be used in this call's Do method. Any 4717// pending HTTP request will be aborted if the provided context is 4718// canceled. 4719func (c *PagesPublishCall) Context(ctx context.Context) *PagesPublishCall { 4720 c.ctx_ = ctx 4721 return c 4722} 4723 4724// Header returns an http.Header that can be modified by the caller to 4725// add HTTP headers to the request. 4726func (c *PagesPublishCall) Header() http.Header { 4727 if c.header_ == nil { 4728 c.header_ = make(http.Header) 4729 } 4730 return c.header_ 4731} 4732 4733func (c *PagesPublishCall) doRequest(alt string) (*http.Response, error) { 4734 reqHeaders := make(http.Header) 4735 for k, v := range c.header_ { 4736 reqHeaders[k] = v 4737 } 4738 reqHeaders.Set("User-Agent", c.s.userAgent()) 4739 var body io.Reader = nil 4740 c.urlParams_.Set("alt", alt) 4741 c.urlParams_.Set("prettyPrint", "false") 4742 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}/publish") 4743 urls += "?" + c.urlParams_.Encode() 4744 req, err := http.NewRequest("POST", urls, body) 4745 if err != nil { 4746 return nil, err 4747 } 4748 req.Header = reqHeaders 4749 googleapi.Expand(req.URL, map[string]string{ 4750 "blogId": c.blogId, 4751 "pageId": c.pageId, 4752 }) 4753 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4754} 4755 4756// Do executes the "blogger.pages.publish" call. 4757// Exactly one of *Page or error will be non-nil. Any non-2xx status 4758// code is an error. Response headers are in either 4759// *Page.ServerResponse.Header or (if a response was returned at all) in 4760// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4761// whether the returned error was because http.StatusNotModified was 4762// returned. 4763func (c *PagesPublishCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4764 gensupport.SetOptions(c.urlParams_, opts...) 4765 res, err := c.doRequest("json") 4766 if res != nil && res.StatusCode == http.StatusNotModified { 4767 if res.Body != nil { 4768 res.Body.Close() 4769 } 4770 return nil, &googleapi.Error{ 4771 Code: res.StatusCode, 4772 Header: res.Header, 4773 } 4774 } 4775 if err != nil { 4776 return nil, err 4777 } 4778 defer googleapi.CloseBody(res) 4779 if err := googleapi.CheckResponse(res); err != nil { 4780 return nil, err 4781 } 4782 ret := &Page{ 4783 ServerResponse: googleapi.ServerResponse{ 4784 Header: res.Header, 4785 HTTPStatusCode: res.StatusCode, 4786 }, 4787 } 4788 target := &ret 4789 if err := gensupport.DecodeResponse(target, res); err != nil { 4790 return nil, err 4791 } 4792 return ret, nil 4793 // { 4794 // "description": "Publishes a draft page.", 4795 // "httpMethod": "POST", 4796 // "id": "blogger.pages.publish", 4797 // "parameterOrder": [ 4798 // "blogId", 4799 // "pageId" 4800 // ], 4801 // "parameters": { 4802 // "blogId": { 4803 // "description": "The ID of the blog.", 4804 // "location": "path", 4805 // "required": true, 4806 // "type": "string" 4807 // }, 4808 // "pageId": { 4809 // "description": "The ID of the page.", 4810 // "location": "path", 4811 // "required": true, 4812 // "type": "string" 4813 // } 4814 // }, 4815 // "path": "blogs/{blogId}/pages/{pageId}/publish", 4816 // "response": { 4817 // "$ref": "Page" 4818 // }, 4819 // "scopes": [ 4820 // "https://www.googleapis.com/auth/blogger" 4821 // ] 4822 // } 4823 4824} 4825 4826// method id "blogger.pages.revert": 4827 4828type PagesRevertCall struct { 4829 s *Service 4830 blogId string 4831 pageId string 4832 urlParams_ gensupport.URLParams 4833 ctx_ context.Context 4834 header_ http.Header 4835} 4836 4837// Revert: Revert a published or scheduled page to draft state. 4838func (r *PagesService) Revert(blogId string, pageId string) *PagesRevertCall { 4839 c := &PagesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4840 c.blogId = blogId 4841 c.pageId = pageId 4842 return c 4843} 4844 4845// Fields allows partial responses to be retrieved. See 4846// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4847// for more information. 4848func (c *PagesRevertCall) Fields(s ...googleapi.Field) *PagesRevertCall { 4849 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4850 return c 4851} 4852 4853// Context sets the context to be used in this call's Do method. Any 4854// pending HTTP request will be aborted if the provided context is 4855// canceled. 4856func (c *PagesRevertCall) Context(ctx context.Context) *PagesRevertCall { 4857 c.ctx_ = ctx 4858 return c 4859} 4860 4861// Header returns an http.Header that can be modified by the caller to 4862// add HTTP headers to the request. 4863func (c *PagesRevertCall) Header() http.Header { 4864 if c.header_ == nil { 4865 c.header_ = make(http.Header) 4866 } 4867 return c.header_ 4868} 4869 4870func (c *PagesRevertCall) doRequest(alt string) (*http.Response, error) { 4871 reqHeaders := make(http.Header) 4872 for k, v := range c.header_ { 4873 reqHeaders[k] = v 4874 } 4875 reqHeaders.Set("User-Agent", c.s.userAgent()) 4876 var body io.Reader = nil 4877 c.urlParams_.Set("alt", alt) 4878 c.urlParams_.Set("prettyPrint", "false") 4879 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}/revert") 4880 urls += "?" + c.urlParams_.Encode() 4881 req, err := http.NewRequest("POST", urls, body) 4882 if err != nil { 4883 return nil, err 4884 } 4885 req.Header = reqHeaders 4886 googleapi.Expand(req.URL, map[string]string{ 4887 "blogId": c.blogId, 4888 "pageId": c.pageId, 4889 }) 4890 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4891} 4892 4893// Do executes the "blogger.pages.revert" call. 4894// Exactly one of *Page or error will be non-nil. Any non-2xx status 4895// code is an error. Response headers are in either 4896// *Page.ServerResponse.Header or (if a response was returned at all) in 4897// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4898// whether the returned error was because http.StatusNotModified was 4899// returned. 4900func (c *PagesRevertCall) Do(opts ...googleapi.CallOption) (*Page, error) { 4901 gensupport.SetOptions(c.urlParams_, opts...) 4902 res, err := c.doRequest("json") 4903 if res != nil && res.StatusCode == http.StatusNotModified { 4904 if res.Body != nil { 4905 res.Body.Close() 4906 } 4907 return nil, &googleapi.Error{ 4908 Code: res.StatusCode, 4909 Header: res.Header, 4910 } 4911 } 4912 if err != nil { 4913 return nil, err 4914 } 4915 defer googleapi.CloseBody(res) 4916 if err := googleapi.CheckResponse(res); err != nil { 4917 return nil, err 4918 } 4919 ret := &Page{ 4920 ServerResponse: googleapi.ServerResponse{ 4921 Header: res.Header, 4922 HTTPStatusCode: res.StatusCode, 4923 }, 4924 } 4925 target := &ret 4926 if err := gensupport.DecodeResponse(target, res); err != nil { 4927 return nil, err 4928 } 4929 return ret, nil 4930 // { 4931 // "description": "Revert a published or scheduled page to draft state.", 4932 // "httpMethod": "POST", 4933 // "id": "blogger.pages.revert", 4934 // "parameterOrder": [ 4935 // "blogId", 4936 // "pageId" 4937 // ], 4938 // "parameters": { 4939 // "blogId": { 4940 // "description": "The ID of the blog.", 4941 // "location": "path", 4942 // "required": true, 4943 // "type": "string" 4944 // }, 4945 // "pageId": { 4946 // "description": "The ID of the page.", 4947 // "location": "path", 4948 // "required": true, 4949 // "type": "string" 4950 // } 4951 // }, 4952 // "path": "blogs/{blogId}/pages/{pageId}/revert", 4953 // "response": { 4954 // "$ref": "Page" 4955 // }, 4956 // "scopes": [ 4957 // "https://www.googleapis.com/auth/blogger" 4958 // ] 4959 // } 4960 4961} 4962 4963// method id "blogger.pages.update": 4964 4965type PagesUpdateCall struct { 4966 s *Service 4967 blogId string 4968 pageId string 4969 page *Page 4970 urlParams_ gensupport.URLParams 4971 ctx_ context.Context 4972 header_ http.Header 4973} 4974 4975// Update: Update a page. 4976func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall { 4977 c := &PagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4978 c.blogId = blogId 4979 c.pageId = pageId 4980 c.page = page 4981 return c 4982} 4983 4984// Publish sets the optional parameter "publish": Whether a publish 4985// action should be performed when the page is updated (default: false). 4986func (c *PagesUpdateCall) Publish(publish bool) *PagesUpdateCall { 4987 c.urlParams_.Set("publish", fmt.Sprint(publish)) 4988 return c 4989} 4990 4991// Revert sets the optional parameter "revert": Whether a revert action 4992// should be performed when the page is updated (default: false). 4993func (c *PagesUpdateCall) Revert(revert bool) *PagesUpdateCall { 4994 c.urlParams_.Set("revert", fmt.Sprint(revert)) 4995 return c 4996} 4997 4998// Fields allows partial responses to be retrieved. See 4999// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5000// for more information. 5001func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall { 5002 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5003 return c 5004} 5005 5006// Context sets the context to be used in this call's Do method. Any 5007// pending HTTP request will be aborted if the provided context is 5008// canceled. 5009func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall { 5010 c.ctx_ = ctx 5011 return c 5012} 5013 5014// Header returns an http.Header that can be modified by the caller to 5015// add HTTP headers to the request. 5016func (c *PagesUpdateCall) Header() http.Header { 5017 if c.header_ == nil { 5018 c.header_ = make(http.Header) 5019 } 5020 return c.header_ 5021} 5022 5023func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) { 5024 reqHeaders := make(http.Header) 5025 for k, v := range c.header_ { 5026 reqHeaders[k] = v 5027 } 5028 reqHeaders.Set("User-Agent", c.s.userAgent()) 5029 var body io.Reader = nil 5030 body, err := googleapi.WithoutDataWrapper.JSONReader(c.page) 5031 if err != nil { 5032 return nil, err 5033 } 5034 reqHeaders.Set("Content-Type", "application/json") 5035 c.urlParams_.Set("alt", alt) 5036 c.urlParams_.Set("prettyPrint", "false") 5037 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") 5038 urls += "?" + c.urlParams_.Encode() 5039 req, err := http.NewRequest("PUT", urls, body) 5040 if err != nil { 5041 return nil, err 5042 } 5043 req.Header = reqHeaders 5044 googleapi.Expand(req.URL, map[string]string{ 5045 "blogId": c.blogId, 5046 "pageId": c.pageId, 5047 }) 5048 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5049} 5050 5051// Do executes the "blogger.pages.update" call. 5052// Exactly one of *Page or error will be non-nil. Any non-2xx status 5053// code is an error. Response headers are in either 5054// *Page.ServerResponse.Header or (if a response was returned at all) in 5055// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5056// whether the returned error was because http.StatusNotModified was 5057// returned. 5058func (c *PagesUpdateCall) Do(opts ...googleapi.CallOption) (*Page, error) { 5059 gensupport.SetOptions(c.urlParams_, opts...) 5060 res, err := c.doRequest("json") 5061 if res != nil && res.StatusCode == http.StatusNotModified { 5062 if res.Body != nil { 5063 res.Body.Close() 5064 } 5065 return nil, &googleapi.Error{ 5066 Code: res.StatusCode, 5067 Header: res.Header, 5068 } 5069 } 5070 if err != nil { 5071 return nil, err 5072 } 5073 defer googleapi.CloseBody(res) 5074 if err := googleapi.CheckResponse(res); err != nil { 5075 return nil, err 5076 } 5077 ret := &Page{ 5078 ServerResponse: googleapi.ServerResponse{ 5079 Header: res.Header, 5080 HTTPStatusCode: res.StatusCode, 5081 }, 5082 } 5083 target := &ret 5084 if err := gensupport.DecodeResponse(target, res); err != nil { 5085 return nil, err 5086 } 5087 return ret, nil 5088 // { 5089 // "description": "Update a page.", 5090 // "httpMethod": "PUT", 5091 // "id": "blogger.pages.update", 5092 // "parameterOrder": [ 5093 // "blogId", 5094 // "pageId" 5095 // ], 5096 // "parameters": { 5097 // "blogId": { 5098 // "description": "The ID of the Blog.", 5099 // "location": "path", 5100 // "required": true, 5101 // "type": "string" 5102 // }, 5103 // "pageId": { 5104 // "description": "The ID of the Page.", 5105 // "location": "path", 5106 // "required": true, 5107 // "type": "string" 5108 // }, 5109 // "publish": { 5110 // "description": "Whether a publish action should be performed when the page is updated (default: false).", 5111 // "location": "query", 5112 // "type": "boolean" 5113 // }, 5114 // "revert": { 5115 // "description": "Whether a revert action should be performed when the page is updated (default: false).", 5116 // "location": "query", 5117 // "type": "boolean" 5118 // } 5119 // }, 5120 // "path": "blogs/{blogId}/pages/{pageId}", 5121 // "request": { 5122 // "$ref": "Page" 5123 // }, 5124 // "response": { 5125 // "$ref": "Page" 5126 // }, 5127 // "scopes": [ 5128 // "https://www.googleapis.com/auth/blogger" 5129 // ] 5130 // } 5131 5132} 5133 5134// method id "blogger.postUserInfos.get": 5135 5136type PostUserInfosGetCall struct { 5137 s *Service 5138 userId string 5139 blogId string 5140 postId string 5141 urlParams_ gensupport.URLParams 5142 ifNoneMatch_ string 5143 ctx_ context.Context 5144 header_ http.Header 5145} 5146 5147// Get: Gets one post and user info pair, by post ID and user ID. The 5148// post user info contains per-user information about the post, such as 5149// access rights, specific to the user. 5150func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall { 5151 c := &PostUserInfosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5152 c.userId = userId 5153 c.blogId = blogId 5154 c.postId = postId 5155 return c 5156} 5157 5158// MaxComments sets the optional parameter "maxComments": Maximum number 5159// of comments to pull back on a post. 5160func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall { 5161 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 5162 return c 5163} 5164 5165// Fields allows partial responses to be retrieved. See 5166// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5167// for more information. 5168func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall { 5169 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5170 return c 5171} 5172 5173// IfNoneMatch sets the optional parameter which makes the operation 5174// fail if the object's ETag matches the given value. This is useful for 5175// getting updates only after the object has changed since the last 5176// request. Use googleapi.IsNotModified to check whether the response 5177// error from Do is the result of In-None-Match. 5178func (c *PostUserInfosGetCall) IfNoneMatch(entityTag string) *PostUserInfosGetCall { 5179 c.ifNoneMatch_ = entityTag 5180 return c 5181} 5182 5183// Context sets the context to be used in this call's Do method. Any 5184// pending HTTP request will be aborted if the provided context is 5185// canceled. 5186func (c *PostUserInfosGetCall) Context(ctx context.Context) *PostUserInfosGetCall { 5187 c.ctx_ = ctx 5188 return c 5189} 5190 5191// Header returns an http.Header that can be modified by the caller to 5192// add HTTP headers to the request. 5193func (c *PostUserInfosGetCall) Header() http.Header { 5194 if c.header_ == nil { 5195 c.header_ = make(http.Header) 5196 } 5197 return c.header_ 5198} 5199 5200func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) { 5201 reqHeaders := make(http.Header) 5202 for k, v := range c.header_ { 5203 reqHeaders[k] = v 5204 } 5205 reqHeaders.Set("User-Agent", c.s.userAgent()) 5206 if c.ifNoneMatch_ != "" { 5207 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5208 } 5209 var body io.Reader = nil 5210 c.urlParams_.Set("alt", alt) 5211 c.urlParams_.Set("prettyPrint", "false") 5212 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") 5213 urls += "?" + c.urlParams_.Encode() 5214 req, err := http.NewRequest("GET", urls, body) 5215 if err != nil { 5216 return nil, err 5217 } 5218 req.Header = reqHeaders 5219 googleapi.Expand(req.URL, map[string]string{ 5220 "userId": c.userId, 5221 "blogId": c.blogId, 5222 "postId": c.postId, 5223 }) 5224 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5225} 5226 5227// Do executes the "blogger.postUserInfos.get" call. 5228// Exactly one of *PostUserInfo or error will be non-nil. Any non-2xx 5229// status code is an error. Response headers are in either 5230// *PostUserInfo.ServerResponse.Header or (if a response was returned at 5231// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5232// to check whether the returned error was because 5233// http.StatusNotModified was returned. 5234func (c *PostUserInfosGetCall) Do(opts ...googleapi.CallOption) (*PostUserInfo, error) { 5235 gensupport.SetOptions(c.urlParams_, opts...) 5236 res, err := c.doRequest("json") 5237 if res != nil && res.StatusCode == http.StatusNotModified { 5238 if res.Body != nil { 5239 res.Body.Close() 5240 } 5241 return nil, &googleapi.Error{ 5242 Code: res.StatusCode, 5243 Header: res.Header, 5244 } 5245 } 5246 if err != nil { 5247 return nil, err 5248 } 5249 defer googleapi.CloseBody(res) 5250 if err := googleapi.CheckResponse(res); err != nil { 5251 return nil, err 5252 } 5253 ret := &PostUserInfo{ 5254 ServerResponse: googleapi.ServerResponse{ 5255 Header: res.Header, 5256 HTTPStatusCode: res.StatusCode, 5257 }, 5258 } 5259 target := &ret 5260 if err := gensupport.DecodeResponse(target, res); err != nil { 5261 return nil, err 5262 } 5263 return ret, nil 5264 // { 5265 // "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.", 5266 // "httpMethod": "GET", 5267 // "id": "blogger.postUserInfos.get", 5268 // "parameterOrder": [ 5269 // "userId", 5270 // "blogId", 5271 // "postId" 5272 // ], 5273 // "parameters": { 5274 // "blogId": { 5275 // "description": "The ID of the blog.", 5276 // "location": "path", 5277 // "required": true, 5278 // "type": "string" 5279 // }, 5280 // "maxComments": { 5281 // "description": "Maximum number of comments to pull back on a post.", 5282 // "format": "uint32", 5283 // "location": "query", 5284 // "type": "integer" 5285 // }, 5286 // "postId": { 5287 // "description": "The ID of the post to get.", 5288 // "location": "path", 5289 // "required": true, 5290 // "type": "string" 5291 // }, 5292 // "userId": { 5293 // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", 5294 // "location": "path", 5295 // "required": true, 5296 // "type": "string" 5297 // } 5298 // }, 5299 // "path": "users/{userId}/blogs/{blogId}/posts/{postId}", 5300 // "response": { 5301 // "$ref": "PostUserInfo" 5302 // }, 5303 // "scopes": [ 5304 // "https://www.googleapis.com/auth/blogger", 5305 // "https://www.googleapis.com/auth/blogger.readonly" 5306 // ] 5307 // } 5308 5309} 5310 5311// method id "blogger.postUserInfos.list": 5312 5313type PostUserInfosListCall struct { 5314 s *Service 5315 userId string 5316 blogId string 5317 urlParams_ gensupport.URLParams 5318 ifNoneMatch_ string 5319 ctx_ context.Context 5320 header_ http.Header 5321} 5322 5323// List: Retrieves a list of post and post user info pairs, possibly 5324// filtered. The post user info contains per-user information about the 5325// post, such as access rights, specific to the user. 5326func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall { 5327 c := &PostUserInfosListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5328 c.userId = userId 5329 c.blogId = blogId 5330 return c 5331} 5332 5333// EndDate sets the optional parameter "endDate": Latest post date to 5334// fetch, a date-time with RFC 3339 formatting. 5335func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall { 5336 c.urlParams_.Set("endDate", endDate) 5337 return c 5338} 5339 5340// FetchBodies sets the optional parameter "fetchBodies": Whether the 5341// body content of posts is included. Default is false. 5342func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall { 5343 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 5344 return c 5345} 5346 5347// Labels sets the optional parameter "labels": Comma-separated list of 5348// labels to search for. 5349func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall { 5350 c.urlParams_.Set("labels", labels) 5351 return c 5352} 5353 5354// MaxResults sets the optional parameter "maxResults": Maximum number 5355// of posts to fetch. 5356func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall { 5357 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5358 return c 5359} 5360 5361// OrderBy sets the optional parameter "orderBy": Sort order applied to 5362// search results. Default is published. 5363// 5364// Possible values: 5365// "published" - Order by the date the post was published 5366// "updated" - Order by the date the post was last updated 5367func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall { 5368 c.urlParams_.Set("orderBy", orderBy) 5369 return c 5370} 5371 5372// PageToken sets the optional parameter "pageToken": Continuation token 5373// if the request is paged. 5374func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall { 5375 c.urlParams_.Set("pageToken", pageToken) 5376 return c 5377} 5378 5379// StartDate sets the optional parameter "startDate": Earliest post date 5380// to fetch, a date-time with RFC 3339 formatting. 5381func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall { 5382 c.urlParams_.Set("startDate", startDate) 5383 return c 5384} 5385 5386// Status sets the optional parameter "status": 5387// 5388// Possible values: 5389// "draft" - Draft posts 5390// "live" - Published posts 5391// "scheduled" - Posts that are scheduled to publish in future. 5392func (c *PostUserInfosListCall) Status(status ...string) *PostUserInfosListCall { 5393 c.urlParams_.SetMulti("status", append([]string{}, status...)) 5394 return c 5395} 5396 5397// View sets the optional parameter "view": Access level with which to 5398// view the returned result. Note that some fields require elevated 5399// access. 5400// 5401// Possible values: 5402// "ADMIN" - Admin level detail 5403// "AUTHOR" - Author level detail 5404// "READER" - Reader level detail 5405func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { 5406 c.urlParams_.Set("view", view) 5407 return c 5408} 5409 5410// Fields allows partial responses to be retrieved. See 5411// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5412// for more information. 5413func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall { 5414 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5415 return c 5416} 5417 5418// IfNoneMatch sets the optional parameter which makes the operation 5419// fail if the object's ETag matches the given value. This is useful for 5420// getting updates only after the object has changed since the last 5421// request. Use googleapi.IsNotModified to check whether the response 5422// error from Do is the result of In-None-Match. 5423func (c *PostUserInfosListCall) IfNoneMatch(entityTag string) *PostUserInfosListCall { 5424 c.ifNoneMatch_ = entityTag 5425 return c 5426} 5427 5428// Context sets the context to be used in this call's Do method. Any 5429// pending HTTP request will be aborted if the provided context is 5430// canceled. 5431func (c *PostUserInfosListCall) Context(ctx context.Context) *PostUserInfosListCall { 5432 c.ctx_ = ctx 5433 return c 5434} 5435 5436// Header returns an http.Header that can be modified by the caller to 5437// add HTTP headers to the request. 5438func (c *PostUserInfosListCall) Header() http.Header { 5439 if c.header_ == nil { 5440 c.header_ = make(http.Header) 5441 } 5442 return c.header_ 5443} 5444 5445func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) { 5446 reqHeaders := make(http.Header) 5447 for k, v := range c.header_ { 5448 reqHeaders[k] = v 5449 } 5450 reqHeaders.Set("User-Agent", c.s.userAgent()) 5451 if c.ifNoneMatch_ != "" { 5452 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5453 } 5454 var body io.Reader = nil 5455 c.urlParams_.Set("alt", alt) 5456 c.urlParams_.Set("prettyPrint", "false") 5457 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") 5458 urls += "?" + c.urlParams_.Encode() 5459 req, err := http.NewRequest("GET", urls, body) 5460 if err != nil { 5461 return nil, err 5462 } 5463 req.Header = reqHeaders 5464 googleapi.Expand(req.URL, map[string]string{ 5465 "userId": c.userId, 5466 "blogId": c.blogId, 5467 }) 5468 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5469} 5470 5471// Do executes the "blogger.postUserInfos.list" call. 5472// Exactly one of *PostUserInfosList or error will be non-nil. Any 5473// non-2xx status code is an error. Response headers are in either 5474// *PostUserInfosList.ServerResponse.Header or (if a response was 5475// returned at all) in error.(*googleapi.Error).Header. Use 5476// googleapi.IsNotModified to check whether the returned error was 5477// because http.StatusNotModified was returned. 5478func (c *PostUserInfosListCall) Do(opts ...googleapi.CallOption) (*PostUserInfosList, error) { 5479 gensupport.SetOptions(c.urlParams_, opts...) 5480 res, err := c.doRequest("json") 5481 if res != nil && res.StatusCode == http.StatusNotModified { 5482 if res.Body != nil { 5483 res.Body.Close() 5484 } 5485 return nil, &googleapi.Error{ 5486 Code: res.StatusCode, 5487 Header: res.Header, 5488 } 5489 } 5490 if err != nil { 5491 return nil, err 5492 } 5493 defer googleapi.CloseBody(res) 5494 if err := googleapi.CheckResponse(res); err != nil { 5495 return nil, err 5496 } 5497 ret := &PostUserInfosList{ 5498 ServerResponse: googleapi.ServerResponse{ 5499 Header: res.Header, 5500 HTTPStatusCode: res.StatusCode, 5501 }, 5502 } 5503 target := &ret 5504 if err := gensupport.DecodeResponse(target, res); err != nil { 5505 return nil, err 5506 } 5507 return ret, nil 5508 // { 5509 // "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.", 5510 // "httpMethod": "GET", 5511 // "id": "blogger.postUserInfos.list", 5512 // "parameterOrder": [ 5513 // "userId", 5514 // "blogId" 5515 // ], 5516 // "parameters": { 5517 // "blogId": { 5518 // "description": "ID of the blog to fetch posts from.", 5519 // "location": "path", 5520 // "required": true, 5521 // "type": "string" 5522 // }, 5523 // "endDate": { 5524 // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", 5525 // "format": "date-time", 5526 // "location": "query", 5527 // "type": "string" 5528 // }, 5529 // "fetchBodies": { 5530 // "default": "false", 5531 // "description": "Whether the body content of posts is included. Default is false.", 5532 // "location": "query", 5533 // "type": "boolean" 5534 // }, 5535 // "labels": { 5536 // "description": "Comma-separated list of labels to search for.", 5537 // "location": "query", 5538 // "type": "string" 5539 // }, 5540 // "maxResults": { 5541 // "description": "Maximum number of posts to fetch.", 5542 // "format": "uint32", 5543 // "location": "query", 5544 // "type": "integer" 5545 // }, 5546 // "orderBy": { 5547 // "default": "PUBLISHED", 5548 // "description": "Sort order applied to search results. Default is published.", 5549 // "enum": [ 5550 // "published", 5551 // "updated" 5552 // ], 5553 // "enumDescriptions": [ 5554 // "Order by the date the post was published", 5555 // "Order by the date the post was last updated" 5556 // ], 5557 // "location": "query", 5558 // "type": "string" 5559 // }, 5560 // "pageToken": { 5561 // "description": "Continuation token if the request is paged.", 5562 // "location": "query", 5563 // "type": "string" 5564 // }, 5565 // "startDate": { 5566 // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", 5567 // "format": "date-time", 5568 // "location": "query", 5569 // "type": "string" 5570 // }, 5571 // "status": { 5572 // "enum": [ 5573 // "draft", 5574 // "live", 5575 // "scheduled" 5576 // ], 5577 // "enumDescriptions": [ 5578 // "Draft posts", 5579 // "Published posts", 5580 // "Posts that are scheduled to publish in future." 5581 // ], 5582 // "location": "query", 5583 // "repeated": true, 5584 // "type": "string" 5585 // }, 5586 // "userId": { 5587 // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", 5588 // "location": "path", 5589 // "required": true, 5590 // "type": "string" 5591 // }, 5592 // "view": { 5593 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 5594 // "enum": [ 5595 // "ADMIN", 5596 // "AUTHOR", 5597 // "READER" 5598 // ], 5599 // "enumDescriptions": [ 5600 // "Admin level detail", 5601 // "Author level detail", 5602 // "Reader level detail" 5603 // ], 5604 // "location": "query", 5605 // "type": "string" 5606 // } 5607 // }, 5608 // "path": "users/{userId}/blogs/{blogId}/posts", 5609 // "response": { 5610 // "$ref": "PostUserInfosList" 5611 // }, 5612 // "scopes": [ 5613 // "https://www.googleapis.com/auth/blogger", 5614 // "https://www.googleapis.com/auth/blogger.readonly" 5615 // ] 5616 // } 5617 5618} 5619 5620// Pages invokes f for each page of results. 5621// A non-nil error returned from f will halt the iteration. 5622// The provided context supersedes any context provided to the Context method. 5623func (c *PostUserInfosListCall) Pages(ctx context.Context, f func(*PostUserInfosList) error) error { 5624 c.ctx_ = ctx 5625 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5626 for { 5627 x, err := c.Do() 5628 if err != nil { 5629 return err 5630 } 5631 if err := f(x); err != nil { 5632 return err 5633 } 5634 if x.NextPageToken == "" { 5635 return nil 5636 } 5637 c.PageToken(x.NextPageToken) 5638 } 5639} 5640 5641// method id "blogger.posts.delete": 5642 5643type PostsDeleteCall struct { 5644 s *Service 5645 blogId string 5646 postId string 5647 urlParams_ gensupport.URLParams 5648 ctx_ context.Context 5649 header_ http.Header 5650} 5651 5652// Delete: Delete a post by ID. 5653func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall { 5654 c := &PostsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5655 c.blogId = blogId 5656 c.postId = postId 5657 return c 5658} 5659 5660// Fields allows partial responses to be retrieved. See 5661// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5662// for more information. 5663func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall { 5664 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5665 return c 5666} 5667 5668// Context sets the context to be used in this call's Do method. Any 5669// pending HTTP request will be aborted if the provided context is 5670// canceled. 5671func (c *PostsDeleteCall) Context(ctx context.Context) *PostsDeleteCall { 5672 c.ctx_ = ctx 5673 return c 5674} 5675 5676// Header returns an http.Header that can be modified by the caller to 5677// add HTTP headers to the request. 5678func (c *PostsDeleteCall) Header() http.Header { 5679 if c.header_ == nil { 5680 c.header_ = make(http.Header) 5681 } 5682 return c.header_ 5683} 5684 5685func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) { 5686 reqHeaders := make(http.Header) 5687 for k, v := range c.header_ { 5688 reqHeaders[k] = v 5689 } 5690 reqHeaders.Set("User-Agent", c.s.userAgent()) 5691 var body io.Reader = nil 5692 c.urlParams_.Set("alt", alt) 5693 c.urlParams_.Set("prettyPrint", "false") 5694 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 5695 urls += "?" + c.urlParams_.Encode() 5696 req, err := http.NewRequest("DELETE", urls, body) 5697 if err != nil { 5698 return nil, err 5699 } 5700 req.Header = reqHeaders 5701 googleapi.Expand(req.URL, map[string]string{ 5702 "blogId": c.blogId, 5703 "postId": c.postId, 5704 }) 5705 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5706} 5707 5708// Do executes the "blogger.posts.delete" call. 5709func (c *PostsDeleteCall) Do(opts ...googleapi.CallOption) error { 5710 gensupport.SetOptions(c.urlParams_, opts...) 5711 res, err := c.doRequest("json") 5712 if err != nil { 5713 return err 5714 } 5715 defer googleapi.CloseBody(res) 5716 if err := googleapi.CheckResponse(res); err != nil { 5717 return err 5718 } 5719 return nil 5720 // { 5721 // "description": "Delete a post by ID.", 5722 // "httpMethod": "DELETE", 5723 // "id": "blogger.posts.delete", 5724 // "parameterOrder": [ 5725 // "blogId", 5726 // "postId" 5727 // ], 5728 // "parameters": { 5729 // "blogId": { 5730 // "description": "The ID of the Blog.", 5731 // "location": "path", 5732 // "required": true, 5733 // "type": "string" 5734 // }, 5735 // "postId": { 5736 // "description": "The ID of the Post.", 5737 // "location": "path", 5738 // "required": true, 5739 // "type": "string" 5740 // } 5741 // }, 5742 // "path": "blogs/{blogId}/posts/{postId}", 5743 // "scopes": [ 5744 // "https://www.googleapis.com/auth/blogger" 5745 // ] 5746 // } 5747 5748} 5749 5750// method id "blogger.posts.get": 5751 5752type PostsGetCall struct { 5753 s *Service 5754 blogId string 5755 postId string 5756 urlParams_ gensupport.URLParams 5757 ifNoneMatch_ string 5758 ctx_ context.Context 5759 header_ http.Header 5760} 5761 5762// Get: Get a post by ID. 5763func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { 5764 c := &PostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5765 c.blogId = blogId 5766 c.postId = postId 5767 return c 5768} 5769 5770// FetchBody sets the optional parameter "fetchBody": Whether the body 5771// content of the post is included (default: true). This should be set 5772// to false when the post bodies are not required, to help minimize 5773// traffic. 5774func (c *PostsGetCall) FetchBody(fetchBody bool) *PostsGetCall { 5775 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 5776 return c 5777} 5778 5779// FetchImages sets the optional parameter "fetchImages": Whether image 5780// URL metadata for each post is included (default: false). 5781func (c *PostsGetCall) FetchImages(fetchImages bool) *PostsGetCall { 5782 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 5783 return c 5784} 5785 5786// MaxComments sets the optional parameter "maxComments": Maximum number 5787// of comments to pull back on a post. 5788func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall { 5789 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 5790 return c 5791} 5792 5793// View sets the optional parameter "view": Access level with which to 5794// view the returned result. Note that some fields require elevated 5795// access. 5796// 5797// Possible values: 5798// "ADMIN" - Admin level detail 5799// "AUTHOR" - Author level detail 5800// "READER" - Reader level detail 5801func (c *PostsGetCall) View(view string) *PostsGetCall { 5802 c.urlParams_.Set("view", view) 5803 return c 5804} 5805 5806// Fields allows partial responses to be retrieved. See 5807// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5808// for more information. 5809func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { 5810 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5811 return c 5812} 5813 5814// IfNoneMatch sets the optional parameter which makes the operation 5815// fail if the object's ETag matches the given value. This is useful for 5816// getting updates only after the object has changed since the last 5817// request. Use googleapi.IsNotModified to check whether the response 5818// error from Do is the result of In-None-Match. 5819func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { 5820 c.ifNoneMatch_ = entityTag 5821 return c 5822} 5823 5824// Context sets the context to be used in this call's Do method. Any 5825// pending HTTP request will be aborted if the provided context is 5826// canceled. 5827func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { 5828 c.ctx_ = ctx 5829 return c 5830} 5831 5832// Header returns an http.Header that can be modified by the caller to 5833// add HTTP headers to the request. 5834func (c *PostsGetCall) Header() http.Header { 5835 if c.header_ == nil { 5836 c.header_ = make(http.Header) 5837 } 5838 return c.header_ 5839} 5840 5841func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { 5842 reqHeaders := make(http.Header) 5843 for k, v := range c.header_ { 5844 reqHeaders[k] = v 5845 } 5846 reqHeaders.Set("User-Agent", c.s.userAgent()) 5847 if c.ifNoneMatch_ != "" { 5848 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5849 } 5850 var body io.Reader = nil 5851 c.urlParams_.Set("alt", alt) 5852 c.urlParams_.Set("prettyPrint", "false") 5853 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 5854 urls += "?" + c.urlParams_.Encode() 5855 req, err := http.NewRequest("GET", urls, body) 5856 if err != nil { 5857 return nil, err 5858 } 5859 req.Header = reqHeaders 5860 googleapi.Expand(req.URL, map[string]string{ 5861 "blogId": c.blogId, 5862 "postId": c.postId, 5863 }) 5864 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5865} 5866 5867// Do executes the "blogger.posts.get" call. 5868// Exactly one of *Post or error will be non-nil. Any non-2xx status 5869// code is an error. Response headers are in either 5870// *Post.ServerResponse.Header or (if a response was returned at all) in 5871// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5872// whether the returned error was because http.StatusNotModified was 5873// returned. 5874func (c *PostsGetCall) Do(opts ...googleapi.CallOption) (*Post, error) { 5875 gensupport.SetOptions(c.urlParams_, opts...) 5876 res, err := c.doRequest("json") 5877 if res != nil && res.StatusCode == http.StatusNotModified { 5878 if res.Body != nil { 5879 res.Body.Close() 5880 } 5881 return nil, &googleapi.Error{ 5882 Code: res.StatusCode, 5883 Header: res.Header, 5884 } 5885 } 5886 if err != nil { 5887 return nil, err 5888 } 5889 defer googleapi.CloseBody(res) 5890 if err := googleapi.CheckResponse(res); err != nil { 5891 return nil, err 5892 } 5893 ret := &Post{ 5894 ServerResponse: googleapi.ServerResponse{ 5895 Header: res.Header, 5896 HTTPStatusCode: res.StatusCode, 5897 }, 5898 } 5899 target := &ret 5900 if err := gensupport.DecodeResponse(target, res); err != nil { 5901 return nil, err 5902 } 5903 return ret, nil 5904 // { 5905 // "description": "Get a post by ID.", 5906 // "httpMethod": "GET", 5907 // "id": "blogger.posts.get", 5908 // "parameterOrder": [ 5909 // "blogId", 5910 // "postId" 5911 // ], 5912 // "parameters": { 5913 // "blogId": { 5914 // "description": "ID of the blog to fetch the post from.", 5915 // "location": "path", 5916 // "required": true, 5917 // "type": "string" 5918 // }, 5919 // "fetchBody": { 5920 // "default": "true", 5921 // "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.", 5922 // "location": "query", 5923 // "type": "boolean" 5924 // }, 5925 // "fetchImages": { 5926 // "description": "Whether image URL metadata for each post is included (default: false).", 5927 // "location": "query", 5928 // "type": "boolean" 5929 // }, 5930 // "maxComments": { 5931 // "description": "Maximum number of comments to pull back on a post.", 5932 // "format": "uint32", 5933 // "location": "query", 5934 // "type": "integer" 5935 // }, 5936 // "postId": { 5937 // "description": "The ID of the post", 5938 // "location": "path", 5939 // "required": true, 5940 // "type": "string" 5941 // }, 5942 // "view": { 5943 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 5944 // "enum": [ 5945 // "ADMIN", 5946 // "AUTHOR", 5947 // "READER" 5948 // ], 5949 // "enumDescriptions": [ 5950 // "Admin level detail", 5951 // "Author level detail", 5952 // "Reader level detail" 5953 // ], 5954 // "location": "query", 5955 // "type": "string" 5956 // } 5957 // }, 5958 // "path": "blogs/{blogId}/posts/{postId}", 5959 // "response": { 5960 // "$ref": "Post" 5961 // }, 5962 // "scopes": [ 5963 // "https://www.googleapis.com/auth/blogger", 5964 // "https://www.googleapis.com/auth/blogger.readonly" 5965 // ] 5966 // } 5967 5968} 5969 5970// method id "blogger.posts.getByPath": 5971 5972type PostsGetByPathCall struct { 5973 s *Service 5974 blogId string 5975 urlParams_ gensupport.URLParams 5976 ifNoneMatch_ string 5977 ctx_ context.Context 5978 header_ http.Header 5979} 5980 5981// GetByPath: Retrieve a Post by Path. 5982func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall { 5983 c := &PostsGetByPathCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5984 c.blogId = blogId 5985 c.urlParams_.Set("path", path) 5986 return c 5987} 5988 5989// MaxComments sets the optional parameter "maxComments": Maximum number 5990// of comments to pull back on a post. 5991func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall { 5992 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 5993 return c 5994} 5995 5996// View sets the optional parameter "view": Access level with which to 5997// view the returned result. Note that some fields require elevated 5998// access. 5999// 6000// Possible values: 6001// "ADMIN" - Admin level detail 6002// "AUTHOR" - Author level detail 6003// "READER" - Reader level detail 6004func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { 6005 c.urlParams_.Set("view", view) 6006 return c 6007} 6008 6009// Fields allows partial responses to be retrieved. See 6010// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6011// for more information. 6012func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall { 6013 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6014 return c 6015} 6016 6017// IfNoneMatch sets the optional parameter which makes the operation 6018// fail if the object's ETag matches the given value. This is useful for 6019// getting updates only after the object has changed since the last 6020// request. Use googleapi.IsNotModified to check whether the response 6021// error from Do is the result of In-None-Match. 6022func (c *PostsGetByPathCall) IfNoneMatch(entityTag string) *PostsGetByPathCall { 6023 c.ifNoneMatch_ = entityTag 6024 return c 6025} 6026 6027// Context sets the context to be used in this call's Do method. Any 6028// pending HTTP request will be aborted if the provided context is 6029// canceled. 6030func (c *PostsGetByPathCall) Context(ctx context.Context) *PostsGetByPathCall { 6031 c.ctx_ = ctx 6032 return c 6033} 6034 6035// Header returns an http.Header that can be modified by the caller to 6036// add HTTP headers to the request. 6037func (c *PostsGetByPathCall) Header() http.Header { 6038 if c.header_ == nil { 6039 c.header_ = make(http.Header) 6040 } 6041 return c.header_ 6042} 6043 6044func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) { 6045 reqHeaders := make(http.Header) 6046 for k, v := range c.header_ { 6047 reqHeaders[k] = v 6048 } 6049 reqHeaders.Set("User-Agent", c.s.userAgent()) 6050 if c.ifNoneMatch_ != "" { 6051 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6052 } 6053 var body io.Reader = nil 6054 c.urlParams_.Set("alt", alt) 6055 c.urlParams_.Set("prettyPrint", "false") 6056 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") 6057 urls += "?" + c.urlParams_.Encode() 6058 req, err := http.NewRequest("GET", urls, body) 6059 if err != nil { 6060 return nil, err 6061 } 6062 req.Header = reqHeaders 6063 googleapi.Expand(req.URL, map[string]string{ 6064 "blogId": c.blogId, 6065 }) 6066 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6067} 6068 6069// Do executes the "blogger.posts.getByPath" call. 6070// Exactly one of *Post or error will be non-nil. Any non-2xx status 6071// code is an error. Response headers are in either 6072// *Post.ServerResponse.Header or (if a response was returned at all) in 6073// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6074// whether the returned error was because http.StatusNotModified was 6075// returned. 6076func (c *PostsGetByPathCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6077 gensupport.SetOptions(c.urlParams_, opts...) 6078 res, err := c.doRequest("json") 6079 if res != nil && res.StatusCode == http.StatusNotModified { 6080 if res.Body != nil { 6081 res.Body.Close() 6082 } 6083 return nil, &googleapi.Error{ 6084 Code: res.StatusCode, 6085 Header: res.Header, 6086 } 6087 } 6088 if err != nil { 6089 return nil, err 6090 } 6091 defer googleapi.CloseBody(res) 6092 if err := googleapi.CheckResponse(res); err != nil { 6093 return nil, err 6094 } 6095 ret := &Post{ 6096 ServerResponse: googleapi.ServerResponse{ 6097 Header: res.Header, 6098 HTTPStatusCode: res.StatusCode, 6099 }, 6100 } 6101 target := &ret 6102 if err := gensupport.DecodeResponse(target, res); err != nil { 6103 return nil, err 6104 } 6105 return ret, nil 6106 // { 6107 // "description": "Retrieve a Post by Path.", 6108 // "httpMethod": "GET", 6109 // "id": "blogger.posts.getByPath", 6110 // "parameterOrder": [ 6111 // "blogId", 6112 // "path" 6113 // ], 6114 // "parameters": { 6115 // "blogId": { 6116 // "description": "ID of the blog to fetch the post from.", 6117 // "location": "path", 6118 // "required": true, 6119 // "type": "string" 6120 // }, 6121 // "maxComments": { 6122 // "description": "Maximum number of comments to pull back on a post.", 6123 // "format": "uint32", 6124 // "location": "query", 6125 // "type": "integer" 6126 // }, 6127 // "path": { 6128 // "description": "Path of the Post to retrieve.", 6129 // "location": "query", 6130 // "required": true, 6131 // "type": "string" 6132 // }, 6133 // "view": { 6134 // "description": "Access level with which to view the returned result. Note that some fields require elevated access.", 6135 // "enum": [ 6136 // "ADMIN", 6137 // "AUTHOR", 6138 // "READER" 6139 // ], 6140 // "enumDescriptions": [ 6141 // "Admin level detail", 6142 // "Author level detail", 6143 // "Reader level detail" 6144 // ], 6145 // "location": "query", 6146 // "type": "string" 6147 // } 6148 // }, 6149 // "path": "blogs/{blogId}/posts/bypath", 6150 // "response": { 6151 // "$ref": "Post" 6152 // }, 6153 // "scopes": [ 6154 // "https://www.googleapis.com/auth/blogger", 6155 // "https://www.googleapis.com/auth/blogger.readonly" 6156 // ] 6157 // } 6158 6159} 6160 6161// method id "blogger.posts.insert": 6162 6163type PostsInsertCall struct { 6164 s *Service 6165 blogId string 6166 post *Post 6167 urlParams_ gensupport.URLParams 6168 ctx_ context.Context 6169 header_ http.Header 6170} 6171 6172// Insert: Add a post. 6173func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall { 6174 c := &PostsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6175 c.blogId = blogId 6176 c.post = post 6177 return c 6178} 6179 6180// FetchBody sets the optional parameter "fetchBody": Whether the body 6181// content of the post is included with the result (default: true). 6182func (c *PostsInsertCall) FetchBody(fetchBody bool) *PostsInsertCall { 6183 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 6184 return c 6185} 6186 6187// FetchImages sets the optional parameter "fetchImages": Whether image 6188// URL metadata for each post is included in the returned result 6189// (default: false). 6190func (c *PostsInsertCall) FetchImages(fetchImages bool) *PostsInsertCall { 6191 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 6192 return c 6193} 6194 6195// IsDraft sets the optional parameter "isDraft": Whether to create the 6196// post as a draft (default: false). 6197func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall { 6198 c.urlParams_.Set("isDraft", fmt.Sprint(isDraft)) 6199 return c 6200} 6201 6202// Fields allows partial responses to be retrieved. See 6203// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6204// for more information. 6205func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall { 6206 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6207 return c 6208} 6209 6210// Context sets the context to be used in this call's Do method. Any 6211// pending HTTP request will be aborted if the provided context is 6212// canceled. 6213func (c *PostsInsertCall) Context(ctx context.Context) *PostsInsertCall { 6214 c.ctx_ = ctx 6215 return c 6216} 6217 6218// Header returns an http.Header that can be modified by the caller to 6219// add HTTP headers to the request. 6220func (c *PostsInsertCall) Header() http.Header { 6221 if c.header_ == nil { 6222 c.header_ = make(http.Header) 6223 } 6224 return c.header_ 6225} 6226 6227func (c *PostsInsertCall) doRequest(alt string) (*http.Response, error) { 6228 reqHeaders := make(http.Header) 6229 for k, v := range c.header_ { 6230 reqHeaders[k] = v 6231 } 6232 reqHeaders.Set("User-Agent", c.s.userAgent()) 6233 var body io.Reader = nil 6234 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) 6235 if err != nil { 6236 return nil, err 6237 } 6238 reqHeaders.Set("Content-Type", "application/json") 6239 c.urlParams_.Set("alt", alt) 6240 c.urlParams_.Set("prettyPrint", "false") 6241 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") 6242 urls += "?" + c.urlParams_.Encode() 6243 req, err := http.NewRequest("POST", urls, body) 6244 if err != nil { 6245 return nil, err 6246 } 6247 req.Header = reqHeaders 6248 googleapi.Expand(req.URL, map[string]string{ 6249 "blogId": c.blogId, 6250 }) 6251 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6252} 6253 6254// Do executes the "blogger.posts.insert" call. 6255// Exactly one of *Post or error will be non-nil. Any non-2xx status 6256// code is an error. Response headers are in either 6257// *Post.ServerResponse.Header or (if a response was returned at all) in 6258// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6259// whether the returned error was because http.StatusNotModified was 6260// returned. 6261func (c *PostsInsertCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6262 gensupport.SetOptions(c.urlParams_, opts...) 6263 res, err := c.doRequest("json") 6264 if res != nil && res.StatusCode == http.StatusNotModified { 6265 if res.Body != nil { 6266 res.Body.Close() 6267 } 6268 return nil, &googleapi.Error{ 6269 Code: res.StatusCode, 6270 Header: res.Header, 6271 } 6272 } 6273 if err != nil { 6274 return nil, err 6275 } 6276 defer googleapi.CloseBody(res) 6277 if err := googleapi.CheckResponse(res); err != nil { 6278 return nil, err 6279 } 6280 ret := &Post{ 6281 ServerResponse: googleapi.ServerResponse{ 6282 Header: res.Header, 6283 HTTPStatusCode: res.StatusCode, 6284 }, 6285 } 6286 target := &ret 6287 if err := gensupport.DecodeResponse(target, res); err != nil { 6288 return nil, err 6289 } 6290 return ret, nil 6291 // { 6292 // "description": "Add a post.", 6293 // "httpMethod": "POST", 6294 // "id": "blogger.posts.insert", 6295 // "parameterOrder": [ 6296 // "blogId" 6297 // ], 6298 // "parameters": { 6299 // "blogId": { 6300 // "description": "ID of the blog to add the post to.", 6301 // "location": "path", 6302 // "required": true, 6303 // "type": "string" 6304 // }, 6305 // "fetchBody": { 6306 // "default": "true", 6307 // "description": "Whether the body content of the post is included with the result (default: true).", 6308 // "location": "query", 6309 // "type": "boolean" 6310 // }, 6311 // "fetchImages": { 6312 // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", 6313 // "location": "query", 6314 // "type": "boolean" 6315 // }, 6316 // "isDraft": { 6317 // "description": "Whether to create the post as a draft (default: false).", 6318 // "location": "query", 6319 // "type": "boolean" 6320 // } 6321 // }, 6322 // "path": "blogs/{blogId}/posts", 6323 // "request": { 6324 // "$ref": "Post" 6325 // }, 6326 // "response": { 6327 // "$ref": "Post" 6328 // }, 6329 // "scopes": [ 6330 // "https://www.googleapis.com/auth/blogger" 6331 // ] 6332 // } 6333 6334} 6335 6336// method id "blogger.posts.list": 6337 6338type PostsListCall struct { 6339 s *Service 6340 blogId string 6341 urlParams_ gensupport.URLParams 6342 ifNoneMatch_ string 6343 ctx_ context.Context 6344 header_ http.Header 6345} 6346 6347// List: Retrieves a list of posts, possibly filtered. 6348func (r *PostsService) List(blogId string) *PostsListCall { 6349 c := &PostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6350 c.blogId = blogId 6351 return c 6352} 6353 6354// EndDate sets the optional parameter "endDate": Latest post date to 6355// fetch, a date-time with RFC 3339 formatting. 6356func (c *PostsListCall) EndDate(endDate string) *PostsListCall { 6357 c.urlParams_.Set("endDate", endDate) 6358 return c 6359} 6360 6361// FetchBodies sets the optional parameter "fetchBodies": Whether the 6362// body content of posts is included (default: true). This should be set 6363// to false when the post bodies are not required, to help minimize 6364// traffic. 6365func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { 6366 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 6367 return c 6368} 6369 6370// FetchImages sets the optional parameter "fetchImages": Whether image 6371// URL metadata for each post is included. 6372func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall { 6373 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 6374 return c 6375} 6376 6377// Labels sets the optional parameter "labels": Comma-separated list of 6378// labels to search for. 6379func (c *PostsListCall) Labels(labels string) *PostsListCall { 6380 c.urlParams_.Set("labels", labels) 6381 return c 6382} 6383 6384// MaxResults sets the optional parameter "maxResults": Maximum number 6385// of posts to fetch. 6386func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { 6387 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6388 return c 6389} 6390 6391// OrderBy sets the optional parameter "orderBy": Sort search results 6392// 6393// Possible values: 6394// "published" - Order by the date the post was published 6395// "updated" - Order by the date the post was last updated 6396func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall { 6397 c.urlParams_.Set("orderBy", orderBy) 6398 return c 6399} 6400 6401// PageToken sets the optional parameter "pageToken": Continuation token 6402// if the request is paged. 6403func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { 6404 c.urlParams_.Set("pageToken", pageToken) 6405 return c 6406} 6407 6408// StartDate sets the optional parameter "startDate": Earliest post date 6409// to fetch, a date-time with RFC 3339 formatting. 6410func (c *PostsListCall) StartDate(startDate string) *PostsListCall { 6411 c.urlParams_.Set("startDate", startDate) 6412 return c 6413} 6414 6415// Status sets the optional parameter "status": Statuses to include in 6416// the results. 6417// 6418// Possible values: 6419// "draft" - Draft (non-published) posts. 6420// "live" - Published posts 6421// "scheduled" - Posts that are scheduled to publish in the future. 6422func (c *PostsListCall) Status(status ...string) *PostsListCall { 6423 c.urlParams_.SetMulti("status", append([]string{}, status...)) 6424 return c 6425} 6426 6427// View sets the optional parameter "view": Access level with which to 6428// view the returned result. Note that some fields require escalated 6429// access. 6430// 6431// Possible values: 6432// "ADMIN" - Admin level detail 6433// "AUTHOR" - Author level detail 6434// "READER" - Reader level detail 6435func (c *PostsListCall) View(view string) *PostsListCall { 6436 c.urlParams_.Set("view", view) 6437 return c 6438} 6439 6440// Fields allows partial responses to be retrieved. See 6441// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6442// for more information. 6443func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { 6444 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6445 return c 6446} 6447 6448// IfNoneMatch sets the optional parameter which makes the operation 6449// fail if the object's ETag matches the given value. This is useful for 6450// getting updates only after the object has changed since the last 6451// request. Use googleapi.IsNotModified to check whether the response 6452// error from Do is the result of In-None-Match. 6453func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { 6454 c.ifNoneMatch_ = entityTag 6455 return c 6456} 6457 6458// Context sets the context to be used in this call's Do method. Any 6459// pending HTTP request will be aborted if the provided context is 6460// canceled. 6461func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { 6462 c.ctx_ = ctx 6463 return c 6464} 6465 6466// Header returns an http.Header that can be modified by the caller to 6467// add HTTP headers to the request. 6468func (c *PostsListCall) Header() http.Header { 6469 if c.header_ == nil { 6470 c.header_ = make(http.Header) 6471 } 6472 return c.header_ 6473} 6474 6475func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { 6476 reqHeaders := make(http.Header) 6477 for k, v := range c.header_ { 6478 reqHeaders[k] = v 6479 } 6480 reqHeaders.Set("User-Agent", c.s.userAgent()) 6481 if c.ifNoneMatch_ != "" { 6482 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6483 } 6484 var body io.Reader = nil 6485 c.urlParams_.Set("alt", alt) 6486 c.urlParams_.Set("prettyPrint", "false") 6487 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") 6488 urls += "?" + c.urlParams_.Encode() 6489 req, err := http.NewRequest("GET", urls, body) 6490 if err != nil { 6491 return nil, err 6492 } 6493 req.Header = reqHeaders 6494 googleapi.Expand(req.URL, map[string]string{ 6495 "blogId": c.blogId, 6496 }) 6497 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6498} 6499 6500// Do executes the "blogger.posts.list" call. 6501// Exactly one of *PostList or error will be non-nil. Any non-2xx status 6502// code is an error. Response headers are in either 6503// *PostList.ServerResponse.Header or (if a response was returned at 6504// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6505// to check whether the returned error was because 6506// http.StatusNotModified was returned. 6507func (c *PostsListCall) Do(opts ...googleapi.CallOption) (*PostList, error) { 6508 gensupport.SetOptions(c.urlParams_, opts...) 6509 res, err := c.doRequest("json") 6510 if res != nil && res.StatusCode == http.StatusNotModified { 6511 if res.Body != nil { 6512 res.Body.Close() 6513 } 6514 return nil, &googleapi.Error{ 6515 Code: res.StatusCode, 6516 Header: res.Header, 6517 } 6518 } 6519 if err != nil { 6520 return nil, err 6521 } 6522 defer googleapi.CloseBody(res) 6523 if err := googleapi.CheckResponse(res); err != nil { 6524 return nil, err 6525 } 6526 ret := &PostList{ 6527 ServerResponse: googleapi.ServerResponse{ 6528 Header: res.Header, 6529 HTTPStatusCode: res.StatusCode, 6530 }, 6531 } 6532 target := &ret 6533 if err := gensupport.DecodeResponse(target, res); err != nil { 6534 return nil, err 6535 } 6536 return ret, nil 6537 // { 6538 // "description": "Retrieves a list of posts, possibly filtered.", 6539 // "httpMethod": "GET", 6540 // "id": "blogger.posts.list", 6541 // "parameterOrder": [ 6542 // "blogId" 6543 // ], 6544 // "parameters": { 6545 // "blogId": { 6546 // "description": "ID of the blog to fetch posts from.", 6547 // "location": "path", 6548 // "required": true, 6549 // "type": "string" 6550 // }, 6551 // "endDate": { 6552 // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.", 6553 // "format": "date-time", 6554 // "location": "query", 6555 // "type": "string" 6556 // }, 6557 // "fetchBodies": { 6558 // "default": "true", 6559 // "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.", 6560 // "location": "query", 6561 // "type": "boolean" 6562 // }, 6563 // "fetchImages": { 6564 // "description": "Whether image URL metadata for each post is included.", 6565 // "location": "query", 6566 // "type": "boolean" 6567 // }, 6568 // "labels": { 6569 // "description": "Comma-separated list of labels to search for.", 6570 // "location": "query", 6571 // "type": "string" 6572 // }, 6573 // "maxResults": { 6574 // "description": "Maximum number of posts to fetch.", 6575 // "format": "uint32", 6576 // "location": "query", 6577 // "type": "integer" 6578 // }, 6579 // "orderBy": { 6580 // "default": "PUBLISHED", 6581 // "description": "Sort search results", 6582 // "enum": [ 6583 // "published", 6584 // "updated" 6585 // ], 6586 // "enumDescriptions": [ 6587 // "Order by the date the post was published", 6588 // "Order by the date the post was last updated" 6589 // ], 6590 // "location": "query", 6591 // "type": "string" 6592 // }, 6593 // "pageToken": { 6594 // "description": "Continuation token if the request is paged.", 6595 // "location": "query", 6596 // "type": "string" 6597 // }, 6598 // "startDate": { 6599 // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", 6600 // "format": "date-time", 6601 // "location": "query", 6602 // "type": "string" 6603 // }, 6604 // "status": { 6605 // "description": "Statuses to include in the results.", 6606 // "enum": [ 6607 // "draft", 6608 // "live", 6609 // "scheduled" 6610 // ], 6611 // "enumDescriptions": [ 6612 // "Draft (non-published) posts.", 6613 // "Published posts", 6614 // "Posts that are scheduled to publish in the future." 6615 // ], 6616 // "location": "query", 6617 // "repeated": true, 6618 // "type": "string" 6619 // }, 6620 // "view": { 6621 // "description": "Access level with which to view the returned result. Note that some fields require escalated access.", 6622 // "enum": [ 6623 // "ADMIN", 6624 // "AUTHOR", 6625 // "READER" 6626 // ], 6627 // "enumDescriptions": [ 6628 // "Admin level detail", 6629 // "Author level detail", 6630 // "Reader level detail" 6631 // ], 6632 // "location": "query", 6633 // "type": "string" 6634 // } 6635 // }, 6636 // "path": "blogs/{blogId}/posts", 6637 // "response": { 6638 // "$ref": "PostList" 6639 // }, 6640 // "scopes": [ 6641 // "https://www.googleapis.com/auth/blogger", 6642 // "https://www.googleapis.com/auth/blogger.readonly" 6643 // ] 6644 // } 6645 6646} 6647 6648// Pages invokes f for each page of results. 6649// A non-nil error returned from f will halt the iteration. 6650// The provided context supersedes any context provided to the Context method. 6651func (c *PostsListCall) Pages(ctx context.Context, f func(*PostList) error) error { 6652 c.ctx_ = ctx 6653 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6654 for { 6655 x, err := c.Do() 6656 if err != nil { 6657 return err 6658 } 6659 if err := f(x); err != nil { 6660 return err 6661 } 6662 if x.NextPageToken == "" { 6663 return nil 6664 } 6665 c.PageToken(x.NextPageToken) 6666 } 6667} 6668 6669// method id "blogger.posts.patch": 6670 6671type PostsPatchCall struct { 6672 s *Service 6673 blogId string 6674 postId string 6675 post *Post 6676 urlParams_ gensupport.URLParams 6677 ctx_ context.Context 6678 header_ http.Header 6679} 6680 6681// Patch: Update a post. This method supports patch semantics. 6682func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall { 6683 c := &PostsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6684 c.blogId = blogId 6685 c.postId = postId 6686 c.post = post 6687 return c 6688} 6689 6690// FetchBody sets the optional parameter "fetchBody": Whether the body 6691// content of the post is included with the result (default: true). 6692func (c *PostsPatchCall) FetchBody(fetchBody bool) *PostsPatchCall { 6693 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 6694 return c 6695} 6696 6697// FetchImages sets the optional parameter "fetchImages": Whether image 6698// URL metadata for each post is included in the returned result 6699// (default: false). 6700func (c *PostsPatchCall) FetchImages(fetchImages bool) *PostsPatchCall { 6701 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 6702 return c 6703} 6704 6705// MaxComments sets the optional parameter "maxComments": Maximum number 6706// of comments to retrieve with the returned post. 6707func (c *PostsPatchCall) MaxComments(maxComments int64) *PostsPatchCall { 6708 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 6709 return c 6710} 6711 6712// Publish sets the optional parameter "publish": Whether a publish 6713// action should be performed when the post is updated (default: false). 6714func (c *PostsPatchCall) Publish(publish bool) *PostsPatchCall { 6715 c.urlParams_.Set("publish", fmt.Sprint(publish)) 6716 return c 6717} 6718 6719// Revert sets the optional parameter "revert": Whether a revert action 6720// should be performed when the post is updated (default: false). 6721func (c *PostsPatchCall) Revert(revert bool) *PostsPatchCall { 6722 c.urlParams_.Set("revert", fmt.Sprint(revert)) 6723 return c 6724} 6725 6726// Fields allows partial responses to be retrieved. See 6727// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6728// for more information. 6729func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall { 6730 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6731 return c 6732} 6733 6734// Context sets the context to be used in this call's Do method. Any 6735// pending HTTP request will be aborted if the provided context is 6736// canceled. 6737func (c *PostsPatchCall) Context(ctx context.Context) *PostsPatchCall { 6738 c.ctx_ = ctx 6739 return c 6740} 6741 6742// Header returns an http.Header that can be modified by the caller to 6743// add HTTP headers to the request. 6744func (c *PostsPatchCall) Header() http.Header { 6745 if c.header_ == nil { 6746 c.header_ = make(http.Header) 6747 } 6748 return c.header_ 6749} 6750 6751func (c *PostsPatchCall) doRequest(alt string) (*http.Response, error) { 6752 reqHeaders := make(http.Header) 6753 for k, v := range c.header_ { 6754 reqHeaders[k] = v 6755 } 6756 reqHeaders.Set("User-Agent", c.s.userAgent()) 6757 var body io.Reader = nil 6758 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) 6759 if err != nil { 6760 return nil, err 6761 } 6762 reqHeaders.Set("Content-Type", "application/json") 6763 c.urlParams_.Set("alt", alt) 6764 c.urlParams_.Set("prettyPrint", "false") 6765 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 6766 urls += "?" + c.urlParams_.Encode() 6767 req, err := http.NewRequest("PATCH", urls, body) 6768 if err != nil { 6769 return nil, err 6770 } 6771 req.Header = reqHeaders 6772 googleapi.Expand(req.URL, map[string]string{ 6773 "blogId": c.blogId, 6774 "postId": c.postId, 6775 }) 6776 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6777} 6778 6779// Do executes the "blogger.posts.patch" call. 6780// Exactly one of *Post or error will be non-nil. Any non-2xx status 6781// code is an error. Response headers are in either 6782// *Post.ServerResponse.Header or (if a response was returned at all) in 6783// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6784// whether the returned error was because http.StatusNotModified was 6785// returned. 6786func (c *PostsPatchCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6787 gensupport.SetOptions(c.urlParams_, opts...) 6788 res, err := c.doRequest("json") 6789 if res != nil && res.StatusCode == http.StatusNotModified { 6790 if res.Body != nil { 6791 res.Body.Close() 6792 } 6793 return nil, &googleapi.Error{ 6794 Code: res.StatusCode, 6795 Header: res.Header, 6796 } 6797 } 6798 if err != nil { 6799 return nil, err 6800 } 6801 defer googleapi.CloseBody(res) 6802 if err := googleapi.CheckResponse(res); err != nil { 6803 return nil, err 6804 } 6805 ret := &Post{ 6806 ServerResponse: googleapi.ServerResponse{ 6807 Header: res.Header, 6808 HTTPStatusCode: res.StatusCode, 6809 }, 6810 } 6811 target := &ret 6812 if err := gensupport.DecodeResponse(target, res); err != nil { 6813 return nil, err 6814 } 6815 return ret, nil 6816 // { 6817 // "description": "Update a post. This method supports patch semantics.", 6818 // "httpMethod": "PATCH", 6819 // "id": "blogger.posts.patch", 6820 // "parameterOrder": [ 6821 // "blogId", 6822 // "postId" 6823 // ], 6824 // "parameters": { 6825 // "blogId": { 6826 // "description": "The ID of the Blog.", 6827 // "location": "path", 6828 // "required": true, 6829 // "type": "string" 6830 // }, 6831 // "fetchBody": { 6832 // "default": "true", 6833 // "description": "Whether the body content of the post is included with the result (default: true).", 6834 // "location": "query", 6835 // "type": "boolean" 6836 // }, 6837 // "fetchImages": { 6838 // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", 6839 // "location": "query", 6840 // "type": "boolean" 6841 // }, 6842 // "maxComments": { 6843 // "description": "Maximum number of comments to retrieve with the returned post.", 6844 // "format": "uint32", 6845 // "location": "query", 6846 // "type": "integer" 6847 // }, 6848 // "postId": { 6849 // "description": "The ID of the Post.", 6850 // "location": "path", 6851 // "required": true, 6852 // "type": "string" 6853 // }, 6854 // "publish": { 6855 // "description": "Whether a publish action should be performed when the post is updated (default: false).", 6856 // "location": "query", 6857 // "type": "boolean" 6858 // }, 6859 // "revert": { 6860 // "description": "Whether a revert action should be performed when the post is updated (default: false).", 6861 // "location": "query", 6862 // "type": "boolean" 6863 // } 6864 // }, 6865 // "path": "blogs/{blogId}/posts/{postId}", 6866 // "request": { 6867 // "$ref": "Post" 6868 // }, 6869 // "response": { 6870 // "$ref": "Post" 6871 // }, 6872 // "scopes": [ 6873 // "https://www.googleapis.com/auth/blogger" 6874 // ] 6875 // } 6876 6877} 6878 6879// method id "blogger.posts.publish": 6880 6881type PostsPublishCall struct { 6882 s *Service 6883 blogId string 6884 postId string 6885 urlParams_ gensupport.URLParams 6886 ctx_ context.Context 6887 header_ http.Header 6888} 6889 6890// Publish: Publishes a draft post, optionally at the specific time of 6891// the given publishDate parameter. 6892func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall { 6893 c := &PostsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6894 c.blogId = blogId 6895 c.postId = postId 6896 return c 6897} 6898 6899// PublishDate sets the optional parameter "publishDate": Optional date 6900// and time to schedule the publishing of the Blog. If no publishDate 6901// parameter is given, the post is either published at the a previously 6902// saved schedule date (if present), or the current time. If a future 6903// date is given, the post will be scheduled to be published. 6904func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall { 6905 c.urlParams_.Set("publishDate", publishDate) 6906 return c 6907} 6908 6909// Fields allows partial responses to be retrieved. See 6910// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6911// for more information. 6912func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall { 6913 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6914 return c 6915} 6916 6917// Context sets the context to be used in this call's Do method. Any 6918// pending HTTP request will be aborted if the provided context is 6919// canceled. 6920func (c *PostsPublishCall) Context(ctx context.Context) *PostsPublishCall { 6921 c.ctx_ = ctx 6922 return c 6923} 6924 6925// Header returns an http.Header that can be modified by the caller to 6926// add HTTP headers to the request. 6927func (c *PostsPublishCall) Header() http.Header { 6928 if c.header_ == nil { 6929 c.header_ = make(http.Header) 6930 } 6931 return c.header_ 6932} 6933 6934func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) { 6935 reqHeaders := make(http.Header) 6936 for k, v := range c.header_ { 6937 reqHeaders[k] = v 6938 } 6939 reqHeaders.Set("User-Agent", c.s.userAgent()) 6940 var body io.Reader = nil 6941 c.urlParams_.Set("alt", alt) 6942 c.urlParams_.Set("prettyPrint", "false") 6943 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") 6944 urls += "?" + c.urlParams_.Encode() 6945 req, err := http.NewRequest("POST", urls, body) 6946 if err != nil { 6947 return nil, err 6948 } 6949 req.Header = reqHeaders 6950 googleapi.Expand(req.URL, map[string]string{ 6951 "blogId": c.blogId, 6952 "postId": c.postId, 6953 }) 6954 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6955} 6956 6957// Do executes the "blogger.posts.publish" call. 6958// Exactly one of *Post or error will be non-nil. Any non-2xx status 6959// code is an error. Response headers are in either 6960// *Post.ServerResponse.Header or (if a response was returned at all) in 6961// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6962// whether the returned error was because http.StatusNotModified was 6963// returned. 6964func (c *PostsPublishCall) Do(opts ...googleapi.CallOption) (*Post, error) { 6965 gensupport.SetOptions(c.urlParams_, opts...) 6966 res, err := c.doRequest("json") 6967 if res != nil && res.StatusCode == http.StatusNotModified { 6968 if res.Body != nil { 6969 res.Body.Close() 6970 } 6971 return nil, &googleapi.Error{ 6972 Code: res.StatusCode, 6973 Header: res.Header, 6974 } 6975 } 6976 if err != nil { 6977 return nil, err 6978 } 6979 defer googleapi.CloseBody(res) 6980 if err := googleapi.CheckResponse(res); err != nil { 6981 return nil, err 6982 } 6983 ret := &Post{ 6984 ServerResponse: googleapi.ServerResponse{ 6985 Header: res.Header, 6986 HTTPStatusCode: res.StatusCode, 6987 }, 6988 } 6989 target := &ret 6990 if err := gensupport.DecodeResponse(target, res); err != nil { 6991 return nil, err 6992 } 6993 return ret, nil 6994 // { 6995 // "description": "Publishes a draft post, optionally at the specific time of the given publishDate parameter.", 6996 // "httpMethod": "POST", 6997 // "id": "blogger.posts.publish", 6998 // "parameterOrder": [ 6999 // "blogId", 7000 // "postId" 7001 // ], 7002 // "parameters": { 7003 // "blogId": { 7004 // "description": "The ID of the Blog.", 7005 // "location": "path", 7006 // "required": true, 7007 // "type": "string" 7008 // }, 7009 // "postId": { 7010 // "description": "The ID of the Post.", 7011 // "location": "path", 7012 // "required": true, 7013 // "type": "string" 7014 // }, 7015 // "publishDate": { 7016 // "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.", 7017 // "format": "date-time", 7018 // "location": "query", 7019 // "type": "string" 7020 // } 7021 // }, 7022 // "path": "blogs/{blogId}/posts/{postId}/publish", 7023 // "response": { 7024 // "$ref": "Post" 7025 // }, 7026 // "scopes": [ 7027 // "https://www.googleapis.com/auth/blogger" 7028 // ] 7029 // } 7030 7031} 7032 7033// method id "blogger.posts.revert": 7034 7035type PostsRevertCall struct { 7036 s *Service 7037 blogId string 7038 postId string 7039 urlParams_ gensupport.URLParams 7040 ctx_ context.Context 7041 header_ http.Header 7042} 7043 7044// Revert: Revert a published or scheduled post to draft state. 7045func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall { 7046 c := &PostsRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7047 c.blogId = blogId 7048 c.postId = postId 7049 return c 7050} 7051 7052// Fields allows partial responses to be retrieved. See 7053// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7054// for more information. 7055func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall { 7056 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7057 return c 7058} 7059 7060// Context sets the context to be used in this call's Do method. Any 7061// pending HTTP request will be aborted if the provided context is 7062// canceled. 7063func (c *PostsRevertCall) Context(ctx context.Context) *PostsRevertCall { 7064 c.ctx_ = ctx 7065 return c 7066} 7067 7068// Header returns an http.Header that can be modified by the caller to 7069// add HTTP headers to the request. 7070func (c *PostsRevertCall) Header() http.Header { 7071 if c.header_ == nil { 7072 c.header_ = make(http.Header) 7073 } 7074 return c.header_ 7075} 7076 7077func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) { 7078 reqHeaders := make(http.Header) 7079 for k, v := range c.header_ { 7080 reqHeaders[k] = v 7081 } 7082 reqHeaders.Set("User-Agent", c.s.userAgent()) 7083 var body io.Reader = nil 7084 c.urlParams_.Set("alt", alt) 7085 c.urlParams_.Set("prettyPrint", "false") 7086 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") 7087 urls += "?" + c.urlParams_.Encode() 7088 req, err := http.NewRequest("POST", urls, body) 7089 if err != nil { 7090 return nil, err 7091 } 7092 req.Header = reqHeaders 7093 googleapi.Expand(req.URL, map[string]string{ 7094 "blogId": c.blogId, 7095 "postId": c.postId, 7096 }) 7097 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7098} 7099 7100// Do executes the "blogger.posts.revert" call. 7101// Exactly one of *Post or error will be non-nil. Any non-2xx status 7102// code is an error. Response headers are in either 7103// *Post.ServerResponse.Header or (if a response was returned at all) in 7104// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7105// whether the returned error was because http.StatusNotModified was 7106// returned. 7107func (c *PostsRevertCall) Do(opts ...googleapi.CallOption) (*Post, error) { 7108 gensupport.SetOptions(c.urlParams_, opts...) 7109 res, err := c.doRequest("json") 7110 if res != nil && res.StatusCode == http.StatusNotModified { 7111 if res.Body != nil { 7112 res.Body.Close() 7113 } 7114 return nil, &googleapi.Error{ 7115 Code: res.StatusCode, 7116 Header: res.Header, 7117 } 7118 } 7119 if err != nil { 7120 return nil, err 7121 } 7122 defer googleapi.CloseBody(res) 7123 if err := googleapi.CheckResponse(res); err != nil { 7124 return nil, err 7125 } 7126 ret := &Post{ 7127 ServerResponse: googleapi.ServerResponse{ 7128 Header: res.Header, 7129 HTTPStatusCode: res.StatusCode, 7130 }, 7131 } 7132 target := &ret 7133 if err := gensupport.DecodeResponse(target, res); err != nil { 7134 return nil, err 7135 } 7136 return ret, nil 7137 // { 7138 // "description": "Revert a published or scheduled post to draft state.", 7139 // "httpMethod": "POST", 7140 // "id": "blogger.posts.revert", 7141 // "parameterOrder": [ 7142 // "blogId", 7143 // "postId" 7144 // ], 7145 // "parameters": { 7146 // "blogId": { 7147 // "description": "The ID of the Blog.", 7148 // "location": "path", 7149 // "required": true, 7150 // "type": "string" 7151 // }, 7152 // "postId": { 7153 // "description": "The ID of the Post.", 7154 // "location": "path", 7155 // "required": true, 7156 // "type": "string" 7157 // } 7158 // }, 7159 // "path": "blogs/{blogId}/posts/{postId}/revert", 7160 // "response": { 7161 // "$ref": "Post" 7162 // }, 7163 // "scopes": [ 7164 // "https://www.googleapis.com/auth/blogger" 7165 // ] 7166 // } 7167 7168} 7169 7170// method id "blogger.posts.search": 7171 7172type PostsSearchCall struct { 7173 s *Service 7174 blogId string 7175 urlParams_ gensupport.URLParams 7176 ifNoneMatch_ string 7177 ctx_ context.Context 7178 header_ http.Header 7179} 7180 7181// Search: Search for a post. 7182func (r *PostsService) Search(blogId string, q string) *PostsSearchCall { 7183 c := &PostsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7184 c.blogId = blogId 7185 c.urlParams_.Set("q", q) 7186 return c 7187} 7188 7189// FetchBodies sets the optional parameter "fetchBodies": Whether the 7190// body content of posts is included (default: true). This should be set 7191// to false when the post bodies are not required, to help minimize 7192// traffic. 7193func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall { 7194 c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) 7195 return c 7196} 7197 7198// OrderBy sets the optional parameter "orderBy": Sort search results 7199// 7200// Possible values: 7201// "published" - Order by the date the post was published 7202// "updated" - Order by the date the post was last updated 7203func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { 7204 c.urlParams_.Set("orderBy", orderBy) 7205 return c 7206} 7207 7208// Fields allows partial responses to be retrieved. See 7209// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7210// for more information. 7211func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall { 7212 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7213 return c 7214} 7215 7216// IfNoneMatch sets the optional parameter which makes the operation 7217// fail if the object's ETag matches the given value. This is useful for 7218// getting updates only after the object has changed since the last 7219// request. Use googleapi.IsNotModified to check whether the response 7220// error from Do is the result of In-None-Match. 7221func (c *PostsSearchCall) IfNoneMatch(entityTag string) *PostsSearchCall { 7222 c.ifNoneMatch_ = entityTag 7223 return c 7224} 7225 7226// Context sets the context to be used in this call's Do method. Any 7227// pending HTTP request will be aborted if the provided context is 7228// canceled. 7229func (c *PostsSearchCall) Context(ctx context.Context) *PostsSearchCall { 7230 c.ctx_ = ctx 7231 return c 7232} 7233 7234// Header returns an http.Header that can be modified by the caller to 7235// add HTTP headers to the request. 7236func (c *PostsSearchCall) Header() http.Header { 7237 if c.header_ == nil { 7238 c.header_ = make(http.Header) 7239 } 7240 return c.header_ 7241} 7242 7243func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) { 7244 reqHeaders := make(http.Header) 7245 for k, v := range c.header_ { 7246 reqHeaders[k] = v 7247 } 7248 reqHeaders.Set("User-Agent", c.s.userAgent()) 7249 if c.ifNoneMatch_ != "" { 7250 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7251 } 7252 var body io.Reader = nil 7253 c.urlParams_.Set("alt", alt) 7254 c.urlParams_.Set("prettyPrint", "false") 7255 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") 7256 urls += "?" + c.urlParams_.Encode() 7257 req, err := http.NewRequest("GET", urls, body) 7258 if err != nil { 7259 return nil, err 7260 } 7261 req.Header = reqHeaders 7262 googleapi.Expand(req.URL, map[string]string{ 7263 "blogId": c.blogId, 7264 }) 7265 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7266} 7267 7268// Do executes the "blogger.posts.search" call. 7269// Exactly one of *PostList or error will be non-nil. Any non-2xx status 7270// code is an error. Response headers are in either 7271// *PostList.ServerResponse.Header or (if a response was returned at 7272// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7273// to check whether the returned error was because 7274// http.StatusNotModified was returned. 7275func (c *PostsSearchCall) Do(opts ...googleapi.CallOption) (*PostList, error) { 7276 gensupport.SetOptions(c.urlParams_, opts...) 7277 res, err := c.doRequest("json") 7278 if res != nil && res.StatusCode == http.StatusNotModified { 7279 if res.Body != nil { 7280 res.Body.Close() 7281 } 7282 return nil, &googleapi.Error{ 7283 Code: res.StatusCode, 7284 Header: res.Header, 7285 } 7286 } 7287 if err != nil { 7288 return nil, err 7289 } 7290 defer googleapi.CloseBody(res) 7291 if err := googleapi.CheckResponse(res); err != nil { 7292 return nil, err 7293 } 7294 ret := &PostList{ 7295 ServerResponse: googleapi.ServerResponse{ 7296 Header: res.Header, 7297 HTTPStatusCode: res.StatusCode, 7298 }, 7299 } 7300 target := &ret 7301 if err := gensupport.DecodeResponse(target, res); err != nil { 7302 return nil, err 7303 } 7304 return ret, nil 7305 // { 7306 // "description": "Search for a post.", 7307 // "httpMethod": "GET", 7308 // "id": "blogger.posts.search", 7309 // "parameterOrder": [ 7310 // "blogId", 7311 // "q" 7312 // ], 7313 // "parameters": { 7314 // "blogId": { 7315 // "description": "ID of the blog to fetch the post from.", 7316 // "location": "path", 7317 // "required": true, 7318 // "type": "string" 7319 // }, 7320 // "fetchBodies": { 7321 // "default": "true", 7322 // "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.", 7323 // "location": "query", 7324 // "type": "boolean" 7325 // }, 7326 // "orderBy": { 7327 // "default": "PUBLISHED", 7328 // "description": "Sort search results", 7329 // "enum": [ 7330 // "published", 7331 // "updated" 7332 // ], 7333 // "enumDescriptions": [ 7334 // "Order by the date the post was published", 7335 // "Order by the date the post was last updated" 7336 // ], 7337 // "location": "query", 7338 // "type": "string" 7339 // }, 7340 // "q": { 7341 // "description": "Query terms to search this blog for matching posts.", 7342 // "location": "query", 7343 // "required": true, 7344 // "type": "string" 7345 // } 7346 // }, 7347 // "path": "blogs/{blogId}/posts/search", 7348 // "response": { 7349 // "$ref": "PostList" 7350 // }, 7351 // "scopes": [ 7352 // "https://www.googleapis.com/auth/blogger", 7353 // "https://www.googleapis.com/auth/blogger.readonly" 7354 // ] 7355 // } 7356 7357} 7358 7359// method id "blogger.posts.update": 7360 7361type PostsUpdateCall struct { 7362 s *Service 7363 blogId string 7364 postId string 7365 post *Post 7366 urlParams_ gensupport.URLParams 7367 ctx_ context.Context 7368 header_ http.Header 7369} 7370 7371// Update: Update a post. 7372func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall { 7373 c := &PostsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7374 c.blogId = blogId 7375 c.postId = postId 7376 c.post = post 7377 return c 7378} 7379 7380// FetchBody sets the optional parameter "fetchBody": Whether the body 7381// content of the post is included with the result (default: true). 7382func (c *PostsUpdateCall) FetchBody(fetchBody bool) *PostsUpdateCall { 7383 c.urlParams_.Set("fetchBody", fmt.Sprint(fetchBody)) 7384 return c 7385} 7386 7387// FetchImages sets the optional parameter "fetchImages": Whether image 7388// URL metadata for each post is included in the returned result 7389// (default: false). 7390func (c *PostsUpdateCall) FetchImages(fetchImages bool) *PostsUpdateCall { 7391 c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages)) 7392 return c 7393} 7394 7395// MaxComments sets the optional parameter "maxComments": Maximum number 7396// of comments to retrieve with the returned post. 7397func (c *PostsUpdateCall) MaxComments(maxComments int64) *PostsUpdateCall { 7398 c.urlParams_.Set("maxComments", fmt.Sprint(maxComments)) 7399 return c 7400} 7401 7402// Publish sets the optional parameter "publish": Whether a publish 7403// action should be performed when the post is updated (default: false). 7404func (c *PostsUpdateCall) Publish(publish bool) *PostsUpdateCall { 7405 c.urlParams_.Set("publish", fmt.Sprint(publish)) 7406 return c 7407} 7408 7409// Revert sets the optional parameter "revert": Whether a revert action 7410// should be performed when the post is updated (default: false). 7411func (c *PostsUpdateCall) Revert(revert bool) *PostsUpdateCall { 7412 c.urlParams_.Set("revert", fmt.Sprint(revert)) 7413 return c 7414} 7415 7416// Fields allows partial responses to be retrieved. See 7417// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7418// for more information. 7419func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall { 7420 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7421 return c 7422} 7423 7424// Context sets the context to be used in this call's Do method. Any 7425// pending HTTP request will be aborted if the provided context is 7426// canceled. 7427func (c *PostsUpdateCall) Context(ctx context.Context) *PostsUpdateCall { 7428 c.ctx_ = ctx 7429 return c 7430} 7431 7432// Header returns an http.Header that can be modified by the caller to 7433// add HTTP headers to the request. 7434func (c *PostsUpdateCall) Header() http.Header { 7435 if c.header_ == nil { 7436 c.header_ = make(http.Header) 7437 } 7438 return c.header_ 7439} 7440 7441func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, error) { 7442 reqHeaders := make(http.Header) 7443 for k, v := range c.header_ { 7444 reqHeaders[k] = v 7445 } 7446 reqHeaders.Set("User-Agent", c.s.userAgent()) 7447 var body io.Reader = nil 7448 body, err := googleapi.WithoutDataWrapper.JSONReader(c.post) 7449 if err != nil { 7450 return nil, err 7451 } 7452 reqHeaders.Set("Content-Type", "application/json") 7453 c.urlParams_.Set("alt", alt) 7454 c.urlParams_.Set("prettyPrint", "false") 7455 urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") 7456 urls += "?" + c.urlParams_.Encode() 7457 req, err := http.NewRequest("PUT", urls, body) 7458 if err != nil { 7459 return nil, err 7460 } 7461 req.Header = reqHeaders 7462 googleapi.Expand(req.URL, map[string]string{ 7463 "blogId": c.blogId, 7464 "postId": c.postId, 7465 }) 7466 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7467} 7468 7469// Do executes the "blogger.posts.update" call. 7470// Exactly one of *Post or error will be non-nil. Any non-2xx status 7471// code is an error. Response headers are in either 7472// *Post.ServerResponse.Header or (if a response was returned at all) in 7473// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7474// whether the returned error was because http.StatusNotModified was 7475// returned. 7476func (c *PostsUpdateCall) Do(opts ...googleapi.CallOption) (*Post, error) { 7477 gensupport.SetOptions(c.urlParams_, opts...) 7478 res, err := c.doRequest("json") 7479 if res != nil && res.StatusCode == http.StatusNotModified { 7480 if res.Body != nil { 7481 res.Body.Close() 7482 } 7483 return nil, &googleapi.Error{ 7484 Code: res.StatusCode, 7485 Header: res.Header, 7486 } 7487 } 7488 if err != nil { 7489 return nil, err 7490 } 7491 defer googleapi.CloseBody(res) 7492 if err := googleapi.CheckResponse(res); err != nil { 7493 return nil, err 7494 } 7495 ret := &Post{ 7496 ServerResponse: googleapi.ServerResponse{ 7497 Header: res.Header, 7498 HTTPStatusCode: res.StatusCode, 7499 }, 7500 } 7501 target := &ret 7502 if err := gensupport.DecodeResponse(target, res); err != nil { 7503 return nil, err 7504 } 7505 return ret, nil 7506 // { 7507 // "description": "Update a post.", 7508 // "httpMethod": "PUT", 7509 // "id": "blogger.posts.update", 7510 // "parameterOrder": [ 7511 // "blogId", 7512 // "postId" 7513 // ], 7514 // "parameters": { 7515 // "blogId": { 7516 // "description": "The ID of the Blog.", 7517 // "location": "path", 7518 // "required": true, 7519 // "type": "string" 7520 // }, 7521 // "fetchBody": { 7522 // "default": "true", 7523 // "description": "Whether the body content of the post is included with the result (default: true).", 7524 // "location": "query", 7525 // "type": "boolean" 7526 // }, 7527 // "fetchImages": { 7528 // "description": "Whether image URL metadata for each post is included in the returned result (default: false).", 7529 // "location": "query", 7530 // "type": "boolean" 7531 // }, 7532 // "maxComments": { 7533 // "description": "Maximum number of comments to retrieve with the returned post.", 7534 // "format": "uint32", 7535 // "location": "query", 7536 // "type": "integer" 7537 // }, 7538 // "postId": { 7539 // "description": "The ID of the Post.", 7540 // "location": "path", 7541 // "required": true, 7542 // "type": "string" 7543 // }, 7544 // "publish": { 7545 // "description": "Whether a publish action should be performed when the post is updated (default: false).", 7546 // "location": "query", 7547 // "type": "boolean" 7548 // }, 7549 // "revert": { 7550 // "description": "Whether a revert action should be performed when the post is updated (default: false).", 7551 // "location": "query", 7552 // "type": "boolean" 7553 // } 7554 // }, 7555 // "path": "blogs/{blogId}/posts/{postId}", 7556 // "request": { 7557 // "$ref": "Post" 7558 // }, 7559 // "response": { 7560 // "$ref": "Post" 7561 // }, 7562 // "scopes": [ 7563 // "https://www.googleapis.com/auth/blogger" 7564 // ] 7565 // } 7566 7567} 7568 7569// method id "blogger.users.get": 7570 7571type UsersGetCall struct { 7572 s *Service 7573 userId string 7574 urlParams_ gensupport.URLParams 7575 ifNoneMatch_ string 7576 ctx_ context.Context 7577 header_ http.Header 7578} 7579 7580// Get: Gets one user by ID. 7581func (r *UsersService) Get(userId string) *UsersGetCall { 7582 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7583 c.userId = userId 7584 return c 7585} 7586 7587// Fields allows partial responses to be retrieved. See 7588// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7589// for more information. 7590func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 7591 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7592 return c 7593} 7594 7595// IfNoneMatch sets the optional parameter which makes the operation 7596// fail if the object's ETag matches the given value. This is useful for 7597// getting updates only after the object has changed since the last 7598// request. Use googleapi.IsNotModified to check whether the response 7599// error from Do is the result of In-None-Match. 7600func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 7601 c.ifNoneMatch_ = entityTag 7602 return c 7603} 7604 7605// Context sets the context to be used in this call's Do method. Any 7606// pending HTTP request will be aborted if the provided context is 7607// canceled. 7608func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 7609 c.ctx_ = ctx 7610 return c 7611} 7612 7613// Header returns an http.Header that can be modified by the caller to 7614// add HTTP headers to the request. 7615func (c *UsersGetCall) Header() http.Header { 7616 if c.header_ == nil { 7617 c.header_ = make(http.Header) 7618 } 7619 return c.header_ 7620} 7621 7622func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 7623 reqHeaders := make(http.Header) 7624 for k, v := range c.header_ { 7625 reqHeaders[k] = v 7626 } 7627 reqHeaders.Set("User-Agent", c.s.userAgent()) 7628 if c.ifNoneMatch_ != "" { 7629 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7630 } 7631 var body io.Reader = nil 7632 c.urlParams_.Set("alt", alt) 7633 c.urlParams_.Set("prettyPrint", "false") 7634 urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") 7635 urls += "?" + c.urlParams_.Encode() 7636 req, err := http.NewRequest("GET", urls, body) 7637 if err != nil { 7638 return nil, err 7639 } 7640 req.Header = reqHeaders 7641 googleapi.Expand(req.URL, map[string]string{ 7642 "userId": c.userId, 7643 }) 7644 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7645} 7646 7647// Do executes the "blogger.users.get" call. 7648// Exactly one of *User or error will be non-nil. Any non-2xx status 7649// code is an error. Response headers are in either 7650// *User.ServerResponse.Header or (if a response was returned at all) in 7651// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7652// whether the returned error was because http.StatusNotModified was 7653// returned. 7654func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 7655 gensupport.SetOptions(c.urlParams_, opts...) 7656 res, err := c.doRequest("json") 7657 if res != nil && res.StatusCode == http.StatusNotModified { 7658 if res.Body != nil { 7659 res.Body.Close() 7660 } 7661 return nil, &googleapi.Error{ 7662 Code: res.StatusCode, 7663 Header: res.Header, 7664 } 7665 } 7666 if err != nil { 7667 return nil, err 7668 } 7669 defer googleapi.CloseBody(res) 7670 if err := googleapi.CheckResponse(res); err != nil { 7671 return nil, err 7672 } 7673 ret := &User{ 7674 ServerResponse: googleapi.ServerResponse{ 7675 Header: res.Header, 7676 HTTPStatusCode: res.StatusCode, 7677 }, 7678 } 7679 target := &ret 7680 if err := gensupport.DecodeResponse(target, res); err != nil { 7681 return nil, err 7682 } 7683 return ret, nil 7684 // { 7685 // "description": "Gets one user by ID.", 7686 // "httpMethod": "GET", 7687 // "id": "blogger.users.get", 7688 // "parameterOrder": [ 7689 // "userId" 7690 // ], 7691 // "parameters": { 7692 // "userId": { 7693 // "description": "The ID of the user to get.", 7694 // "location": "path", 7695 // "required": true, 7696 // "type": "string" 7697 // } 7698 // }, 7699 // "path": "users/{userId}", 7700 // "response": { 7701 // "$ref": "User" 7702 // }, 7703 // "scopes": [ 7704 // "https://www.googleapis.com/auth/blogger", 7705 // "https://www.googleapis.com/auth/blogger.readonly" 7706 // ] 7707 // } 7708 7709} 7710