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