~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/blogger/v2/blogger-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package blogger provides access to the Blogger API.
 
2
//
 
3
// See https://developers.google.com/blogger/docs/2.0/json/getting_started
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/blogger/v2"
 
8
//   ...
 
9
//   bloggerService, err := blogger.New(oauthHttpClient)
 
10
package blogger
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
37
const apiId = "blogger:v2"
 
38
const apiName = "blogger"
 
39
const apiVersion = "v2"
 
40
const basePath = "https://www.googleapis.com/blogger/v2/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // Manage your Blogger account
 
45
        BloggerScope = "https://www.googleapis.com/auth/blogger"
 
46
)
 
47
 
 
48
func New(client *http.Client) (*Service, error) {
 
49
        if client == nil {
 
50
                return nil, errors.New("client is nil")
 
51
        }
 
52
        s := &Service{client: client, BasePath: basePath}
 
53
        s.Blogs = NewBlogsService(s)
 
54
        s.Comments = NewCommentsService(s)
 
55
        s.Pages = NewPagesService(s)
 
56
        s.Posts = NewPostsService(s)
 
57
        s.Users = NewUsersService(s)
 
58
        return s, nil
 
59
}
 
60
 
 
61
type Service struct {
 
62
        client   *http.Client
 
63
        BasePath string // API endpoint base URL
 
64
 
 
65
        Blogs *BlogsService
 
66
 
 
67
        Comments *CommentsService
 
68
 
 
69
        Pages *PagesService
 
70
 
 
71
        Posts *PostsService
 
72
 
 
73
        Users *UsersService
 
74
}
 
75
 
 
76
func NewBlogsService(s *Service) *BlogsService {
 
77
        rs := &BlogsService{s: s}
 
78
        return rs
 
79
}
 
80
 
 
81
type BlogsService struct {
 
82
        s *Service
 
83
}
 
84
 
 
85
func NewCommentsService(s *Service) *CommentsService {
 
86
        rs := &CommentsService{s: s}
 
87
        return rs
 
88
}
 
89
 
 
90
type CommentsService struct {
 
91
        s *Service
 
92
}
 
93
 
 
94
func NewPagesService(s *Service) *PagesService {
 
95
        rs := &PagesService{s: s}
 
96
        return rs
 
97
}
 
98
 
 
99
type PagesService struct {
 
100
        s *Service
 
101
}
 
102
 
 
103
func NewPostsService(s *Service) *PostsService {
 
104
        rs := &PostsService{s: s}
 
105
        return rs
 
106
}
 
107
 
 
108
type PostsService struct {
 
109
        s *Service
 
110
}
 
111
 
 
112
func NewUsersService(s *Service) *UsersService {
 
113
        rs := &UsersService{s: s}
 
114
        rs.Blogs = NewUsersBlogsService(s)
 
115
        return rs
 
116
}
 
117
 
 
118
type UsersService struct {
 
119
        s *Service
 
120
 
 
121
        Blogs *UsersBlogsService
 
122
}
 
123
 
 
124
func NewUsersBlogsService(s *Service) *UsersBlogsService {
 
125
        rs := &UsersBlogsService{s: s}
 
126
        return rs
 
127
}
 
128
 
 
129
type UsersBlogsService struct {
 
130
        s *Service
 
131
}
 
132
 
 
133
type Blog struct {
 
134
        // Description: The description of this blog. This is displayed
 
135
        // underneath the title.
 
136
        Description string `json:"description,omitempty"`
 
137
 
 
138
        // Id: The identifier for this resource.
 
139
        Id int64 `json:"id,omitempty,string"`
 
140
 
 
141
        // Kind: The kind of this entry. Always blogger#blog
 
142
        Kind string `json:"kind,omitempty"`
 
143
 
 
144
        // Locale: The locale this Blog is set to.
 
145
        Locale *BlogLocale `json:"locale,omitempty"`
 
146
 
 
147
        // Name: The name of this blog. This is displayed as the title.
 
148
        Name string `json:"name,omitempty"`
 
149
 
 
150
        // Pages: The container of pages in this blog.
 
151
        Pages *BlogPages `json:"pages,omitempty"`
 
152
 
 
153
        // Posts: The container of posts in this blog.
 
154
        Posts *BlogPosts `json:"posts,omitempty"`
 
155
 
 
156
        // Published: RFC 3339 date-time when this blog was published.
 
157
        Published string `json:"published,omitempty"`
 
158
 
 
159
        // SelfLink: The API REST URL to fetch this resource from.
 
160
        SelfLink string `json:"selfLink,omitempty"`
 
161
 
 
162
        // Updated: RFC 3339 date-time when this blog was last updated.
 
163
        Updated string `json:"updated,omitempty"`
 
164
 
 
165
        // Url: The URL where this blog is published.
 
166
        Url string `json:"url,omitempty"`
 
167
}
 
168
 
 
169
type BlogLocale struct {
 
170
        // Country: The country this blog's locale is set to.
 
171
        Country string `json:"country,omitempty"`
 
172
 
 
173
        // Language: The language this blog is authored in.
 
174
        Language string `json:"language,omitempty"`
 
175
 
 
176
        // Variant: The language variant this blog is authored in.
 
177
        Variant string `json:"variant,omitempty"`
 
178
}
 
179
 
 
180
type BlogPages struct {
 
181
        // SelfLink: The URL of the container for pages in this blog.
 
182
        SelfLink string `json:"selfLink,omitempty"`
 
183
 
 
184
        // TotalItems: The count of pages in this blog.
 
185
        TotalItems int64 `json:"totalItems,omitempty"`
 
186
}
 
187
 
 
188
type BlogPosts struct {
 
189
        // SelfLink: The URL of the container for posts in this blog.
 
190
        SelfLink string `json:"selfLink,omitempty"`
 
191
 
 
192
        // TotalItems: The count of posts in this blog.
 
193
        TotalItems int64 `json:"totalItems,omitempty"`
 
194
}
 
195
 
 
196
type BlogList struct {
 
197
        // Items: The list of Blogs this user has Authorship or Admin rights
 
198
        // over.
 
199
        Items []*Blog `json:"items,omitempty"`
 
200
 
 
201
        // Kind: The kind of this entity. Always blogger#blogList
 
202
        Kind string `json:"kind,omitempty"`
 
203
}
 
