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