| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
package blogger |
| 52 |
|
| 53 |
import ( |
| 54 |
"bytes" |
| 55 |
"context" |
| 56 |
"encoding/json" |
| 57 |
"errors" |
| 58 |
"fmt" |
| 59 |
"io" |
| 60 |
"log/slog" |
| 61 |
"net/http" |
| 62 |
"net/url" |
| 63 |
"strconv" |
| 64 |
"strings" |
| 65 |
|
| 66 |
"github.com/googleapis/gax-go/v2/internallog" |
| 67 |
googleapi "google.golang.org/api/googleapi" |
| 68 |
internal "google.golang.org/api/internal" |
| 69 |
gensupport "google.golang.org/api/internal/gensupport" |
| 70 |
option "google.golang.org/api/option" |
| 71 |
internaloption "google.golang.org/api/option/internaloption" |
| 72 |
htransport "google.golang.org/api/transport/http" |
| 73 |
) |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
var _ = bytes.NewBuffer |
| 78 |
var _ = strconv.Itoa |
| 79 |
var _ = fmt.Sprintf |
| 80 |
var _ = json.NewDecoder |
| 81 |
var _ = io.Copy |
| 82 |
var _ = url.Parse |
| 83 |
var _ = gensupport.MarshalJSON |
| 84 |
var _ = googleapi.Version |
| 85 |
var _ = errors.New |
| 86 |
var _ = strings.Replace |
| 87 |
var _ = context.Canceled |
| 88 |
var _ = internaloption.WithDefaultEndpoint |
| 89 |
var _ = internal.Version |
| 90 |
var _ = internallog.New |
| 91 |
|
| 92 |
const apiId = "blogger:v2" |
| 93 |
const apiName = "blogger" |
| 94 |
const apiVersion = "v2" |
| 95 |
const basePath = "https://blogger.googleapis.com/" |
| 96 |
const basePathTemplate = "https://blogger.UNIVERSE_DOMAIN/" |
| 97 |
const mtlsBasePath = "https://blogger.mtls.googleapis.com/" |
| 98 |
|
| 99 |
|
| 100 |
const ( |
| 101 |
|
| 102 |
BloggerScope = "https://www.googleapis.com/auth/blogger" |
| 103 |
) |
| 104 |
|
| 105 |
|
| 106 |
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { |
| 107 |
scopesOption := internaloption.WithDefaultScopes( |
| 108 |
"https://www.googleapis.com/auth/blogger", |
| 109 |
) |
| 110 |
|
| 111 |
opts = append([]option.ClientOption{scopesOption}, opts...) |
| 112 |
opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) |
| 113 |
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) |
| 114 |
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) |
| 115 |
opts = append(opts, internaloption.EnableNewAuthLibrary()) |
| 116 |
client, endpoint, err := htransport.NewClient(ctx, opts...) |
| 117 |
if err != nil { |
| 118 |
return nil, err |
| 119 |
} |
| 120 |
s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} |
| 121 |
s.Blogs = NewBlogsService(s) |
| 122 |
s.Comments = NewCommentsService(s) |
| 123 |
s.Pages = NewPagesService(s) |
| 124 |
s.Posts = NewPostsService(s) |
| 125 |
s.Users = NewUsersService(s) |
| 126 |
if endpoint != "" { |
| 127 |
s.BasePath = endpoint |
| 128 |
} |
| 129 |
return s, nil |
| 130 |
} |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
func New(client *http.Client) (*Service, error) { |
| 138 |
if client == nil { |
| 139 |
return nil, errors.New("client is nil") |
| 140 |
} |
| 141 |
return NewService(context.TODO(), option.WithHTTPClient(client)) |
| 142 |
} |
| 143 |
|
| 144 |
type Service struct { |
| 145 |
client *http.Client |
| 146 |
logger *slog.Logger |
| 147 |
BasePath string |
| 148 |
UserAgent string |
| 149 |
|
| 150 |
Blogs *BlogsService |
| 151 |
|
| 152 |
Comments *CommentsService |
| 153 |
|
| 154 |
Pages *PagesService |
| 155 |
|
| 156 |
Posts *PostsService |
| 157 |
|
| 158 |
Users *UsersService |
| 159 |
} |
| 160 |
|
| 161 |
func (s *Service) userAgent() string { |
| 162 |
if s.UserAgent == "" { |
| 163 |
return googleapi.UserAgent |
| 164 |
} |
| 165 |
return googleapi.UserAgent + " " + s.UserAgent |
| 166 |
} |
| 167 |
|
| 168 |
func NewBlogsService(s *Service) *BlogsService { |
| 169 |
rs := &BlogsService{s: s} |
| 170 |
return rs |
| 171 |
} |
| 172 |
|
| 173 |
type BlogsService struct { |
| 174 |
s *Service |
| 175 |
} |
| 176 |
|
| 177 |
func NewCommentsService(s *Service) *CommentsService { |
| 178 |
rs := &CommentsService{s: s} |
| 179 |
return rs |
| 180 |
} |
| 181 |
|
| 182 |
type CommentsService struct { |
| 183 |
s *Service |
| 184 |
} |
| 185 |
|
| 186 |
func NewPagesService(s *Service) *PagesService { |
| 187 |
rs := &PagesService{s: s} |
| 188 |
return rs |
| 189 |
} |
| 190 |
|
| 191 |
type PagesService struct { |
| 192 |
s *Service |
| 193 |
} |
| 194 |
|
| 195 |
func NewPostsService(s *Service) *PostsService { |
| 196 |
rs := &PostsService{s: s} |
| 197 |
return rs |
| 198 |
} |
| 199 |
|
| 200 |
type PostsService struct { |
| 201 |
s *Service |
| 202 |
} |
| 203 |
|
| 204 |
func NewUsersService(s *Service) *UsersService { |
| 205 |
rs := &UsersService{s: s} |
| 206 |
return rs |
| 207 |
} |
| 208 |
|
| 209 |
type UsersService struct { |
| 210 |
s *Service |
| 211 |
} |
| 212 |
|
| 213 |
type Blog struct { |
| 214 |
|
| 215 |
CustomMetaData string `json:"customMetaData,omitempty"` |
| 216 |
|
| 217 |
|
| 218 |
Description string `json:"description,omitempty"` |
| 219 |
|
| 220 |
Id string `json:"id,omitempty"` |
| 221 |
|
| 222 |
Kind string `json:"kind,omitempty"` |
| 223 |
|
| 224 |
Locale *BlogLocale `json:"locale,omitempty"` |
| 225 |
|
| 226 |
Name string `json:"name,omitempty"` |
| 227 |
|
| 228 |
Pages *BlogPages `json:"pages,omitempty"` |
| 229 |
|
| 230 |
Posts *BlogPosts `json:"posts,omitempty"` |
| 231 |
|
| 232 |
Published string `json:"published,omitempty"` |
| 233 |
|
| 234 |
SelfLink string `json:"selfLink,omitempty"` |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
Status string `json:"status,omitempty"` |
| 241 |
|
| 242 |
Updated string `json:"updated,omitempty"` |
| 243 |
|
| 244 |
Url string `json:"url,omitempty"` |
| 245 |
|
| 246 |
|
| 247 |
googleapi.ServerResponse `json:"-"` |
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
ForceSendFields []string `json:"-"` |
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
NullFields []string `json:"-"` |
| 259 |
} |
| 260 |
|
| 261 |
func (s Blog) MarshalJSON() ([]byte, error) { |
| 262 |
type NoMethod Blog |
| 263 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 264 |
} |
| 265 |
|
| 266 |
|
| 267 |
type BlogLocale struct { |
| 268 |
|
| 269 |
Country string `json:"country,omitempty"` |
| 270 |
|
| 271 |
Language string `json:"language,omitempty"` |
| 272 |
|
| 273 |
Variant string `json:"variant,omitempty"` |
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
ForceSendFields []string `json:"-"` |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
NullFields []string `json:"-"` |
| 285 |
} |
| 286 |
|
| 287 |
func (s BlogLocale) MarshalJSON() ([]byte, error) { |
| 288 |
type NoMethod BlogLocale |
| 289 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 290 |
} |
| 291 |
|
| 292 |
|
| 293 |
type BlogPages struct { |
| 294 |
|
| 295 |
SelfLink string `json:"selfLink,omitempty"` |
| 296 |
|
| 297 |
TotalItems int64 `json:"totalItems,omitempty"` |
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
ForceSendFields []string `json:"-"` |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
NullFields []string `json:"-"` |
| 309 |
} |
| 310 |
|
| 311 |
func (s BlogPages) MarshalJSON() ([]byte, error) { |
| 312 |
type NoMethod BlogPages |
| 313 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 314 |
} |
| 315 |
|
| 316 |
|
| 317 |
type BlogPosts struct { |
| 318 |
|
| 319 |
Items []*Post `json:"items,omitempty"` |
| 320 |
|
| 321 |
SelfLink string `json:"selfLink,omitempty"` |
| 322 |
|
| 323 |
TotalItems int64 `json:"totalItems,omitempty"` |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
ForceSendFields []string `json:"-"` |
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
NullFields []string `json:"-"` |
| 335 |
} |
| 336 |
|
| 337 |
func (s BlogPosts) MarshalJSON() ([]byte, error) { |
| 338 |
type NoMethod BlogPosts |
| 339 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 340 |
} |
| 341 |
|
| 342 |
type BlogList struct { |
| 343 |
|
| 344 |
BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"` |
| 345 |
|
| 346 |
Items []*Blog `json:"items,omitempty"` |
| 347 |
|
| 348 |
Kind string `json:"kind,omitempty"` |
| 349 |
|
| 350 |
|
| 351 |
googleapi.ServerResponse `json:"-"` |
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
ForceSendFields []string `json:"-"` |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
NullFields []string `json:"-"` |
| 363 |
} |
| 364 |
|
| 365 |
func (s BlogList) MarshalJSON() ([]byte, error) { |
| 366 |
type NoMethod BlogList |
| 367 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 368 |
} |
| 369 |
|
| 370 |
type BlogPerUserInfo struct { |
| 371 |
|
| 372 |
BlogId string `json:"blogId,omitempty"` |
| 373 |
|
| 374 |
HasAdminAccess bool `json:"hasAdminAccess,omitempty"` |
| 375 |
|
| 376 |
Kind string `json:"kind,omitempty"` |
| 377 |
|
| 378 |
|
| 379 |
PhotosAlbumKey string `json:"photosAlbumKey,omitempty"` |
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
Role string `json:"role,omitempty"` |
| 389 |
|
| 390 |
UserId string `json:"userId,omitempty"` |
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
ForceSendFields []string `json:"-"` |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
NullFields []string `json:"-"` |
| 402 |
} |
| 403 |
|
| 404 |
func (s BlogPerUserInfo) MarshalJSON() ([]byte, error) { |
| 405 |
type NoMethod BlogPerUserInfo |
| 406 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 407 |
} |
| 408 |
|
| 409 |
type BlogUserInfo struct { |
| 410 |
|
| 411 |
Blog *Blog `json:"blog,omitempty"` |
| 412 |
|
| 413 |
BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"` |
| 414 |
|
| 415 |
Kind string `json:"kind,omitempty"` |
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
ForceSendFields []string `json:"-"` |
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
NullFields []string `json:"-"` |
| 427 |
} |
| 428 |
|
| 429 |
func (s BlogUserInfo) MarshalJSON() ([]byte, error) { |
| 430 |
type NoMethod BlogUserInfo |
| 431 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 432 |
} |
| 433 |
|
| 434 |
type Comment struct { |
| 435 |
|
| 436 |
Author *CommentAuthor `json:"author,omitempty"` |
| 437 |
|
| 438 |
Blog *CommentBlog `json:"blog,omitempty"` |
| 439 |
|
| 440 |
Content string `json:"content,omitempty"` |
| 441 |
|
| 442 |
Id string `json:"id,omitempty"` |
| 443 |
|
| 444 |
InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"` |
| 445 |
|
| 446 |
Kind string `json:"kind,omitempty"` |
| 447 |
|
| 448 |
Post *CommentPost `json:"post,omitempty"` |
| 449 |
|
| 450 |
Published string `json:"published,omitempty"` |
| 451 |
|
| 452 |
SelfLink string `json:"selfLink,omitempty"` |
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
Status string `json:"status,omitempty"` |
| 461 |
|
| 462 |
Updated string `json:"updated,omitempty"` |
| 463 |
|
| 464 |
|
| 465 |
googleapi.ServerResponse `json:"-"` |
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
ForceSendFields []string `json:"-"` |
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
NullFields []string `json:"-"` |
| 477 |
} |
| 478 |
|
| 479 |
func (s Comment) MarshalJSON() ([]byte, error) { |
| 480 |
type NoMethod Comment |
| 481 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 482 |
} |
| 483 |
|
| 484 |
|
| 485 |
type CommentAuthor struct { |
| 486 |
|
| 487 |
DisplayName string `json:"displayName,omitempty"` |
| 488 |
|
| 489 |
Id string `json:"id,omitempty"` |
| 490 |
|
| 491 |
Image *CommentAuthorImage `json:"image,omitempty"` |
| 492 |
|
| 493 |
Url string `json:"url,omitempty"` |
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
ForceSendFields []string `json:"-"` |
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
NullFields []string `json:"-"` |
| 505 |
} |
| 506 |
|
| 507 |
func (s CommentAuthor) MarshalJSON() ([]byte, error) { |
| 508 |
type NoMethod CommentAuthor |
| 509 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 510 |
} |
| 511 |
|
| 512 |
|
| 513 |
type CommentAuthorImage struct { |
| 514 |
|
| 515 |
Url string `json:"url,omitempty"` |
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
ForceSendFields []string `json:"-"` |
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
NullFields []string `json:"-"` |
| 527 |
} |
| 528 |
|
| 529 |
func (s CommentAuthorImage) MarshalJSON() ([]byte, error) { |
| 530 |
type NoMethod CommentAuthorImage |
| 531 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 532 |
} |
| 533 |
|
| 534 |
|
| 535 |
type CommentBlog struct { |
| 536 |
|
| 537 |
Id string `json:"id,omitempty"` |
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
ForceSendFields []string `json:"-"` |
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
NullFields []string `json:"-"` |
| 549 |
} |
| 550 |
|
| 551 |
func (s CommentBlog) MarshalJSON() ([]byte, error) { |
| 552 |
type NoMethod CommentBlog |
| 553 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 554 |
} |
| 555 |
|
| 556 |
|
| 557 |
type CommentInReplyTo struct { |
| 558 |
|
| 559 |
Id string `json:"id,omitempty"` |
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
ForceSendFields []string `json:"-"` |
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
NullFields []string `json:"-"` |
| 571 |
} |
| 572 |
|
| 573 |
func (s CommentInReplyTo) MarshalJSON() ([]byte, error) { |
| 574 |
type NoMethod CommentInReplyTo |
| 575 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 576 |
} |
| 577 |
|
| 578 |
|
| 579 |
type CommentPost struct { |
| 580 |
|
| 581 |
Id string `json:"id,omitempty"` |
| 582 |
|
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
ForceSendFields []string `json:"-"` |
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
NullFields []string `json:"-"` |
| 593 |
} |
| 594 |
|
| 595 |
func (s CommentPost) MarshalJSON() ([]byte, error) { |
| 596 |
type NoMethod CommentPost |
| 597 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 598 |
} |
| 599 |
|
| 600 |
type CommentList struct { |
| 601 |
|
| 602 |
Etag string `json:"etag,omitempty"` |
| 603 |
|
| 604 |
Items []*Comment `json:"items,omitempty"` |
| 605 |
|
| 606 |
Kind string `json:"kind,omitempty"` |
| 607 |
|
| 608 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 609 |
|
| 610 |
PrevPageToken string `json:"prevPageToken,omitempty"` |
| 611 |
|
| 612 |
|
| 613 |
googleapi.ServerResponse `json:"-"` |
| 614 |
|
| 615 |
|
| 616 |
|
| 617 |
|
| 618 |
|
| 619 |
ForceSendFields []string `json:"-"` |
| 620 |
|
| 621 |
|
| 622 |
|
| 623 |
|
| 624 |
NullFields []string `json:"-"` |
| 625 |
} |
| 626 |
|
| 627 |
func (s CommentList) MarshalJSON() ([]byte, error) { |
| 628 |
type NoMethod CommentList |
| 629 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 630 |
} |
| 631 |
|
| 632 |
type Page struct { |
| 633 |
|
| 634 |
Author *PageAuthor `json:"author,omitempty"` |
| 635 |
|
| 636 |
Blog *PageBlog `json:"blog,omitempty"` |
| 637 |
|
| 638 |
Content string `json:"content,omitempty"` |
| 639 |
|
| 640 |
Etag string `json:"etag,omitempty"` |
| 641 |
|
| 642 |
Id string `json:"id,omitempty"` |
| 643 |
|
| 644 |
Kind string `json:"kind,omitempty"` |
| 645 |
|
| 646 |
Published string `json:"published,omitempty"` |
| 647 |
|
| 648 |
SelfLink string `json:"selfLink,omitempty"` |
| 649 |
|
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
Status string `json:"status,omitempty"` |
| 656 |
|
| 657 |
|
| 658 |
Title string `json:"title,omitempty"` |
| 659 |
|
| 660 |
Trashed string `json:"trashed,omitempty"` |
| 661 |
|
| 662 |
Updated string `json:"updated,omitempty"` |
| 663 |
|
| 664 |
Url string `json:"url,omitempty"` |
| 665 |
|
| 666 |
|
| 667 |
googleapi.ServerResponse `json:"-"` |
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
ForceSendFields []string `json:"-"` |
| 674 |
|
| 675 |
|
| 676 |
|
| 677 |
|
| 678 |
NullFields []string `json:"-"` |
| 679 |
} |
| 680 |
|
| 681 |
func (s Page) MarshalJSON() ([]byte, error) { |
| 682 |
type NoMethod Page |
| 683 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 684 |
} |
| 685 |
|
| 686 |
|
| 687 |
type PageAuthor struct { |
| 688 |
|
| 689 |
DisplayName string `json:"displayName,omitempty"` |
| 690 |
|
| 691 |
Id string `json:"id,omitempty"` |
| 692 |
|
| 693 |
Image *PageAuthorImage `json:"image,omitempty"` |
| 694 |
|
| 695 |
Url string `json:"url,omitempty"` |
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
ForceSendFields []string `json:"-"` |
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
NullFields []string `json:"-"` |
| 707 |
} |
| 708 |
|
| 709 |
func (s PageAuthor) MarshalJSON() ([]byte, error) { |
| 710 |
type NoMethod PageAuthor |
| 711 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 712 |
} |
| 713 |
|
| 714 |
|
| 715 |
type PageAuthorImage struct { |
| 716 |
|
| 717 |
Url string `json:"url,omitempty"` |
| 718 |
|
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
ForceSendFields []string `json:"-"` |
| 724 |
|
| 725 |
|
| 726 |
|
| 727 |
|
| 728 |
NullFields []string `json:"-"` |
| 729 |
} |
| 730 |
|
| 731 |
func (s PageAuthorImage) MarshalJSON() ([]byte, error) { |
| 732 |
type NoMethod PageAuthorImage |
| 733 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 734 |
} |
| 735 |
|
| 736 |
|
| 737 |
type PageBlog struct { |
| 738 |
|
| 739 |
Id string `json:"id,omitempty"` |
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
|
| 744 |
|
| 745 |
ForceSendFields []string `json:"-"` |
| 746 |
|
| 747 |
|
| 748 |
|
| 749 |
|
| 750 |
NullFields []string `json:"-"` |
| 751 |
} |
| 752 |
|
| 753 |
func (s PageBlog) MarshalJSON() ([]byte, error) { |
| 754 |
type NoMethod PageBlog |
| 755 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 756 |
} |
| 757 |
|
| 758 |
type PageList struct { |
| 759 |
|
| 760 |
Etag string `json:"etag,omitempty"` |
| 761 |
|
| 762 |
Items []*Page `json:"items,omitempty"` |
| 763 |
|
| 764 |
Kind string `json:"kind,omitempty"` |
| 765 |
|
| 766 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 767 |
|
| 768 |
|
| 769 |
googleapi.ServerResponse `json:"-"` |
| 770 |
|
| 771 |
|
| 772 |
|
| 773 |
|
| 774 |
|
| 775 |
ForceSendFields []string `json:"-"` |
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
NullFields []string `json:"-"` |
| 781 |
} |
| 782 |
|
| 783 |
func (s PageList) MarshalJSON() ([]byte, error) { |
| 784 |
type NoMethod PageList |
| 785 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 786 |
} |
| 787 |
|
| 788 |
type Post struct { |
| 789 |
|
| 790 |
Author *PostAuthor `json:"author,omitempty"` |
| 791 |
|
| 792 |
Blog *PostBlog `json:"blog,omitempty"` |
| 793 |
|
| 794 |
Content string `json:"content,omitempty"` |
| 795 |
|
| 796 |
CustomMetaData string `json:"customMetaData,omitempty"` |
| 797 |
|
| 798 |
Etag string `json:"etag,omitempty"` |
| 799 |
|
| 800 |
Id string `json:"id,omitempty"` |
| 801 |
|
| 802 |
Images []*PostImages `json:"images,omitempty"` |
| 803 |
|
| 804 |
Kind string `json:"kind,omitempty"` |
| 805 |
|
| 806 |
Labels []string `json:"labels,omitempty"` |
| 807 |
|
| 808 |
Location *PostLocation `json:"location,omitempty"` |
| 809 |
|
| 810 |
Published string `json:"published,omitempty"` |
| 811 |
|
| 812 |
|
| 813 |
|
| 814 |
|
| 815 |
|
| 816 |
|
| 817 |
|
| 818 |
ReaderComments string `json:"readerComments,omitempty"` |
| 819 |
|
| 820 |
Replies *PostReplies `json:"replies,omitempty"` |
| 821 |
|
| 822 |
SelfLink string `json:"selfLink,omitempty"` |
| 823 |
|
| 824 |
|
| 825 |
|
| 826 |
|
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
Status string `json:"status,omitempty"` |
| 831 |
|
| 832 |
Title string `json:"title,omitempty"` |
| 833 |
|
| 834 |
TitleLink string `json:"titleLink,omitempty"` |
| 835 |
|
| 836 |
Trashed string `json:"trashed,omitempty"` |
| 837 |
|
| 838 |
Updated string `json:"updated,omitempty"` |
| 839 |
|
| 840 |
Url string `json:"url,omitempty"` |
| 841 |
|
| 842 |
|
| 843 |
googleapi.ServerResponse `json:"-"` |
| 844 |
|
| 845 |
|
| 846 |
|
| 847 |
|
| 848 |
|
| 849 |
ForceSendFields []string `json:"-"` |
| 850 |
|
| 851 |
|
| 852 |
|
| 853 |
|
| 854 |
NullFields []string `json:"-"` |
| 855 |
} |
| 856 |
|
| 857 |
func (s Post) MarshalJSON() ([]byte, error) { |
| 858 |
type NoMethod Post |
| 859 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 860 |
} |
| 861 |
|
| 862 |
|
| 863 |
type PostAuthor struct { |
| 864 |
|
| 865 |
DisplayName string `json:"displayName,omitempty"` |
| 866 |
|
| 867 |
Id string `json:"id,omitempty"` |
| 868 |
|
| 869 |
Image *PostAuthorImage `json:"image,omitempty"` |
| 870 |
|
| 871 |
Url string `json:"url,omitempty"` |
| 872 |
|
| 873 |
|
| 874 |
|
| 875 |
|
| 876 |
|
| 877 |
ForceSendFields []string `json:"-"` |
| 878 |
|
| 879 |
|
| 880 |
|
| 881 |
|
| 882 |
NullFields []string `json:"-"` |
| 883 |
} |
| 884 |
|
| 885 |
func (s PostAuthor) MarshalJSON() ([]byte, error) { |
| 886 |
type NoMethod PostAuthor |
| 887 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 888 |
} |
| 889 |
|
| 890 |
|
| 891 |
type PostAuthorImage struct { |
| 892 |
|
| 893 |
Url string `json:"url,omitempty"` |
| 894 |
|
| 895 |
|
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
ForceSendFields []string `json:"-"` |
| 900 |
|
| 901 |
|
| 902 |
|
| 903 |
|
| 904 |
NullFields []string `json:"-"` |
| 905 |
} |
| 906 |
|
| 907 |
func (s PostAuthorImage) MarshalJSON() ([]byte, error) { |
| 908 |
type NoMethod PostAuthorImage |
| 909 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 910 |
} |
| 911 |
|
| 912 |
|
| 913 |
type PostBlog struct { |
| 914 |
|
| 915 |
Id string `json:"id,omitempty"` |
| 916 |
|
| 917 |
|
| 918 |
|
| 919 |
|
| 920 |
|
| 921 |
ForceSendFields []string `json:"-"` |
| 922 |
|
| 923 |
|
| 924 |
|
| 925 |
|
| 926 |
NullFields []string `json:"-"` |
| 927 |
} |
| 928 |
|
| 929 |
func (s PostBlog) MarshalJSON() ([]byte, error) { |
| 930 |
type NoMethod PostBlog |
| 931 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 932 |
} |
| 933 |
|
| 934 |
type PostImages struct { |
| 935 |
Url string `json:"url,omitempty"` |
| 936 |
|
| 937 |
|
| 938 |
|
| 939 |
|
| 940 |
|
| 941 |
ForceSendFields []string `json:"-"` |
| 942 |
|
| 943 |
|
| 944 |
|
| 945 |
|
| 946 |
NullFields []string `json:"-"` |
| 947 |
} |
| 948 |
|
| 949 |
func (s PostImages) MarshalJSON() ([]byte, error) { |
| 950 |
type NoMethod PostImages |
| 951 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 952 |
} |
| 953 |
|
| 954 |
|
| 955 |
type PostLocation struct { |
| 956 |
|
| 957 |
Lat float64 `json:"lat,omitempty"` |
| 958 |
|
| 959 |
Lng float64 `json:"lng,omitempty"` |
| 960 |
|
| 961 |
Name string `json:"name,omitempty"` |
| 962 |
|
| 963 |
Span string `json:"span,omitempty"` |
| 964 |
|
| 965 |
|
| 966 |
|
| 967 |
|
| 968 |
|
| 969 |
ForceSendFields []string `json:"-"` |
| 970 |
|
| 971 |
|
| 972 |
|
| 973 |
|
| 974 |
NullFields []string `json:"-"` |
| 975 |
} |
| 976 |
|
| 977 |
func (s PostLocation) MarshalJSON() ([]byte, error) { |
| 978 |
type NoMethod PostLocation |
| 979 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 980 |
} |
| 981 |
|
| 982 |
func (s *PostLocation) UnmarshalJSON(data []byte) error { |
| 983 |
type NoMethod PostLocation |
| 984 |
var s1 struct { |
| 985 |
Lat gensupport.JSONFloat64 `json:"lat"` |
| 986 |
Lng gensupport.JSONFloat64 `json:"lng"` |
| 987 |
*NoMethod |
| 988 |
} |
| 989 |
s1.NoMethod = (*NoMethod)(s) |
| 990 |
if err := json.Unmarshal(data, &s1); err != nil { |
| 991 |
return err |
| 992 |
} |
| 993 |
s.Lat = float64(s1.Lat) |
| 994 |
s.Lng = float64(s1.Lng) |
| 995 |
return nil |
| 996 |
} |
| 997 |
|
| 998 |
|
| 999 |
type PostReplies struct { |
| 1000 |
|
| 1001 |
Items []*Comment `json:"items,omitempty"` |
| 1002 |
|
| 1003 |
SelfLink string `json:"selfLink,omitempty"` |
| 1004 |
|
| 1005 |
TotalItems int64 `json:"totalItems,omitempty,string"` |
| 1006 |
|
| 1007 |
|
| 1008 |
|
| 1009 |
|
| 1010 |
|
| 1011 |
ForceSendFields []string `json:"-"` |
| 1012 |
|
| 1013 |
|
| 1014 |
|
| 1015 |
|
| 1016 |
NullFields []string `json:"-"` |
| 1017 |
} |
| 1018 |
|
| 1019 |
func (s PostReplies) MarshalJSON() ([]byte, error) { |
| 1020 |
type NoMethod PostReplies |
| 1021 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1022 |
} |
| 1023 |
|
| 1024 |
type PostList struct { |
| 1025 |
|
| 1026 |
Etag string `json:"etag,omitempty"` |
| 1027 |
|
| 1028 |
Items []*Post `json:"items,omitempty"` |
| 1029 |
|
| 1030 |
Kind string `json:"kind,omitempty"` |
| 1031 |
|
| 1032 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 1033 |
|
| 1034 |
PrevPageToken string `json:"prevPageToken,omitempty"` |
| 1035 |
|
| 1036 |
|
| 1037 |
googleapi.ServerResponse `json:"-"` |
| 1038 |
|
| 1039 |
|
| 1040 |
|
| 1041 |
|
| 1042 |
|
| 1043 |
ForceSendFields []string `json:"-"` |
| 1044 |
|
| 1045 |
|
| 1046 |
|
| 1047 |
|
| 1048 |
NullFields []string `json:"-"` |
| 1049 |
} |
| 1050 |
|
| 1051 |
func (s PostList) MarshalJSON() ([]byte, error) { |
| 1052 |
type NoMethod PostList |
| 1053 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1054 |
} |
| 1055 |
|
| 1056 |
type User struct { |
| 1057 |
|
| 1058 |
About string `json:"about,omitempty"` |
| 1059 |
|
| 1060 |
Blogs *UserBlogs `json:"blogs,omitempty"` |
| 1061 |
|
| 1062 |
|
| 1063 |
Created string `json:"created,omitempty"` |
| 1064 |
|
| 1065 |
DisplayName string `json:"displayName,omitempty"` |
| 1066 |
|
| 1067 |
Id string `json:"id,omitempty"` |
| 1068 |
|
| 1069 |
Kind string `json:"kind,omitempty"` |
| 1070 |
|
| 1071 |
Locale *UserLocale `json:"locale,omitempty"` |
| 1072 |
|
| 1073 |
SelfLink string `json:"selfLink,omitempty"` |
| 1074 |
|
| 1075 |
Url string `json:"url,omitempty"` |
| 1076 |
|
| 1077 |
|
| 1078 |
googleapi.ServerResponse `json:"-"` |
| 1079 |
|
| 1080 |
|
| 1081 |
|
| 1082 |
|
| 1083 |
|
| 1084 |
ForceSendFields []string `json:"-"` |
| 1085 |
|
| 1086 |
|
| 1087 |
|
| 1088 |
|
| 1089 |
NullFields []string `json:"-"` |
| 1090 |
} |
| 1091 |
|
| 1092 |
func (s User) MarshalJSON() ([]byte, error) { |
| 1093 |
type NoMethod User |
| 1094 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1095 |
} |
| 1096 |
|
| 1097 |
|
| 1098 |
type UserBlogs struct { |
| 1099 |
|
| 1100 |
SelfLink string `json:"selfLink,omitempty"` |
| 1101 |
|
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
|
| 1106 |
ForceSendFields []string `json:"-"` |
| 1107 |
|
| 1108 |
|
| 1109 |
|
| 1110 |
|
| 1111 |
NullFields []string `json:"-"` |
| 1112 |
} |
| 1113 |
|
| 1114 |
func (s UserBlogs) MarshalJSON() ([]byte, error) { |
| 1115 |
type NoMethod UserBlogs |
| 1116 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1117 |
} |
| 1118 |
|
| 1119 |
|
| 1120 |
type UserLocale struct { |
| 1121 |
|
| 1122 |
Country string `json:"country,omitempty"` |
| 1123 |
|
| 1124 |
Language string `json:"language,omitempty"` |
| 1125 |
|
| 1126 |
Variant string `json:"variant,omitempty"` |
| 1127 |
|
| 1128 |
|
| 1129 |
|
| 1130 |
|
| 1131 |
|
| 1132 |
ForceSendFields []string `json:"-"` |
| 1133 |
|
| 1134 |
|
| 1135 |
|
| 1136 |
|
| 1137 |
NullFields []string `json:"-"` |
| 1138 |
} |
| 1139 |
|
| 1140 |
func (s UserLocale) MarshalJSON() ([]byte, error) { |
| 1141 |
type NoMethod UserLocale |
| 1142 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1143 |
} |
| 1144 |
|
| 1145 |
type BlogsGetCall struct { |
| 1146 |
s *Service |
| 1147 |
blogId string |
| 1148 |
urlParams_ gensupport.URLParams |
| 1149 |
ifNoneMatch_ string |
| 1150 |
ctx_ context.Context |
| 1151 |
header_ http.Header |
| 1152 |
} |
| 1153 |
|
| 1154 |
|
| 1155 |
|
| 1156 |
|
| 1157 |
func (r *BlogsService) Get(blogId string) *BlogsGetCall { |
| 1158 |
c := &BlogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1159 |
c.blogId = blogId |
| 1160 |
return c |
| 1161 |
} |
| 1162 |
|
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 |
func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { |
| 1167 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1168 |
return c |
| 1169 |
} |
| 1170 |
|
| 1171 |
|
| 1172 |
|
| 1173 |
|
| 1174 |
func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { |
| 1175 |
c.ifNoneMatch_ = entityTag |
| 1176 |
return c |
| 1177 |
} |
| 1178 |
|
| 1179 |
|
| 1180 |
func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { |
| 1181 |
c.ctx_ = ctx |
| 1182 |
return c |
| 1183 |
} |
| 1184 |
|
| 1185 |
|
| 1186 |
|
| 1187 |
func (c *BlogsGetCall) Header() http.Header { |
| 1188 |
if c.header_ == nil { |
| 1189 |
c.header_ = make(http.Header) |
| 1190 |
} |
| 1191 |
return c.header_ |
| 1192 |
} |
| 1193 |
|
| 1194 |
func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { |
| 1195 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1196 |
if c.ifNoneMatch_ != "" { |
| 1197 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1198 |
} |
| 1199 |
c.urlParams_.Set("alt", alt) |
| 1200 |
c.urlParams_.Set("prettyPrint", "false") |
| 1201 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}") |
| 1202 |
urls += "?" + c.urlParams_.Encode() |
| 1203 |
req, err := http.NewRequest("GET", urls, nil) |
| 1204 |
if err != nil { |
| 1205 |
return nil, err |
| 1206 |
} |
| 1207 |
req.Header = reqHeaders |
| 1208 |
googleapi.Expand(req.URL, map[string]string{ |
| 1209 |
"blogId": c.blogId, |
| 1210 |
}) |
| 1211 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.blogs.get", "request", internallog.HTTPRequest(req, nil)) |
| 1212 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1213 |
} |
| 1214 |
|
| 1215 |
|
| 1216 |
|
| 1217 |
|
| 1218 |
|
| 1219 |
|
| 1220 |
func (c *BlogsGetCall) Do(opts ...googleapi.CallOption) (*Blog, error) { |
| 1221 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1222 |
res, err := c.doRequest("json") |
| 1223 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1224 |
if res.Body != nil { |
| 1225 |
res.Body.Close() |
| 1226 |
} |
| 1227 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1228 |
Code: res.StatusCode, |
| 1229 |
Header: res.Header, |
| 1230 |
}) |
| 1231 |
} |
| 1232 |
if err != nil { |
| 1233 |
return nil, err |
| 1234 |
} |
| 1235 |
defer googleapi.CloseBody(res) |
| 1236 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1237 |
return nil, gensupport.WrapError(err) |
| 1238 |
} |
| 1239 |
ret := &Blog{ |
| 1240 |
ServerResponse: googleapi.ServerResponse{ |
| 1241 |
Header: res.Header, |
| 1242 |
HTTPStatusCode: res.StatusCode, |
| 1243 |
}, |
| 1244 |
} |
| 1245 |
target := &ret |
| 1246 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1247 |
if err != nil { |
| 1248 |
return nil, err |
| 1249 |
} |
| 1250 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.blogs.get", "response", internallog.HTTPResponse(res, b)) |
| 1251 |
return ret, nil |
| 1252 |
} |
| 1253 |
|
| 1254 |
type BlogsListCall struct { |
| 1255 |
s *Service |
| 1256 |
userId string |
| 1257 |
urlParams_ gensupport.URLParams |
| 1258 |
ifNoneMatch_ string |
| 1259 |
ctx_ context.Context |
| 1260 |
header_ http.Header |
| 1261 |
} |
| 1262 |
|
| 1263 |
|
| 1264 |
|
| 1265 |
|
| 1266 |
func (r *BlogsService) List(userId string) *BlogsListCall { |
| 1267 |
c := &BlogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1268 |
c.userId = userId |
| 1269 |
return c |
| 1270 |
} |
| 1271 |
|
| 1272 |
|
| 1273 |
|
| 1274 |
|
| 1275 |
func (c *BlogsListCall) Fields(s ...googleapi.Field) *BlogsListCall { |
| 1276 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1277 |
return c |
| 1278 |
} |
| 1279 |
|
| 1280 |
|
| 1281 |
|
| 1282 |
|
| 1283 |
func (c *BlogsListCall) IfNoneMatch(entityTag string) *BlogsListCall { |
| 1284 |
c.ifNoneMatch_ = entityTag |
| 1285 |
return c |
| 1286 |
} |
| 1287 |
|
| 1288 |
|
| 1289 |
func (c *BlogsListCall) Context(ctx context.Context) *BlogsListCall { |
| 1290 |
c.ctx_ = ctx |
| 1291 |
return c |
| 1292 |
} |
| 1293 |
|
| 1294 |
|
| 1295 |
|
| 1296 |
func (c *BlogsListCall) Header() http.Header { |
| 1297 |
if c.header_ == nil { |
| 1298 |
c.header_ = make(http.Header) |
| 1299 |
} |
| 1300 |
return c.header_ |
| 1301 |
} |
| 1302 |
|
| 1303 |
func (c *BlogsListCall) doRequest(alt string) (*http.Response, error) { |
| 1304 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1305 |
if c.ifNoneMatch_ != "" { |
| 1306 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1307 |
} |
| 1308 |
c.urlParams_.Set("alt", alt) |
| 1309 |
c.urlParams_.Set("prettyPrint", "false") |
| 1310 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/blogs") |
| 1311 |
urls += "?" + c.urlParams_.Encode() |
| 1312 |
req, err := http.NewRequest("GET", urls, nil) |
| 1313 |
if err != nil { |
| 1314 |
return nil, err |
| 1315 |
} |
| 1316 |
req.Header = reqHeaders |
| 1317 |
googleapi.Expand(req.URL, map[string]string{ |
| 1318 |
"userId": c.userId, |
| 1319 |
}) |
| 1320 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.blogs.list", "request", internallog.HTTPRequest(req, nil)) |
| 1321 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1322 |
} |
| 1323 |
|
| 1324 |
|
| 1325 |
|
| 1326 |
|
| 1327 |
|
| 1328 |
|
| 1329 |
func (c *BlogsListCall) Do(opts ...googleapi.CallOption) (*BlogList, error) { |
| 1330 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1331 |
res, err := c.doRequest("json") |
| 1332 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1333 |
if res.Body != nil { |
| 1334 |
res.Body.Close() |
| 1335 |
} |
| 1336 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1337 |
Code: res.StatusCode, |
| 1338 |
Header: res.Header, |
| 1339 |
}) |
| 1340 |
} |
| 1341 |
if err != nil { |
| 1342 |
return nil, err |
| 1343 |
} |
| 1344 |
defer googleapi.CloseBody(res) |
| 1345 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1346 |
return nil, gensupport.WrapError(err) |
| 1347 |
} |
| 1348 |
ret := &BlogList{ |
| 1349 |
ServerResponse: googleapi.ServerResponse{ |
| 1350 |
Header: res.Header, |
| 1351 |
HTTPStatusCode: res.StatusCode, |
| 1352 |
}, |
| 1353 |
} |
| 1354 |
target := &ret |
| 1355 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1356 |
if err != nil { |
| 1357 |
return nil, err |
| 1358 |
} |
| 1359 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.blogs.list", "response", internallog.HTTPResponse(res, b)) |
| 1360 |
return ret, nil |
| 1361 |
} |
| 1362 |
|
| 1363 |
type CommentsGetCall struct { |
| 1364 |
s *Service |
| 1365 |
blogId string |
| 1366 |
postId string |
| 1367 |
commentId string |
| 1368 |
urlParams_ gensupport.URLParams |
| 1369 |
ifNoneMatch_ string |
| 1370 |
ctx_ context.Context |
| 1371 |
header_ http.Header |
| 1372 |
} |
| 1373 |
|
| 1374 |
|
| 1375 |
|
| 1376 |
|
| 1377 |
|
| 1378 |
|
| 1379 |
func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall { |
| 1380 |
c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1381 |
c.blogId = blogId |
| 1382 |
c.postId = postId |
| 1383 |
c.commentId = commentId |
| 1384 |
return c |
| 1385 |
} |
| 1386 |
|
| 1387 |
|
| 1388 |
|
| 1389 |
|
| 1390 |
func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { |
| 1391 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1392 |
return c |
| 1393 |
} |
| 1394 |
|
| 1395 |
|
| 1396 |
|
| 1397 |
|
| 1398 |
func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { |
| 1399 |
c.ifNoneMatch_ = entityTag |
| 1400 |
return c |
| 1401 |
} |
| 1402 |
|
| 1403 |
|
| 1404 |
func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { |
| 1405 |
c.ctx_ = ctx |
| 1406 |
return c |
| 1407 |
} |
| 1408 |
|
| 1409 |
|
| 1410 |
|
| 1411 |
func (c *CommentsGetCall) Header() http.Header { |
| 1412 |
if c.header_ == nil { |
| 1413 |
c.header_ = make(http.Header) |
| 1414 |
} |
| 1415 |
return c.header_ |
| 1416 |
} |
| 1417 |
|
| 1418 |
func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { |
| 1419 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1420 |
if c.ifNoneMatch_ != "" { |
| 1421 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1422 |
} |
| 1423 |
c.urlParams_.Set("alt", alt) |
| 1424 |
c.urlParams_.Set("prettyPrint", "false") |
| 1425 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments/{commentId}") |
| 1426 |
urls += "?" + c.urlParams_.Encode() |
| 1427 |
req, err := http.NewRequest("GET", urls, nil) |
| 1428 |
if err != nil { |
| 1429 |
return nil, err |
| 1430 |
} |
| 1431 |
req.Header = reqHeaders |
| 1432 |
googleapi.Expand(req.URL, map[string]string{ |
| 1433 |
"blogId": c.blogId, |
| 1434 |
"postId": c.postId, |
| 1435 |
"commentId": c.commentId, |
| 1436 |
}) |
| 1437 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.comments.get", "request", internallog.HTTPRequest(req, nil)) |
| 1438 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1439 |
} |
| 1440 |
|
| 1441 |
|
| 1442 |
|
| 1443 |
|
| 1444 |
|
| 1445 |
|
| 1446 |
func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) { |
| 1447 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1448 |
res, err := c.doRequest("json") |
| 1449 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1450 |
if res.Body != nil { |
| 1451 |
res.Body.Close() |
| 1452 |
} |
| 1453 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1454 |
Code: res.StatusCode, |
| 1455 |
Header: res.Header, |
| 1456 |
}) |
| 1457 |
} |
| 1458 |
if err != nil { |
| 1459 |
return nil, err |
| 1460 |
} |
| 1461 |
defer googleapi.CloseBody(res) |
| 1462 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1463 |
return nil, gensupport.WrapError(err) |
| 1464 |
} |
| 1465 |
ret := &Comment{ |
| 1466 |
ServerResponse: googleapi.ServerResponse{ |
| 1467 |
Header: res.Header, |
| 1468 |
HTTPStatusCode: res.StatusCode, |
| 1469 |
}, |
| 1470 |
} |
| 1471 |
target := &ret |
| 1472 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1473 |
if err != nil { |
| 1474 |
return nil, err |
| 1475 |
} |
| 1476 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.comments.get", "response", internallog.HTTPResponse(res, b)) |
| 1477 |
return ret, nil |
| 1478 |
} |
| 1479 |
|
| 1480 |
type CommentsListCall struct { |
| 1481 |
s *Service |
| 1482 |
blogId string |
| 1483 |
postId string |
| 1484 |
urlParams_ gensupport.URLParams |
| 1485 |
ifNoneMatch_ string |
| 1486 |
ctx_ context.Context |
| 1487 |
header_ http.Header |
| 1488 |
} |
| 1489 |
|
| 1490 |
|
| 1491 |
|
| 1492 |
|
| 1493 |
|
| 1494 |
func (r *CommentsService) List(blogId string, postId string) *CommentsListCall { |
| 1495 |
c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1496 |
c.blogId = blogId |
| 1497 |
c.postId = postId |
| 1498 |
return c |
| 1499 |
} |
| 1500 |
|
| 1501 |
|
| 1502 |
func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall { |
| 1503 |
c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) |
| 1504 |
return c |
| 1505 |
} |
| 1506 |
|
| 1507 |
|
| 1508 |
func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { |
| 1509 |
c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) |
| 1510 |
return c |
| 1511 |
} |
| 1512 |
|
| 1513 |
|
| 1514 |
func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { |
| 1515 |
c.urlParams_.Set("pageToken", pageToken) |
| 1516 |
return c |
| 1517 |
} |
| 1518 |
|
| 1519 |
|
| 1520 |
func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall { |
| 1521 |
c.urlParams_.Set("startDate", startDate) |
| 1522 |
return c |
| 1523 |
} |
| 1524 |
|
| 1525 |
|
| 1526 |
|
| 1527 |
|
| 1528 |
func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { |
| 1529 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1530 |
return c |
| 1531 |
} |
| 1532 |
|
| 1533 |
|
| 1534 |
|
| 1535 |
|
| 1536 |
func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { |
| 1537 |
c.ifNoneMatch_ = entityTag |
| 1538 |
return c |
| 1539 |
} |
| 1540 |
|
| 1541 |
|
| 1542 |
func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { |
| 1543 |
c.ctx_ = ctx |
| 1544 |
return c |
| 1545 |
} |
| 1546 |
|
| 1547 |
|
| 1548 |
|
| 1549 |
func (c *CommentsListCall) Header() http.Header { |
| 1550 |
if c.header_ == nil { |
| 1551 |
c.header_ = make(http.Header) |
| 1552 |
} |
| 1553 |
return c.header_ |
| 1554 |
} |
| 1555 |
|
| 1556 |
func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { |
| 1557 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1558 |
if c.ifNoneMatch_ != "" { |
| 1559 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1560 |
} |
| 1561 |
c.urlParams_.Set("alt", alt) |
| 1562 |
c.urlParams_.Set("prettyPrint", "false") |
| 1563 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}/comments") |
| 1564 |
urls += "?" + c.urlParams_.Encode() |
| 1565 |
req, err := http.NewRequest("GET", urls, nil) |
| 1566 |
if err != nil { |
| 1567 |
return nil, err |
| 1568 |
} |
| 1569 |
req.Header = reqHeaders |
| 1570 |
googleapi.Expand(req.URL, map[string]string{ |
| 1571 |
"blogId": c.blogId, |
| 1572 |
"postId": c.postId, |
| 1573 |
}) |
| 1574 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.comments.list", "request", internallog.HTTPRequest(req, nil)) |
| 1575 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1576 |
} |
| 1577 |
|
| 1578 |
|
| 1579 |
|
| 1580 |
|
| 1581 |
|
| 1582 |
|
| 1583 |
func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { |
| 1584 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1585 |
res, err := c.doRequest("json") |
| 1586 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1587 |
if res.Body != nil { |
| 1588 |
res.Body.Close() |
| 1589 |
} |
| 1590 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1591 |
Code: res.StatusCode, |
| 1592 |
Header: res.Header, |
| 1593 |
}) |
| 1594 |
} |
| 1595 |
if err != nil { |
| 1596 |
return nil, err |
| 1597 |
} |
| 1598 |
defer googleapi.CloseBody(res) |
| 1599 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1600 |
return nil, gensupport.WrapError(err) |
| 1601 |
} |
| 1602 |
ret := &CommentList{ |
| 1603 |
ServerResponse: googleapi.ServerResponse{ |
| 1604 |
Header: res.Header, |
| 1605 |
HTTPStatusCode: res.StatusCode, |
| 1606 |
}, |
| 1607 |
} |
| 1608 |
target := &ret |
| 1609 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1610 |
if err != nil { |
| 1611 |
return nil, err |
| 1612 |
} |
| 1613 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.comments.list", "response", internallog.HTTPResponse(res, b)) |
| 1614 |
return ret, nil |
| 1615 |
} |
| 1616 |
|
| 1617 |
|
| 1618 |
|
| 1619 |
|
| 1620 |
func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error { |
| 1621 |
c.ctx_ = ctx |
| 1622 |
defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 1623 |
for { |
| 1624 |
x, err := c.Do() |
| 1625 |
if err != nil { |
| 1626 |
return err |
| 1627 |
} |
| 1628 |
if err := f(x); err != nil { |
| 1629 |
return err |
| 1630 |
} |
| 1631 |
if x.NextPageToken == "" { |
| 1632 |
return nil |
| 1633 |
} |
| 1634 |
c.PageToken(x.NextPageToken) |
| 1635 |
} |
| 1636 |
} |
| 1637 |
|
| 1638 |
type PagesGetCall struct { |
| 1639 |
s *Service |
| 1640 |
blogId string |
| 1641 |
pageId string |
| 1642 |
urlParams_ gensupport.URLParams |
| 1643 |
ifNoneMatch_ string |
| 1644 |
ctx_ context.Context |
| 1645 |
header_ http.Header |
| 1646 |
} |
| 1647 |
|
| 1648 |
|
| 1649 |
|
| 1650 |
|
| 1651 |
|
| 1652 |
func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall { |
| 1653 |
c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1654 |
c.blogId = blogId |
| 1655 |
c.pageId = pageId |
| 1656 |
return c |
| 1657 |
} |
| 1658 |
|
| 1659 |
|
| 1660 |
|
| 1661 |
|
| 1662 |
func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { |
| 1663 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1664 |
return c |
| 1665 |
} |
| 1666 |
|
| 1667 |
|
| 1668 |
|
| 1669 |
|
| 1670 |
func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { |
| 1671 |
c.ifNoneMatch_ = entityTag |
| 1672 |
return c |
| 1673 |
} |
| 1674 |
|
| 1675 |
|
| 1676 |
func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { |
| 1677 |
c.ctx_ = ctx |
| 1678 |
return c |
| 1679 |
} |
| 1680 |
|
| 1681 |
|
| 1682 |
|
| 1683 |
func (c *PagesGetCall) Header() http.Header { |
| 1684 |
if c.header_ == nil { |
| 1685 |
c.header_ = make(http.Header) |
| 1686 |
} |
| 1687 |
return c.header_ |
| 1688 |
} |
| 1689 |
|
| 1690 |
func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { |
| 1691 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1692 |
if c.ifNoneMatch_ != "" { |
| 1693 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1694 |
} |
| 1695 |
c.urlParams_.Set("alt", alt) |
| 1696 |
c.urlParams_.Set("prettyPrint", "false") |
| 1697 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages/{pageId}") |
| 1698 |
urls += "?" + c.urlParams_.Encode() |
| 1699 |
req, err := http.NewRequest("GET", urls, nil) |
| 1700 |
if err != nil { |
| 1701 |
return nil, err |
| 1702 |
} |
| 1703 |
req.Header = reqHeaders |
| 1704 |
googleapi.Expand(req.URL, map[string]string{ |
| 1705 |
"blogId": c.blogId, |
| 1706 |
"pageId": c.pageId, |
| 1707 |
}) |
| 1708 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.pages.get", "request", internallog.HTTPRequest(req, nil)) |
| 1709 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1710 |
} |
| 1711 |
|
| 1712 |
|
| 1713 |
|
| 1714 |
|
| 1715 |
|
| 1716 |
|
| 1717 |
func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*Page, error) { |
| 1718 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1719 |
res, err := c.doRequest("json") |
| 1720 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1721 |
if res.Body != nil { |
| 1722 |
res.Body.Close() |
| 1723 |
} |
| 1724 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1725 |
Code: res.StatusCode, |
| 1726 |
Header: res.Header, |
| 1727 |
}) |
| 1728 |
} |
| 1729 |
if err != nil { |
| 1730 |
return nil, err |
| 1731 |
} |
| 1732 |
defer googleapi.CloseBody(res) |
| 1733 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1734 |
return nil, gensupport.WrapError(err) |
| 1735 |
} |
| 1736 |
ret := &Page{ |
| 1737 |
ServerResponse: googleapi.ServerResponse{ |
| 1738 |
Header: res.Header, |
| 1739 |
HTTPStatusCode: res.StatusCode, |
| 1740 |
}, |
| 1741 |
} |
| 1742 |
target := &ret |
| 1743 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1744 |
if err != nil { |
| 1745 |
return nil, err |
| 1746 |
} |
| 1747 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.pages.get", "response", internallog.HTTPResponse(res, b)) |
| 1748 |
return ret, nil |
| 1749 |
} |
| 1750 |
|
| 1751 |
type PagesListCall struct { |
| 1752 |
s *Service |
| 1753 |
blogId string |
| 1754 |
urlParams_ gensupport.URLParams |
| 1755 |
ifNoneMatch_ string |
| 1756 |
ctx_ context.Context |
| 1757 |
header_ http.Header |
| 1758 |
} |
| 1759 |
|
| 1760 |
|
| 1761 |
|
| 1762 |
|
| 1763 |
func (r *PagesService) List(blogId string) *PagesListCall { |
| 1764 |
c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1765 |
c.blogId = blogId |
| 1766 |
return c |
| 1767 |
} |
| 1768 |
|
| 1769 |
|
| 1770 |
func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall { |
| 1771 |
c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) |
| 1772 |
return c |
| 1773 |
} |
| 1774 |
|
| 1775 |
|
| 1776 |
|
| 1777 |
|
| 1778 |
func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { |
| 1779 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1780 |
return c |
| 1781 |
} |
| 1782 |
|
| 1783 |
|
| 1784 |
|
| 1785 |
|
| 1786 |
func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { |
| 1787 |
c.ifNoneMatch_ = entityTag |
| 1788 |
return c |
| 1789 |
} |
| 1790 |
|
| 1791 |
|
| 1792 |
func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { |
| 1793 |
c.ctx_ = ctx |
| 1794 |
return c |
| 1795 |
} |
| 1796 |
|
| 1797 |
|
| 1798 |
|
| 1799 |
func (c *PagesListCall) Header() http.Header { |
| 1800 |
if c.header_ == nil { |
| 1801 |
c.header_ = make(http.Header) |
| 1802 |
} |
| 1803 |
return c.header_ |
| 1804 |
} |
| 1805 |
|
| 1806 |
func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { |
| 1807 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1808 |
if c.ifNoneMatch_ != "" { |
| 1809 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1810 |
} |
| 1811 |
c.urlParams_.Set("alt", alt) |
| 1812 |
c.urlParams_.Set("prettyPrint", "false") |
| 1813 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/pages") |
| 1814 |
urls += "?" + c.urlParams_.Encode() |
| 1815 |
req, err := http.NewRequest("GET", urls, nil) |
| 1816 |
if err != nil { |
| 1817 |
return nil, err |
| 1818 |
} |
| 1819 |
req.Header = reqHeaders |
| 1820 |
googleapi.Expand(req.URL, map[string]string{ |
| 1821 |
"blogId": c.blogId, |
| 1822 |
}) |
| 1823 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.pages.list", "request", internallog.HTTPRequest(req, nil)) |
| 1824 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1825 |
} |
| 1826 |
|
| 1827 |
|
| 1828 |
|
| 1829 |
|
| 1830 |
|
| 1831 |
|
| 1832 |
func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*PageList, error) { |
| 1833 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1834 |
res, err := c.doRequest("json") |
| 1835 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1836 |
if res.Body != nil { |
| 1837 |
res.Body.Close() |
| 1838 |
} |
| 1839 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1840 |
Code: res.StatusCode, |
| 1841 |
Header: res.Header, |
| 1842 |
}) |
| 1843 |
} |
| 1844 |
if err != nil { |
| 1845 |
return nil, err |
| 1846 |
} |
| 1847 |
defer googleapi.CloseBody(res) |
| 1848 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1849 |
return nil, gensupport.WrapError(err) |
| 1850 |
} |
| 1851 |
ret := &PageList{ |
| 1852 |
ServerResponse: googleapi.ServerResponse{ |
| 1853 |
Header: res.Header, |
| 1854 |
HTTPStatusCode: res.StatusCode, |
| 1855 |
}, |
| 1856 |
} |
| 1857 |
target := &ret |
| 1858 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1859 |
if err != nil { |
| 1860 |
return nil, err |
| 1861 |
} |
| 1862 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.pages.list", "response", internallog.HTTPResponse(res, b)) |
| 1863 |
return ret, nil |
| 1864 |
} |
| 1865 |
|
| 1866 |
type PostsGetCall struct { |
| 1867 |
s *Service |
| 1868 |
blogId string |
| 1869 |
postId string |
| 1870 |
urlParams_ gensupport.URLParams |
| 1871 |
ifNoneMatch_ string |
| 1872 |
ctx_ context.Context |
| 1873 |
header_ http.Header |
| 1874 |
} |
| 1875 |
|
| 1876 |
|
| 1877 |
|
| 1878 |
|
| 1879 |
|
| 1880 |
func (r *PostsService) Get(blogId string, postId string) *PostsGetCall { |
| 1881 |
c := &PostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1882 |
c.blogId = blogId |
| 1883 |
c.postId = postId |
| 1884 |
return c |
| 1885 |
} |
| 1886 |
|
| 1887 |
|
| 1888 |
|
| 1889 |
|
| 1890 |
func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { |
| 1891 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1892 |
return c |
| 1893 |
} |
| 1894 |
|
| 1895 |
|
| 1896 |
|
| 1897 |
|
| 1898 |
func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { |
| 1899 |
c.ifNoneMatch_ = entityTag |
| 1900 |
return c |
| 1901 |
} |
| 1902 |
|
| 1903 |
|
| 1904 |
func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { |
| 1905 |
c.ctx_ = ctx |
| 1906 |
return c |
| 1907 |
} |
| 1908 |
|
| 1909 |
|
| 1910 |
|
| 1911 |
func (c *PostsGetCall) Header() http.Header { |
| 1912 |
if c.header_ == nil { |
| 1913 |
c.header_ = make(http.Header) |
| 1914 |
} |
| 1915 |
return c.header_ |
| 1916 |
} |
| 1917 |
|
| 1918 |
func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { |
| 1919 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1920 |
if c.ifNoneMatch_ != "" { |
| 1921 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1922 |
} |
| 1923 |
c.urlParams_.Set("alt", alt) |
| 1924 |
c.urlParams_.Set("prettyPrint", "false") |
| 1925 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts/{postId}") |
| 1926 |
urls += "?" + c.urlParams_.Encode() |
| 1927 |
req, err := http.NewRequest("GET", urls, nil) |
| 1928 |
if err != nil { |
| 1929 |
return nil, err |
| 1930 |
} |
| 1931 |
req.Header = reqHeaders |
| 1932 |
googleapi.Expand(req.URL, map[string]string{ |
| 1933 |
"blogId": c.blogId, |
| 1934 |
"postId": c.postId, |
| 1935 |
}) |
| 1936 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.posts.get", "request", internallog.HTTPRequest(req, nil)) |
| 1937 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1938 |
} |
| 1939 |
|
| 1940 |
|
| 1941 |
|
| 1942 |
|
| 1943 |
|
| 1944 |
|
| 1945 |
func (c *PostsGetCall) Do(opts ...googleapi.CallOption) (*Post, error) { |
| 1946 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1947 |
res, err := c.doRequest("json") |
| 1948 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1949 |
if res.Body != nil { |
| 1950 |
res.Body.Close() |
| 1951 |
} |
| 1952 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1953 |
Code: res.StatusCode, |
| 1954 |
Header: res.Header, |
| 1955 |
}) |
| 1956 |
} |
| 1957 |
if err != nil { |
| 1958 |
return nil, err |
| 1959 |
} |
| 1960 |
defer googleapi.CloseBody(res) |
| 1961 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1962 |
return nil, gensupport.WrapError(err) |
| 1963 |
} |
| 1964 |
ret := &Post{ |
| 1965 |
ServerResponse: googleapi.ServerResponse{ |
| 1966 |
Header: res.Header, |
| 1967 |
HTTPStatusCode: res.StatusCode, |
| 1968 |
}, |
| 1969 |
} |
| 1970 |
target := &ret |
| 1971 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1972 |
if err != nil { |
| 1973 |
return nil, err |
| 1974 |
} |
| 1975 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.posts.get", "response", internallog.HTTPResponse(res, b)) |
| 1976 |
return ret, nil |
| 1977 |
} |
| 1978 |
|
| 1979 |
type PostsListCall struct { |
| 1980 |
s *Service |
| 1981 |
blogId string |
| 1982 |
urlParams_ gensupport.URLParams |
| 1983 |
ifNoneMatch_ string |
| 1984 |
ctx_ context.Context |
| 1985 |
header_ http.Header |
| 1986 |
} |
| 1987 |
|
| 1988 |
|
| 1989 |
|
| 1990 |
|
| 1991 |
func (r *PostsService) List(blogId string) *PostsListCall { |
| 1992 |
c := &PostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1993 |
c.blogId = blogId |
| 1994 |
return c |
| 1995 |
} |
| 1996 |
|
| 1997 |
|
| 1998 |
func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall { |
| 1999 |
c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies)) |
| 2000 |
return c |
| 2001 |
} |
| 2002 |
|
| 2003 |
|
| 2004 |
func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall { |
| 2005 |
c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) |
| 2006 |
return c |
| 2007 |
} |
| 2008 |
|
| 2009 |
|
| 2010 |
func (c *PostsListCall) PageToken(pageToken string) *PostsListCall { |
| 2011 |
c.urlParams_.Set("pageToken", pageToken) |
| 2012 |
return c |
| 2013 |
} |
| 2014 |
|
| 2015 |
|
| 2016 |
func (c *PostsListCall) StartDate(startDate string) *PostsListCall { |
| 2017 |
c.urlParams_.Set("startDate", startDate) |
| 2018 |
return c |
| 2019 |
} |
| 2020 |
|
| 2021 |
|
| 2022 |
|
| 2023 |
|
| 2024 |
func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { |
| 2025 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 2026 |
return c |
| 2027 |
} |
| 2028 |
|
| 2029 |
|
| 2030 |
|
| 2031 |
|
| 2032 |
func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { |
| 2033 |
c.ifNoneMatch_ = entityTag |
| 2034 |
return c |
| 2035 |
} |
| 2036 |
|
| 2037 |
|
| 2038 |
func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { |
| 2039 |
c.ctx_ = ctx |
| 2040 |
return c |
| 2041 |
} |
| 2042 |
|
| 2043 |
|
| 2044 |
|
| 2045 |
func (c *PostsListCall) Header() http.Header { |
| 2046 |
if c.header_ == nil { |
| 2047 |
c.header_ = make(http.Header) |
| 2048 |
} |
| 2049 |
return c.header_ |
| 2050 |
} |
| 2051 |
|
| 2052 |
func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { |
| 2053 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 2054 |
if c.ifNoneMatch_ != "" { |
| 2055 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 2056 |
} |
| 2057 |
c.urlParams_.Set("alt", alt) |
| 2058 |
c.urlParams_.Set("prettyPrint", "false") |
| 2059 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/blogs/{blogId}/posts") |
| 2060 |
urls += "?" + c.urlParams_.Encode() |
| 2061 |
req, err := http.NewRequest("GET", urls, nil) |
| 2062 |
if err != nil { |
| 2063 |
return nil, err |
| 2064 |
} |
| 2065 |
req.Header = reqHeaders |
| 2066 |
googleapi.Expand(req.URL, map[string]string{ |
| 2067 |
"blogId": c.blogId, |
| 2068 |
}) |
| 2069 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.posts.list", "request", internallog.HTTPRequest(req, nil)) |
| 2070 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 2071 |
} |
| 2072 |
|
| 2073 |
|
| 2074 |
|
| 2075 |
|
| 2076 |
|
| 2077 |
|
| 2078 |
func (c *PostsListCall) Do(opts ...googleapi.CallOption) (*PostList, error) { |
| 2079 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 2080 |
res, err := c.doRequest("json") |
| 2081 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 2082 |
if res.Body != nil { |
| 2083 |
res.Body.Close() |
| 2084 |
} |
| 2085 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 2086 |
Code: res.StatusCode, |
| 2087 |
Header: res.Header, |
| 2088 |
}) |
| 2089 |
} |
| 2090 |
if err != nil { |
| 2091 |
return nil, err |
| 2092 |
} |
| 2093 |
defer googleapi.CloseBody(res) |
| 2094 |
if err := googleapi.CheckResponse(res); err != nil { |
| 2095 |
return nil, gensupport.WrapError(err) |
| 2096 |
} |
| 2097 |
ret := &PostList{ |
| 2098 |
ServerResponse: googleapi.ServerResponse{ |
| 2099 |
Header: res.Header, |
| 2100 |
HTTPStatusCode: res.StatusCode, |
| 2101 |
}, |
| 2102 |
} |
| 2103 |
target := &ret |
| 2104 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 2105 |
if err != nil { |
| 2106 |
return nil, err |
| 2107 |
} |
| 2108 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.posts.list", "response", internallog.HTTPResponse(res, b)) |
| 2109 |
return ret, nil |
| 2110 |
} |
| 2111 |
|
| 2112 |
|
| 2113 |
|
| 2114 |
|
| 2115 |
func (c *PostsListCall) Pages(ctx context.Context, f func(*PostList) error) error { |
| 2116 |
c.ctx_ = ctx |
| 2117 |
defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 2118 |
for { |
| 2119 |
x, err := c.Do() |
| 2120 |
if err != nil { |
| 2121 |
return err |
| 2122 |
} |
| 2123 |
if err := f(x); err != nil { |
| 2124 |
return err |
| 2125 |
} |
| 2126 |
if x.NextPageToken == "" { |
| 2127 |
return nil |
| 2128 |
} |
| 2129 |
c.PageToken(x.NextPageToken) |
| 2130 |
} |
| 2131 |
} |
| 2132 |
|
| 2133 |
type UsersGetCall struct { |
| 2134 |
s *Service |
| 2135 |
userId string |
| 2136 |
urlParams_ gensupport.URLParams |
| 2137 |
ifNoneMatch_ string |
| 2138 |
ctx_ context.Context |
| 2139 |
header_ http.Header |
| 2140 |
} |
| 2141 |
|
| 2142 |
|
| 2143 |
|
| 2144 |
|
| 2145 |
func (r *UsersService) Get(userId string) *UsersGetCall { |
| 2146 |
c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 2147 |
c.userId = userId |
| 2148 |
return c |
| 2149 |
} |
| 2150 |
|
| 2151 |
|
| 2152 |
|
| 2153 |
|
| 2154 |
func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { |
| 2155 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 2156 |
return c |
| 2157 |
} |
| 2158 |
|
| 2159 |
|
| 2160 |
|
| 2161 |
|
| 2162 |
func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { |
| 2163 |
c.ifNoneMatch_ = entityTag |
| 2164 |
return c |
| 2165 |
} |
| 2166 |
|
| 2167 |
|
| 2168 |
func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { |
| 2169 |
c.ctx_ = ctx |
| 2170 |
return c |
| 2171 |
} |
| 2172 |
|
| 2173 |
|
| 2174 |
|
| 2175 |
func (c *UsersGetCall) Header() http.Header { |
| 2176 |
if c.header_ == nil { |
| 2177 |
c.header_ = make(http.Header) |
| 2178 |
} |
| 2179 |
return c.header_ |
| 2180 |
} |
| 2181 |
|
| 2182 |
func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { |
| 2183 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 2184 |
if c.ifNoneMatch_ != "" { |
| 2185 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 2186 |
} |
| 2187 |
c.urlParams_.Set("alt", alt) |
| 2188 |
c.urlParams_.Set("prettyPrint", "false") |
| 2189 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}") |
| 2190 |
urls += "?" + c.urlParams_.Encode() |
| 2191 |
req, err := http.NewRequest("GET", urls, nil) |
| 2192 |
if err != nil { |
| 2193 |
return nil, err |
| 2194 |
} |
| 2195 |
req.Header = reqHeaders |
| 2196 |
googleapi.Expand(req.URL, map[string]string{ |
| 2197 |
"userId": c.userId, |
| 2198 |
}) |
| 2199 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "blogger.users.get", "request", internallog.HTTPRequest(req, nil)) |
| 2200 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 2201 |
} |
| 2202 |
|
| 2203 |
|
| 2204 |
|
| 2205 |
|
| 2206 |
|
| 2207 |
|
| 2208 |
func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { |
| 2209 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 2210 |
res, err := c.doRequest("json") |
| 2211 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 2212 |
if res.Body != nil { |
| 2213 |
res.Body.Close() |
| 2214 |
} |
| 2215 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 2216 |
Code: res.StatusCode, |
| 2217 |
Header: res.Header, |
| 2218 |
}) |
| 2219 |
} |
| 2220 |
if err != nil { |
| 2221 |
return nil, err |
| 2222 |
} |
| 2223 |
defer googleapi.CloseBody(res) |
| 2224 |
if err := googleapi.CheckResponse(res); err != nil { |
| 2225 |
return nil, gensupport.WrapError(err) |
| 2226 |
} |
| 2227 |
ret := &User{ |
| 2228 |
ServerResponse: googleapi.ServerResponse{ |
| 2229 |
Header: res.Header, |
| 2230 |
HTTPStatusCode: res.StatusCode, |
| 2231 |
}, |
| 2232 |
} |
| 2233 |
target := &ret |
| 2234 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 2235 |
if err != nil { |
| 2236 |
return nil, err |
| 2237 |
} |
| 2238 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "blogger.users.get", "response", internallog.HTTPResponse(res, b)) |
| 2239 |
return ret, nil |
| 2240 |
} |