204
 
 
205
type Comment struct {
 
206
        // Author: The author of this Comment.
 
207
        Author *CommentAuthor `json:"author,omitempty"`
 
208
 
 
209
        // Blog: Data about the blog containing this comment.
 
210
        Blog *CommentBlog `json:"blog,omitempty"`
 
211
 
 
212
        // Content: The actual content of the comment. May include HTML markup.
 
213
        Content string `json:"content,omitempty"`
 
214
 
 
215
        // Id: The identifier for this resource.
 
216
        Id int64 `json:"id,omitempty,string"`
 
217
 
 
218
        // InReplyTo: Data about the comment this is in reply to.
 
219
        InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"`
 
220
 
 
221
        // Kind: The kind of this entry. Always blogger#comment
 
222
        Kind string `json:"kind,omitempty"`
 
223
 
 
224
        // Post: Data about the post containing this comment.
 
225
        Post *CommentPost `json:"post,omitempty"`
 
226
 
 
227
        // Published: RFC 3339 date-time when this comment was published.
 
228
        Published string `json:"published,omitempty"`
 
229
 
 
230
        // SelfLink: The API REST URL to fetch this resource from.
 
231
        SelfLink string `json:"selfLink,omitempty"`
 
232
 
 
233
        // Updated: RFC 3339 date-time when this comment was last updated.
 
234
        Updated string `json:"updated,omitempty"`
 
235
}
 
236
 
 
237
type CommentAuthor struct {
 
238
        // DisplayName: The display name.
 
239
        DisplayName string `json:"displayName,omitempty"`
 
240
 
 
241
        // Id: The identifier of the Comment creator.
 
242
        Id string `json:"id,omitempty"`
 
243
 
 
244
        // Image: The comment creator's avatar.
 
245
        Image *CommentAuthorImage `json:"image,omitempty"`
 
246
 
 
247
        // Url: The URL of the Comment creator's Profile page.
 
248
        Url string `json:"url,omitempty"`
 
249
}
 
250
 
 
251
type CommentAuthorImage struct {
 
252
        // Url: The comment creator's avatar URL.
 
253
        Url string `json:"url,omitempty"`
 
254
}
 
255
 
 
256
type CommentBlog struct {
 
257
        // Id: The identifier of the blog containing this comment.
 
258
        Id int64 `json:"id,omitempty,string"`
 
259
}
 
260
 
 
261
type CommentInReplyTo struct {
 
262
        // Id: The identified of the parent of this comment.
 
263
        Id int64 `json:"id,omitempty,string"`
 
264
}
 
265
 
 
266
type CommentPost struct {
 
267
        // Id: The identifier of the post containing this comment.
 
268
        Id int64 `json:"id,omitempty,string"`
 
269
}
 
270
 
 
271
type CommentList struct {
 
272
        // Items: The List of Comments for a Post.
 
273
        Items []*Comment `json:"items,omitempty"`
 
274
 
 
275
        // Kind: The kind of this entry. Always blogger#commentList
 
276
        Kind string `json:"kind,omitempty"`
 
277
 
 
278
        // NextPageToken: Pagination token to fetch the next page, if one
 
279
        // exists.
 
280
        NextPageToken string `json:"nextPageToken,omitempty"`
 
281
 
 
282
        // PrevPageToken: Pagination token to fetch the previous page, if one
 
283
        // exists.
 
284
        PrevPageToken string `json:"prevPageToken,omitempty"`
 
285
}
 
286
 
 
287
type Page struct {
 
288
        // Author: The author of this Page.
 
289
        Author *PageAuthor `json:"author,omitempty"`
 
290
 
 
291
        // Blog: Data about the blog containing this Page.
 
292
        Blog *PageBlog `json:"blog,omitempty"`
 
293
 
 
294
        // Content: The body content of this Page, in HTML.
 
295
        Content string `json:"content,omitempty"`
 
296
 
 
297
        // Id: The identifier for this resource.
 
298
        Id int64 `json:"id,omitempty,string"`
 
299
 
 
300
        // Kind: The kind of this entity. Always blogger#page
 
301
        Kind string `json:"kind,omitempty"`
 
302
 
 
303
        // Published: RFC 3339 date-time when this Page was published.
 
304
        Published string `json:"published,omitempty"`
 
305
 
 
306
        // SelfLink: The API REST URL to fetch this resource from.
 
307
        SelfLink string `json:"selfLink,omitempty"`
 
308
 
 
309
        // Title: The title of this entity. This is the name displayed in the
 
310
        // Admin user interface.
 
311
        Title string `json:"title,omitempty"`
 
312
 
 
313
        // Updated: RFC 3339 date-time when this Page was last updated.
 
314
        Updated string `json:"updated,omitempty"`
 
315
 
 
316
        // Url: The URL that this Page is displayed at.
 
317
        Url string `json:"url,omitempty"`
 
318
}
 
319
 
 
320
type PageAuthor struct {
 
321
        // DisplayName: The display name.
 
322
        DisplayName string `json:"displayName,omitempty"`
 
323
 
 
324
        // Id: The identifier of the Page creator.
 
325
        Id string `json:"id,omitempty"`
 
326
 
 
327
        // Image: The page author's avatar.
 
328
        Image *PageAuthorImage `json:"image,omitempty"`
 
329
 
 
330
        // Url: The URL of the Page creator's Profile page.
 
331
        Url string `json:"url,omitempty"`
 
332
}
 
333
 
 
334
type PageAuthorImage struct {
 
335
        // Url: The page author's avatar URL.
 
336
        Url string `json:"url,omitempty"`
 
337
}
 
338
 
 
339
type PageBlog struct {
 
340
        // Id: The identifier of the blog containing this page.
 
341
        Id int64 `json:"id,omitempty,string"`
 
342
}
 
343
 
 
344
type PageList struct {
 
345
        // Items: The list of Pages for a Blog.
 
346
        Items []*Page `json:"items,omitempty"`
 
347
 
 
348
        // Kind: The kind of this entity. Always blogger#pageList
 
349
        Kind string `json:"kind,omitempty"`
 
350
}
 
