You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2650 line
86 KiB

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