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.
 
 
 

2559 lines
83 KiB

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