351
 
 
352
type Post struct {
 
353
        // Author: The author of this Post.
 
354
        Author *PostAuthor `json:"author,omitempty"`
 
355
 
 
356
        // Blog: Data about the blog containing this Post.
 
357
        Blog *PostBlog `json:"blog,omitempty"`
 
358
 
 
359
        // Content: The content of the Post. May contain HTML markup.
 
360
        Content string `json:"content,omitempty"`
 
361
 
 
362
        // Id: The identifier of this Post.
 
363
        Id int64 `json:"id,omitempty,string"`
 
364
 
 
365
        // Kind: The kind of this entity. Always blogger#post
 
366
        Kind string `json:"kind,omitempty"`
 
367
 
 
368
        // Labels: The list of labels this Post was tagged with.
 
369
        Labels []string `json:"labels,omitempty"`
 
370
 
 
371
        // Published: RFC 3339 date-time when this Post was published.
 
372
        Published string `json:"published,omitempty"`
 
373
 
 
374
        // Replies: The container of comments on this Post.
 
375
        Replies *PostReplies `json:"replies,omitempty"`
 
376
 
 
377
        // SelfLink: The API REST URL to fetch this resource from.
 
378
        SelfLink string `json:"selfLink,omitempty"`
 
379
 
 
380
        // Title: The title of the Post.
 
381
        Title string `json:"title,omitempty"`
 
382
 
 
383
        // Updated: RFC 3339 date-time when this Post was last updated.
 
384
        Updated string `json:"updated,omitempty"`
 
385
 
 
386
        // Url: The URL where this Post is displayed.
 
387
        Url string `json:"url,omitempty"`
 
388
}
 
389
 
 
390
type PostAuthor struct {
 
391
        // DisplayName: The display name.
 
392
        DisplayName string `json:"displayName,omitempty"`
 
393
 
 
394
        // Id: The identifier of the Post creator.
 
395
        Id string `json:"id,omitempty"`
 
396
 
 
397
        // Image: The Post author's avatar.
 
398
        Image *PostAuthorImage `json:"image,omitempty"`
 
399
 
 
400
        // Url: The URL of the Post creator's Profile page.
 
401
        Url string `json:"url,omitempty"`
 
402
}
 
403
 
 
404
type PostAuthorImage struct {
 
405
        // Url: The Post author's avatar URL.
 
406
        Url string `json:"url,omitempty"`
 
407
}
 
408
 
 
409
type PostBlog struct {
 
410
        // Id: The identifier of the Blog that contains this Post.
 
411
        Id int64 `json:"id,omitempty,string"`
 
412
}
 
413
 
 
414
type PostReplies struct {
 
415
        // SelfLink: The URL of the comments on this post.
 
416
        SelfLink string `json:"selfLink,omitempty"`
 
417
 
 
418
        // TotalItems: The count of comments on this post.
 
419
        TotalItems int64 `json:"totalItems,omitempty,string"`
 
420
}
 
421
 
 
422
type PostList struct {
 
423
        // Items: The list of Posts for this Blog.
 
424
        Items []*Post `json:"items,omitempty"`
 
425
 
 
426
        // Kind: The kind of this entity. Always blogger#postList
 
427
        Kind string `json:"kind,omitempty"`
 
428
 
 
429
        // NextPageToken: Pagination token to fetch the next page, if one
 
430
        // exists.
 
431
        NextPageToken string `json:"nextPageToken,omitempty"`
 
432
 
 
433
        // PrevPageToken: Pagination token to fetch the previous page, if one
 
434
        // exists.
 
435
        PrevPageToken string `json:"prevPageToken,omitempty"`
 
436
}
 
437
 
 
438
type User struct {
 
439
        // About: Profile summary information.
 
440
        About string `json:"about,omitempty"`
 
441
 
 
442
        // Blogs: The container of blogs for this user.
 
443
        Blogs *UserBlogs `json:"blogs,omitempty"`
 
444
 
 
445
        // Created: The timestamp of when this profile was created, in seconds
 
446
        // since epoch.
 
447
        Created string `json:"created,omitempty"`
 
448
 
 
449
        // DisplayName: The display name.
 
450
        DisplayName string `json:"displayName,omitempty"`
 
451
 
 
452
        // Id: The identifier for this User.
 
453
        Id string `json:"id,omitempty"`
 
454
 
 
455
        // Kind: The kind of this entity. Always blogger#user
 
456
        Kind string `json:"kind,omitempty"`
 
457
 
 
458
        // Locale: This user's locale
 
459
        Locale *UserLocale `json:"locale,omitempty"`
 
460
 
 
461
        // SelfLink: The API REST URL to fetch this resource from.
 
462
        SelfLink string `json:"selfLink,omitempty"`
 
463
 
 
464
        // Url: The user's profile page.
 
465
        Url string `json:"url,omitempty"`
 
466
}
 
467
 
 
468
type UserBlogs struct {
 
469
        // SelfLink: The URL of the Blogs for this user.
 
470
        SelfLink string `json:"selfLink,omitempty"`
 
471
}
 
472
 
 
473
type UserLocale struct {
 
474
        // Country: The user's country setting.
 
475
        Country string `json:"country,omitempty"`
 
476
 
 
477
        // Language: The user's language setting.
 
478
        Language string `json:"language,omitempty"`
 
479
 
 
480
        // Variant: The user's language variant setting.
 
481
        Variant string `json:"variant,omitempty"`
 
482
}
 
483
 
 
484
// method id "blogger.blogs.get":
 
485
 
 
486
type BlogsGetCall struct {
 
487
        s      *Service
 
488
        blogId string
 
489
        opt_   map[string]interface{}
 
490
}
 
491
 
 
492
// Get: Gets one blog by id.
 
493
func (r *BlogsService) Get(blogId string) *BlogsGetCall {
 
494
        c := &BlogsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
495
        c.blogId = blogId
 
496
        return c
 
497
}
 
498
 
 
499
// Fields allows partial responses to be retrieved.
 
500
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
501
// for more information.
 
502
func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall {
 
503
        c.opt_["fields"] = googleapi.CombineFields(s)
 
504
        return c
 
505
}
 
506
 
 
507
func (c *BlogsGetCall) Do() (*Blog, error) {
 
508
        var body io.Reader = nil
 
509
        params := make(url.Values)
 
510
        params.Set("alt", "json")
 
511
        if v, ok := c.opt_["fields"]; ok {
 
512
                params.Set("fields", fmt.Sprintf("%v", v))
 
513
        }
 
514
        urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}")
 
515
        urls += "?" + params.Encode()
 
516
        req, _ := http.NewRequest("GET", urls, body)
 
517
        googleapi.Expand(req.URL, map[string]string{
 
518
                "blogId": c.blogId,
 
519
        })
 
520
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
521
        res, err := c.s.client.Do(req)
 
522
        if err != nil {
 
523
                return nil, err
 
524
        }
 
525
        defer googleapi.CloseBody(res)
 
526
        if err := googleapi.CheckResponse(res); err != nil {
 
527
                return nil, err
 
528
        }
 
529
        var ret *Blog
 
530
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
531
                return nil, err
 
532
        }
 
533
        return ret, nil
 
534
        // {
 
535
        //   "description": "Gets one blog by id.",
 
536
        //   "httpMethod": "GET",
 
537
        //   "id": "blogger.blogs.get",
 
538
        //   "parameterOrder": [
 
539
        //     "blogId"
 
540
        //   ],
 
541
        //   "parameters": {
 
542
        //     "blogId": {
 
543
        //       "description": "The ID of the blog to get.",
 
544
        //       "location": "path",
 
545
        //       "required": true,
 
546
        //       "type": "string"
 
547
        //     }
 
548
        //   },
 
549
        //   "path": "blogs/{blogId}",
 
550
        //   "response": {
 
551
        //     "$ref": "Blog"
 
552
        //   },
 
553
        //   "scopes": [
 
554
        //     "https://www.googleapis.com/auth/blogger"
 
555
        //   ]
 
556
        // }
 
557
 
 
558
}
 
559
 
 
560
// method id "blogger.comments.get":
 
561
 
 
562
type CommentsGetCall struct {
 
563
        s         *Service
 
564
        blogId    string
 
565
        postId    string
 
566
        commentId string
 
567
        opt_      map[string]interface{}
 
568
}
 
569
 
 
570
// Get: Gets one comment by id.
 
571
func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall {
 
572
        c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
573
        c.blogId = blogId
 
574
        c.postId = postId
 
575
        c.commentId = commentId
 
576
        return c
 
577
}
 
578
 
 
579
// Fields allows partial responses to be retrieved.
 
580
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
581
// for more information.
 
582
func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
 
583
        c.opt_["fields"] = googleapi.CombineFields(s)
 
584
        return c
 
585
}
 
586
 
 
587
func (c *CommentsGetCall) Do() (*Comment, error) {
 
588
        var body io.Reader = nil
 
589
        params := make(url.Values)
 
590
        params.Set("alt", "json")
 
591
        if v, ok := c.opt_["fields"]; ok {
 
592
                params.Set("fields", fmt.Sprintf("%v", v))
 
593
        }
 
594
        urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}")
 
595
        urls += "?" + params.Encode()
 
596
        req, _ := http.NewRequest("GET", urls, body)
 
597
        googleapi.Expand(req.URL, map[string]string{
 
598
                "blogId":    c.blogId,
 
599
                "postId":    c.postId,
 
600
                "commentId": c.commentId,
 
601
        })
 
602
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
603
        res, err := c.s.client.Do(req)
 
604
        if err != nil {
 
605
                return nil, err
 
606
        }
 
607
        defer googleapi.CloseBody(res)
 
608
        if err := googleapi.CheckResponse(res); err != nil {
 
609
                return nil, err
 
610
        }
 
611
        var ret *Comment
 
612
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
613
                return nil, err
 
614
        }
 
615
        return ret, nil
 
616
        // {
 
617
        //   "description": "Gets one comment by id.",
 
618
        //   "httpMethod": "GET",
 
619
        //   "id": "blogger.comments.get",
 
620
        //   "parameterOrder": [
 
621
        //     "blogId",
 
622
        //     "postId",
 
623
        //     "commentId"
 
624
        //   ],
 
625
        //   "parameters": {
 
626
        //     "blogId": {
 
627
        //       "description": "ID of the blog to containing the comment.",
 
628
        //       "location": "path",
 
629
        //       "required": true,
 
630
        //       "type": "string"
 
631
        //     },
 
632
        //     "commentId": {
 
633
        //       "description": "The ID of the comment to get.",
 
634
        //       "location": "path",
 
635
        //       "required": true,
 
636
        //       "type": "string"
 
637
        //     },
 
638
        //     "postId": {
 
639
        //       "description": "ID of the post to fetch posts from.",
 
640
        //       "location": "path",
 
641
        //       "required": true,
 
642
        //       "type": "string"
 
643
        //     }
 
644
        //   },
 
645
        //   "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}",
 
646
        //   "response": {
 
647
        //     "$ref": "Comment"
 
648
        //   },
 
649
        //   "scopes": [
 
650
        //     "https://www.googleapis.com/auth/blogger"
 
651
        //   ]
 
652
        // }
 
653
 
 
654
}
 
655
 
 
656
// method id "blogger.comments.list":
 
657
 
 
658
type CommentsListCall struct {
 
659
        s      *Service
 
660
        blogId string
 
661
        postId string
 
662
        opt_   map[string]interface{}
 
663
}
 
664
 
 
665
// List: Retrieves the comments for a blog, possibly filtered.
 
666
func (r *CommentsService) List(blogId string, postId string) *CommentsListCall {
 
667
        c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})}
 
668
        c.blogId = blogId
 
669
        c.postId = postId
 
670
        return c
 
671
}
 
672
 
 
673
// FetchBodies sets the optional parameter "fetchBodies": Whether the
 
674
// body content of the comments is included.
 
675
func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall {
 
676
        c.opt_["fetchBodies"] = fetchBodies
 
677
        return c
 
678
}
 
679
 
 
680
// MaxResults sets the optional parameter "maxResults": Maximum number
 
681
// of comments to include in the result.
 
682
func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
 
683
        c.opt_["maxResults"] = maxResults
 
684
        return c
 
685
}
 
686
 
 
687
// PageToken sets the optional parameter "pageToken": Continuation token
 
688
// if request is paged.
 
689
func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
 
690
        c.opt_["pageToken"] = pageToken
 
691
        return c
 
692
}
 
693
 
 
694
// StartDate sets the optional parameter "startDate": Earliest date of
 
695
// comment to fetch, a date-time with RFC 3339 formatting.
 
696
func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall {
 
697
        c.opt_["startDate"] = startDate
 
698
        return c
 
699
}
 
700
 
 
701
// Fields allows partial responses to be retrieved.
 
702
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
703
// for more information.
 
704
func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
 
705
        c.opt_["fields"] = googleapi.CombineFields(s)
 
706
        return c
 
707
}
 
708
 
 
709
func (c *CommentsListCall) Do() (*CommentList, error) {
 
710
        var body io.Reader = nil
 
711
        params := make(url.Values)
 
712
        params.Set("alt", "json")
 
713
        if v, ok := c.opt_["fetchBodies"]; ok {
 
714
                params.Set("fetchBodies", fmt.Sprintf("%v", v))
 
715
        }
 
716
        if v, ok := c.opt_["maxResults"]; ok {
 
717
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
718
        }
 
719
        if v, ok := c.opt_["pageToken"]; ok {
 
720
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
721
        }
 
722
        if v, ok := c.opt_["startDate"]; ok {
 
723
                params.Set("startDate", fmt.Sprintf("%v", v))
 
724
        }
 
725
        if v, ok := c.opt_["fields"]; ok {
 
726
                params.Set("fields", fmt.Sprintf("%v", v))
 
727
        }
 
728
        urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments")
 
729
        urls += "?" + params.Encode()
 
730
        req, _ := http.NewRequest("GET", urls, body)
 
731
        googleapi.Expand(req.URL, map[string]string{
 
732
                "blogId": c.blogId,
 
733
                "postId": c.postId,
 
734
        })
 
735
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
736
        res, err := c.s.client.Do(req)
 
737
        if err != nil {
 
738
                return nil, err
 
739
        }
 
740
        defer googleapi.CloseBody(res)
 
741
        if err := googleapi.CheckResponse(res); err != nil {
 
742
                return nil, err
 
743
        }
 
744
        var ret *CommentList
 
745
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
746
                return nil, err
 
747
        }
 
748
        return ret, nil
 
749
        // {
 
750
        //   "description": "Retrieves the comments for a blog, possibly filtered.",
 
751
        //   "httpMethod": "GET",
 
752
        //   "id": "blogger.comments.list",
 
753
        //   "parameterOrder": [
 
754
        //     "blogId",
 
755
        //     "postId"
 
756
        //   ],
 
757
        //   "parameters": {
 
758
        //     "blogId": {
 
759
        //       "description": "ID of the blog to fetch comments from.",
 
760
        //       "location": "path",
 
761
        //       "required": true,
 
762
        //       "type": "string"
 
763
        //     },
 
764
        //     "fetchBodies": {
 
765
        //       "description": "Whether the body content of the comments is included.",
 
766
        //       "location": "query",
 
767
        //       "type": "boolean"
 
768
        //     },
 
769
        //     "maxResults": {
 
770
        //       "description": "Maximum number of comments to include in the result.",
 
771
        //       "format": "uint32",
 
772
        //       "location": "query",
 
773
        //       "type": "integer"
 
774
        //     },
 
775
        //     "pageToken": {
 
776
        //       "description": "Continuation token if request is paged.",
 
777
        //       "location": "query",
 
778
        //       "type": "string"
 
779
        //     },
 
780
        //     "postId": {
 
781
        //       "description": "ID of the post to fetch posts from.",
 
782
        //       "location": "path",
 
783
        //       "required": true,
 
784
        //       "type": "string"
 
785
        //     },
 
786
        //     "startDate": {
 
787
        //       "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.",
 
788
        //       "format": "date-time",
 
789
        //       "location": "query",
 
790
        //       "type": "string"
 
791
        //     }
 
792
        //   },
 
793
        //   "path": "blogs/{blogId}/posts/{postId}/comments",
 
794
        //   "response": {
 
795
        //     "$ref": "CommentList"
 
796
        //   },
 
797
        //   "scopes": [
 
798
        //     "https://www.googleapis.com/auth/blogger"
 
799
        //   ]
 
800
        // }
 
801
 
 
802
}
 
803
 
 
804
// method id "blogger.pages.get":
 
805
 
 
806
type PagesGetCall struct {
 
807
        s      *Service
 
808
        blogId string
 
809
        pageId string
 
810
        opt_   map[string]interface{}
 
811
}
 
812
 
 
813
// Get: Gets one blog page by id.
 
814
func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall {
 
815
        c := &PagesGetCall{s: r.s, opt_: make(map[string]interface{})}
 
816
        c.blogId = blogId
 
817
        c.pageId = pageId
 
818
        return c
 
819
}
 
820
 
 
821
// Fields allows partial responses to be retrieved.
 
822
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
823
// for more information.
 
824
func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall {
 
825
        c.opt_["fields"] = googleapi.CombineFields(s)
 
826
        return c
 
827
}
 
828
 
 
829
func (c *PagesGetCall) Do() (*Page, error) {
 
830
        var body io.Reader = nil
 
831
        params := make(url.Values)
 
832
        params.Set("alt", "json")
 
833
        if v, ok := c.opt_["fields"]; ok {
 
834
                params.Set("fields", fmt.Sprintf("%v", v))
 
835
        }
 
836
        urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
 
837
        urls += "?" + params.Encode()
 
838
        req, _ := http.NewRequest("GET", urls, body)
 
839
        googleapi.Expand(req.URL, map[string]string{
 
840
                "blogId": c.blogId,
 
841
                "pageId": c.pageId,
 
842
        })
 
843
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
844
        res, err := c.s.client.Do(req)
 
845
        if err != nil {
 
846
                return nil, err
 
847
        }
 
848
        defer googleapi.CloseBody(res)
 
849
        if err := googleapi.CheckResponse(res); err != nil {
 
850
                return nil, err
 
851
        }
 
852
        var ret *Page
 
853
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
854
                return nil, err
 
855
        }
 
856
        return ret, nil
 
857
        // {
 
858
        //   "description": "Gets one blog page by id.",
 
859
        //   "httpMethod": "GET",
 
860
        //   "id": "blogger.pages.get",
 
861
        //   "parameterOrder": [
 
862
        //     "blogId",
 
863
        //     "pageId"
 
864
        //   ],
 
865
        //   "parameters": {
 
866
        //     "blogId": {
 
867
        //       "description": "ID of the blog containing the page.",
 
868
        //       "location": "path",
 
869
        //       "required": true,
 
870
        //       "type": "string"
 
871
        //     },
 
872
        //     "pageId": {
 
873
        //       "description": "The ID of the page to get.",
 
874
        //       "location": "path",
 
875
        //       "required": true,
 
876
        //       "type": "string"
 
877
        //     }
 
878
        //   },
 
879
        //   "path": "blogs/{blogId}/pages/{pageId}",
 
880
        //   "response": {
 
881
        //     "$ref": "Page"
 
882
        //   },
 
883
        //   "scopes": [
 
884
        //     "https://www.googleapis.com/auth/blogger"
 
885
        //   ]
 
886
        // }
 
887
 
 
888
}
 
889
 
 
890
// method id "blogger.pages.list":
 
891
 
 
892
type PagesListCall struct {
 
893
        s      *Service
 
894
        blogId string
 
895
        opt_   map[string]interface{}
 
896
}
 
897
 
 
898
// List: Retrieves pages for a blog, possibly filtered.
 
899
func (r *PagesService) List(blogId string) *PagesListCall {
 
900
        c := &PagesListCall{s: r.s, opt_: make(map[string]interface{})}
 
901
        c.blogId = blogId
 
902
        return c
 
903
}
 
904
 
 
905
// FetchBodies sets the optional parameter "fetchBodies": Whether to
 
906
// retrieve the Page bodies.
 
907
func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall {
 
908
        c.opt_["fetchBodies"] = fetchBodies
 
909
        return c
 
910
}
 
911
 
 
912
// Fields allows partial responses to be retrieved.
 
913
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
914
// for more information.
 
915
func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall {
 
916
        c.opt_["fields"] = googleapi.CombineFields(s)
 
917
        return c
 
918
}
 
919
 
 
920
func (c *PagesListCall) Do() (*PageList, error) {
 
921
        var body io.Reader = nil
 
922
        params := make(url.Values)
 
923
        params.Set("alt", "json")
 
924
        if v, ok := c.opt_["fetchBodies"]; ok {
 
925
                params.Set("fetchBodies", fmt.Sprintf("%v", v))
 
926
        }
 
927
        if v, ok := c.opt_["fields"]; ok {
 
928
                params.Set("fields", fmt.Sprintf("%v", v))
 
929
        }
 
930
        urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages")
 
931
        urls += "?" + params.Encode()
 
932
        req, _ := http.NewRequest("GET", urls, body)
 
933
        googleapi.Expand(req.URL, map[string]string{
 
934
                "blogId": c.blogId,
 
935
        })
 
936
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
937
        res, err := c.s.client.Do(req)
 
938
        if err != nil {
 
939
                return nil, err
 
940
        }
 
941
        defer googleapi.CloseBody(res)
 
942
        if err := googleapi.CheckResponse(res); err != nil {
 
943
                return nil, err
 
944
        }
 
945
        var ret *PageList
 
946
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
947
                return nil, err
 
948
        }
 
949
        return ret, nil
 
950
        // {
 
951
        //   "description": "Retrieves pages for a blog, possibly filtered.",
 
952
        //   "httpMethod": "GET",
 
953
        //   "id": "blogger.pages.list",
 
954
        //   "parameterOrder": [
 
955
        //     "blogId"
 
956
        //   ],
 
957
        //   "parameters": {
 
958
        //     "blogId": {
 
959
        //       "description": "ID of the blog to fetch pages from.",
 
960
        //       "location": "path",
 
961
        //       "required": true,
 
962
        //       "type": "string"
 
963
        //     },
 
964
        //     "fetchBodies": {
 
965
        //       "description": "Whether to retrieve the Page bodies.",
 
966
        //       "location": "query",
 
967
        //       "type": "boolean"
 
968
        //     }
 
969
        //   },
 
970
        //   "path": "blogs/{blogId}/pages",
 
971
        //   "response": {
 
972
        //     "$ref": "PageList"
 
973
        //   },
 
974
        //   "scopes": [
 
975
        //     "https://www.googleapis.com/auth/blogger"
 
976
        //   ]
 
977
        // }
 
978
 
 
979
}
 
980
 
 
981
// method id "blogger.posts.get":
 
982
 
 
983
type PostsGetCall struct {
 
984
        s      *Service
 
985
        blogId string
 
986
        postId string
 
987
        opt_   map[string]interface{}
 
988
}
 
989
 
 
990
// Get: Get a post by id.
 
991
func (r *PostsService) Get(blogId string, postId string) *PostsGetCall {
 
992
        c := &PostsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
993
        c.blogId = blogId
 
994
        c.postId = postId
 
995
        return c
 
996
}
 
997
 
 
998
// Fields allows partial responses to be retrieved.
 
999
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1000
// for more information.
 
1001
func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall {
 
1002
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1003
        return c
 
1004
}
 
1005
 
 
1006
func (c *PostsGetCall) Do() (*Post, error) {
 
1007
        var body io.Reader = nil
 
1008
        params := make(url.Values)
 
1009
        params.Set("alt", "json")
 
1010
        if v, ok := c.opt_["fields"]; ok {
 
1011
                params.Set("fields", fmt.Sprintf("%v", v))
 
1012
        }
 
1013
        urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
 
1014
        urls += "?" + params.Encode()
 
1015
        req, _ := http.NewRequest("GET", urls, body)
 
1016
        googleapi.Expand(req.URL, map[string]string{
 
1017
                "blogId": c.blogId,
 
1018
                "postId": c.postId,
 
1019
        })
 
1020
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1021
        res, err := c.s.client.Do(req)
 
1022
        if err != nil {
 
1023
                return nil, err
 
1024
        }
 
1025
        defer googleapi.CloseBody(res)
 
1026
        if err := googleapi.CheckResponse(res); err != nil {
 
1027
                return nil, err
 
1028
        }
 
1029
        var ret *Post
 
1030
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1031
                return nil, err
 
1032
        }
 
1033
        return ret, nil
 
1034
        // {
 
1035
        //   "description": "Get a post by id.",
 
1036
        //   "httpMethod": "GET",
 
1037
        //   "id": "blogger.posts.get",
 
1038
        //   "parameterOrder": [
 
1039
        //     "blogId",
 
1040
        //     "postId"
 
1041
        //   ],
 
1042
        //   "parameters": {
 
1043
        //     "blogId": {
 
1044
        //       "description": "ID of the blog to fetch the post from.",
 
1045
        //       "location": "path",
 
1046
        //       "required": true,
 
1047
        //       "type": "string"
 
1048
        //     },
 
1049
        //     "postId": {
 
1050
        //       "description": "The ID of the post",
 
1051
        //       "location": "path",
 
1052
        //       "required": true,
 
1053
        //       "type": "string"
 
1054
        //     }
 
1055
        //   },
 
1056
        //   "path": "blogs/{blogId}/posts/{postId}",
 
1057
        //   "response": {
 
1058
        //     "$ref": "Post"
 
1059
        //   },
 
1060
        //   "scopes": [
 
1061
        //     "https://www.googleapis.com/auth/blogger"
 
1062
        //   ]
 
1063
        // }
 
1064
 
 
1065
}
 
1066
 
 
1067
// method id "blogger.posts.list":
 
1068
 
 
1069
type PostsListCall struct {
 
1070
        s      *Service
 
1071
        blogId string
 
1072
        opt_   map[string]interface{}
 
1073
}
 
1074
 
 
1075
// List: Retrieves a list of posts, possibly filtered.
 
1076
func (r *PostsService) List(blogId string) *PostsListCall {
 
1077
        c := &PostsListCall{s: r.s, opt_: make(map[string]interface{})}
 
1078
        c.blogId = blogId
 
1079
        return c
 
1080
}
 
1081
 
 
1082
// FetchBodies sets the optional parameter "fetchBodies": Whether the
 
1083
// body content of posts is included.
 
1084
func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall {
 
1085
        c.opt_["fetchBodies"] = fetchBodies
 
1086
        return c
 
1087
}
 
1088
 
 
1089
// MaxResults sets the optional parameter "maxResults": Maximum number
 
1090
// of posts to fetch.
 
1091
func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall {
 
1092
        c.opt_["maxResults"] = maxResults
 
1093
        return c
 
1094
}
 
1095
 
 
1096
// PageToken sets the optional parameter "pageToken": Continuation token
 
1097
// if the request is paged.
 
1098
func (c *PostsListCall) PageToken(pageToken string) *PostsListCall {
 
1099
        c.opt_["pageToken"] = pageToken
 
1100
        return c
 
1101
}
 
1102
 
 
1103
// StartDate sets the optional parameter "startDate": Earliest post date
 
1104
// to fetch, a date-time with RFC 3339 formatting.
 
1105
func (c *PostsListCall) StartDate(startDate string) *PostsListCall {
 
1106
        c.opt_["startDate"] = startDate
 
1107
        return c
 
1108
}
 
1109
 
 
1110
// Fields allows partial responses to be retrieved.
 
1111
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1112
// for more information.
 
1113
func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall {
 
1114
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1115
        return c
 
1116
}
 
1117
 
 
1118
func (c *PostsListCall) Do() (*PostList, error) {
 
1119
        var body io.Reader = nil
 
1120
        params := make(url.Values)
 
1121
        params.Set("alt", "json")
 
1122
        if v, ok := c.opt_["fetchBodies"]; ok {
 
1123
                params.Set("fetchBodies", fmt.Sprintf("%v", v))
 
1124
        }
 
1125
        if v, ok := c.opt_["maxResults"]; ok {
 
1126
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
1127
        }
 
1128
        if v, ok := c.opt_["pageToken"]; ok {
 
1129
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
1130
        }
 
1131
        if v, ok := c.opt_["startDate"]; ok {
 
1132
                params.Set("startDate", fmt.Sprintf("%v", v))
 
1133
        }
 
1134
        if v, ok := c.opt_["fields"]; ok {
 
1135
                params.Set("fields", fmt.Sprintf("%v", v))
 
1136
        }
 
1137
        urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts")
 
1138
        urls += "?" + params.Encode()
 
1139
        req, _ := http.NewRequest("GET", urls, body)
 
1140
        googleapi.Expand(req.URL, map[string]string{
 
1141
                "blogId": c.blogId,
 
1142
        })
 
1143
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1144
        res, err := c.s.client.Do(req)
 
1145
        if err != nil {
 
1146
                return nil, err
 
1147
        }
 
1148
        defer googleapi.CloseBody(res)
 
1149
        if err := googleapi.CheckResponse(res); err != nil {
 
1150
                return nil, err
 
1151
        }
 
1152
        var ret *PostList
 
1153
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1154
                return nil, err
 
1155
        }
 
1156
        return ret, nil
 
1157
        // {
 
1158
        //   "description": "Retrieves a list of posts, possibly filtered.",
 
1159
        //   "httpMethod": "GET",
 
1160
        //   "id": "blogger.posts.list",
 
1161
        //   "parameterOrder": [
 
1162
        //     "blogId"
 
1163
        //   ],
 
1164
        //   "parameters": {
 
1165
        //     "blogId": {
 
1166
        //       "description": "ID of the blog to fetch posts from.",
 
1167
        //       "location": "path",
 
1168
        //       "required": true,
 
1169
        //       "type": "string"
 
1170
        //     },
 
1171
        //     "fetchBodies": {
 
1172
        //       "description": "Whether the body content of posts is included.",
 
1173
        //       "location": "query",
 
1174
        //       "type": "boolean"
 
1175
        //     },
 
1176
        //     "maxResults": {
 
1177
        //       "description": "Maximum number of posts to fetch.",
 
1178
        //       "format": "uint32",
 
1179
        //       "location": "query",
 
1180
        //       "type": "integer"
 
1181
        //     },
 
1182
        //     "pageToken": {
 
1183
        //       "description": "Continuation token if the request is paged.",
 
1184
        //       "location": "query",
 
1185
        //       "type": "string"
 
1186
        //     },
 
1187
        //     "startDate": {
 
1188
        //       "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.",
 
1189
        //       "format": "date-time",
 
1190
        //       "location": "query",
 
1191
        //       "type": "string"
 
1192
        //     }
 
1193
        //   },
 
1194
        //   "path": "blogs/{blogId}/posts",
 
1195
        //   "response": {
 
1196
        //     "$ref": "PostList"
 
1197
        //   },
 
1198
        //   "scopes": [
 
1199
        //     "https://www.googleapis.com/auth/blogger"
 
1200
        //   ]
 
1201
        // }
 
1202
 
 
1203
}
 
1204
 
 
1205
// method id "blogger.users.get":
 
1206
 
 
1207
type UsersGetCall struct {
 
1208
        s      *Service
 
1209
        userId string
 
1210
        opt_   map[string]interface{}
 
1211
}
 
1212
 
 
1213
// Get: Gets one user by id.
 
1214
func (r *UsersService) Get(userId string) *UsersGetCall {
 
1215
        c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})}
 
1216
        c.userId = userId
 
1217
        return c
 
1218
}
 
1219
 
 
1220
// Fields allows partial responses to be retrieved.
 
1221
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1222
// for more information.
 
1223
func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
 
1224
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1225
        return c
 
1226
}
 
1227
 
 
1228
func (c *UsersGetCall) Do() (*User, error) {
 
1229
        var body io.Reader = nil
 
1230
        params := make(url.Values)
 
1231
        params.Set("alt", "json")
 
1232
        if v, ok := c.opt_["fields"]; ok {
 
1233
                params.Set("fields", fmt.Sprintf("%v", v))
 
1234
        }
 
1235
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}")
 
1236
        urls += "?" + params.Encode()
 
1237
        req, _ := http.NewRequest("GET", urls, body)
 
1238
        googleapi.Expand(req.URL, map[string]string{
 
1239
                "userId": c.userId,
 
1240
        })
 
1241
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1242
        res, err := c.s.client.Do(req)
 
1243
        if err != nil {
 
1244
                return nil, err
 
1245
        }
 
1246
        defer googleapi.CloseBody(res)
 
1247
        if err := googleapi.CheckResponse(res); err != nil {
 
1248
                return nil, err
 
1249
        }
 
1250
        var ret *User
 
1251
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1252
                return nil, err
 
1253
        }
 
1254
        return ret, nil
 
1255
        // {
 
1256
        //   "description": "Gets one user by id.",
 
1257
        //   "httpMethod": "GET",
 
1258
        //   "id": "blogger.users.get",
 
1259
        //   "parameterOrder": [
 
1260
        //     "userId"
 
1261
        //   ],
 
1262
        //   "parameters": {
 
1263
        //     "userId": {
 
1264
        //       "description": "The ID of the user to get.",
 
1265
        //       "location": "path",
 
1266
        //       "required": true,
 
1267
        //       "type": "string"
 
1268
        //     }
 
1269
        //   },
 
1270
        //   "path": "users/{userId}",
 
1271
        //   "response": {
 
1272
        //     "$ref": "User"
 
1273
        //   },
 
1274
        //   "scopes": [
 
1275
        //     "https://www.googleapis.com/auth/blogger"
 
1276
        //   ]
 
1277
        // }
 
1278
 
 
1279
}
 
1280
 
 
1281
// method id "blogger.users.blogs.list":
 
1282
 
 
1283
type UsersBlogsListCall struct {
 
1284
        s      *Service
 
1285
        userId string
 
1286
        opt_   map[string]interface{}
 
1287
}
 
1288
 
 
1289
// List: Retrieves a list of blogs, possibly filtered.
 
1290
func (r *UsersBlogsService) List(userId string) *UsersBlogsListCall {
 
1291
        c := &UsersBlogsListCall{s: r.s, opt_: make(map[string]interface{})}
 
1292
        c.userId = userId
 
1293
        return c
 
1294
}
 
1295
 
 
1296
// Fields allows partial responses to be retrieved.
 
1297
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1298
// for more information.
 
1299
func (c *UsersBlogsListCall) Fields(s ...googleapi.Field) *UsersBlogsListCall {
 
1300
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1301
        return c
 
1302
}
 
1303
 
 
1304
func (c *UsersBlogsListCall) Do() (*BlogList, error) {
 
1305
        var body io.Reader = nil
 
1306
        params := make(url.Values)
 
1307
        params.Set("alt", "json")
 
1308
        if v, ok := c.opt_["fields"]; ok {
 
1309
                params.Set("fields", fmt.Sprintf("%v", v))
 
1310
        }
 
1311
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs")
 
1312
        urls += "?" + params.Encode()
 
1313
        req, _ := http.NewRequest("GET", urls, body)
 
1314
        googleapi.Expand(req.URL, map[string]string{
 
1315
                "userId": c.userId,
 
1316
        })
 
1317
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1318
        res, err := c.s.client.Do(req)
 
1319
        if err != nil {
 
1320
                return nil, err
 
1321
        }
 
1322
        defer googleapi.CloseBody(res)
 
1323
        if err := googleapi.CheckResponse(res); err != nil {
 
1324
                return nil, err
 
1325
        }
 
1326
        var ret *BlogList
 
1327
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1328
                return nil, err
 
1329
        }
 
1330
        return ret, nil
 
1331
        // {
 
1332
        //   "description": "Retrieves a list of blogs, possibly filtered.",
 
1333
        //   "httpMethod": "GET",
 
1334
        //   "id": "blogger.users.blogs.list",
 
1335
        //   "parameterOrder": [
 
1336
        //     "userId"
 
1337
        //   ],
 
1338
        //   "parameters": {
 
1339
        //     "userId": {
 
1340
        //       "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
 
1341
        //       "location": "path",
 
1342
        //       "required": true,
 
1343
        //       "type": "string"
 
1344
        //     }
 
1345
        //   },
 
1346
        //   "path": "users/{userId}/blogs",
 
1347
        //   "response": {
 
1348
        //     "$ref": "BlogList"
 
1349
        //   },
 
1350
        //   "scopes": [
 
1351
        //     "https://www.googleapis.com/auth/blogger"
 
1352
        //   ]
 
1353
        // }
 
1354
 
 
1355
}