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.
 
 
 

6921 lines
212 KiB

  1. // Copyright YEAR Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package blogger provides access to the Blogger API.
  6. //
  7. // For product documentation, see: https://developers.google.com/blogger/docs/3.0/getting_started
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/blogger/v3"
  14. // ...
  15. // ctx := context.Background()
  16. // bloggerService, err := blogger.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // bloggerService, err := blogger.NewService(ctx, option.WithScopes(blogger.BloggerReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // bloggerService, err := blogger.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // bloggerService, err := blogger.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package blogger // import "google.golang.org/api/blogger/v3"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "blogger:v3"
  71. const apiName = "blogger"
  72. const apiVersion = "v3"
  73. const basePath = "https://www.googleapis.com/blogger/v3/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // Manage your Blogger account
  77. BloggerScope = "https://www.googleapis.com/auth/blogger"
  78. // View your Blogger account
  79. BloggerReadonlyScope = "https://www.googleapis.com/auth/blogger.readonly"
  80. )
  81. // NewService creates a new Service.
  82. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  83. scopesOption := option.WithScopes(
  84. "https://www.googleapis.com/auth/blogger",
  85. "https://www.googleapis.com/auth/blogger.readonly",
  86. )
  87. // NOTE: prepend, so we don't override user-specified scopes.
  88. opts = append([]option.ClientOption{scopesOption}, opts...)
  89. client, endpoint, err := htransport.NewClient(ctx, opts...)
  90. if err != nil {
  91. return nil, err
  92. }
  93. s, err := New(client)
  94. if err != nil {
  95. return nil, err
  96. }
  97. if endpoint != "" {
  98. s.BasePath = endpoint
  99. }
  100. return s, nil
  101. }
  102. // New creates a new Service. It uses the provided http.Client for requests.
  103. //
  104. // Deprecated: please use NewService instead.
  105. // To provide a custom HTTP client, use option.WithHTTPClient.
  106. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  107. func New(client *http.Client) (*Service, error) {
  108. if client == nil {
  109. return nil, errors.New("client is nil")
  110. }
  111. s := &Service{client: client, BasePath: basePath}
  112. s.BlogUserInfos = NewBlogUserInfosService(s)
  113. s.Blogs = NewBlogsService(s)
  114. s.Comments = NewCommentsService(s)
  115. s.PageViews = NewPageViewsService(s)
  116. s.Pages = NewPagesService(s)
  117. s.PostUserInfos = NewPostUserInfosService(s)
  118. s.Posts = NewPostsService(s)
  119. s.Users = NewUsersService(s)
  120. return s, nil
  121. }
  122. type Service struct {
  123. client *http.Client
  124. BasePath string // API endpoint base URL
  125. UserAgent string // optional additional User-Agent fragment
  126. BlogUserInfos *BlogUserInfosService
  127. Blogs *BlogsService
  128. Comments *CommentsService
  129. PageViews *PageViewsService
  130. Pages *PagesService
  131. PostUserInfos *PostUserInfosService
  132. Posts *PostsService
  133. Users *UsersService
  134. }
  135. func (s *Service) userAgent() string {
  136. if s.UserAgent == "" {
  137. return googleapi.UserAgent
  138. }
  139. return googleapi.UserAgent + " " + s.UserAgent
  140. }
  141. func NewBlogUserInfosService(s *Service) *BlogUserInfosService {
  142. rs := &BlogUserInfosService{s: s}
  143. return rs
  144. }
  145. type BlogUserInfosService struct {
  146. s *Service
  147. }
  148. func NewBlogsService(s *Service) *BlogsService {
  149. rs := &BlogsService{s: s}
  150. return rs
  151. }
  152. type BlogsService struct {
  153. s *Service
  154. }
  155. func NewCommentsService(s *Service) *CommentsService {
  156. rs := &CommentsService{s: s}
  157. return rs
  158. }
  159. type CommentsService struct {
  160. s *Service
  161. }
  162. func NewPageViewsService(s *Service) *PageViewsService {
  163. rs := &PageViewsService{s: s}
  164. return rs
  165. }
  166. type PageViewsService struct {
  167. s *Service
  168. }
  169. func NewPagesService(s *Service) *PagesService {
  170. rs := &PagesService{s: s}
  171. return rs
  172. }
  173. type PagesService struct {
  174. s *Service
  175. }
  176. func NewPostUserInfosService(s *Service) *PostUserInfosService {
  177. rs := &PostUserInfosService{s: s}
  178. return rs
  179. }
  180. type PostUserInfosService struct {
  181. s *Service
  182. }
  183. func NewPostsService(s *Service) *PostsService {
  184. rs := &PostsService{s: s}
  185. return rs
  186. }
  187. type PostsService struct {
  188. s *Service
  189. }
  190. func NewUsersService(s *Service) *UsersService {
  191. rs := &UsersService{s: s}
  192. return rs
  193. }
  194. type UsersService struct {
  195. s *Service
  196. }
  197. type Blog struct {
  198. // CustomMetaData: The JSON custom meta-data for the Blog
  199. CustomMetaData string `json:"customMetaData,omitempty"`
  200. // Description: The description of this blog. This is displayed
  201. // underneath the title.
  202. Description string `json:"description,omitempty"`
  203. // Id: The identifier for this resource.
  204. Id string `json:"id,omitempty"`
  205. // Kind: The kind of this entry. Always blogger#blog
  206. Kind string `json:"kind,omitempty"`
  207. // Locale: The locale this Blog is set to.
  208. Locale *BlogLocale `json:"locale,omitempty"`
  209. // Name: The name of this blog. This is displayed as the title.
  210. Name string `json:"name,omitempty"`
  211. // Pages: The container of pages in this blog.
  212. Pages *BlogPages `json:"pages,omitempty"`
  213. // Posts: The container of posts in this blog.
  214. Posts *BlogPosts `json:"posts,omitempty"`
  215. // Published: RFC 3339 date-time when this blog was published.
  216. Published string `json:"published,omitempty"`
  217. // SelfLink: The API REST URL to fetch this resource from.
  218. SelfLink string `json:"selfLink,omitempty"`
  219. // Updated: RFC 3339 date-time when this blog was last updated.
  220. Updated string `json:"updated,omitempty"`
  221. // Url: The URL where this blog is published.
  222. Url string `json:"url,omitempty"`
  223. // ServerResponse contains the HTTP response code and headers from the
  224. // server.
  225. googleapi.ServerResponse `json:"-"`
  226. // ForceSendFields is a list of field names (e.g. "CustomMetaData") to
  227. // unconditionally include in API requests. By default, fields with
  228. // empty values are omitted from API requests. However, any non-pointer,
  229. // non-interface field appearing in ForceSendFields will be sent to the
  230. // server regardless of whether the field is empty or not. This may be
  231. // used to include empty fields in Patch requests.
  232. ForceSendFields []string `json:"-"`
  233. // NullFields is a list of field names (e.g. "CustomMetaData") to
  234. // include in API requests with the JSON null value. By default, fields
  235. // with empty values are omitted from API requests. However, any field
  236. // with an empty value appearing in NullFields will be sent to the
  237. // server as null. It is an error if a field in this list has a
  238. // non-empty value. This may be used to include null fields in Patch
  239. // requests.
  240. NullFields []string `json:"-"`
  241. }
  242. func (s *Blog) MarshalJSON() ([]byte, error) {
  243. type NoMethod Blog
  244. raw := NoMethod(*s)
  245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  246. }
  247. // BlogLocale: The locale this Blog is set to.
  248. type BlogLocale struct {
  249. // Country: The country this blog's locale is set to.
  250. Country string `json:"country,omitempty"`
  251. // Language: The language this blog is authored in.
  252. Language string `json:"language,omitempty"`
  253. // Variant: The language variant this blog is authored in.
  254. Variant string `json:"variant,omitempty"`
  255. // ForceSendFields is a list of field names (e.g. "Country") to
  256. // unconditionally include in API requests. By default, fields with
  257. // empty values are omitted from API requests. However, any non-pointer,
  258. // non-interface field appearing in ForceSendFields will be sent to the
  259. // server regardless of whether the field is empty or not. This may be
  260. // used to include empty fields in Patch requests.
  261. ForceSendFields []string `json:"-"`
  262. // NullFields is a list of field names (e.g. "Country") to include in
  263. // API requests with the JSON null value. By default, fields with empty
  264. // values are omitted from API requests. However, any field with an
  265. // empty value appearing in NullFields will be sent to the server as
  266. // null. It is an error if a field in this list has a non-empty value.
  267. // This may be used to include null fields in Patch requests.
  268. NullFields []string `json:"-"`
  269. }
  270. func (s *BlogLocale) MarshalJSON() ([]byte, error) {
  271. type NoMethod BlogLocale
  272. raw := NoMethod(*s)
  273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  274. }
  275. // BlogPages: The container of pages in this blog.
  276. type BlogPages struct {
  277. // SelfLink: The URL of the container for pages in this blog.
  278. SelfLink string `json:"selfLink,omitempty"`
  279. // TotalItems: The count of pages in this blog.
  280. TotalItems int64 `json:"totalItems,omitempty"`
  281. // ForceSendFields is a list of field names (e.g. "SelfLink") to
  282. // unconditionally include in API requests. By default, fields with
  283. // empty values are omitted from API requests. However, any non-pointer,
  284. // non-interface field appearing in ForceSendFields will be sent to the
  285. // server regardless of whether the field is empty or not. This may be
  286. // used to include empty fields in Patch requests.
  287. ForceSendFields []string `json:"-"`
  288. // NullFields is a list of field names (e.g. "SelfLink") to include in
  289. // API requests with the JSON null value. By default, fields with empty
  290. // values are omitted from API requests. However, any field with an
  291. // empty value appearing in NullFields will be sent to the server as
  292. // null. It is an error if a field in this list has a non-empty value.
  293. // This may be used to include null fields in Patch requests.
  294. NullFields []string `json:"-"`
  295. }
  296. func (s *BlogPages) MarshalJSON() ([]byte, error) {
  297. type NoMethod BlogPages
  298. raw := NoMethod(*s)
  299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  300. }
  301. // BlogPosts: The container of posts in this blog.
  302. type BlogPosts struct {
  303. // Items: The List of Posts for this Blog.
  304. Items []*Post `json:"items,omitempty"`
  305. // SelfLink: The URL of the container for posts in this blog.
  306. SelfLink string `json:"selfLink,omitempty"`
  307. // TotalItems: The count of posts in this blog.
  308. TotalItems int64 `json:"totalItems,omitempty"`
  309. // ForceSendFields is a list of field names (e.g. "Items") to
  310. // unconditionally include in API requests. By default, fields with
  311. // empty values are omitted from API requests. However, any non-pointer,
  312. // non-interface field appearing in ForceSendFields will be sent to the
  313. // server regardless of whether the field is empty or not. This may be
  314. // used to include empty fields in Patch requests.
  315. ForceSendFields []string `json:"-"`
  316. // NullFields is a list of field names (e.g. "Items") to include in API
  317. // requests with the JSON null value. By default, fields with empty
  318. // values are omitted from API requests. However, any field with an
  319. // empty value appearing in NullFields will be sent to the server as
  320. // null. It is an error if a field in this list has a non-empty value.
  321. // This may be used to include null fields in Patch requests.
  322. NullFields []string `json:"-"`
  323. }
  324. func (s *BlogPosts) MarshalJSON() ([]byte, error) {
  325. type NoMethod BlogPosts
  326. raw := NoMethod(*s)
  327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  328. }
  329. type BlogList struct {
  330. // BlogUserInfos: Admin level list of blog per-user information
  331. BlogUserInfos []*BlogUserInfo `json:"blogUserInfos,omitempty"`
  332. // Items: The list of Blogs this user has Authorship or Admin rights
  333. // over.
  334. Items []*Blog `json:"items,omitempty"`
  335. // Kind: The kind of this entity. Always blogger#blogList
  336. Kind string `json:"kind,omitempty"`
  337. // ServerResponse contains the HTTP response code and headers from the
  338. // server.
  339. googleapi.ServerResponse `json:"-"`
  340. // ForceSendFields is a list of field names (e.g. "BlogUserInfos") to
  341. // unconditionally include in API requests. By default, fields with
  342. // empty values are omitted from API requests. However, any non-pointer,
  343. // non-interface field appearing in ForceSendFields will be sent to the
  344. // server regardless of whether the field is empty or not. This may be
  345. // used to include empty fields in Patch requests.
  346. ForceSendFields []string `json:"-"`
  347. // NullFields is a list of field names (e.g. "BlogUserInfos") to include
  348. // in API requests with the JSON null value. By default, fields with
  349. // empty values are omitted from API requests. However, any field with
  350. // an empty value appearing in NullFields will be sent to the server as
  351. // null. It is an error if a field in this list has a non-empty value.
  352. // This may be used to include null fields in Patch requests.
  353. NullFields []string `json:"-"`
  354. }
  355. func (s *BlogList) MarshalJSON() ([]byte, error) {
  356. type NoMethod BlogList
  357. raw := NoMethod(*s)
  358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  359. }
  360. type BlogPerUserInfo struct {
  361. // BlogId: ID of the Blog resource
  362. BlogId string `json:"blogId,omitempty"`
  363. // HasAdminAccess: True if the user has Admin level access to the blog.
  364. HasAdminAccess bool `json:"hasAdminAccess,omitempty"`
  365. // Kind: The kind of this entity. Always blogger#blogPerUserInfo
  366. Kind string `json:"kind,omitempty"`
  367. // PhotosAlbumKey: The Photo Album Key for the user when adding photos
  368. // to the blog
  369. PhotosAlbumKey string `json:"photosAlbumKey,omitempty"`
  370. // UserId: ID of the User
  371. UserId string `json:"userId,omitempty"`
  372. // ForceSendFields is a list of field names (e.g. "BlogId") to
  373. // unconditionally include in API requests. By default, fields with
  374. // empty values are omitted from API requests. However, any non-pointer,
  375. // non-interface field appearing in ForceSendFields will be sent to the
  376. // server regardless of whether the field is empty or not. This may be
  377. // used to include empty fields in Patch requests.
  378. ForceSendFields []string `json:"-"`
  379. // NullFields is a list of field names (e.g. "BlogId") to include in API
  380. // requests with the JSON null value. By default, fields with empty
  381. // values are omitted from API requests. However, any field with an
  382. // empty value appearing in NullFields will be sent to the server as
  383. // null. It is an error if a field in this list has a non-empty value.
  384. // This may be used to include null fields in Patch requests.
  385. NullFields []string `json:"-"`
  386. }
  387. func (s *BlogPerUserInfo) MarshalJSON() ([]byte, error) {
  388. type NoMethod BlogPerUserInfo
  389. raw := NoMethod(*s)
  390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  391. }
  392. type BlogUserInfo struct {
  393. // Blog: The Blog resource.
  394. Blog *Blog `json:"blog,omitempty"`
  395. // BlogUserInfo: Information about a User for the Blog.
  396. BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"`
  397. // Kind: The kind of this entity. Always blogger#blogUserInfo
  398. Kind string `json:"kind,omitempty"`
  399. // ServerResponse contains the HTTP response code and headers from the
  400. // server.
  401. googleapi.ServerResponse `json:"-"`
  402. // ForceSendFields is a list of field names (e.g. "Blog") to
  403. // unconditionally include in API requests. By default, fields with
  404. // empty values are omitted from API requests. However, any non-pointer,
  405. // non-interface field appearing in ForceSendFields will be sent to the
  406. // server regardless of whether the field is empty or not. This may be
  407. // used to include empty fields in Patch requests.
  408. ForceSendFields []string `json:"-"`
  409. // NullFields is a list of field names (e.g. "Blog") to include in API
  410. // requests with the JSON null value. By default, fields with empty
  411. // values are omitted from API requests. However, any field with an
  412. // empty value appearing in NullFields will be sent to the server as
  413. // null. It is an error if a field in this list has a non-empty value.
  414. // This may be used to include null fields in Patch requests.
  415. NullFields []string `json:"-"`
  416. }
  417. func (s *BlogUserInfo) MarshalJSON() ([]byte, error) {
  418. type NoMethod BlogUserInfo
  419. raw := NoMethod(*s)
  420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  421. }
  422. type Comment struct {
  423. // Author: The author of this Comment.
  424. Author *CommentAuthor `json:"author,omitempty"`
  425. // Blog: Data about the blog containing this comment.
  426. Blog *CommentBlog `json:"blog,omitempty"`
  427. // Content: The actual content of the comment. May include HTML markup.
  428. Content string `json:"content,omitempty"`
  429. // Id: The identifier for this resource.
  430. Id string `json:"id,omitempty"`
  431. // InReplyTo: Data about the comment this is in reply to.
  432. InReplyTo *CommentInReplyTo `json:"inReplyTo,omitempty"`
  433. // Kind: The kind of this entry. Always blogger#comment
  434. Kind string `json:"kind,omitempty"`
  435. // Post: Data about the post containing this comment.
  436. Post *CommentPost `json:"post,omitempty"`
  437. // Published: RFC 3339 date-time when this comment was published.
  438. Published string `json:"published,omitempty"`
  439. // SelfLink: The API REST URL to fetch this resource from.
  440. SelfLink string `json:"selfLink,omitempty"`
  441. // Status: The status of the comment (only populated for admin users)
  442. Status string `json:"status,omitempty"`
  443. // Updated: RFC 3339 date-time when this comment was last updated.
  444. Updated string `json:"updated,omitempty"`
  445. // ServerResponse contains the HTTP response code and headers from the
  446. // server.
  447. googleapi.ServerResponse `json:"-"`
  448. // ForceSendFields is a list of field names (e.g. "Author") to
  449. // unconditionally include in API requests. By default, fields with
  450. // empty values are omitted from API requests. However, any non-pointer,
  451. // non-interface field appearing in ForceSendFields will be sent to the
  452. // server regardless of whether the field is empty or not. This may be
  453. // used to include empty fields in Patch requests.
  454. ForceSendFields []string `json:"-"`
  455. // NullFields is a list of field names (e.g. "Author") to include in API
  456. // requests with the JSON null value. By default, fields with empty
  457. // values are omitted from API requests. However, any field with an
  458. // empty value appearing in NullFields will be sent to the server as
  459. // null. It is an error if a field in this list has a non-empty value.
  460. // This may be used to include null fields in Patch requests.
  461. NullFields []string `json:"-"`
  462. }
  463. func (s *Comment) MarshalJSON() ([]byte, error) {
  464. type NoMethod Comment
  465. raw := NoMethod(*s)
  466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  467. }
  468. // CommentAuthor: The author of this Comment.
  469. type CommentAuthor struct {
  470. // DisplayName: The display name.
  471. DisplayName string `json:"displayName,omitempty"`
  472. // Id: The identifier of the Comment creator.
  473. Id string `json:"id,omitempty"`
  474. // Image: The comment creator's avatar.
  475. Image *CommentAuthorImage `json:"image,omitempty"`
  476. // Url: The URL of the Comment creator's Profile page.
  477. Url string `json:"url,omitempty"`
  478. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  479. // unconditionally include in API requests. By default, fields with
  480. // empty values are omitted from API requests. However, any non-pointer,
  481. // non-interface field appearing in ForceSendFields will be sent to the
  482. // server regardless of whether the field is empty or not. This may be
  483. // used to include empty fields in Patch requests.
  484. ForceSendFields []string `json:"-"`
  485. // NullFields is a list of field names (e.g. "DisplayName") to include
  486. // in API requests with the JSON null value. By default, fields with
  487. // empty values are omitted from API requests. However, any field with
  488. // an empty value appearing in NullFields will be sent to the server as
  489. // null. It is an error if a field in this list has a non-empty value.
  490. // This may be used to include null fields in Patch requests.
  491. NullFields []string `json:"-"`
  492. }
  493. func (s *CommentAuthor) MarshalJSON() ([]byte, error) {
  494. type NoMethod CommentAuthor
  495. raw := NoMethod(*s)
  496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  497. }
  498. // CommentAuthorImage: The comment creator's avatar.
  499. type CommentAuthorImage struct {
  500. // Url: The comment creator's avatar URL.
  501. Url string `json:"url,omitempty"`
  502. // ForceSendFields is a list of field names (e.g. "Url") to
  503. // unconditionally include in API requests. By default, fields with
  504. // empty values are omitted from API requests. However, any non-pointer,
  505. // non-interface field appearing in ForceSendFields will be sent to the
  506. // server regardless of whether the field is empty or not. This may be
  507. // used to include empty fields in Patch requests.
  508. ForceSendFields []string `json:"-"`
  509. // NullFields is a list of field names (e.g. "Url") to include in API
  510. // requests with the JSON null value. By default, fields with empty
  511. // values are omitted from API requests. However, any field with an
  512. // empty value appearing in NullFields will be sent to the server as
  513. // null. It is an error if a field in this list has a non-empty value.
  514. // This may be used to include null fields in Patch requests.
  515. NullFields []string `json:"-"`
  516. }
  517. func (s *CommentAuthorImage) MarshalJSON() ([]byte, error) {
  518. type NoMethod CommentAuthorImage
  519. raw := NoMethod(*s)
  520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  521. }
  522. // CommentBlog: Data about the blog containing this comment.
  523. type CommentBlog struct {
  524. // Id: The identifier of the blog containing this comment.
  525. Id string `json:"id,omitempty"`
  526. // ForceSendFields is a list of field names (e.g. "Id") to
  527. // unconditionally include in API requests. By default, fields with
  528. // empty values are omitted from API requests. However, any non-pointer,
  529. // non-interface field appearing in ForceSendFields will be sent to the
  530. // server regardless of whether the field is empty or not. This may be
  531. // used to include empty fields in Patch requests.
  532. ForceSendFields []string `json:"-"`
  533. // NullFields is a list of field names (e.g. "Id") to include in API
  534. // requests with the JSON null value. By default, fields with empty
  535. // values are omitted from API requests. However, any field with an
  536. // empty value appearing in NullFields will be sent to the server as
  537. // null. It is an error if a field in this list has a non-empty value.
  538. // This may be used to include null fields in Patch requests.
  539. NullFields []string `json:"-"`
  540. }
  541. func (s *CommentBlog) MarshalJSON() ([]byte, error) {
  542. type NoMethod CommentBlog
  543. raw := NoMethod(*s)
  544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  545. }
  546. // CommentInReplyTo: Data about the comment this is in reply to.
  547. type CommentInReplyTo struct {
  548. // Id: The identified of the parent of this comment.
  549. Id string `json:"id,omitempty"`
  550. // ForceSendFields is a list of field names (e.g. "Id") to
  551. // unconditionally include in API requests. By default, fields with
  552. // empty values are omitted from API requests. However, any non-pointer,
  553. // non-interface field appearing in ForceSendFields will be sent to the
  554. // server regardless of whether the field is empty or not. This may be
  555. // used to include empty fields in Patch requests.
  556. ForceSendFields []string `json:"-"`
  557. // NullFields is a list of field names (e.g. "Id") to include in API
  558. // requests with the JSON null value. By default, fields with empty
  559. // values are omitted from API requests. However, any field with an
  560. // empty value appearing in NullFields will be sent to the server as
  561. // null. It is an error if a field in this list has a non-empty value.
  562. // This may be used to include null fields in Patch requests.
  563. NullFields []string `json:"-"`
  564. }
  565. func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) {
  566. type NoMethod CommentInReplyTo
  567. raw := NoMethod(*s)
  568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  569. }
  570. // CommentPost: Data about the post containing this comment.
  571. type CommentPost struct {
  572. // Id: The identifier of the post containing this comment.
  573. Id string `json:"id,omitempty"`
  574. // ForceSendFields is a list of field names (e.g. "Id") to
  575. // unconditionally include in API requests. By default, fields with
  576. // empty values are omitted from API requests. However, any non-pointer,
  577. // non-interface field appearing in ForceSendFields will be sent to the
  578. // server regardless of whether the field is empty or not. This may be
  579. // used to include empty fields in Patch requests.
  580. ForceSendFields []string `json:"-"`
  581. // NullFields is a list of field names (e.g. "Id") to include in API
  582. // requests with the JSON null value. By default, fields with empty
  583. // values are omitted from API requests. However, any field with an
  584. // empty value appearing in NullFields will be sent to the server as
  585. // null. It is an error if a field in this list has a non-empty value.
  586. // This may be used to include null fields in Patch requests.
  587. NullFields []string `json:"-"`
  588. }
  589. func (s *CommentPost) MarshalJSON() ([]byte, error) {
  590. type NoMethod CommentPost
  591. raw := NoMethod(*s)
  592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  593. }
  594. type CommentList struct {
  595. // Items: The List of Comments for a Post.
  596. Items []*Comment `json:"items,omitempty"`
  597. // Kind: The kind of this entry. Always blogger#commentList
  598. Kind string `json:"kind,omitempty"`
  599. // NextPageToken: Pagination token to fetch the next page, if one
  600. // exists.
  601. NextPageToken string `json:"nextPageToken,omitempty"`
  602. // PrevPageToken: Pagination token to fetch the previous page, if one
  603. // exists.
  604. PrevPageToken string `json:"prevPageToken,omitempty"`
  605. // ServerResponse contains the HTTP response code and headers from the
  606. // server.
  607. googleapi.ServerResponse `json:"-"`
  608. // ForceSendFields is a list of field names (e.g. "Items") to
  609. // unconditionally include in API requests. By default, fields with
  610. // empty values are omitted from API requests. However, any non-pointer,
  611. // non-interface field appearing in ForceSendFields will be sent to the
  612. // server regardless of whether the field is empty or not. This may be
  613. // used to include empty fields in Patch requests.
  614. ForceSendFields []string `json:"-"`
  615. // NullFields is a list of field names (e.g. "Items") to include in API
  616. // requests with the JSON null value. By default, fields with empty
  617. // values are omitted from API requests. However, any field with an
  618. // empty value appearing in NullFields will be sent to the server as
  619. // null. It is an error if a field in this list has a non-empty value.
  620. // This may be used to include null fields in Patch requests.
  621. NullFields []string `json:"-"`
  622. }
  623. func (s *CommentList) MarshalJSON() ([]byte, error) {
  624. type NoMethod CommentList
  625. raw := NoMethod(*s)
  626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  627. }
  628. type Page struct {
  629. // Author: The author of this Page.
  630. Author *PageAuthor `json:"author,omitempty"`
  631. // Blog: Data about the blog containing this Page.
  632. Blog *PageBlog `json:"blog,omitempty"`
  633. // Content: The body content of this Page, in HTML.
  634. Content string `json:"content,omitempty"`
  635. // Id: The identifier for this resource.
  636. Id string `json:"id,omitempty"`
  637. // Kind: The kind of this entity. Always blogger#page
  638. Kind string `json:"kind,omitempty"`
  639. // Published: RFC 3339 date-time when this Page was published.
  640. Published string `json:"published,omitempty"`
  641. // SelfLink: The API REST URL to fetch this resource from.
  642. SelfLink string `json:"selfLink,omitempty"`
  643. // Status: The status of the page for admin resources (either LIVE or
  644. // DRAFT).
  645. Status string `json:"status,omitempty"`
  646. // Title: The title of this entity. This is the name displayed in the
  647. // Admin user interface.
  648. Title string `json:"title,omitempty"`
  649. // Updated: RFC 3339 date-time when this Page was last updated.
  650. Updated string `json:"updated,omitempty"`
  651. // Url: The URL that this Page is displayed at.
  652. Url string `json:"url,omitempty"`
  653. // ServerResponse contains the HTTP response code and headers from the
  654. // server.
  655. googleapi.ServerResponse `json:"-"`
  656. // ForceSendFields is a list of field names (e.g. "Author") to
  657. // unconditionally include in API requests. By default, fields with
  658. // empty values are omitted from API requests. However, any non-pointer,
  659. // non-interface field appearing in ForceSendFields will be sent to the
  660. // server regardless of whether the field is empty or not. This may be
  661. // used to include empty fields in Patch requests.
  662. ForceSendFields []string `json:"-"`
  663. // NullFields is a list of field names (e.g. "Author") to include in API
  664. // requests with the JSON null value. By default, fields with empty
  665. // values are omitted from API requests. However, any field with an
  666. // empty value appearing in NullFields will be sent to the server as
  667. // null. It is an error if a field in this list has a non-empty value.
  668. // This may be used to include null fields in Patch requests.
  669. NullFields []string `json:"-"`
  670. }
  671. func (s *Page) MarshalJSON() ([]byte, error) {
  672. type NoMethod Page
  673. raw := NoMethod(*s)
  674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  675. }
  676. // PageAuthor: The author of this Page.
  677. type PageAuthor struct {
  678. // DisplayName: The display name.
  679. DisplayName string `json:"displayName,omitempty"`
  680. // Id: The identifier of the Page creator.
  681. Id string `json:"id,omitempty"`
  682. // Image: The page author's avatar.
  683. Image *PageAuthorImage `json:"image,omitempty"`
  684. // Url: The URL of the Page creator's Profile page.
  685. Url string `json:"url,omitempty"`
  686. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  687. // unconditionally include in API requests. By default, fields with
  688. // empty values are omitted from API requests. However, any non-pointer,
  689. // non-interface field appearing in ForceSendFields will be sent to the
  690. // server regardless of whether the field is empty or not. This may be
  691. // used to include empty fields in Patch requests.
  692. ForceSendFields []string `json:"-"`
  693. // NullFields is a list of field names (e.g. "DisplayName") to include
  694. // in API requests with the JSON null value. By default, fields with
  695. // empty values are omitted from API requests. However, any field with
  696. // an empty value appearing in NullFields will be sent to the server as
  697. // null. It is an error if a field in this list has a non-empty value.
  698. // This may be used to include null fields in Patch requests.
  699. NullFields []string `json:"-"`
  700. }
  701. func (s *PageAuthor) MarshalJSON() ([]byte, error) {
  702. type NoMethod PageAuthor
  703. raw := NoMethod(*s)
  704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  705. }
  706. // PageAuthorImage: The page author's avatar.
  707. type PageAuthorImage struct {
  708. // Url: The page author's avatar URL.
  709. Url string `json:"url,omitempty"`
  710. // ForceSendFields is a list of field names (e.g. "Url") to
  711. // unconditionally include in API requests. By default, fields with
  712. // empty values are omitted from API requests. However, any non-pointer,
  713. // non-interface field appearing in ForceSendFields will be sent to the
  714. // server regardless of whether the field is empty or not. This may be
  715. // used to include empty fields in Patch requests.
  716. ForceSendFields []string `json:"-"`
  717. // NullFields is a list of field names (e.g. "Url") to include in API
  718. // requests with the JSON null value. By default, fields with empty
  719. // values are omitted from API requests. However, any field with an
  720. // empty value appearing in NullFields will be sent to the server as
  721. // null. It is an error if a field in this list has a non-empty value.
  722. // This may be used to include null fields in Patch requests.
  723. NullFields []string `json:"-"`
  724. }
  725. func (s *PageAuthorImage) MarshalJSON() ([]byte, error) {
  726. type NoMethod PageAuthorImage
  727. raw := NoMethod(*s)
  728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  729. }
  730. // PageBlog: Data about the blog containing this Page.
  731. type PageBlog struct {
  732. // Id: The identifier of the blog containing this page.
  733. Id string `json:"id,omitempty"`
  734. // ForceSendFields is a list of field names (e.g. "Id") to
  735. // unconditionally include in API requests. By default, fields with
  736. // empty values are omitted from API requests. However, any non-pointer,
  737. // non-interface field appearing in ForceSendFields will be sent to the
  738. // server regardless of whether the field is empty or not. This may be
  739. // used to include empty fields in Patch requests.
  740. ForceSendFields []string `json:"-"`
  741. // NullFields is a list of field names (e.g. "Id") to include in API
  742. // requests with the JSON null value. By default, fields with empty
  743. // values are omitted from API requests. However, any field with an
  744. // empty value appearing in NullFields will be sent to the server as
  745. // null. It is an error if a field in this list has a non-empty value.
  746. // This may be used to include null fields in Patch requests.
  747. NullFields []string `json:"-"`
  748. }
  749. func (s *PageBlog) MarshalJSON() ([]byte, error) {
  750. type NoMethod PageBlog
  751. raw := NoMethod(*s)
  752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  753. }
  754. type PageList struct {
  755. // Items: The list of Pages for a Blog.
  756. Items []*Page `json:"items,omitempty"`
  757. // Kind: The kind of this entity. Always blogger#pageList
  758. Kind string `json:"kind,omitempty"`
  759. // ServerResponse contains the HTTP response code and headers from the
  760. // server.
  761. googleapi.ServerResponse `json:"-"`
  762. // ForceSendFields is a list of field names (e.g. "Items") to
  763. // unconditionally include in API requests. By default, fields with
  764. // empty values are omitted from API requests. However, any non-pointer,
  765. // non-interface field appearing in ForceSendFields will be sent to the
  766. // server regardless of whether the field is empty or not. This may be
  767. // used to include empty fields in Patch requests.
  768. ForceSendFields []string `json:"-"`
  769. // NullFields is a list of field names (e.g. "Items") to include in API
  770. // requests with the JSON null value. By default, fields with empty
  771. // values are omitted from API requests. However, any field with an
  772. // empty value appearing in NullFields will be sent to the server as
  773. // null. It is an error if a field in this list has a non-empty value.
  774. // This may be used to include null fields in Patch requests.
  775. NullFields []string `json:"-"`
  776. }
  777. func (s *PageList) MarshalJSON() ([]byte, error) {
  778. type NoMethod PageList
  779. raw := NoMethod(*s)
  780. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  781. }
  782. type Pageviews struct {
  783. // BlogId: Blog Id
  784. BlogId int64 `json:"blogId,omitempty,string"`
  785. // Counts: The container of posts in this blog.
  786. Counts []*PageviewsCounts `json:"counts,omitempty"`
  787. // Kind: The kind of this entry. Always blogger#page_views
  788. Kind string `json:"kind,omitempty"`
  789. // ServerResponse contains the HTTP response code and headers from the
  790. // server.
  791. googleapi.ServerResponse `json:"-"`
  792. // ForceSendFields is a list of field names (e.g. "BlogId") to
  793. // unconditionally include in API requests. By default, fields with
  794. // empty values are omitted from API requests. However, any non-pointer,
  795. // non-interface field appearing in ForceSendFields will be sent to the
  796. // server regardless of whether the field is empty or not. This may be
  797. // used to include empty fields in Patch requests.
  798. ForceSendFields []string `json:"-"`
  799. // NullFields is a list of field names (e.g. "BlogId") to include in API
  800. // requests with the JSON null value. By default, fields with empty
  801. // values are omitted from API requests. However, any field with an
  802. // empty value appearing in NullFields will be sent to the server as
  803. // null. It is an error if a field in this list has a non-empty value.
  804. // This may be used to include null fields in Patch requests.
  805. NullFields []string `json:"-"`
  806. }
  807. func (s *Pageviews) MarshalJSON() ([]byte, error) {
  808. type NoMethod Pageviews
  809. raw := NoMethod(*s)
  810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  811. }
  812. type PageviewsCounts struct {
  813. // Count: Count of page views for the given time range
  814. Count int64 `json:"count,omitempty,string"`
  815. // TimeRange: Time range the given count applies to
  816. TimeRange string `json:"timeRange,omitempty"`
  817. // ForceSendFields is a list of field names (e.g. "Count") to
  818. // unconditionally include in API requests. By default, fields with
  819. // empty values are omitted from API requests. However, any non-pointer,
  820. // non-interface field appearing in ForceSendFields will be sent to the
  821. // server regardless of whether the field is empty or not. This may be
  822. // used to include empty fields in Patch requests.
  823. ForceSendFields []string `json:"-"`
  824. // NullFields is a list of field names (e.g. "Count") to include in API
  825. // requests with the JSON null value. By default, fields with empty
  826. // values are omitted from API requests. However, any field with an
  827. // empty value appearing in NullFields will be sent to the server as
  828. // null. It is an error if a field in this list has a non-empty value.
  829. // This may be used to include null fields in Patch requests.
  830. NullFields []string `json:"-"`
  831. }
  832. func (s *PageviewsCounts) MarshalJSON() ([]byte, error) {
  833. type NoMethod PageviewsCounts
  834. raw := NoMethod(*s)
  835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  836. }
  837. type Post struct {
  838. // Author: The author of this Post.
  839. Author *PostAuthor `json:"author,omitempty"`
  840. // Blog: Data about the blog containing this Post.
  841. Blog *PostBlog `json:"blog,omitempty"`
  842. // Content: The content of the Post. May contain HTML markup.
  843. Content string `json:"content,omitempty"`
  844. // CustomMetaData: The JSON meta-data for the Post.
  845. CustomMetaData string `json:"customMetaData,omitempty"`
  846. // Id: The identifier of this Post.
  847. Id string `json:"id,omitempty"`
  848. // Images: Display image for the Post.
  849. Images []*PostImages `json:"images,omitempty"`
  850. // Kind: The kind of this entity. Always blogger#post
  851. Kind string `json:"kind,omitempty"`
  852. // Labels: The list of labels this Post was tagged with.
  853. Labels []string `json:"labels,omitempty"`
  854. // Location: The location for geotagged posts.
  855. Location *PostLocation `json:"location,omitempty"`
  856. // Published: RFC 3339 date-time when this Post was published.
  857. Published string `json:"published,omitempty"`
  858. // Replies: The container of comments on this Post.
  859. Replies *PostReplies `json:"replies,omitempty"`
  860. // SelfLink: The API REST URL to fetch this resource from.
  861. SelfLink string `json:"selfLink,omitempty"`
  862. // Status: Status of the post. Only set for admin-level requests
  863. Status string `json:"status,omitempty"`
  864. // Title: The title of the Post.
  865. Title string `json:"title,omitempty"`
  866. // TitleLink: The title link URL, similar to atom's related link.
  867. TitleLink string `json:"titleLink,omitempty"`
  868. // Updated: RFC 3339 date-time when this Post was last updated.
  869. Updated string `json:"updated,omitempty"`
  870. // Url: The URL where this Post is displayed.
  871. Url string `json:"url,omitempty"`
  872. // ServerResponse contains the HTTP response code and headers from the
  873. // server.
  874. googleapi.ServerResponse `json:"-"`
  875. // ForceSendFields is a list of field names (e.g. "Author") to
  876. // unconditionally include in API requests. By default, fields with
  877. // empty values are omitted from API requests. However, any non-pointer,
  878. // non-interface field appearing in ForceSendFields will be sent to the
  879. // server regardless of whether the field is empty or not. This may be
  880. // used to include empty fields in Patch requests.
  881. ForceSendFields []string `json:"-"`
  882. // NullFields is a list of field names (e.g. "Author") to include in API
  883. // requests with the JSON null value. By default, fields with empty
  884. // values are omitted from API requests. However, any field with an
  885. // empty value appearing in NullFields will be sent to the server as
  886. // null. It is an error if a field in this list has a non-empty value.
  887. // This may be used to include null fields in Patch requests.
  888. NullFields []string `json:"-"`
  889. }
  890. func (s *Post) MarshalJSON() ([]byte, error) {
  891. type NoMethod Post
  892. raw := NoMethod(*s)
  893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  894. }
  895. // PostAuthor: The author of this Post.
  896. type PostAuthor struct {
  897. // DisplayName: The display name.
  898. DisplayName string `json:"displayName,omitempty"`
  899. // Id: The identifier of the Post creator.
  900. Id string `json:"id,omitempty"`
  901. // Image: The Post author's avatar.
  902. Image *PostAuthorImage `json:"image,omitempty"`
  903. // Url: The URL of the Post creator's Profile page.
  904. Url string `json:"url,omitempty"`
  905. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  906. // unconditionally include in API requests. By default, fields with
  907. // empty values are omitted from API requests. However, any non-pointer,
  908. // non-interface field appearing in ForceSendFields will be sent to the
  909. // server regardless of whether the field is empty or not. This may be
  910. // used to include empty fields in Patch requests.
  911. ForceSendFields []string `json:"-"`
  912. // NullFields is a list of field names (e.g. "DisplayName") to include
  913. // in API requests with the JSON null value. By default, fields with
  914. // empty values are omitted from API requests. However, any field with
  915. // an empty value appearing in NullFields will be sent to the server as
  916. // null. It is an error if a field in this list has a non-empty value.
  917. // This may be used to include null fields in Patch requests.
  918. NullFields []string `json:"-"`
  919. }
  920. func (s *PostAuthor) MarshalJSON() ([]byte, error) {
  921. type NoMethod PostAuthor
  922. raw := NoMethod(*s)
  923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  924. }
  925. // PostAuthorImage: The Post author's avatar.
  926. type PostAuthorImage struct {
  927. // Url: The Post author's avatar URL.
  928. Url string `json:"url,omitempty"`
  929. // ForceSendFields is a list of field names (e.g. "Url") to
  930. // unconditionally include in API requests. By default, fields with
  931. // empty values are omitted from API requests. However, any non-pointer,
  932. // non-interface field appearing in ForceSendFields will be sent to the
  933. // server regardless of whether the field is empty or not. This may be
  934. // used to include empty fields in Patch requests.
  935. ForceSendFields []string `json:"-"`
  936. // NullFields is a list of field names (e.g. "Url") to include in API
  937. // requests with the JSON null value. By default, fields with empty
  938. // values are omitted from API requests. However, any field with an
  939. // empty value appearing in NullFields will be sent to the server as
  940. // null. It is an error if a field in this list has a non-empty value.
  941. // This may be used to include null fields in Patch requests.
  942. NullFields []string `json:"-"`
  943. }
  944. func (s *PostAuthorImage) MarshalJSON() ([]byte, error) {
  945. type NoMethod PostAuthorImage
  946. raw := NoMethod(*s)
  947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  948. }
  949. // PostBlog: Data about the blog containing this Post.
  950. type PostBlog struct {
  951. // Id: The identifier of the Blog that contains this Post.
  952. Id string `json:"id,omitempty"`
  953. // ForceSendFields is a list of field names (e.g. "Id") to
  954. // unconditionally include in API requests. By default, fields with
  955. // empty values are omitted from API requests. However, any non-pointer,
  956. // non-interface field appearing in ForceSendFields will be sent to the
  957. // server regardless of whether the field is empty or not. This may be
  958. // used to include empty fields in Patch requests.
  959. ForceSendFields []string `json:"-"`
  960. // NullFields is a list of field names (e.g. "Id") to include in API
  961. // requests with the JSON null value. By default, fields with empty
  962. // values are omitted from API requests. However, any field with an
  963. // empty value appearing in NullFields will be sent to the server as
  964. // null. It is an error if a field in this list has a non-empty value.
  965. // This may be used to include null fields in Patch requests.
  966. NullFields []string `json:"-"`
  967. }
  968. func (s *PostBlog) MarshalJSON() ([]byte, error) {
  969. type NoMethod PostBlog
  970. raw := NoMethod(*s)
  971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  972. }
  973. type PostImages struct {
  974. Url string `json:"url,omitempty"`
  975. // ForceSendFields is a list of field names (e.g. "Url") to
  976. // unconditionally include in API requests. By default, fields with
  977. // empty values are omitted from API requests. However, any non-pointer,
  978. // non-interface field appearing in ForceSendFields will be sent to the
  979. // server regardless of whether the field is empty or not. This may be
  980. // used to include empty fields in Patch requests.
  981. ForceSendFields []string `json:"-"`
  982. // NullFields is a list of field names (e.g. "Url") to include in API
  983. // requests with the JSON null value. By default, fields with empty
  984. // values are omitted from API requests. However, any field with an
  985. // empty value appearing in NullFields will be sent to the server as
  986. // null. It is an error if a field in this list has a non-empty value.
  987. // This may be used to include null fields in Patch requests.
  988. NullFields []string `json:"-"`
  989. }
  990. func (s *PostImages) MarshalJSON() ([]byte, error) {
  991. type NoMethod PostImages
  992. raw := NoMethod(*s)
  993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  994. }
  995. // PostLocation: The location for geotagged posts.
  996. type PostLocation struct {
  997. // Lat: Location's latitude.
  998. Lat float64 `json:"lat,omitempty"`
  999. // Lng: Location's longitude.
  1000. Lng float64 `json:"lng,omitempty"`
  1001. // Name: Location name.
  1002. Name string `json:"name,omitempty"`
  1003. // Span: Location's viewport span. Can be used when rendering a map
  1004. // preview.
  1005. Span string `json:"span,omitempty"`
  1006. // ForceSendFields is a list of field names (e.g. "Lat") to
  1007. // unconditionally include in API requests. By default, fields with
  1008. // empty values are omitted from API requests. However, any non-pointer,
  1009. // non-interface field appearing in ForceSendFields will be sent to the
  1010. // server regardless of whether the field is empty or not. This may be
  1011. // used to include empty fields in Patch requests.
  1012. ForceSendFields []string `json:"-"`
  1013. // NullFields is a list of field names (e.g. "Lat") to include in API
  1014. // requests with the JSON null value. By default, fields with empty
  1015. // values are omitted from API requests. However, any field with an
  1016. // empty value appearing in NullFields will be sent to the server as
  1017. // null. It is an error if a field in this list has a non-empty value.
  1018. // This may be used to include null fields in Patch requests.
  1019. NullFields []string `json:"-"`
  1020. }
  1021. func (s *PostLocation) MarshalJSON() ([]byte, error) {
  1022. type NoMethod PostLocation
  1023. raw := NoMethod(*s)
  1024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1025. }
  1026. func (s *PostLocation) UnmarshalJSON(data []byte) error {
  1027. type NoMethod PostLocation
  1028. var s1 struct {
  1029. Lat gensupport.JSONFloat64 `json:"lat"`
  1030. Lng gensupport.JSONFloat64 `json:"lng"`
  1031. *NoMethod
  1032. }
  1033. s1.NoMethod = (*NoMethod)(s)
  1034. if err := json.Unmarshal(data, &s1); err != nil {
  1035. return err
  1036. }
  1037. s.Lat = float64(s1.Lat)
  1038. s.Lng = float64(s1.Lng)
  1039. return nil
  1040. }
  1041. // PostReplies: The container of comments on this Post.
  1042. type PostReplies struct {
  1043. // Items: The List of Comments for this Post.
  1044. Items []*Comment `json:"items,omitempty"`
  1045. // SelfLink: The URL of the comments on this post.
  1046. SelfLink string `json:"selfLink,omitempty"`
  1047. // TotalItems: The count of comments on this post.
  1048. TotalItems int64 `json:"totalItems,omitempty,string"`
  1049. // ForceSendFields is a list of field names (e.g. "Items") to
  1050. // unconditionally include in API requests. By default, fields with
  1051. // empty values are omitted from API requests. However, any non-pointer,
  1052. // non-interface field appearing in ForceSendFields will be sent to the
  1053. // server regardless of whether the field is empty or not. This may be
  1054. // used to include empty fields in Patch requests.
  1055. ForceSendFields []string `json:"-"`
  1056. // NullFields is a list of field names (e.g. "Items") to include in API
  1057. // requests with the JSON null value. By default, fields with empty
  1058. // values are omitted from API requests. However, any field with an
  1059. // empty value appearing in NullFields will be sent to the server as
  1060. // null. It is an error if a field in this list has a non-empty value.
  1061. // This may be used to include null fields in Patch requests.
  1062. NullFields []string `json:"-"`
  1063. }
  1064. func (s *PostReplies) MarshalJSON() ([]byte, error) {
  1065. type NoMethod PostReplies
  1066. raw := NoMethod(*s)
  1067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1068. }
  1069. type PostList struct {
  1070. // Items: The list of Posts for this Blog.
  1071. Items []*Post `json:"items,omitempty"`
  1072. // Kind: The kind of this entity. Always blogger#postList
  1073. Kind string `json:"kind,omitempty"`
  1074. // NextPageToken: Pagination token to fetch the next page, if one
  1075. // exists.
  1076. NextPageToken string `json:"nextPageToken,omitempty"`
  1077. // ServerResponse contains the HTTP response code and headers from the
  1078. // server.
  1079. googleapi.ServerResponse `json:"-"`
  1080. // ForceSendFields is a list of field names (e.g. "Items") to
  1081. // unconditionally include in API requests. By default, fields with
  1082. // empty values are omitted from API requests. However, any non-pointer,
  1083. // non-interface field appearing in ForceSendFields will be sent to the
  1084. // server regardless of whether the field is empty or not. This may be
  1085. // used to include empty fields in Patch requests.
  1086. ForceSendFields []string `json:"-"`
  1087. // NullFields is a list of field names (e.g. "Items") to include in API
  1088. // requests with the JSON null value. By default, fields with empty
  1089. // values are omitted from API requests. However, any field with an
  1090. // empty value appearing in NullFields will be sent to the server as
  1091. // null. It is an error if a field in this list has a non-empty value.
  1092. // This may be used to include null fields in Patch requests.
  1093. NullFields []string `json:"-"`
  1094. }
  1095. func (s *PostList) MarshalJSON() ([]byte, error) {
  1096. type NoMethod PostList
  1097. raw := NoMethod(*s)
  1098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1099. }
  1100. type PostPerUserInfo struct {
  1101. // BlogId: ID of the Blog that the post resource belongs to.
  1102. BlogId string `json:"blogId,omitempty"`
  1103. // HasEditAccess: True if the user has Author level access to the post.
  1104. HasEditAccess bool `json:"hasEditAccess,omitempty"`
  1105. // Kind: The kind of this entity. Always blogger#postPerUserInfo
  1106. Kind string `json:"kind,omitempty"`
  1107. // PostId: ID of the Post resource.
  1108. PostId string `json:"postId,omitempty"`
  1109. // UserId: ID of the User.
  1110. UserId string `json:"userId,omitempty"`
  1111. // ForceSendFields is a list of field names (e.g. "BlogId") to
  1112. // unconditionally include in API requests. By default, fields with
  1113. // empty values are omitted from API requests. However, any non-pointer,
  1114. // non-interface field appearing in ForceSendFields will be sent to the
  1115. // server regardless of whether the field is empty or not. This may be
  1116. // used to include empty fields in Patch requests.
  1117. ForceSendFields []string `json:"-"`
  1118. // NullFields is a list of field names (e.g. "BlogId") to include in API
  1119. // requests with the JSON null value. By default, fields with empty
  1120. // values are omitted from API requests. However, any field with an
  1121. // empty value appearing in NullFields will be sent to the server as
  1122. // null. It is an error if a field in this list has a non-empty value.
  1123. // This may be used to include null fields in Patch requests.
  1124. NullFields []string `json:"-"`
  1125. }
  1126. func (s *PostPerUserInfo) MarshalJSON() ([]byte, error) {
  1127. type NoMethod PostPerUserInfo
  1128. raw := NoMethod(*s)
  1129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1130. }
  1131. type PostUserInfo struct {
  1132. // Kind: The kind of this entity. Always blogger#postUserInfo
  1133. Kind string `json:"kind,omitempty"`
  1134. // Post: The Post resource.
  1135. Post *Post `json:"post,omitempty"`
  1136. // PostUserInfo: Information about a User for the Post.
  1137. PostUserInfo *PostPerUserInfo `json:"post_user_info,omitempty"`
  1138. // ServerResponse contains the HTTP response code and headers from the
  1139. // server.
  1140. googleapi.ServerResponse `json:"-"`
  1141. // ForceSendFields is a list of field names (e.g. "Kind") to
  1142. // unconditionally include in API requests. By default, fields with
  1143. // empty values are omitted from API requests. However, any non-pointer,
  1144. // non-interface field appearing in ForceSendFields will be sent to the
  1145. // server regardless of whether the field is empty or not. This may be
  1146. // used to include empty fields in Patch requests.
  1147. ForceSendFields []string `json:"-"`
  1148. // NullFields is a list of field names (e.g. "Kind") to include in API
  1149. // requests with the JSON null value. By default, fields with empty
  1150. // values are omitted from API requests. However, any field with an
  1151. // empty value appearing in NullFields will be sent to the server as
  1152. // null. It is an error if a field in this list has a non-empty value.
  1153. // This may be used to include null fields in Patch requests.
  1154. NullFields []string `json:"-"`
  1155. }
  1156. func (s *PostUserInfo) MarshalJSON() ([]byte, error) {
  1157. type NoMethod PostUserInfo
  1158. raw := NoMethod(*s)
  1159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1160. }
  1161. type PostUserInfosList struct {
  1162. // Items: The list of Posts with User information for the post, for this
  1163. // Blog.
  1164. Items []*PostUserInfo `json:"items,omitempty"`
  1165. // Kind: The kind of this entity. Always blogger#postList
  1166. Kind string `json:"kind,omitempty"`
  1167. // NextPageToken: Pagination token to fetch the next page, if one
  1168. // exists.
  1169. NextPageToken string `json:"nextPageToken,omitempty"`
  1170. // ServerResponse contains the HTTP response code and headers from the
  1171. // server.
  1172. googleapi.ServerResponse `json:"-"`
  1173. // ForceSendFields is a list of field names (e.g. "Items") to
  1174. // unconditionally include in API requests. By default, fields with
  1175. // empty values are omitted from API requests. However, any non-pointer,
  1176. // non-interface field appearing in ForceSendFields will be sent to the
  1177. // server regardless of whether the field is empty or not. This may be
  1178. // used to include empty fields in Patch requests.
  1179. ForceSendFields []string `json:"-"`
  1180. // NullFields is a list of field names (e.g. "Items") to include in API
  1181. // requests with the JSON null value. By default, fields with empty
  1182. // values are omitted from API requests. However, any field with an
  1183. // empty value appearing in NullFields will be sent to the server as
  1184. // null. It is an error if a field in this list has a non-empty value.
  1185. // This may be used to include null fields in Patch requests.
  1186. NullFields []string `json:"-"`
  1187. }
  1188. func (s *PostUserInfosList) MarshalJSON() ([]byte, error) {
  1189. type NoMethod PostUserInfosList
  1190. raw := NoMethod(*s)
  1191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1192. }
  1193. type User struct {
  1194. // About: Profile summary information.
  1195. About string `json:"about,omitempty"`
  1196. // Blogs: The container of blogs for this user.
  1197. Blogs *UserBlogs `json:"blogs,omitempty"`
  1198. // Created: The timestamp of when this profile was created, in seconds
  1199. // since epoch.
  1200. Created string `json:"created,omitempty"`
  1201. // DisplayName: The display name.
  1202. DisplayName string `json:"displayName,omitempty"`
  1203. // Id: The identifier for this User.
  1204. Id string `json:"id,omitempty"`
  1205. // Kind: The kind of this entity. Always blogger#user
  1206. Kind string `json:"kind,omitempty"`
  1207. // Locale: This user's locale
  1208. Locale *UserLocale `json:"locale,omitempty"`
  1209. // SelfLink: The API REST URL to fetch this resource from.
  1210. SelfLink string `json:"selfLink,omitempty"`
  1211. // Url: The user's profile page.
  1212. Url string `json:"url,omitempty"`
  1213. // ServerResponse contains the HTTP response code and headers from the
  1214. // server.
  1215. googleapi.ServerResponse `json:"-"`
  1216. // ForceSendFields is a list of field names (e.g. "About") to
  1217. // unconditionally include in API requests. By default, fields with
  1218. // empty values are omitted from API requests. However, any non-pointer,
  1219. // non-interface field appearing in ForceSendFields will be sent to the
  1220. // server regardless of whether the field is empty or not. This may be
  1221. // used to include empty fields in Patch requests.
  1222. ForceSendFields []string `json:"-"`
  1223. // NullFields is a list of field names (e.g. "About") to include in API
  1224. // requests with the JSON null value. By default, fields with empty
  1225. // values are omitted from API requests. However, any field with an
  1226. // empty value appearing in NullFields will be sent to the server as
  1227. // null. It is an error if a field in this list has a non-empty value.
  1228. // This may be used to include null fields in Patch requests.
  1229. NullFields []string `json:"-"`
  1230. }
  1231. func (s *User) MarshalJSON() ([]byte, error) {
  1232. type NoMethod User
  1233. raw := NoMethod(*s)
  1234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1235. }
  1236. // UserBlogs: The container of blogs for this user.
  1237. type UserBlogs struct {
  1238. // SelfLink: The URL of the Blogs for this user.
  1239. SelfLink string `json:"selfLink,omitempty"`
  1240. // ForceSendFields is a list of field names (e.g. "SelfLink") to
  1241. // unconditionally include in API requests. By default, fields with
  1242. // empty values are omitted from API requests. However, any non-pointer,
  1243. // non-interface field appearing in ForceSendFields will be sent to the
  1244. // server regardless of whether the field is empty or not. This may be
  1245. // used to include empty fields in Patch requests.
  1246. ForceSendFields []string `json:"-"`
  1247. // NullFields is a list of field names (e.g. "SelfLink") to include in
  1248. // API requests with the JSON null value. By default, fields with empty
  1249. // values are omitted from API requests. However, any field with an
  1250. // empty value appearing in NullFields will be sent to the server as
  1251. // null. It is an error if a field in this list has a non-empty value.
  1252. // This may be used to include null fields in Patch requests.
  1253. NullFields []string `json:"-"`
  1254. }
  1255. func (s *UserBlogs) MarshalJSON() ([]byte, error) {
  1256. type NoMethod UserBlogs
  1257. raw := NoMethod(*s)
  1258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1259. }
  1260. // UserLocale: This user's locale
  1261. type UserLocale struct {
  1262. // Country: The user's country setting.
  1263. Country string `json:"country,omitempty"`
  1264. // Language: The user's language setting.
  1265. Language string `json:"language,omitempty"`
  1266. // Variant: The user's language variant setting.
  1267. Variant string `json:"variant,omitempty"`
  1268. // ForceSendFields is a list of field names (e.g. "Country") to
  1269. // unconditionally include in API requests. By default, fields with
  1270. // empty values are omitted from API requests. However, any non-pointer,
  1271. // non-interface field appearing in ForceSendFields will be sent to the
  1272. // server regardless of whether the field is empty or not. This may be
  1273. // used to include empty fields in Patch requests.
  1274. ForceSendFields []string `json:"-"`
  1275. // NullFields is a list of field names (e.g. "Country") to include in
  1276. // API requests with the JSON null value. By default, fields with empty
  1277. // values are omitted from API requests. However, any field with an
  1278. // empty value appearing in NullFields will be sent to the server as
  1279. // null. It is an error if a field in this list has a non-empty value.
  1280. // This may be used to include null fields in Patch requests.
  1281. NullFields []string `json:"-"`
  1282. }
  1283. func (s *UserLocale) MarshalJSON() ([]byte, error) {
  1284. type NoMethod UserLocale
  1285. raw := NoMethod(*s)
  1286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1287. }
  1288. // method id "blogger.blogUserInfos.get":
  1289. type BlogUserInfosGetCall struct {
  1290. s *Service
  1291. userId string
  1292. blogId string
  1293. urlParams_ gensupport.URLParams
  1294. ifNoneMatch_ string
  1295. ctx_ context.Context
  1296. header_ http.Header
  1297. }
  1298. // Get: Gets one blog and user info pair by blogId and userId.
  1299. func (r *BlogUserInfosService) Get(userId string, blogId string) *BlogUserInfosGetCall {
  1300. c := &BlogUserInfosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1301. c.userId = userId
  1302. c.blogId = blogId
  1303. return c
  1304. }
  1305. // MaxPosts sets the optional parameter "maxPosts": Maximum number of
  1306. // posts to pull back with the blog.
  1307. func (c *BlogUserInfosGetCall) MaxPosts(maxPosts int64) *BlogUserInfosGetCall {
  1308. c.urlParams_.Set("maxPosts", fmt.Sprint(maxPosts))
  1309. return c
  1310. }
  1311. // Fields allows partial responses to be retrieved. See
  1312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1313. // for more information.
  1314. func (c *BlogUserInfosGetCall) Fields(s ...googleapi.Field) *BlogUserInfosGetCall {
  1315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1316. return c
  1317. }
  1318. // IfNoneMatch sets the optional parameter which makes the operation
  1319. // fail if the object's ETag matches the given value. This is useful for
  1320. // getting updates only after the object has changed since the last
  1321. // request. Use googleapi.IsNotModified to check whether the response
  1322. // error from Do is the result of In-None-Match.
  1323. func (c *BlogUserInfosGetCall) IfNoneMatch(entityTag string) *BlogUserInfosGetCall {
  1324. c.ifNoneMatch_ = entityTag
  1325. return c
  1326. }
  1327. // Context sets the context to be used in this call's Do method. Any
  1328. // pending HTTP request will be aborted if the provided context is
  1329. // canceled.
  1330. func (c *BlogUserInfosGetCall) Context(ctx context.Context) *BlogUserInfosGetCall {
  1331. c.ctx_ = ctx
  1332. return c
  1333. }
  1334. // Header returns an http.Header that can be modified by the caller to
  1335. // add HTTP headers to the request.
  1336. func (c *BlogUserInfosGetCall) Header() http.Header {
  1337. if c.header_ == nil {
  1338. c.header_ = make(http.Header)
  1339. }
  1340. return c.header_
  1341. }
  1342. func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) {
  1343. reqHeaders := make(http.Header)
  1344. for k, v := range c.header_ {
  1345. reqHeaders[k] = v
  1346. }
  1347. reqHeaders.Set("User-Agent", c.s.userAgent())
  1348. if c.ifNoneMatch_ != "" {
  1349. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1350. }
  1351. var body io.Reader = nil
  1352. c.urlParams_.Set("alt", alt)
  1353. c.urlParams_.Set("prettyPrint", "false")
  1354. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}")
  1355. urls += "?" + c.urlParams_.Encode()
  1356. req, err := http.NewRequest("GET", urls, body)
  1357. if err != nil {
  1358. return nil, err
  1359. }
  1360. req.Header = reqHeaders
  1361. googleapi.Expand(req.URL, map[string]string{
  1362. "userId": c.userId,
  1363. "blogId": c.blogId,
  1364. })
  1365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1366. }
  1367. // Do executes the "blogger.blogUserInfos.get" call.
  1368. // Exactly one of *BlogUserInfo or error will be non-nil. Any non-2xx
  1369. // status code is an error. Response headers are in either
  1370. // *BlogUserInfo.ServerResponse.Header or (if a response was returned at
  1371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1372. // to check whether the returned error was because
  1373. // http.StatusNotModified was returned.
  1374. func (c *BlogUserInfosGetCall) Do(opts ...googleapi.CallOption) (*BlogUserInfo, error) {
  1375. gensupport.SetOptions(c.urlParams_, opts...)
  1376. res, err := c.doRequest("json")
  1377. if res != nil && res.StatusCode == http.StatusNotModified {
  1378. if res.Body != nil {
  1379. res.Body.Close()
  1380. }
  1381. return nil, &googleapi.Error{
  1382. Code: res.StatusCode,
  1383. Header: res.Header,
  1384. }
  1385. }
  1386. if err != nil {
  1387. return nil, err
  1388. }
  1389. defer googleapi.CloseBody(res)
  1390. if err := googleapi.CheckResponse(res); err != nil {
  1391. return nil, err
  1392. }
  1393. ret := &BlogUserInfo{
  1394. ServerResponse: googleapi.ServerResponse{
  1395. Header: res.Header,
  1396. HTTPStatusCode: res.StatusCode,
  1397. },
  1398. }
  1399. target := &ret
  1400. if err := gensupport.DecodeResponse(target, res); err != nil {
  1401. return nil, err
  1402. }
  1403. return ret, nil
  1404. // {
  1405. // "description": "Gets one blog and user info pair by blogId and userId.",
  1406. // "httpMethod": "GET",
  1407. // "id": "blogger.blogUserInfos.get",
  1408. // "parameterOrder": [
  1409. // "userId",
  1410. // "blogId"
  1411. // ],
  1412. // "parameters": {
  1413. // "blogId": {
  1414. // "description": "The ID of the blog to get.",
  1415. // "location": "path",
  1416. // "required": true,
  1417. // "type": "string"
  1418. // },
  1419. // "maxPosts": {
  1420. // "description": "Maximum number of posts to pull back with the blog.",
  1421. // "format": "uint32",
  1422. // "location": "query",
  1423. // "type": "integer"
  1424. // },
  1425. // "userId": {
  1426. // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
  1427. // "location": "path",
  1428. // "required": true,
  1429. // "type": "string"
  1430. // }
  1431. // },
  1432. // "path": "users/{userId}/blogs/{blogId}",
  1433. // "response": {
  1434. // "$ref": "BlogUserInfo"
  1435. // },
  1436. // "scopes": [
  1437. // "https://www.googleapis.com/auth/blogger",
  1438. // "https://www.googleapis.com/auth/blogger.readonly"
  1439. // ]
  1440. // }
  1441. }
  1442. // method id "blogger.blogs.get":
  1443. type BlogsGetCall struct {
  1444. s *Service
  1445. blogId string
  1446. urlParams_ gensupport.URLParams
  1447. ifNoneMatch_ string
  1448. ctx_ context.Context
  1449. header_ http.Header
  1450. }
  1451. // Get: Gets one blog by id.
  1452. func (r *BlogsService) Get(blogId string) *BlogsGetCall {
  1453. c := &BlogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1454. c.blogId = blogId
  1455. return c
  1456. }
  1457. // MaxPosts sets the optional parameter "maxPosts": Maximum number of
  1458. // posts to pull back with the blog.
  1459. func (c *BlogsGetCall) MaxPosts(maxPosts int64) *BlogsGetCall {
  1460. c.urlParams_.Set("maxPosts", fmt.Sprint(maxPosts))
  1461. return c
  1462. }
  1463. // Fields allows partial responses to be retrieved. See
  1464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1465. // for more information.
  1466. func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall {
  1467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1468. return c
  1469. }
  1470. // IfNoneMatch sets the optional parameter which makes the operation
  1471. // fail if the object's ETag matches the given value. This is useful for
  1472. // getting updates only after the object has changed since the last
  1473. // request. Use googleapi.IsNotModified to check whether the response
  1474. // error from Do is the result of In-None-Match.
  1475. func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall {
  1476. c.ifNoneMatch_ = entityTag
  1477. return c
  1478. }
  1479. // Context sets the context to be used in this call's Do method. Any
  1480. // pending HTTP request will be aborted if the provided context is
  1481. // canceled.
  1482. func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall {
  1483. c.ctx_ = ctx
  1484. return c
  1485. }
  1486. // Header returns an http.Header that can be modified by the caller to
  1487. // add HTTP headers to the request.
  1488. func (c *BlogsGetCall) Header() http.Header {
  1489. if c.header_ == nil {
  1490. c.header_ = make(http.Header)
  1491. }
  1492. return c.header_
  1493. }
  1494. func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) {
  1495. reqHeaders := make(http.Header)
  1496. for k, v := range c.header_ {
  1497. reqHeaders[k] = v
  1498. }
  1499. reqHeaders.Set("User-Agent", c.s.userAgent())
  1500. if c.ifNoneMatch_ != "" {
  1501. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1502. }
  1503. var body io.Reader = nil
  1504. c.urlParams_.Set("alt", alt)
  1505. c.urlParams_.Set("prettyPrint", "false")
  1506. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}")
  1507. urls += "?" + c.urlParams_.Encode()
  1508. req, err := http.NewRequest("GET", urls, body)
  1509. if err != nil {
  1510. return nil, err
  1511. }
  1512. req.Header = reqHeaders
  1513. googleapi.Expand(req.URL, map[string]string{
  1514. "blogId": c.blogId,
  1515. })
  1516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1517. }
  1518. // Do executes the "blogger.blogs.get" call.
  1519. // Exactly one of *Blog or error will be non-nil. Any non-2xx status
  1520. // code is an error. Response headers are in either
  1521. // *Blog.ServerResponse.Header or (if a response was returned at all) in
  1522. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1523. // whether the returned error was because http.StatusNotModified was
  1524. // returned.
  1525. func (c *BlogsGetCall) Do(opts ...googleapi.CallOption) (*Blog, error) {
  1526. gensupport.SetOptions(c.urlParams_, opts...)
  1527. res, err := c.doRequest("json")
  1528. if res != nil && res.StatusCode == http.StatusNotModified {
  1529. if res.Body != nil {
  1530. res.Body.Close()
  1531. }
  1532. return nil, &googleapi.Error{
  1533. Code: res.StatusCode,
  1534. Header: res.Header,
  1535. }
  1536. }
  1537. if err != nil {
  1538. return nil, err
  1539. }
  1540. defer googleapi.CloseBody(res)
  1541. if err := googleapi.CheckResponse(res); err != nil {
  1542. return nil, err
  1543. }
  1544. ret := &Blog{
  1545. ServerResponse: googleapi.ServerResponse{
  1546. Header: res.Header,
  1547. HTTPStatusCode: res.StatusCode,
  1548. },
  1549. }
  1550. target := &ret
  1551. if err := gensupport.DecodeResponse(target, res); err != nil {
  1552. return nil, err
  1553. }
  1554. return ret, nil
  1555. // {
  1556. // "description": "Gets one blog by id.",
  1557. // "httpMethod": "GET",
  1558. // "id": "blogger.blogs.get",
  1559. // "parameterOrder": [
  1560. // "blogId"
  1561. // ],
  1562. // "parameters": {
  1563. // "blogId": {
  1564. // "description": "The ID of the blog to get.",
  1565. // "location": "path",
  1566. // "required": true,
  1567. // "type": "string"
  1568. // },
  1569. // "maxPosts": {
  1570. // "description": "Maximum number of posts to pull back with the blog.",
  1571. // "format": "uint32",
  1572. // "location": "query",
  1573. // "type": "integer"
  1574. // }
  1575. // },
  1576. // "path": "blogs/{blogId}",
  1577. // "response": {
  1578. // "$ref": "Blog"
  1579. // },
  1580. // "scopes": [
  1581. // "https://www.googleapis.com/auth/blogger",
  1582. // "https://www.googleapis.com/auth/blogger.readonly"
  1583. // ]
  1584. // }
  1585. }
  1586. // method id "blogger.blogs.getByUrl":
  1587. type BlogsGetByUrlCall struct {
  1588. s *Service
  1589. urlParams_ gensupport.URLParams
  1590. ifNoneMatch_ string
  1591. ctx_ context.Context
  1592. header_ http.Header
  1593. }
  1594. // GetByUrl: Retrieve a Blog by URL.
  1595. func (r *BlogsService) GetByUrl(url string) *BlogsGetByUrlCall {
  1596. c := &BlogsGetByUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1597. c.urlParams_.Set("url", url)
  1598. return c
  1599. }
  1600. // Fields allows partial responses to be retrieved. See
  1601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1602. // for more information.
  1603. func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall {
  1604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1605. return c
  1606. }
  1607. // IfNoneMatch sets the optional parameter which makes the operation
  1608. // fail if the object's ETag matches the given value. This is useful for
  1609. // getting updates only after the object has changed since the last
  1610. // request. Use googleapi.IsNotModified to check whether the response
  1611. // error from Do is the result of In-None-Match.
  1612. func (c *BlogsGetByUrlCall) IfNoneMatch(entityTag string) *BlogsGetByUrlCall {
  1613. c.ifNoneMatch_ = entityTag
  1614. return c
  1615. }
  1616. // Context sets the context to be used in this call's Do method. Any
  1617. // pending HTTP request will be aborted if the provided context is
  1618. // canceled.
  1619. func (c *BlogsGetByUrlCall) Context(ctx context.Context) *BlogsGetByUrlCall {
  1620. c.ctx_ = ctx
  1621. return c
  1622. }
  1623. // Header returns an http.Header that can be modified by the caller to
  1624. // add HTTP headers to the request.
  1625. func (c *BlogsGetByUrlCall) Header() http.Header {
  1626. if c.header_ == nil {
  1627. c.header_ = make(http.Header)
  1628. }
  1629. return c.header_
  1630. }
  1631. func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) {
  1632. reqHeaders := make(http.Header)
  1633. for k, v := range c.header_ {
  1634. reqHeaders[k] = v
  1635. }
  1636. reqHeaders.Set("User-Agent", c.s.userAgent())
  1637. if c.ifNoneMatch_ != "" {
  1638. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1639. }
  1640. var body io.Reader = nil
  1641. c.urlParams_.Set("alt", alt)
  1642. c.urlParams_.Set("prettyPrint", "false")
  1643. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl")
  1644. urls += "?" + c.urlParams_.Encode()
  1645. req, err := http.NewRequest("GET", urls, body)
  1646. if err != nil {
  1647. return nil, err
  1648. }
  1649. req.Header = reqHeaders
  1650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1651. }
  1652. // Do executes the "blogger.blogs.getByUrl" call.
  1653. // Exactly one of *Blog or error will be non-nil. Any non-2xx status
  1654. // code is an error. Response headers are in either
  1655. // *Blog.ServerResponse.Header or (if a response was returned at all) in
  1656. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1657. // whether the returned error was because http.StatusNotModified was
  1658. // returned.
  1659. func (c *BlogsGetByUrlCall) Do(opts ...googleapi.CallOption) (*Blog, error) {
  1660. gensupport.SetOptions(c.urlParams_, opts...)
  1661. res, err := c.doRequest("json")
  1662. if res != nil && res.StatusCode == http.StatusNotModified {
  1663. if res.Body != nil {
  1664. res.Body.Close()
  1665. }
  1666. return nil, &googleapi.Error{
  1667. Code: res.StatusCode,
  1668. Header: res.Header,
  1669. }
  1670. }
  1671. if err != nil {
  1672. return nil, err
  1673. }
  1674. defer googleapi.CloseBody(res)
  1675. if err := googleapi.CheckResponse(res); err != nil {
  1676. return nil, err
  1677. }
  1678. ret := &Blog{
  1679. ServerResponse: googleapi.ServerResponse{
  1680. Header: res.Header,
  1681. HTTPStatusCode: res.StatusCode,
  1682. },
  1683. }
  1684. target := &ret
  1685. if err := gensupport.DecodeResponse(target, res); err != nil {
  1686. return nil, err
  1687. }
  1688. return ret, nil
  1689. // {
  1690. // "description": "Retrieve a Blog by URL.",
  1691. // "httpMethod": "GET",
  1692. // "id": "blogger.blogs.getByUrl",
  1693. // "parameterOrder": [
  1694. // "url"
  1695. // ],
  1696. // "parameters": {
  1697. // "url": {
  1698. // "description": "The URL of the blog to retrieve.",
  1699. // "location": "query",
  1700. // "required": true,
  1701. // "type": "string"
  1702. // }
  1703. // },
  1704. // "path": "blogs/byurl",
  1705. // "response": {
  1706. // "$ref": "Blog"
  1707. // },
  1708. // "scopes": [
  1709. // "https://www.googleapis.com/auth/blogger",
  1710. // "https://www.googleapis.com/auth/blogger.readonly"
  1711. // ]
  1712. // }
  1713. }
  1714. // method id "blogger.blogs.listByUser":
  1715. type BlogsListByUserCall struct {
  1716. s *Service
  1717. userId string
  1718. urlParams_ gensupport.URLParams
  1719. ifNoneMatch_ string
  1720. ctx_ context.Context
  1721. header_ http.Header
  1722. }
  1723. // ListByUser: Retrieves a list of blogs, possibly filtered.
  1724. func (r *BlogsService) ListByUser(userId string) *BlogsListByUserCall {
  1725. c := &BlogsListByUserCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1726. c.userId = userId
  1727. return c
  1728. }
  1729. // FetchUserInfo sets the optional parameter "fetchUserInfo": Whether
  1730. // the response is a list of blogs with per-user information instead of
  1731. // just blogs.
  1732. func (c *BlogsListByUserCall) FetchUserInfo(fetchUserInfo bool) *BlogsListByUserCall {
  1733. c.urlParams_.Set("fetchUserInfo", fmt.Sprint(fetchUserInfo))
  1734. return c
  1735. }
  1736. // View sets the optional parameter "view":
  1737. //
  1738. // Possible values:
  1739. // "ADMIN" - Admin level detail
  1740. // "AUTHOR" - Author level detail
  1741. // "READER" - Admin level detail
  1742. func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall {
  1743. c.urlParams_.Set("view", view)
  1744. return c
  1745. }
  1746. // Fields allows partial responses to be retrieved. See
  1747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1748. // for more information.
  1749. func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall {
  1750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1751. return c
  1752. }
  1753. // IfNoneMatch sets the optional parameter which makes the operation
  1754. // fail if the object's ETag matches the given value. This is useful for
  1755. // getting updates only after the object has changed since the last
  1756. // request. Use googleapi.IsNotModified to check whether the response
  1757. // error from Do is the result of In-None-Match.
  1758. func (c *BlogsListByUserCall) IfNoneMatch(entityTag string) *BlogsListByUserCall {
  1759. c.ifNoneMatch_ = entityTag
  1760. return c
  1761. }
  1762. // Context sets the context to be used in this call's Do method. Any
  1763. // pending HTTP request will be aborted if the provided context is
  1764. // canceled.
  1765. func (c *BlogsListByUserCall) Context(ctx context.Context) *BlogsListByUserCall {
  1766. c.ctx_ = ctx
  1767. return c
  1768. }
  1769. // Header returns an http.Header that can be modified by the caller to
  1770. // add HTTP headers to the request.
  1771. func (c *BlogsListByUserCall) Header() http.Header {
  1772. if c.header_ == nil {
  1773. c.header_ = make(http.Header)
  1774. }
  1775. return c.header_
  1776. }
  1777. func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) {
  1778. reqHeaders := make(http.Header)
  1779. for k, v := range c.header_ {
  1780. reqHeaders[k] = v
  1781. }
  1782. reqHeaders.Set("User-Agent", c.s.userAgent())
  1783. if c.ifNoneMatch_ != "" {
  1784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1785. }
  1786. var body io.Reader = nil
  1787. c.urlParams_.Set("alt", alt)
  1788. c.urlParams_.Set("prettyPrint", "false")
  1789. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs")
  1790. urls += "?" + c.urlParams_.Encode()
  1791. req, err := http.NewRequest("GET", urls, body)
  1792. if err != nil {
  1793. return nil, err
  1794. }
  1795. req.Header = reqHeaders
  1796. googleapi.Expand(req.URL, map[string]string{
  1797. "userId": c.userId,
  1798. })
  1799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1800. }
  1801. // Do executes the "blogger.blogs.listByUser" call.
  1802. // Exactly one of *BlogList or error will be non-nil. Any non-2xx status
  1803. // code is an error. Response headers are in either
  1804. // *BlogList.ServerResponse.Header or (if a response was returned at
  1805. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1806. // to check whether the returned error was because
  1807. // http.StatusNotModified was returned.
  1808. func (c *BlogsListByUserCall) Do(opts ...googleapi.CallOption) (*BlogList, error) {
  1809. gensupport.SetOptions(c.urlParams_, opts...)
  1810. res, err := c.doRequest("json")
  1811. if res != nil && res.StatusCode == http.StatusNotModified {
  1812. if res.Body != nil {
  1813. res.Body.Close()
  1814. }
  1815. return nil, &googleapi.Error{
  1816. Code: res.StatusCode,
  1817. Header: res.Header,
  1818. }
  1819. }
  1820. if err != nil {
  1821. return nil, err
  1822. }
  1823. defer googleapi.CloseBody(res)
  1824. if err := googleapi.CheckResponse(res); err != nil {
  1825. return nil, err
  1826. }
  1827. ret := &BlogList{
  1828. ServerResponse: googleapi.ServerResponse{
  1829. Header: res.Header,
  1830. HTTPStatusCode: res.StatusCode,
  1831. },
  1832. }
  1833. target := &ret
  1834. if err := gensupport.DecodeResponse(target, res); err != nil {
  1835. return nil, err
  1836. }
  1837. return ret, nil
  1838. // {
  1839. // "description": "Retrieves a list of blogs, possibly filtered.",
  1840. // "httpMethod": "GET",
  1841. // "id": "blogger.blogs.listByUser",
  1842. // "parameterOrder": [
  1843. // "userId"
  1844. // ],
  1845. // "parameters": {
  1846. // "fetchUserInfo": {
  1847. // "description": "Whether the response is a list of blogs with per-user information instead of just blogs.",
  1848. // "location": "query",
  1849. // "type": "boolean"
  1850. // },
  1851. // "userId": {
  1852. // "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
  1853. // "location": "path",
  1854. // "required": true,
  1855. // "type": "string"
  1856. // },
  1857. // "view": {
  1858. // "enum": [
  1859. // "ADMIN",
  1860. // "AUTHOR",
  1861. // "READER"
  1862. // ],
  1863. // "enumDescriptions": [
  1864. // "Admin level detail",
  1865. // "Author level detail",
  1866. // "Admin level detail"
  1867. // ],
  1868. // "location": "query",
  1869. // "type": "string"
  1870. // }
  1871. // },
  1872. // "path": "users/{userId}/blogs",
  1873. // "response": {
  1874. // "$ref": "BlogList"
  1875. // },
  1876. // "scopes": [
  1877. // "https://www.googleapis.com/auth/blogger",
  1878. // "https://www.googleapis.com/auth/blogger.readonly"
  1879. // ]
  1880. // }
  1881. }
  1882. // method id "blogger.comments.approve":
  1883. type CommentsApproveCall struct {
  1884. s *Service
  1885. blogId string
  1886. postId string
  1887. commentId string
  1888. urlParams_ gensupport.URLParams
  1889. ctx_ context.Context
  1890. header_ http.Header
  1891. }
  1892. // Approve: Marks a comment as not spam.
  1893. func (r *CommentsService) Approve(blogId string, postId string, commentId string) *CommentsApproveCall {
  1894. c := &CommentsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1895. c.blogId = blogId
  1896. c.postId = postId
  1897. c.commentId = commentId
  1898. return c
  1899. }
  1900. // Fields allows partial responses to be retrieved. See
  1901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1902. // for more information.
  1903. func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall {
  1904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1905. return c
  1906. }
  1907. // Context sets the context to be used in this call's Do method. Any
  1908. // pending HTTP request will be aborted if the provided context is
  1909. // canceled.
  1910. func (c *CommentsApproveCall) Context(ctx context.Context) *CommentsApproveCall {
  1911. c.ctx_ = ctx
  1912. return c
  1913. }
  1914. // Header returns an http.Header that can be modified by the caller to
  1915. // add HTTP headers to the request.
  1916. func (c *CommentsApproveCall) Header() http.Header {
  1917. if c.header_ == nil {
  1918. c.header_ = make(http.Header)
  1919. }
  1920. return c.header_
  1921. }
  1922. func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) {
  1923. reqHeaders := make(http.Header)
  1924. for k, v := range c.header_ {
  1925. reqHeaders[k] = v
  1926. }
  1927. reqHeaders.Set("User-Agent", c.s.userAgent())
  1928. var body io.Reader = nil
  1929. c.urlParams_.Set("alt", alt)
  1930. c.urlParams_.Set("prettyPrint", "false")
  1931. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve")
  1932. urls += "?" + c.urlParams_.Encode()
  1933. req, err := http.NewRequest("POST", urls, body)
  1934. if err != nil {
  1935. return nil, err
  1936. }
  1937. req.Header = reqHeaders
  1938. googleapi.Expand(req.URL, map[string]string{
  1939. "blogId": c.blogId,
  1940. "postId": c.postId,
  1941. "commentId": c.commentId,
  1942. })
  1943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1944. }
  1945. // Do executes the "blogger.comments.approve" call.
  1946. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  1947. // code is an error. Response headers are in either
  1948. // *Comment.ServerResponse.Header or (if a response was returned at all)
  1949. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1950. // check whether the returned error was because http.StatusNotModified
  1951. // was returned.
  1952. func (c *CommentsApproveCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  1953. gensupport.SetOptions(c.urlParams_, opts...)
  1954. res, err := c.doRequest("json")
  1955. if res != nil && res.StatusCode == http.StatusNotModified {
  1956. if res.Body != nil {
  1957. res.Body.Close()
  1958. }
  1959. return nil, &googleapi.Error{
  1960. Code: res.StatusCode,
  1961. Header: res.Header,
  1962. }
  1963. }
  1964. if err != nil {
  1965. return nil, err
  1966. }
  1967. defer googleapi.CloseBody(res)
  1968. if err := googleapi.CheckResponse(res); err != nil {
  1969. return nil, err
  1970. }
  1971. ret := &Comment{
  1972. ServerResponse: googleapi.ServerResponse{
  1973. Header: res.Header,
  1974. HTTPStatusCode: res.StatusCode,
  1975. },
  1976. }
  1977. target := &ret
  1978. if err := gensupport.DecodeResponse(target, res); err != nil {
  1979. return nil, err
  1980. }
  1981. return ret, nil
  1982. // {
  1983. // "description": "Marks a comment as not spam.",
  1984. // "httpMethod": "POST",
  1985. // "id": "blogger.comments.approve",
  1986. // "parameterOrder": [
  1987. // "blogId",
  1988. // "postId",
  1989. // "commentId"
  1990. // ],
  1991. // "parameters": {
  1992. // "blogId": {
  1993. // "description": "The Id of the Blog.",
  1994. // "location": "path",
  1995. // "required": true,
  1996. // "type": "string"
  1997. // },
  1998. // "commentId": {
  1999. // "description": "The ID of the comment to mark as not spam.",
  2000. // "location": "path",
  2001. // "required": true,
  2002. // "type": "string"
  2003. // },
  2004. // "postId": {
  2005. // "description": "The ID of the Post.",
  2006. // "location": "path",
  2007. // "required": true,
  2008. // "type": "string"
  2009. // }
  2010. // },
  2011. // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve",
  2012. // "response": {
  2013. // "$ref": "Comment"
  2014. // },
  2015. // "scopes": [
  2016. // "https://www.googleapis.com/auth/blogger"
  2017. // ]
  2018. // }
  2019. }
  2020. // method id "blogger.comments.delete":
  2021. type CommentsDeleteCall struct {
  2022. s *Service
  2023. blogId string
  2024. postId string
  2025. commentId string
  2026. urlParams_ gensupport.URLParams
  2027. ctx_ context.Context
  2028. header_ http.Header
  2029. }
  2030. // Delete: Delete a comment by id.
  2031. func (r *CommentsService) Delete(blogId string, postId string, commentId string) *CommentsDeleteCall {
  2032. c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2033. c.blogId = blogId
  2034. c.postId = postId
  2035. c.commentId = commentId
  2036. return c
  2037. }
  2038. // Fields allows partial responses to be retrieved. See
  2039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2040. // for more information.
  2041. func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
  2042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2043. return c
  2044. }
  2045. // Context sets the context to be used in this call's Do method. Any
  2046. // pending HTTP request will be aborted if the provided context is
  2047. // canceled.
  2048. func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
  2049. c.ctx_ = ctx
  2050. return c
  2051. }
  2052. // Header returns an http.Header that can be modified by the caller to
  2053. // add HTTP headers to the request.
  2054. func (c *CommentsDeleteCall) Header() http.Header {
  2055. if c.header_ == nil {
  2056. c.header_ = make(http.Header)
  2057. }
  2058. return c.header_
  2059. }
  2060. func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2061. reqHeaders := make(http.Header)
  2062. for k, v := range c.header_ {
  2063. reqHeaders[k] = v
  2064. }
  2065. reqHeaders.Set("User-Agent", c.s.userAgent())
  2066. var body io.Reader = nil
  2067. c.urlParams_.Set("alt", alt)
  2068. c.urlParams_.Set("prettyPrint", "false")
  2069. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}")
  2070. urls += "?" + c.urlParams_.Encode()
  2071. req, err := http.NewRequest("DELETE", urls, body)
  2072. if err != nil {
  2073. return nil, err
  2074. }
  2075. req.Header = reqHeaders
  2076. googleapi.Expand(req.URL, map[string]string{
  2077. "blogId": c.blogId,
  2078. "postId": c.postId,
  2079. "commentId": c.commentId,
  2080. })
  2081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2082. }
  2083. // Do executes the "blogger.comments.delete" call.
  2084. func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2085. gensupport.SetOptions(c.urlParams_, opts...)
  2086. res, err := c.doRequest("json")
  2087. if err != nil {
  2088. return err
  2089. }
  2090. defer googleapi.CloseBody(res)
  2091. if err := googleapi.CheckResponse(res); err != nil {
  2092. return err
  2093. }
  2094. return nil
  2095. // {
  2096. // "description": "Delete a comment by id.",
  2097. // "httpMethod": "DELETE",
  2098. // "id": "blogger.comments.delete",
  2099. // "parameterOrder": [
  2100. // "blogId",
  2101. // "postId",
  2102. // "commentId"
  2103. // ],
  2104. // "parameters": {
  2105. // "blogId": {
  2106. // "description": "The Id of the Blog.",
  2107. // "location": "path",
  2108. // "required": true,
  2109. // "type": "string"
  2110. // },
  2111. // "commentId": {
  2112. // "description": "The ID of the comment to delete.",
  2113. // "location": "path",
  2114. // "required": true,
  2115. // "type": "string"
  2116. // },
  2117. // "postId": {
  2118. // "description": "The ID of the Post.",
  2119. // "location": "path",
  2120. // "required": true,
  2121. // "type": "string"
  2122. // }
  2123. // },
  2124. // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}",
  2125. // "scopes": [
  2126. // "https://www.googleapis.com/auth/blogger"
  2127. // ]
  2128. // }
  2129. }
  2130. // method id "blogger.comments.get":
  2131. type CommentsGetCall struct {
  2132. s *Service
  2133. blogId string
  2134. postId string
  2135. commentId string
  2136. urlParams_ gensupport.URLParams
  2137. ifNoneMatch_ string
  2138. ctx_ context.Context
  2139. header_ http.Header
  2140. }
  2141. // Get: Gets one comment by id.
  2142. func (r *CommentsService) Get(blogId string, postId string, commentId string) *CommentsGetCall {
  2143. c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2144. c.blogId = blogId
  2145. c.postId = postId
  2146. c.commentId = commentId
  2147. return c
  2148. }
  2149. // Fields allows partial responses to be retrieved. See
  2150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2151. // for more information.
  2152. func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
  2153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2154. return c
  2155. }
  2156. // IfNoneMatch sets the optional parameter which makes the operation
  2157. // fail if the object's ETag matches the given value. This is useful for
  2158. // getting updates only after the object has changed since the last
  2159. // request. Use googleapi.IsNotModified to check whether the response
  2160. // error from Do is the result of In-None-Match.
  2161. func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall {
  2162. c.ifNoneMatch_ = entityTag
  2163. return c
  2164. }
  2165. // Context sets the context to be used in this call's Do method. Any
  2166. // pending HTTP request will be aborted if the provided context is
  2167. // canceled.
  2168. func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall {
  2169. c.ctx_ = ctx
  2170. return c
  2171. }
  2172. // Header returns an http.Header that can be modified by the caller to
  2173. // add HTTP headers to the request.
  2174. func (c *CommentsGetCall) Header() http.Header {
  2175. if c.header_ == nil {
  2176. c.header_ = make(http.Header)
  2177. }
  2178. return c.header_
  2179. }
  2180. func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) {
  2181. reqHeaders := make(http.Header)
  2182. for k, v := range c.header_ {
  2183. reqHeaders[k] = v
  2184. }
  2185. reqHeaders.Set("User-Agent", c.s.userAgent())
  2186. if c.ifNoneMatch_ != "" {
  2187. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2188. }
  2189. var body io.Reader = nil
  2190. c.urlParams_.Set("alt", alt)
  2191. c.urlParams_.Set("prettyPrint", "false")
  2192. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}")
  2193. urls += "?" + c.urlParams_.Encode()
  2194. req, err := http.NewRequest("GET", urls, body)
  2195. if err != nil {
  2196. return nil, err
  2197. }
  2198. req.Header = reqHeaders
  2199. googleapi.Expand(req.URL, map[string]string{
  2200. "blogId": c.blogId,
  2201. "postId": c.postId,
  2202. "commentId": c.commentId,
  2203. })
  2204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2205. }
  2206. // Do executes the "blogger.comments.get" call.
  2207. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  2208. // code is an error. Response headers are in either
  2209. // *Comment.ServerResponse.Header or (if a response was returned at all)
  2210. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2211. // check whether the returned error was because http.StatusNotModified
  2212. // was returned.
  2213. func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  2214. gensupport.SetOptions(c.urlParams_, opts...)
  2215. res, err := c.doRequest("json")
  2216. if res != nil && res.StatusCode == http.StatusNotModified {
  2217. if res.Body != nil {
  2218. res.Body.Close()
  2219. }
  2220. return nil, &googleapi.Error{
  2221. Code: res.StatusCode,
  2222. Header: res.Header,
  2223. }
  2224. }
  2225. if err != nil {
  2226. return nil, err
  2227. }
  2228. defer googleapi.CloseBody(res)
  2229. if err := googleapi.CheckResponse(res); err != nil {
  2230. return nil, err
  2231. }
  2232. ret := &Comment{
  2233. ServerResponse: googleapi.ServerResponse{
  2234. Header: res.Header,
  2235. HTTPStatusCode: res.StatusCode,
  2236. },
  2237. }
  2238. target := &ret
  2239. if err := gensupport.DecodeResponse(target, res); err != nil {
  2240. return nil, err
  2241. }
  2242. return ret, nil
  2243. // {
  2244. // "description": "Gets one comment by id.",
  2245. // "httpMethod": "GET",
  2246. // "id": "blogger.comments.get",
  2247. // "parameterOrder": [
  2248. // "blogId",
  2249. // "postId",
  2250. // "commentId"
  2251. // ],
  2252. // "parameters": {
  2253. // "blogId": {
  2254. // "description": "ID of the blog to containing the comment.",
  2255. // "location": "path",
  2256. // "required": true,
  2257. // "type": "string"
  2258. // },
  2259. // "commentId": {
  2260. // "description": "The ID of the comment to get.",
  2261. // "location": "path",
  2262. // "required": true,
  2263. // "type": "string"
  2264. // },
  2265. // "postId": {
  2266. // "description": "ID of the post to fetch posts from.",
  2267. // "location": "path",
  2268. // "required": true,
  2269. // "type": "string"
  2270. // }
  2271. // },
  2272. // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}",
  2273. // "response": {
  2274. // "$ref": "Comment"
  2275. // },
  2276. // "scopes": [
  2277. // "https://www.googleapis.com/auth/blogger",
  2278. // "https://www.googleapis.com/auth/blogger.readonly"
  2279. // ]
  2280. // }
  2281. }
  2282. // method id "blogger.comments.list":
  2283. type CommentsListCall struct {
  2284. s *Service
  2285. blogId string
  2286. postId string
  2287. urlParams_ gensupport.URLParams
  2288. ifNoneMatch_ string
  2289. ctx_ context.Context
  2290. header_ http.Header
  2291. }
  2292. // List: Retrieves the comments for a post, possibly filtered.
  2293. func (r *CommentsService) List(blogId string, postId string) *CommentsListCall {
  2294. c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2295. c.blogId = blogId
  2296. c.postId = postId
  2297. return c
  2298. }
  2299. // EndDate sets the optional parameter "endDate": Latest date of comment
  2300. // to fetch, a date-time with RFC 3339 formatting.
  2301. func (c *CommentsListCall) EndDate(endDate string) *CommentsListCall {
  2302. c.urlParams_.Set("endDate", endDate)
  2303. return c
  2304. }
  2305. // FetchBodies sets the optional parameter "fetchBodies": Whether the
  2306. // body content of the comments is included.
  2307. func (c *CommentsListCall) FetchBodies(fetchBodies bool) *CommentsListCall {
  2308. c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
  2309. return c
  2310. }
  2311. // MaxResults sets the optional parameter "maxResults": Maximum number
  2312. // of comments to include in the result.
  2313. func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
  2314. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2315. return c
  2316. }
  2317. // PageToken sets the optional parameter "pageToken": Continuation token
  2318. // if request is paged.
  2319. func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
  2320. c.urlParams_.Set("pageToken", pageToken)
  2321. return c
  2322. }
  2323. // StartDate sets the optional parameter "startDate": Earliest date of
  2324. // comment to fetch, a date-time with RFC 3339 formatting.
  2325. func (c *CommentsListCall) StartDate(startDate string) *CommentsListCall {
  2326. c.urlParams_.Set("startDate", startDate)
  2327. return c
  2328. }
  2329. // Statuses sets the optional parameter "statuses":
  2330. //
  2331. // Possible values:
  2332. // "emptied" - Comments that have had their content removed
  2333. // "live" - Comments that are publicly visible
  2334. // "pending" - Comments that are awaiting administrator approval
  2335. // "spam" - Comments marked as spam by the administrator
  2336. func (c *CommentsListCall) Statuses(statuses ...string) *CommentsListCall {
  2337. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  2338. return c
  2339. }
  2340. // View sets the optional parameter "view":
  2341. //
  2342. // Possible values:
  2343. // "ADMIN" - Admin level detail
  2344. // "AUTHOR" - Author level detail
  2345. // "READER" - Admin level detail
  2346. func (c *CommentsListCall) View(view string) *CommentsListCall {
  2347. c.urlParams_.Set("view", view)
  2348. return c
  2349. }
  2350. // Fields allows partial responses to be retrieved. See
  2351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2352. // for more information.
  2353. func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
  2354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2355. return c
  2356. }
  2357. // IfNoneMatch sets the optional parameter which makes the operation
  2358. // fail if the object's ETag matches the given value. This is useful for
  2359. // getting updates only after the object has changed since the last
  2360. // request. Use googleapi.IsNotModified to check whether the response
  2361. // error from Do is the result of In-None-Match.
  2362. func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
  2363. c.ifNoneMatch_ = entityTag
  2364. return c
  2365. }
  2366. // Context sets the context to be used in this call's Do method. Any
  2367. // pending HTTP request will be aborted if the provided context is
  2368. // canceled.
  2369. func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
  2370. c.ctx_ = ctx
  2371. return c
  2372. }
  2373. // Header returns an http.Header that can be modified by the caller to
  2374. // add HTTP headers to the request.
  2375. func (c *CommentsListCall) Header() http.Header {
  2376. if c.header_ == nil {
  2377. c.header_ = make(http.Header)
  2378. }
  2379. return c.header_
  2380. }
  2381. func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
  2382. reqHeaders := make(http.Header)
  2383. for k, v := range c.header_ {
  2384. reqHeaders[k] = v
  2385. }
  2386. reqHeaders.Set("User-Agent", c.s.userAgent())
  2387. if c.ifNoneMatch_ != "" {
  2388. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2389. }
  2390. var body io.Reader = nil
  2391. c.urlParams_.Set("alt", alt)
  2392. c.urlParams_.Set("prettyPrint", "false")
  2393. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments")
  2394. urls += "?" + c.urlParams_.Encode()
  2395. req, err := http.NewRequest("GET", urls, body)
  2396. if err != nil {
  2397. return nil, err
  2398. }
  2399. req.Header = reqHeaders
  2400. googleapi.Expand(req.URL, map[string]string{
  2401. "blogId": c.blogId,
  2402. "postId": c.postId,
  2403. })
  2404. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2405. }
  2406. // Do executes the "blogger.comments.list" call.
  2407. // Exactly one of *CommentList or error will be non-nil. Any non-2xx
  2408. // status code is an error. Response headers are in either
  2409. // *CommentList.ServerResponse.Header or (if a response was returned at
  2410. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2411. // to check whether the returned error was because
  2412. // http.StatusNotModified was returned.
  2413. func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
  2414. gensupport.SetOptions(c.urlParams_, opts...)
  2415. res, err := c.doRequest("json")
  2416. if res != nil && res.StatusCode == http.StatusNotModified {
  2417. if res.Body != nil {
  2418. res.Body.Close()
  2419. }
  2420. return nil, &googleapi.Error{
  2421. Code: res.StatusCode,
  2422. Header: res.Header,
  2423. }
  2424. }
  2425. if err != nil {
  2426. return nil, err
  2427. }
  2428. defer googleapi.CloseBody(res)
  2429. if err := googleapi.CheckResponse(res); err != nil {
  2430. return nil, err
  2431. }
  2432. ret := &CommentList{
  2433. ServerResponse: googleapi.ServerResponse{
  2434. Header: res.Header,
  2435. HTTPStatusCode: res.StatusCode,
  2436. },
  2437. }
  2438. target := &ret
  2439. if err := gensupport.DecodeResponse(target, res); err != nil {
  2440. return nil, err
  2441. }
  2442. return ret, nil
  2443. // {
  2444. // "description": "Retrieves the comments for a post, possibly filtered.",
  2445. // "httpMethod": "GET",
  2446. // "id": "blogger.comments.list",
  2447. // "parameterOrder": [
  2448. // "blogId",
  2449. // "postId"
  2450. // ],
  2451. // "parameters": {
  2452. // "blogId": {
  2453. // "description": "ID of the blog to fetch comments from.",
  2454. // "location": "path",
  2455. // "required": true,
  2456. // "type": "string"
  2457. // },
  2458. // "endDate": {
  2459. // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.",
  2460. // "format": "date-time",
  2461. // "location": "query",
  2462. // "type": "string"
  2463. // },
  2464. // "fetchBodies": {
  2465. // "description": "Whether the body content of the comments is included.",
  2466. // "location": "query",
  2467. // "type": "boolean"
  2468. // },
  2469. // "maxResults": {
  2470. // "description": "Maximum number of comments to include in the result.",
  2471. // "format": "uint32",
  2472. // "location": "query",
  2473. // "type": "integer"
  2474. // },
  2475. // "pageToken": {
  2476. // "description": "Continuation token if request is paged.",
  2477. // "location": "query",
  2478. // "type": "string"
  2479. // },
  2480. // "postId": {
  2481. // "description": "ID of the post to fetch posts from.",
  2482. // "location": "path",
  2483. // "required": true,
  2484. // "type": "string"
  2485. // },
  2486. // "startDate": {
  2487. // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.",
  2488. // "format": "date-time",
  2489. // "location": "query",
  2490. // "type": "string"
  2491. // },
  2492. // "statuses": {
  2493. // "enum": [
  2494. // "emptied",
  2495. // "live",
  2496. // "pending",
  2497. // "spam"
  2498. // ],
  2499. // "enumDescriptions": [
  2500. // "Comments that have had their content removed",
  2501. // "Comments that are publicly visible",
  2502. // "Comments that are awaiting administrator approval",
  2503. // "Comments marked as spam by the administrator"
  2504. // ],
  2505. // "location": "query",
  2506. // "repeated": true,
  2507. // "type": "string"
  2508. // },
  2509. // "view": {
  2510. // "enum": [
  2511. // "ADMIN",
  2512. // "AUTHOR",
  2513. // "READER"
  2514. // ],
  2515. // "enumDescriptions": [
  2516. // "Admin level detail",
  2517. // "Author level detail",
  2518. // "Admin level detail"
  2519. // ],
  2520. // "location": "query",
  2521. // "type": "string"
  2522. // }
  2523. // },
  2524. // "path": "blogs/{blogId}/posts/{postId}/comments",
  2525. // "response": {
  2526. // "$ref": "CommentList"
  2527. // },
  2528. // "scopes": [
  2529. // "https://www.googleapis.com/auth/blogger",
  2530. // "https://www.googleapis.com/auth/blogger.readonly"
  2531. // ]
  2532. // }
  2533. }
  2534. // Pages invokes f for each page of results.
  2535. // A non-nil error returned from f will halt the iteration.
  2536. // The provided context supersedes any context provided to the Context method.
  2537. func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error {
  2538. c.ctx_ = ctx
  2539. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2540. for {
  2541. x, err := c.Do()
  2542. if err != nil {
  2543. return err
  2544. }
  2545. if err := f(x); err != nil {
  2546. return err
  2547. }
  2548. if x.NextPageToken == "" {
  2549. return nil
  2550. }
  2551. c.PageToken(x.NextPageToken)
  2552. }
  2553. }
  2554. // method id "blogger.comments.listByBlog":
  2555. type CommentsListByBlogCall struct {
  2556. s *Service
  2557. blogId string
  2558. urlParams_ gensupport.URLParams
  2559. ifNoneMatch_ string
  2560. ctx_ context.Context
  2561. header_ http.Header
  2562. }
  2563. // ListByBlog: Retrieves the comments for a blog, across all posts,
  2564. // possibly filtered.
  2565. func (r *CommentsService) ListByBlog(blogId string) *CommentsListByBlogCall {
  2566. c := &CommentsListByBlogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2567. c.blogId = blogId
  2568. return c
  2569. }
  2570. // EndDate sets the optional parameter "endDate": Latest date of comment
  2571. // to fetch, a date-time with RFC 3339 formatting.
  2572. func (c *CommentsListByBlogCall) EndDate(endDate string) *CommentsListByBlogCall {
  2573. c.urlParams_.Set("endDate", endDate)
  2574. return c
  2575. }
  2576. // FetchBodies sets the optional parameter "fetchBodies": Whether the
  2577. // body content of the comments is included.
  2578. func (c *CommentsListByBlogCall) FetchBodies(fetchBodies bool) *CommentsListByBlogCall {
  2579. c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
  2580. return c
  2581. }
  2582. // MaxResults sets the optional parameter "maxResults": Maximum number
  2583. // of comments to include in the result.
  2584. func (c *CommentsListByBlogCall) MaxResults(maxResults int64) *CommentsListByBlogCall {
  2585. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2586. return c
  2587. }
  2588. // PageToken sets the optional parameter "pageToken": Continuation token
  2589. // if request is paged.
  2590. func (c *CommentsListByBlogCall) PageToken(pageToken string) *CommentsListByBlogCall {
  2591. c.urlParams_.Set("pageToken", pageToken)
  2592. return c
  2593. }
  2594. // StartDate sets the optional parameter "startDate": Earliest date of
  2595. // comment to fetch, a date-time with RFC 3339 formatting.
  2596. func (c *CommentsListByBlogCall) StartDate(startDate string) *CommentsListByBlogCall {
  2597. c.urlParams_.Set("startDate", startDate)
  2598. return c
  2599. }
  2600. // Fields allows partial responses to be retrieved. See
  2601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2602. // for more information.
  2603. func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall {
  2604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2605. return c
  2606. }
  2607. // IfNoneMatch sets the optional parameter which makes the operation
  2608. // fail if the object's ETag matches the given value. This is useful for
  2609. // getting updates only after the object has changed since the last
  2610. // request. Use googleapi.IsNotModified to check whether the response
  2611. // error from Do is the result of In-None-Match.
  2612. func (c *CommentsListByBlogCall) IfNoneMatch(entityTag string) *CommentsListByBlogCall {
  2613. c.ifNoneMatch_ = entityTag
  2614. return c
  2615. }
  2616. // Context sets the context to be used in this call's Do method. Any
  2617. // pending HTTP request will be aborted if the provided context is
  2618. // canceled.
  2619. func (c *CommentsListByBlogCall) Context(ctx context.Context) *CommentsListByBlogCall {
  2620. c.ctx_ = ctx
  2621. return c
  2622. }
  2623. // Header returns an http.Header that can be modified by the caller to
  2624. // add HTTP headers to the request.
  2625. func (c *CommentsListByBlogCall) Header() http.Header {
  2626. if c.header_ == nil {
  2627. c.header_ = make(http.Header)
  2628. }
  2629. return c.header_
  2630. }
  2631. func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) {
  2632. reqHeaders := make(http.Header)
  2633. for k, v := range c.header_ {
  2634. reqHeaders[k] = v
  2635. }
  2636. reqHeaders.Set("User-Agent", c.s.userAgent())
  2637. if c.ifNoneMatch_ != "" {
  2638. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2639. }
  2640. var body io.Reader = nil
  2641. c.urlParams_.Set("alt", alt)
  2642. c.urlParams_.Set("prettyPrint", "false")
  2643. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments")
  2644. urls += "?" + c.urlParams_.Encode()
  2645. req, err := http.NewRequest("GET", urls, body)
  2646. if err != nil {
  2647. return nil, err
  2648. }
  2649. req.Header = reqHeaders
  2650. googleapi.Expand(req.URL, map[string]string{
  2651. "blogId": c.blogId,
  2652. })
  2653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2654. }
  2655. // Do executes the "blogger.comments.listByBlog" call.
  2656. // Exactly one of *CommentList or error will be non-nil. Any non-2xx
  2657. // status code is an error. Response headers are in either
  2658. // *CommentList.ServerResponse.Header or (if a response was returned at
  2659. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2660. // to check whether the returned error was because
  2661. // http.StatusNotModified was returned.
  2662. func (c *CommentsListByBlogCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
  2663. gensupport.SetOptions(c.urlParams_, opts...)
  2664. res, err := c.doRequest("json")
  2665. if res != nil && res.StatusCode == http.StatusNotModified {
  2666. if res.Body != nil {
  2667. res.Body.Close()
  2668. }
  2669. return nil, &googleapi.Error{
  2670. Code: res.StatusCode,
  2671. Header: res.Header,
  2672. }
  2673. }
  2674. if err != nil {
  2675. return nil, err
  2676. }
  2677. defer googleapi.CloseBody(res)
  2678. if err := googleapi.CheckResponse(res); err != nil {
  2679. return nil, err
  2680. }
  2681. ret := &CommentList{
  2682. ServerResponse: googleapi.ServerResponse{
  2683. Header: res.Header,
  2684. HTTPStatusCode: res.StatusCode,
  2685. },
  2686. }
  2687. target := &ret
  2688. if err := gensupport.DecodeResponse(target, res); err != nil {
  2689. return nil, err
  2690. }
  2691. return ret, nil
  2692. // {
  2693. // "description": "Retrieves the comments for a blog, across all posts, possibly filtered.",
  2694. // "httpMethod": "GET",
  2695. // "id": "blogger.comments.listByBlog",
  2696. // "parameterOrder": [
  2697. // "blogId"
  2698. // ],
  2699. // "parameters": {
  2700. // "blogId": {
  2701. // "description": "ID of the blog to fetch comments from.",
  2702. // "location": "path",
  2703. // "required": true,
  2704. // "type": "string"
  2705. // },
  2706. // "endDate": {
  2707. // "description": "Latest date of comment to fetch, a date-time with RFC 3339 formatting.",
  2708. // "format": "date-time",
  2709. // "location": "query",
  2710. // "type": "string"
  2711. // },
  2712. // "fetchBodies": {
  2713. // "description": "Whether the body content of the comments is included.",
  2714. // "location": "query",
  2715. // "type": "boolean"
  2716. // },
  2717. // "maxResults": {
  2718. // "description": "Maximum number of comments to include in the result.",
  2719. // "format": "uint32",
  2720. // "location": "query",
  2721. // "type": "integer"
  2722. // },
  2723. // "pageToken": {
  2724. // "description": "Continuation token if request is paged.",
  2725. // "location": "query",
  2726. // "type": "string"
  2727. // },
  2728. // "startDate": {
  2729. // "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.",
  2730. // "format": "date-time",
  2731. // "location": "query",
  2732. // "type": "string"
  2733. // }
  2734. // },
  2735. // "path": "blogs/{blogId}/comments",
  2736. // "response": {
  2737. // "$ref": "CommentList"
  2738. // },
  2739. // "scopes": [
  2740. // "https://www.googleapis.com/auth/blogger",
  2741. // "https://www.googleapis.com/auth/blogger.readonly"
  2742. // ]
  2743. // }
  2744. }
  2745. // Pages invokes f for each page of results.
  2746. // A non-nil error returned from f will halt the iteration.
  2747. // The provided context supersedes any context provided to the Context method.
  2748. func (c *CommentsListByBlogCall) Pages(ctx context.Context, f func(*CommentList) error) error {
  2749. c.ctx_ = ctx
  2750. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2751. for {
  2752. x, err := c.Do()
  2753. if err != nil {
  2754. return err
  2755. }
  2756. if err := f(x); err != nil {
  2757. return err
  2758. }
  2759. if x.NextPageToken == "" {
  2760. return nil
  2761. }
  2762. c.PageToken(x.NextPageToken)
  2763. }
  2764. }
  2765. // method id "blogger.comments.markAsSpam":
  2766. type CommentsMarkAsSpamCall struct {
  2767. s *Service
  2768. blogId string
  2769. postId string
  2770. commentId string
  2771. urlParams_ gensupport.URLParams
  2772. ctx_ context.Context
  2773. header_ http.Header
  2774. }
  2775. // MarkAsSpam: Marks a comment as spam.
  2776. func (r *CommentsService) MarkAsSpam(blogId string, postId string, commentId string) *CommentsMarkAsSpamCall {
  2777. c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2778. c.blogId = blogId
  2779. c.postId = postId
  2780. c.commentId = commentId
  2781. return c
  2782. }
  2783. // Fields allows partial responses to be retrieved. See
  2784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2785. // for more information.
  2786. func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall {
  2787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2788. return c
  2789. }
  2790. // Context sets the context to be used in this call's Do method. Any
  2791. // pending HTTP request will be aborted if the provided context is
  2792. // canceled.
  2793. func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall {
  2794. c.ctx_ = ctx
  2795. return c
  2796. }
  2797. // Header returns an http.Header that can be modified by the caller to
  2798. // add HTTP headers to the request.
  2799. func (c *CommentsMarkAsSpamCall) Header() http.Header {
  2800. if c.header_ == nil {
  2801. c.header_ = make(http.Header)
  2802. }
  2803. return c.header_
  2804. }
  2805. func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) {
  2806. reqHeaders := make(http.Header)
  2807. for k, v := range c.header_ {
  2808. reqHeaders[k] = v
  2809. }
  2810. reqHeaders.Set("User-Agent", c.s.userAgent())
  2811. var body io.Reader = nil
  2812. c.urlParams_.Set("alt", alt)
  2813. c.urlParams_.Set("prettyPrint", "false")
  2814. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam")
  2815. urls += "?" + c.urlParams_.Encode()
  2816. req, err := http.NewRequest("POST", urls, body)
  2817. if err != nil {
  2818. return nil, err
  2819. }
  2820. req.Header = reqHeaders
  2821. googleapi.Expand(req.URL, map[string]string{
  2822. "blogId": c.blogId,
  2823. "postId": c.postId,
  2824. "commentId": c.commentId,
  2825. })
  2826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2827. }
  2828. // Do executes the "blogger.comments.markAsSpam" call.
  2829. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  2830. // code is an error. Response headers are in either
  2831. // *Comment.ServerResponse.Header or (if a response was returned at all)
  2832. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2833. // check whether the returned error was because http.StatusNotModified
  2834. // was returned.
  2835. func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  2836. gensupport.SetOptions(c.urlParams_, opts...)
  2837. res, err := c.doRequest("json")
  2838. if res != nil && res.StatusCode == http.StatusNotModified {
  2839. if res.Body != nil {
  2840. res.Body.Close()
  2841. }
  2842. return nil, &googleapi.Error{
  2843. Code: res.StatusCode,
  2844. Header: res.Header,
  2845. }
  2846. }
  2847. if err != nil {
  2848. return nil, err
  2849. }
  2850. defer googleapi.CloseBody(res)
  2851. if err := googleapi.CheckResponse(res); err != nil {
  2852. return nil, err
  2853. }
  2854. ret := &Comment{
  2855. ServerResponse: googleapi.ServerResponse{
  2856. Header: res.Header,
  2857. HTTPStatusCode: res.StatusCode,
  2858. },
  2859. }
  2860. target := &ret
  2861. if err := gensupport.DecodeResponse(target, res); err != nil {
  2862. return nil, err
  2863. }
  2864. return ret, nil
  2865. // {
  2866. // "description": "Marks a comment as spam.",
  2867. // "httpMethod": "POST",
  2868. // "id": "blogger.comments.markAsSpam",
  2869. // "parameterOrder": [
  2870. // "blogId",
  2871. // "postId",
  2872. // "commentId"
  2873. // ],
  2874. // "parameters": {
  2875. // "blogId": {
  2876. // "description": "The Id of the Blog.",
  2877. // "location": "path",
  2878. // "required": true,
  2879. // "type": "string"
  2880. // },
  2881. // "commentId": {
  2882. // "description": "The ID of the comment to mark as spam.",
  2883. // "location": "path",
  2884. // "required": true,
  2885. // "type": "string"
  2886. // },
  2887. // "postId": {
  2888. // "description": "The ID of the Post.",
  2889. // "location": "path",
  2890. // "required": true,
  2891. // "type": "string"
  2892. // }
  2893. // },
  2894. // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam",
  2895. // "response": {
  2896. // "$ref": "Comment"
  2897. // },
  2898. // "scopes": [
  2899. // "https://www.googleapis.com/auth/blogger"
  2900. // ]
  2901. // }
  2902. }
  2903. // method id "blogger.comments.removeContent":
  2904. type CommentsRemoveContentCall struct {
  2905. s *Service
  2906. blogId string
  2907. postId string
  2908. commentId string
  2909. urlParams_ gensupport.URLParams
  2910. ctx_ context.Context
  2911. header_ http.Header
  2912. }
  2913. // RemoveContent: Removes the content of a comment.
  2914. func (r *CommentsService) RemoveContent(blogId string, postId string, commentId string) *CommentsRemoveContentCall {
  2915. c := &CommentsRemoveContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2916. c.blogId = blogId
  2917. c.postId = postId
  2918. c.commentId = commentId
  2919. return c
  2920. }
  2921. // Fields allows partial responses to be retrieved. See
  2922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2923. // for more information.
  2924. func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall {
  2925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2926. return c
  2927. }
  2928. // Context sets the context to be used in this call's Do method. Any
  2929. // pending HTTP request will be aborted if the provided context is
  2930. // canceled.
  2931. func (c *CommentsRemoveContentCall) Context(ctx context.Context) *CommentsRemoveContentCall {
  2932. c.ctx_ = ctx
  2933. return c
  2934. }
  2935. // Header returns an http.Header that can be modified by the caller to
  2936. // add HTTP headers to the request.
  2937. func (c *CommentsRemoveContentCall) Header() http.Header {
  2938. if c.header_ == nil {
  2939. c.header_ = make(http.Header)
  2940. }
  2941. return c.header_
  2942. }
  2943. func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) {
  2944. reqHeaders := make(http.Header)
  2945. for k, v := range c.header_ {
  2946. reqHeaders[k] = v
  2947. }
  2948. reqHeaders.Set("User-Agent", c.s.userAgent())
  2949. var body io.Reader = nil
  2950. c.urlParams_.Set("alt", alt)
  2951. c.urlParams_.Set("prettyPrint", "false")
  2952. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent")
  2953. urls += "?" + c.urlParams_.Encode()
  2954. req, err := http.NewRequest("POST", urls, body)
  2955. if err != nil {
  2956. return nil, err
  2957. }
  2958. req.Header = reqHeaders
  2959. googleapi.Expand(req.URL, map[string]string{
  2960. "blogId": c.blogId,
  2961. "postId": c.postId,
  2962. "commentId": c.commentId,
  2963. })
  2964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2965. }
  2966. // Do executes the "blogger.comments.removeContent" call.
  2967. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  2968. // code is an error. Response headers are in either
  2969. // *Comment.ServerResponse.Header or (if a response was returned at all)
  2970. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2971. // check whether the returned error was because http.StatusNotModified
  2972. // was returned.
  2973. func (c *CommentsRemoveContentCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  2974. gensupport.SetOptions(c.urlParams_, opts...)
  2975. res, err := c.doRequest("json")
  2976. if res != nil && res.StatusCode == http.StatusNotModified {
  2977. if res.Body != nil {
  2978. res.Body.Close()
  2979. }
  2980. return nil, &googleapi.Error{
  2981. Code: res.StatusCode,
  2982. Header: res.Header,
  2983. }
  2984. }
  2985. if err != nil {
  2986. return nil, err
  2987. }
  2988. defer googleapi.CloseBody(res)
  2989. if err := googleapi.CheckResponse(res); err != nil {
  2990. return nil, err
  2991. }
  2992. ret := &Comment{
  2993. ServerResponse: googleapi.ServerResponse{
  2994. Header: res.Header,
  2995. HTTPStatusCode: res.StatusCode,
  2996. },
  2997. }
  2998. target := &ret
  2999. if err := gensupport.DecodeResponse(target, res); err != nil {
  3000. return nil, err
  3001. }
  3002. return ret, nil
  3003. // {
  3004. // "description": "Removes the content of a comment.",
  3005. // "httpMethod": "POST",
  3006. // "id": "blogger.comments.removeContent",
  3007. // "parameterOrder": [
  3008. // "blogId",
  3009. // "postId",
  3010. // "commentId"
  3011. // ],
  3012. // "parameters": {
  3013. // "blogId": {
  3014. // "description": "The Id of the Blog.",
  3015. // "location": "path",
  3016. // "required": true,
  3017. // "type": "string"
  3018. // },
  3019. // "commentId": {
  3020. // "description": "The ID of the comment to delete content from.",
  3021. // "location": "path",
  3022. // "required": true,
  3023. // "type": "string"
  3024. // },
  3025. // "postId": {
  3026. // "description": "The ID of the Post.",
  3027. // "location": "path",
  3028. // "required": true,
  3029. // "type": "string"
  3030. // }
  3031. // },
  3032. // "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent",
  3033. // "response": {
  3034. // "$ref": "Comment"
  3035. // },
  3036. // "scopes": [
  3037. // "https://www.googleapis.com/auth/blogger"
  3038. // ]
  3039. // }
  3040. }
  3041. // method id "blogger.pageViews.get":
  3042. type PageViewsGetCall struct {
  3043. s *Service
  3044. blogId string
  3045. urlParams_ gensupport.URLParams
  3046. ifNoneMatch_ string
  3047. ctx_ context.Context
  3048. header_ http.Header
  3049. }
  3050. // Get: Retrieve pageview stats for a Blog.
  3051. func (r *PageViewsService) Get(blogId string) *PageViewsGetCall {
  3052. c := &PageViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3053. c.blogId = blogId
  3054. return c
  3055. }
  3056. // Range sets the optional parameter "range":
  3057. //
  3058. // Possible values:
  3059. // "30DAYS" - Page view counts from the last thirty days.
  3060. // "7DAYS" - Page view counts from the last seven days.
  3061. // "all" - Total page view counts from all time.
  3062. func (c *PageViewsGetCall) Range(range_ ...string) *PageViewsGetCall {
  3063. c.urlParams_.SetMulti("range", append([]string{}, range_...))
  3064. return c
  3065. }
  3066. // Fields allows partial responses to be retrieved. See
  3067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3068. // for more information.
  3069. func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall {
  3070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3071. return c
  3072. }
  3073. // IfNoneMatch sets the optional parameter which makes the operation
  3074. // fail if the object's ETag matches the given value. This is useful for
  3075. // getting updates only after the object has changed since the last
  3076. // request. Use googleapi.IsNotModified to check whether the response
  3077. // error from Do is the result of In-None-Match.
  3078. func (c *PageViewsGetCall) IfNoneMatch(entityTag string) *PageViewsGetCall {
  3079. c.ifNoneMatch_ = entityTag
  3080. return c
  3081. }
  3082. // Context sets the context to be used in this call's Do method. Any
  3083. // pending HTTP request will be aborted if the provided context is
  3084. // canceled.
  3085. func (c *PageViewsGetCall) Context(ctx context.Context) *PageViewsGetCall {
  3086. c.ctx_ = ctx
  3087. return c
  3088. }
  3089. // Header returns an http.Header that can be modified by the caller to
  3090. // add HTTP headers to the request.
  3091. func (c *PageViewsGetCall) Header() http.Header {
  3092. if c.header_ == nil {
  3093. c.header_ = make(http.Header)
  3094. }
  3095. return c.header_
  3096. }
  3097. func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) {
  3098. reqHeaders := make(http.Header)
  3099. for k, v := range c.header_ {
  3100. reqHeaders[k] = v
  3101. }
  3102. reqHeaders.Set("User-Agent", c.s.userAgent())
  3103. if c.ifNoneMatch_ != "" {
  3104. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3105. }
  3106. var body io.Reader = nil
  3107. c.urlParams_.Set("alt", alt)
  3108. c.urlParams_.Set("prettyPrint", "false")
  3109. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews")
  3110. urls += "?" + c.urlParams_.Encode()
  3111. req, err := http.NewRequest("GET", urls, body)
  3112. if err != nil {
  3113. return nil, err
  3114. }
  3115. req.Header = reqHeaders
  3116. googleapi.Expand(req.URL, map[string]string{
  3117. "blogId": c.blogId,
  3118. })
  3119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3120. }
  3121. // Do executes the "blogger.pageViews.get" call.
  3122. // Exactly one of *Pageviews or error will be non-nil. Any non-2xx
  3123. // status code is an error. Response headers are in either
  3124. // *Pageviews.ServerResponse.Header or (if a response was returned at
  3125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3126. // to check whether the returned error was because
  3127. // http.StatusNotModified was returned.
  3128. func (c *PageViewsGetCall) Do(opts ...googleapi.CallOption) (*Pageviews, error) {
  3129. gensupport.SetOptions(c.urlParams_, opts...)
  3130. res, err := c.doRequest("json")
  3131. if res != nil && res.StatusCode == http.StatusNotModified {
  3132. if res.Body != nil {
  3133. res.Body.Close()
  3134. }
  3135. return nil, &googleapi.Error{
  3136. Code: res.StatusCode,
  3137. Header: res.Header,
  3138. }
  3139. }
  3140. if err != nil {
  3141. return nil, err
  3142. }
  3143. defer googleapi.CloseBody(res)
  3144. if err := googleapi.CheckResponse(res); err != nil {
  3145. return nil, err
  3146. }
  3147. ret := &Pageviews{
  3148. ServerResponse: googleapi.ServerResponse{
  3149. Header: res.Header,
  3150. HTTPStatusCode: res.StatusCode,
  3151. },
  3152. }
  3153. target := &ret
  3154. if err := gensupport.DecodeResponse(target, res); err != nil {
  3155. return nil, err
  3156. }
  3157. return ret, nil
  3158. // {
  3159. // "description": "Retrieve pageview stats for a Blog.",
  3160. // "httpMethod": "GET",
  3161. // "id": "blogger.pageViews.get",
  3162. // "parameterOrder": [
  3163. // "blogId"
  3164. // ],
  3165. // "parameters": {
  3166. // "blogId": {
  3167. // "description": "The ID of the blog to get.",
  3168. // "location": "path",
  3169. // "required": true,
  3170. // "type": "string"
  3171. // },
  3172. // "range": {
  3173. // "enum": [
  3174. // "30DAYS",
  3175. // "7DAYS",
  3176. // "all"
  3177. // ],
  3178. // "enumDescriptions": [
  3179. // "Page view counts from the last thirty days.",
  3180. // "Page view counts from the last seven days.",
  3181. // "Total page view counts from all time."
  3182. // ],
  3183. // "location": "query",
  3184. // "repeated": true,
  3185. // "type": "string"
  3186. // }
  3187. // },
  3188. // "path": "blogs/{blogId}/pageviews",
  3189. // "response": {
  3190. // "$ref": "Pageviews"
  3191. // },
  3192. // "scopes": [
  3193. // "https://www.googleapis.com/auth/blogger"
  3194. // ]
  3195. // }
  3196. }
  3197. // method id "blogger.pages.delete":
  3198. type PagesDeleteCall struct {
  3199. s *Service
  3200. blogId string
  3201. pageId string
  3202. urlParams_ gensupport.URLParams
  3203. ctx_ context.Context
  3204. header_ http.Header
  3205. }
  3206. // Delete: Delete a page by id.
  3207. func (r *PagesService) Delete(blogId string, pageId string) *PagesDeleteCall {
  3208. c := &PagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3209. c.blogId = blogId
  3210. c.pageId = pageId
  3211. return c
  3212. }
  3213. // Fields allows partial responses to be retrieved. See
  3214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3215. // for more information.
  3216. func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall {
  3217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3218. return c
  3219. }
  3220. // Context sets the context to be used in this call's Do method. Any
  3221. // pending HTTP request will be aborted if the provided context is
  3222. // canceled.
  3223. func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall {
  3224. c.ctx_ = ctx
  3225. return c
  3226. }
  3227. // Header returns an http.Header that can be modified by the caller to
  3228. // add HTTP headers to the request.
  3229. func (c *PagesDeleteCall) Header() http.Header {
  3230. if c.header_ == nil {
  3231. c.header_ = make(http.Header)
  3232. }
  3233. return c.header_
  3234. }
  3235. func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  3236. reqHeaders := make(http.Header)
  3237. for k, v := range c.header_ {
  3238. reqHeaders[k] = v
  3239. }
  3240. reqHeaders.Set("User-Agent", c.s.userAgent())
  3241. var body io.Reader = nil
  3242. c.urlParams_.Set("alt", alt)
  3243. c.urlParams_.Set("prettyPrint", "false")
  3244. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
  3245. urls += "?" + c.urlParams_.Encode()
  3246. req, err := http.NewRequest("DELETE", urls, body)
  3247. if err != nil {
  3248. return nil, err
  3249. }
  3250. req.Header = reqHeaders
  3251. googleapi.Expand(req.URL, map[string]string{
  3252. "blogId": c.blogId,
  3253. "pageId": c.pageId,
  3254. })
  3255. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3256. }
  3257. // Do executes the "blogger.pages.delete" call.
  3258. func (c *PagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  3259. gensupport.SetOptions(c.urlParams_, opts...)
  3260. res, err := c.doRequest("json")
  3261. if err != nil {
  3262. return err
  3263. }
  3264. defer googleapi.CloseBody(res)
  3265. if err := googleapi.CheckResponse(res); err != nil {
  3266. return err
  3267. }
  3268. return nil
  3269. // {
  3270. // "description": "Delete a page by id.",
  3271. // "httpMethod": "DELETE",
  3272. // "id": "blogger.pages.delete",
  3273. // "parameterOrder": [
  3274. // "blogId",
  3275. // "pageId"
  3276. // ],
  3277. // "parameters": {
  3278. // "blogId": {
  3279. // "description": "The Id of the Blog.",
  3280. // "location": "path",
  3281. // "required": true,
  3282. // "type": "string"
  3283. // },
  3284. // "pageId": {
  3285. // "description": "The ID of the Page.",
  3286. // "location": "path",
  3287. // "required": true,
  3288. // "type": "string"
  3289. // }
  3290. // },
  3291. // "path": "blogs/{blogId}/pages/{pageId}",
  3292. // "scopes": [
  3293. // "https://www.googleapis.com/auth/blogger"
  3294. // ]
  3295. // }
  3296. }
  3297. // method id "blogger.pages.get":
  3298. type PagesGetCall struct {
  3299. s *Service
  3300. blogId string
  3301. pageId string
  3302. urlParams_ gensupport.URLParams
  3303. ifNoneMatch_ string
  3304. ctx_ context.Context
  3305. header_ http.Header
  3306. }
  3307. // Get: Gets one blog page by id.
  3308. func (r *PagesService) Get(blogId string, pageId string) *PagesGetCall {
  3309. c := &PagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3310. c.blogId = blogId
  3311. c.pageId = pageId
  3312. return c
  3313. }
  3314. // View sets the optional parameter "view":
  3315. //
  3316. // Possible values:
  3317. // "ADMIN" - Admin level detail
  3318. // "AUTHOR" - Author level detail
  3319. // "READER" - Admin level detail
  3320. func (c *PagesGetCall) View(view string) *PagesGetCall {
  3321. c.urlParams_.Set("view", view)
  3322. return c
  3323. }
  3324. // Fields allows partial responses to be retrieved. See
  3325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3326. // for more information.
  3327. func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall {
  3328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3329. return c
  3330. }
  3331. // IfNoneMatch sets the optional parameter which makes the operation
  3332. // fail if the object's ETag matches the given value. This is useful for
  3333. // getting updates only after the object has changed since the last
  3334. // request. Use googleapi.IsNotModified to check whether the response
  3335. // error from Do is the result of In-None-Match.
  3336. func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall {
  3337. c.ifNoneMatch_ = entityTag
  3338. return c
  3339. }
  3340. // Context sets the context to be used in this call's Do method. Any
  3341. // pending HTTP request will be aborted if the provided context is
  3342. // canceled.
  3343. func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall {
  3344. c.ctx_ = ctx
  3345. return c
  3346. }
  3347. // Header returns an http.Header that can be modified by the caller to
  3348. // add HTTP headers to the request.
  3349. func (c *PagesGetCall) Header() http.Header {
  3350. if c.header_ == nil {
  3351. c.header_ = make(http.Header)
  3352. }
  3353. return c.header_
  3354. }
  3355. func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) {
  3356. reqHeaders := make(http.Header)
  3357. for k, v := range c.header_ {
  3358. reqHeaders[k] = v
  3359. }
  3360. reqHeaders.Set("User-Agent", c.s.userAgent())
  3361. if c.ifNoneMatch_ != "" {
  3362. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3363. }
  3364. var body io.Reader = nil
  3365. c.urlParams_.Set("alt", alt)
  3366. c.urlParams_.Set("prettyPrint", "false")
  3367. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
  3368. urls += "?" + c.urlParams_.Encode()
  3369. req, err := http.NewRequest("GET", urls, body)
  3370. if err != nil {
  3371. return nil, err
  3372. }
  3373. req.Header = reqHeaders
  3374. googleapi.Expand(req.URL, map[string]string{
  3375. "blogId": c.blogId,
  3376. "pageId": c.pageId,
  3377. })
  3378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3379. }
  3380. // Do executes the "blogger.pages.get" call.
  3381. // Exactly one of *Page or error will be non-nil. Any non-2xx status
  3382. // code is an error. Response headers are in either
  3383. // *Page.ServerResponse.Header or (if a response was returned at all) in
  3384. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3385. // whether the returned error was because http.StatusNotModified was
  3386. // returned.
  3387. func (c *PagesGetCall) Do(opts ...googleapi.CallOption) (*Page, error) {
  3388. gensupport.SetOptions(c.urlParams_, opts...)
  3389. res, err := c.doRequest("json")
  3390. if res != nil && res.StatusCode == http.StatusNotModified {
  3391. if res.Body != nil {
  3392. res.Body.Close()
  3393. }
  3394. return nil, &googleapi.Error{
  3395. Code: res.StatusCode,
  3396. Header: res.Header,
  3397. }
  3398. }
  3399. if err != nil {
  3400. return nil, err
  3401. }
  3402. defer googleapi.CloseBody(res)
  3403. if err := googleapi.CheckResponse(res); err != nil {
  3404. return nil, err
  3405. }
  3406. ret := &Page{
  3407. ServerResponse: googleapi.ServerResponse{
  3408. Header: res.Header,
  3409. HTTPStatusCode: res.StatusCode,
  3410. },
  3411. }
  3412. target := &ret
  3413. if err := gensupport.DecodeResponse(target, res); err != nil {
  3414. return nil, err
  3415. }
  3416. return ret, nil
  3417. // {
  3418. // "description": "Gets one blog page by id.",
  3419. // "httpMethod": "GET",
  3420. // "id": "blogger.pages.get",
  3421. // "parameterOrder": [
  3422. // "blogId",
  3423. // "pageId"
  3424. // ],
  3425. // "parameters": {
  3426. // "blogId": {
  3427. // "description": "ID of the blog containing the page.",
  3428. // "location": "path",
  3429. // "required": true,
  3430. // "type": "string"
  3431. // },
  3432. // "pageId": {
  3433. // "description": "The ID of the page to get.",
  3434. // "location": "path",
  3435. // "required": true,
  3436. // "type": "string"
  3437. // },
  3438. // "view": {
  3439. // "enum": [
  3440. // "ADMIN",
  3441. // "AUTHOR",
  3442. // "READER"
  3443. // ],
  3444. // "enumDescriptions": [
  3445. // "Admin level detail",
  3446. // "Author level detail",
  3447. // "Admin level detail"
  3448. // ],
  3449. // "location": "query",
  3450. // "type": "string"
  3451. // }
  3452. // },
  3453. // "path": "blogs/{blogId}/pages/{pageId}",
  3454. // "response": {
  3455. // "$ref": "Page"
  3456. // },
  3457. // "scopes": [
  3458. // "https://www.googleapis.com/auth/blogger",
  3459. // "https://www.googleapis.com/auth/blogger.readonly"
  3460. // ]
  3461. // }
  3462. }
  3463. // method id "blogger.pages.insert":
  3464. type PagesInsertCall struct {
  3465. s *Service
  3466. blogId string
  3467. page *Page
  3468. urlParams_ gensupport.URLParams
  3469. ctx_ context.Context
  3470. header_ http.Header
  3471. }
  3472. // Insert: Add a page.
  3473. func (r *PagesService) Insert(blogId string, page *Page) *PagesInsertCall {
  3474. c := &PagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3475. c.blogId = blogId
  3476. c.page = page
  3477. return c
  3478. }
  3479. // Fields allows partial responses to be retrieved. See
  3480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3481. // for more information.
  3482. func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall {
  3483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3484. return c
  3485. }
  3486. // Context sets the context to be used in this call's Do method. Any
  3487. // pending HTTP request will be aborted if the provided context is
  3488. // canceled.
  3489. func (c *PagesInsertCall) Context(ctx context.Context) *PagesInsertCall {
  3490. c.ctx_ = ctx
  3491. return c
  3492. }
  3493. // Header returns an http.Header that can be modified by the caller to
  3494. // add HTTP headers to the request.
  3495. func (c *PagesInsertCall) Header() http.Header {
  3496. if c.header_ == nil {
  3497. c.header_ = make(http.Header)
  3498. }
  3499. return c.header_
  3500. }
  3501. func (c *PagesInsertCall) doRequest(alt string) (*http.Response, error) {
  3502. reqHeaders := make(http.Header)
  3503. for k, v := range c.header_ {
  3504. reqHeaders[k] = v
  3505. }
  3506. reqHeaders.Set("User-Agent", c.s.userAgent())
  3507. var body io.Reader = nil
  3508. body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
  3509. if err != nil {
  3510. return nil, err
  3511. }
  3512. reqHeaders.Set("Content-Type", "application/json")
  3513. c.urlParams_.Set("alt", alt)
  3514. c.urlParams_.Set("prettyPrint", "false")
  3515. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages")
  3516. urls += "?" + c.urlParams_.Encode()
  3517. req, err := http.NewRequest("POST", urls, body)
  3518. if err != nil {
  3519. return nil, err
  3520. }
  3521. req.Header = reqHeaders
  3522. googleapi.Expand(req.URL, map[string]string{
  3523. "blogId": c.blogId,
  3524. })
  3525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3526. }
  3527. // Do executes the "blogger.pages.insert" call.
  3528. // Exactly one of *Page or error will be non-nil. Any non-2xx status
  3529. // code is an error. Response headers are in either
  3530. // *Page.ServerResponse.Header or (if a response was returned at all) in
  3531. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3532. // whether the returned error was because http.StatusNotModified was
  3533. // returned.
  3534. func (c *PagesInsertCall) Do(opts ...googleapi.CallOption) (*Page, error) {
  3535. gensupport.SetOptions(c.urlParams_, opts...)
  3536. res, err := c.doRequest("json")
  3537. if res != nil && res.StatusCode == http.StatusNotModified {
  3538. if res.Body != nil {
  3539. res.Body.Close()
  3540. }
  3541. return nil, &googleapi.Error{
  3542. Code: res.StatusCode,
  3543. Header: res.Header,
  3544. }
  3545. }
  3546. if err != nil {
  3547. return nil, err
  3548. }
  3549. defer googleapi.CloseBody(res)
  3550. if err := googleapi.CheckResponse(res); err != nil {
  3551. return nil, err
  3552. }
  3553. ret := &Page{
  3554. ServerResponse: googleapi.ServerResponse{
  3555. Header: res.Header,
  3556. HTTPStatusCode: res.StatusCode,
  3557. },
  3558. }
  3559. target := &ret
  3560. if err := gensupport.DecodeResponse(target, res); err != nil {
  3561. return nil, err
  3562. }
  3563. return ret, nil
  3564. // {
  3565. // "description": "Add a page.",
  3566. // "httpMethod": "POST",
  3567. // "id": "blogger.pages.insert",
  3568. // "parameterOrder": [
  3569. // "blogId"
  3570. // ],
  3571. // "parameters": {
  3572. // "blogId": {
  3573. // "description": "ID of the blog to add the page to.",
  3574. // "location": "path",
  3575. // "required": true,
  3576. // "type": "string"
  3577. // }
  3578. // },
  3579. // "path": "blogs/{blogId}/pages",
  3580. // "request": {
  3581. // "$ref": "Page"
  3582. // },
  3583. // "response": {
  3584. // "$ref": "Page"
  3585. // },
  3586. // "scopes": [
  3587. // "https://www.googleapis.com/auth/blogger"
  3588. // ]
  3589. // }
  3590. }
  3591. // method id "blogger.pages.list":
  3592. type PagesListCall struct {
  3593. s *Service
  3594. blogId string
  3595. urlParams_ gensupport.URLParams
  3596. ifNoneMatch_ string
  3597. ctx_ context.Context
  3598. header_ http.Header
  3599. }
  3600. // List: Retrieves the pages for a blog, optionally including non-LIVE
  3601. // statuses.
  3602. func (r *PagesService) List(blogId string) *PagesListCall {
  3603. c := &PagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3604. c.blogId = blogId
  3605. return c
  3606. }
  3607. // FetchBodies sets the optional parameter "fetchBodies": Whether to
  3608. // retrieve the Page bodies.
  3609. func (c *PagesListCall) FetchBodies(fetchBodies bool) *PagesListCall {
  3610. c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
  3611. return c
  3612. }
  3613. // Statuses sets the optional parameter "statuses":
  3614. //
  3615. // Possible values:
  3616. // "draft" - Draft (unpublished) Pages
  3617. // "imported" - Pages that have had their content removed
  3618. // "live" - Pages that are publicly visible
  3619. func (c *PagesListCall) Statuses(statuses ...string) *PagesListCall {
  3620. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  3621. return c
  3622. }
  3623. // View sets the optional parameter "view":
  3624. //
  3625. // Possible values:
  3626. // "ADMIN" - Admin level detail
  3627. // "AUTHOR" - Author level detail
  3628. // "READER" - Admin level detail
  3629. func (c *PagesListCall) View(view string) *PagesListCall {
  3630. c.urlParams_.Set("view", view)
  3631. return c
  3632. }
  3633. // Fields allows partial responses to be retrieved. See
  3634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3635. // for more information.
  3636. func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall {
  3637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3638. return c
  3639. }
  3640. // IfNoneMatch sets the optional parameter which makes the operation
  3641. // fail if the object's ETag matches the given value. This is useful for
  3642. // getting updates only after the object has changed since the last
  3643. // request. Use googleapi.IsNotModified to check whether the response
  3644. // error from Do is the result of In-None-Match.
  3645. func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall {
  3646. c.ifNoneMatch_ = entityTag
  3647. return c
  3648. }
  3649. // Context sets the context to be used in this call's Do method. Any
  3650. // pending HTTP request will be aborted if the provided context is
  3651. // canceled.
  3652. func (c *PagesListCall) Context(ctx context.Context) *PagesListCall {
  3653. c.ctx_ = ctx
  3654. return c
  3655. }
  3656. // Header returns an http.Header that can be modified by the caller to
  3657. // add HTTP headers to the request.
  3658. func (c *PagesListCall) Header() http.Header {
  3659. if c.header_ == nil {
  3660. c.header_ = make(http.Header)
  3661. }
  3662. return c.header_
  3663. }
  3664. func (c *PagesListCall) doRequest(alt string) (*http.Response, error) {
  3665. reqHeaders := make(http.Header)
  3666. for k, v := range c.header_ {
  3667. reqHeaders[k] = v
  3668. }
  3669. reqHeaders.Set("User-Agent", c.s.userAgent())
  3670. if c.ifNoneMatch_ != "" {
  3671. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3672. }
  3673. var body io.Reader = nil
  3674. c.urlParams_.Set("alt", alt)
  3675. c.urlParams_.Set("prettyPrint", "false")
  3676. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages")
  3677. urls += "?" + c.urlParams_.Encode()
  3678. req, err := http.NewRequest("GET", urls, body)
  3679. if err != nil {
  3680. return nil, err
  3681. }
  3682. req.Header = reqHeaders
  3683. googleapi.Expand(req.URL, map[string]string{
  3684. "blogId": c.blogId,
  3685. })
  3686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3687. }
  3688. // Do executes the "blogger.pages.list" call.
  3689. // Exactly one of *PageList or error will be non-nil. Any non-2xx status
  3690. // code is an error. Response headers are in either
  3691. // *PageList.ServerResponse.Header or (if a response was returned at
  3692. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3693. // to check whether the returned error was because
  3694. // http.StatusNotModified was returned.
  3695. func (c *PagesListCall) Do(opts ...googleapi.CallOption) (*PageList, error) {
  3696. gensupport.SetOptions(c.urlParams_, opts...)
  3697. res, err := c.doRequest("json")
  3698. if res != nil && res.StatusCode == http.StatusNotModified {
  3699. if res.Body != nil {
  3700. res.Body.Close()
  3701. }
  3702. return nil, &googleapi.Error{
  3703. Code: res.StatusCode,
  3704. Header: res.Header,
  3705. }
  3706. }
  3707. if err != nil {
  3708. return nil, err
  3709. }
  3710. defer googleapi.CloseBody(res)
  3711. if err := googleapi.CheckResponse(res); err != nil {
  3712. return nil, err
  3713. }
  3714. ret := &PageList{
  3715. ServerResponse: googleapi.ServerResponse{
  3716. Header: res.Header,
  3717. HTTPStatusCode: res.StatusCode,
  3718. },
  3719. }
  3720. target := &ret
  3721. if err := gensupport.DecodeResponse(target, res); err != nil {
  3722. return nil, err
  3723. }
  3724. return ret, nil
  3725. // {
  3726. // "description": "Retrieves the pages for a blog, optionally including non-LIVE statuses.",
  3727. // "httpMethod": "GET",
  3728. // "id": "blogger.pages.list",
  3729. // "parameterOrder": [
  3730. // "blogId"
  3731. // ],
  3732. // "parameters": {
  3733. // "blogId": {
  3734. // "description": "ID of the blog to fetch pages from.",
  3735. // "location": "path",
  3736. // "required": true,
  3737. // "type": "string"
  3738. // },
  3739. // "fetchBodies": {
  3740. // "description": "Whether to retrieve the Page bodies.",
  3741. // "location": "query",
  3742. // "type": "boolean"
  3743. // },
  3744. // "statuses": {
  3745. // "enum": [
  3746. // "draft",
  3747. // "imported",
  3748. // "live"
  3749. // ],
  3750. // "enumDescriptions": [
  3751. // "Draft (unpublished) Pages",
  3752. // "Pages that have had their content removed",
  3753. // "Pages that are publicly visible"
  3754. // ],
  3755. // "location": "query",
  3756. // "repeated": true,
  3757. // "type": "string"
  3758. // },
  3759. // "view": {
  3760. // "enum": [
  3761. // "ADMIN",
  3762. // "AUTHOR",
  3763. // "READER"
  3764. // ],
  3765. // "enumDescriptions": [
  3766. // "Admin level detail",
  3767. // "Author level detail",
  3768. // "Admin level detail"
  3769. // ],
  3770. // "location": "query",
  3771. // "type": "string"
  3772. // }
  3773. // },
  3774. // "path": "blogs/{blogId}/pages",
  3775. // "response": {
  3776. // "$ref": "PageList"
  3777. // },
  3778. // "scopes": [
  3779. // "https://www.googleapis.com/auth/blogger",
  3780. // "https://www.googleapis.com/auth/blogger.readonly"
  3781. // ]
  3782. // }
  3783. }
  3784. // method id "blogger.pages.patch":
  3785. type PagesPatchCall struct {
  3786. s *Service
  3787. blogId string
  3788. pageId string
  3789. page *Page
  3790. urlParams_ gensupport.URLParams
  3791. ctx_ context.Context
  3792. header_ http.Header
  3793. }
  3794. // Patch: Update a page. This method supports patch semantics.
  3795. func (r *PagesService) Patch(blogId string, pageId string, page *Page) *PagesPatchCall {
  3796. c := &PagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3797. c.blogId = blogId
  3798. c.pageId = pageId
  3799. c.page = page
  3800. return c
  3801. }
  3802. // Fields allows partial responses to be retrieved. See
  3803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3804. // for more information.
  3805. func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall {
  3806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3807. return c
  3808. }
  3809. // Context sets the context to be used in this call's Do method. Any
  3810. // pending HTTP request will be aborted if the provided context is
  3811. // canceled.
  3812. func (c *PagesPatchCall) Context(ctx context.Context) *PagesPatchCall {
  3813. c.ctx_ = ctx
  3814. return c
  3815. }
  3816. // Header returns an http.Header that can be modified by the caller to
  3817. // add HTTP headers to the request.
  3818. func (c *PagesPatchCall) Header() http.Header {
  3819. if c.header_ == nil {
  3820. c.header_ = make(http.Header)
  3821. }
  3822. return c.header_
  3823. }
  3824. func (c *PagesPatchCall) doRequest(alt string) (*http.Response, error) {
  3825. reqHeaders := make(http.Header)
  3826. for k, v := range c.header_ {
  3827. reqHeaders[k] = v
  3828. }
  3829. reqHeaders.Set("User-Agent", c.s.userAgent())
  3830. var body io.Reader = nil
  3831. body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
  3832. if err != nil {
  3833. return nil, err
  3834. }
  3835. reqHeaders.Set("Content-Type", "application/json")
  3836. c.urlParams_.Set("alt", alt)
  3837. c.urlParams_.Set("prettyPrint", "false")
  3838. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
  3839. urls += "?" + c.urlParams_.Encode()
  3840. req, err := http.NewRequest("PATCH", urls, body)
  3841. if err != nil {
  3842. return nil, err
  3843. }
  3844. req.Header = reqHeaders
  3845. googleapi.Expand(req.URL, map[string]string{
  3846. "blogId": c.blogId,
  3847. "pageId": c.pageId,
  3848. })
  3849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3850. }
  3851. // Do executes the "blogger.pages.patch" call.
  3852. // Exactly one of *Page or error will be non-nil. Any non-2xx status
  3853. // code is an error. Response headers are in either
  3854. // *Page.ServerResponse.Header or (if a response was returned at all) in
  3855. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3856. // whether the returned error was because http.StatusNotModified was
  3857. // returned.
  3858. func (c *PagesPatchCall) Do(opts ...googleapi.CallOption) (*Page, error) {
  3859. gensupport.SetOptions(c.urlParams_, opts...)
  3860. res, err := c.doRequest("json")
  3861. if res != nil && res.StatusCode == http.StatusNotModified {
  3862. if res.Body != nil {
  3863. res.Body.Close()
  3864. }
  3865. return nil, &googleapi.Error{
  3866. Code: res.StatusCode,
  3867. Header: res.Header,
  3868. }
  3869. }
  3870. if err != nil {
  3871. return nil, err
  3872. }
  3873. defer googleapi.CloseBody(res)
  3874. if err := googleapi.CheckResponse(res); err != nil {
  3875. return nil, err
  3876. }
  3877. ret := &Page{
  3878. ServerResponse: googleapi.ServerResponse{
  3879. Header: res.Header,
  3880. HTTPStatusCode: res.StatusCode,
  3881. },
  3882. }
  3883. target := &ret
  3884. if err := gensupport.DecodeResponse(target, res); err != nil {
  3885. return nil, err
  3886. }
  3887. return ret, nil
  3888. // {
  3889. // "description": "Update a page. This method supports patch semantics.",
  3890. // "httpMethod": "PATCH",
  3891. // "id": "blogger.pages.patch",
  3892. // "parameterOrder": [
  3893. // "blogId",
  3894. // "pageId"
  3895. // ],
  3896. // "parameters": {
  3897. // "blogId": {
  3898. // "description": "The ID of the Blog.",
  3899. // "location": "path",
  3900. // "required": true,
  3901. // "type": "string"
  3902. // },
  3903. // "pageId": {
  3904. // "description": "The ID of the Page.",
  3905. // "location": "path",
  3906. // "required": true,
  3907. // "type": "string"
  3908. // }
  3909. // },
  3910. // "path": "blogs/{blogId}/pages/{pageId}",
  3911. // "request": {
  3912. // "$ref": "Page"
  3913. // },
  3914. // "response": {
  3915. // "$ref": "Page"
  3916. // },
  3917. // "scopes": [
  3918. // "https://www.googleapis.com/auth/blogger"
  3919. // ]
  3920. // }
  3921. }
  3922. // method id "blogger.pages.update":
  3923. type PagesUpdateCall struct {
  3924. s *Service
  3925. blogId string
  3926. pageId string
  3927. page *Page
  3928. urlParams_ gensupport.URLParams
  3929. ctx_ context.Context
  3930. header_ http.Header
  3931. }
  3932. // Update: Update a page.
  3933. func (r *PagesService) Update(blogId string, pageId string, page *Page) *PagesUpdateCall {
  3934. c := &PagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3935. c.blogId = blogId
  3936. c.pageId = pageId
  3937. c.page = page
  3938. return c
  3939. }
  3940. // Fields allows partial responses to be retrieved. See
  3941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3942. // for more information.
  3943. func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall {
  3944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3945. return c
  3946. }
  3947. // Context sets the context to be used in this call's Do method. Any
  3948. // pending HTTP request will be aborted if the provided context is
  3949. // canceled.
  3950. func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall {
  3951. c.ctx_ = ctx
  3952. return c
  3953. }
  3954. // Header returns an http.Header that can be modified by the caller to
  3955. // add HTTP headers to the request.
  3956. func (c *PagesUpdateCall) Header() http.Header {
  3957. if c.header_ == nil {
  3958. c.header_ = make(http.Header)
  3959. }
  3960. return c.header_
  3961. }
  3962. func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3963. reqHeaders := make(http.Header)
  3964. for k, v := range c.header_ {
  3965. reqHeaders[k] = v
  3966. }
  3967. reqHeaders.Set("User-Agent", c.s.userAgent())
  3968. var body io.Reader = nil
  3969. body, err := googleapi.WithoutDataWrapper.JSONReader(c.page)
  3970. if err != nil {
  3971. return nil, err
  3972. }
  3973. reqHeaders.Set("Content-Type", "application/json")
  3974. c.urlParams_.Set("alt", alt)
  3975. c.urlParams_.Set("prettyPrint", "false")
  3976. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
  3977. urls += "?" + c.urlParams_.Encode()
  3978. req, err := http.NewRequest("PUT", urls, body)
  3979. if err != nil {
  3980. return nil, err
  3981. }
  3982. req.Header = reqHeaders
  3983. googleapi.Expand(req.URL, map[string]string{
  3984. "blogId": c.blogId,
  3985. "pageId": c.pageId,
  3986. })
  3987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3988. }
  3989. // Do executes the "blogger.pages.update" call.
  3990. // Exactly one of *Page or error will be non-nil. Any non-2xx status
  3991. // code is an error. Response headers are in either
  3992. // *Page.ServerResponse.Header or (if a response was returned at all) in
  3993. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3994. // whether the returned error was because http.StatusNotModified was
  3995. // returned.
  3996. func (c *PagesUpdateCall) Do(opts ...googleapi.CallOption) (*Page, error) {
  3997. gensupport.SetOptions(c.urlParams_, opts...)
  3998. res, err := c.doRequest("json")
  3999. if res != nil && res.StatusCode == http.StatusNotModified {
  4000. if res.Body != nil {
  4001. res.Body.Close()
  4002. }
  4003. return nil, &googleapi.Error{
  4004. Code: res.StatusCode,
  4005. Header: res.Header,
  4006. }
  4007. }
  4008. if err != nil {
  4009. return nil, err
  4010. }
  4011. defer googleapi.CloseBody(res)
  4012. if err := googleapi.CheckResponse(res); err != nil {
  4013. return nil, err
  4014. }
  4015. ret := &Page{
  4016. ServerResponse: googleapi.ServerResponse{
  4017. Header: res.Header,
  4018. HTTPStatusCode: res.StatusCode,
  4019. },
  4020. }
  4021. target := &ret
  4022. if err := gensupport.DecodeResponse(target, res); err != nil {
  4023. return nil, err
  4024. }
  4025. return ret, nil
  4026. // {
  4027. // "description": "Update a page.",
  4028. // "httpMethod": "PUT",
  4029. // "id": "blogger.pages.update",
  4030. // "parameterOrder": [
  4031. // "blogId",
  4032. // "pageId"
  4033. // ],
  4034. // "parameters": {
  4035. // "blogId": {
  4036. // "description": "The ID of the Blog.",
  4037. // "location": "path",
  4038. // "required": true,
  4039. // "type": "string"
  4040. // },
  4041. // "pageId": {
  4042. // "description": "The ID of the Page.",
  4043. // "location": "path",
  4044. // "required": true,
  4045. // "type": "string"
  4046. // }
  4047. // },
  4048. // "path": "blogs/{blogId}/pages/{pageId}",
  4049. // "request": {
  4050. // "$ref": "Page"
  4051. // },
  4052. // "response": {
  4053. // "$ref": "Page"
  4054. // },
  4055. // "scopes": [
  4056. // "https://www.googleapis.com/auth/blogger"
  4057. // ]
  4058. // }
  4059. }
  4060. // method id "blogger.postUserInfos.get":
  4061. type PostUserInfosGetCall struct {
  4062. s *Service
  4063. userId string
  4064. blogId string
  4065. postId string
  4066. urlParams_ gensupport.URLParams
  4067. ifNoneMatch_ string
  4068. ctx_ context.Context
  4069. header_ http.Header
  4070. }
  4071. // Get: Gets one post and user info pair by postId and userId.
  4072. func (r *PostUserInfosService) Get(userId string, blogId string, postId string) *PostUserInfosGetCall {
  4073. c := &PostUserInfosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4074. c.userId = userId
  4075. c.blogId = blogId
  4076. c.postId = postId
  4077. return c
  4078. }
  4079. // MaxComments sets the optional parameter "maxComments": Maximum number
  4080. // of comments to pull back on a post.
  4081. func (c *PostUserInfosGetCall) MaxComments(maxComments int64) *PostUserInfosGetCall {
  4082. c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
  4083. return c
  4084. }
  4085. // Fields allows partial responses to be retrieved. See
  4086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4087. // for more information.
  4088. func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall {
  4089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4090. return c
  4091. }
  4092. // IfNoneMatch sets the optional parameter which makes the operation
  4093. // fail if the object's ETag matches the given value. This is useful for
  4094. // getting updates only after the object has changed since the last
  4095. // request. Use googleapi.IsNotModified to check whether the response
  4096. // error from Do is the result of In-None-Match.
  4097. func (c *PostUserInfosGetCall) IfNoneMatch(entityTag string) *PostUserInfosGetCall {
  4098. c.ifNoneMatch_ = entityTag
  4099. return c
  4100. }
  4101. // Context sets the context to be used in this call's Do method. Any
  4102. // pending HTTP request will be aborted if the provided context is
  4103. // canceled.
  4104. func (c *PostUserInfosGetCall) Context(ctx context.Context) *PostUserInfosGetCall {
  4105. c.ctx_ = ctx
  4106. return c
  4107. }
  4108. // Header returns an http.Header that can be modified by the caller to
  4109. // add HTTP headers to the request.
  4110. func (c *PostUserInfosGetCall) Header() http.Header {
  4111. if c.header_ == nil {
  4112. c.header_ = make(http.Header)
  4113. }
  4114. return c.header_
  4115. }
  4116. func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) {
  4117. reqHeaders := make(http.Header)
  4118. for k, v := range c.header_ {
  4119. reqHeaders[k] = v
  4120. }
  4121. reqHeaders.Set("User-Agent", c.s.userAgent())
  4122. if c.ifNoneMatch_ != "" {
  4123. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4124. }
  4125. var body io.Reader = nil
  4126. c.urlParams_.Set("alt", alt)
  4127. c.urlParams_.Set("prettyPrint", "false")
  4128. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}")
  4129. urls += "?" + c.urlParams_.Encode()
  4130. req, err := http.NewRequest("GET", urls, body)
  4131. if err != nil {
  4132. return nil, err
  4133. }
  4134. req.Header = reqHeaders
  4135. googleapi.Expand(req.URL, map[string]string{
  4136. "userId": c.userId,
  4137. "blogId": c.blogId,
  4138. "postId": c.postId,
  4139. })
  4140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4141. }
  4142. // Do executes the "blogger.postUserInfos.get" call.
  4143. // Exactly one of *PostUserInfo or error will be non-nil. Any non-2xx
  4144. // status code is an error. Response headers are in either
  4145. // *PostUserInfo.ServerResponse.Header or (if a response was returned at
  4146. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4147. // to check whether the returned error was because
  4148. // http.StatusNotModified was returned.
  4149. func (c *PostUserInfosGetCall) Do(opts ...googleapi.CallOption) (*PostUserInfo, error) {
  4150. gensupport.SetOptions(c.urlParams_, opts...)
  4151. res, err := c.doRequest("json")
  4152. if res != nil && res.StatusCode == http.StatusNotModified {
  4153. if res.Body != nil {
  4154. res.Body.Close()
  4155. }
  4156. return nil, &googleapi.Error{
  4157. Code: res.StatusCode,
  4158. Header: res.Header,
  4159. }
  4160. }
  4161. if err != nil {
  4162. return nil, err
  4163. }
  4164. defer googleapi.CloseBody(res)
  4165. if err := googleapi.CheckResponse(res); err != nil {
  4166. return nil, err
  4167. }
  4168. ret := &PostUserInfo{
  4169. ServerResponse: googleapi.ServerResponse{
  4170. Header: res.Header,
  4171. HTTPStatusCode: res.StatusCode,
  4172. },
  4173. }
  4174. target := &ret
  4175. if err := gensupport.DecodeResponse(target, res); err != nil {
  4176. return nil, err
  4177. }
  4178. return ret, nil
  4179. // {
  4180. // "description": "Gets one post and user info pair by postId and userId.",
  4181. // "httpMethod": "GET",
  4182. // "id": "blogger.postUserInfos.get",
  4183. // "parameterOrder": [
  4184. // "userId",
  4185. // "blogId",
  4186. // "postId"
  4187. // ],
  4188. // "parameters": {
  4189. // "blogId": {
  4190. // "description": "The ID of the blog.",
  4191. // "location": "path",
  4192. // "required": true,
  4193. // "type": "string"
  4194. // },
  4195. // "maxComments": {
  4196. // "description": "Maximum number of comments to pull back on a post.",
  4197. // "format": "uint32",
  4198. // "location": "query",
  4199. // "type": "integer"
  4200. // },
  4201. // "postId": {
  4202. // "description": "The ID of the post to get.",
  4203. // "location": "path",
  4204. // "required": true,
  4205. // "type": "string"
  4206. // },
  4207. // "userId": {
  4208. // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
  4209. // "location": "path",
  4210. // "required": true,
  4211. // "type": "string"
  4212. // }
  4213. // },
  4214. // "path": "users/{userId}/blogs/{blogId}/posts/{postId}",
  4215. // "response": {
  4216. // "$ref": "PostUserInfo"
  4217. // },
  4218. // "scopes": [
  4219. // "https://www.googleapis.com/auth/blogger",
  4220. // "https://www.googleapis.com/auth/blogger.readonly"
  4221. // ]
  4222. // }
  4223. }
  4224. // method id "blogger.postUserInfos.list":
  4225. type PostUserInfosListCall struct {
  4226. s *Service
  4227. userId string
  4228. blogId string
  4229. urlParams_ gensupport.URLParams
  4230. ifNoneMatch_ string
  4231. ctx_ context.Context
  4232. header_ http.Header
  4233. }
  4234. // List: Retrieves a list of post and user info pairs, possibly
  4235. // filtered.
  4236. func (r *PostUserInfosService) List(userId string, blogId string) *PostUserInfosListCall {
  4237. c := &PostUserInfosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4238. c.userId = userId
  4239. c.blogId = blogId
  4240. return c
  4241. }
  4242. // EndDate sets the optional parameter "endDate": Latest post date to
  4243. // fetch, a date-time with RFC 3339 formatting.
  4244. func (c *PostUserInfosListCall) EndDate(endDate string) *PostUserInfosListCall {
  4245. c.urlParams_.Set("endDate", endDate)
  4246. return c
  4247. }
  4248. // FetchBodies sets the optional parameter "fetchBodies": Whether the
  4249. // body content of posts is included.
  4250. func (c *PostUserInfosListCall) FetchBodies(fetchBodies bool) *PostUserInfosListCall {
  4251. c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
  4252. return c
  4253. }
  4254. // Labels sets the optional parameter "labels": Comma-separated list of
  4255. // labels to search for.
  4256. func (c *PostUserInfosListCall) Labels(labels string) *PostUserInfosListCall {
  4257. c.urlParams_.Set("labels", labels)
  4258. return c
  4259. }
  4260. // MaxResults sets the optional parameter "maxResults": Maximum number
  4261. // of posts to fetch.
  4262. func (c *PostUserInfosListCall) MaxResults(maxResults int64) *PostUserInfosListCall {
  4263. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4264. return c
  4265. }
  4266. // OrderBy sets the optional parameter "orderBy": Sort search results
  4267. //
  4268. // Possible values:
  4269. // "published" - Order by the date the post was published
  4270. // "updated" - Order by the date the post was last updated
  4271. func (c *PostUserInfosListCall) OrderBy(orderBy string) *PostUserInfosListCall {
  4272. c.urlParams_.Set("orderBy", orderBy)
  4273. return c
  4274. }
  4275. // PageToken sets the optional parameter "pageToken": Continuation token
  4276. // if the request is paged.
  4277. func (c *PostUserInfosListCall) PageToken(pageToken string) *PostUserInfosListCall {
  4278. c.urlParams_.Set("pageToken", pageToken)
  4279. return c
  4280. }
  4281. // StartDate sets the optional parameter "startDate": Earliest post date
  4282. // to fetch, a date-time with RFC 3339 formatting.
  4283. func (c *PostUserInfosListCall) StartDate(startDate string) *PostUserInfosListCall {
  4284. c.urlParams_.Set("startDate", startDate)
  4285. return c
  4286. }
  4287. // Statuses sets the optional parameter "statuses":
  4288. //
  4289. // Possible values:
  4290. // "draft" - Draft posts
  4291. // "live" - Published posts
  4292. // "scheduled" - Posts that are scheduled to publish in future.
  4293. func (c *PostUserInfosListCall) Statuses(statuses ...string) *PostUserInfosListCall {
  4294. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  4295. return c
  4296. }
  4297. // View sets the optional parameter "view":
  4298. //
  4299. // Possible values:
  4300. // "ADMIN" - Admin level detail
  4301. // "AUTHOR" - Author level detail
  4302. // "READER" - Reader level detail
  4303. func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall {
  4304. c.urlParams_.Set("view", view)
  4305. return c
  4306. }
  4307. // Fields allows partial responses to be retrieved. See
  4308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4309. // for more information.
  4310. func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall {
  4311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4312. return c
  4313. }
  4314. // IfNoneMatch sets the optional parameter which makes the operation
  4315. // fail if the object's ETag matches the given value. This is useful for
  4316. // getting updates only after the object has changed since the last
  4317. // request. Use googleapi.IsNotModified to check whether the response
  4318. // error from Do is the result of In-None-Match.
  4319. func (c *PostUserInfosListCall) IfNoneMatch(entityTag string) *PostUserInfosListCall {
  4320. c.ifNoneMatch_ = entityTag
  4321. return c
  4322. }
  4323. // Context sets the context to be used in this call's Do method. Any
  4324. // pending HTTP request will be aborted if the provided context is
  4325. // canceled.
  4326. func (c *PostUserInfosListCall) Context(ctx context.Context) *PostUserInfosListCall {
  4327. c.ctx_ = ctx
  4328. return c
  4329. }
  4330. // Header returns an http.Header that can be modified by the caller to
  4331. // add HTTP headers to the request.
  4332. func (c *PostUserInfosListCall) Header() http.Header {
  4333. if c.header_ == nil {
  4334. c.header_ = make(http.Header)
  4335. }
  4336. return c.header_
  4337. }
  4338. func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) {
  4339. reqHeaders := make(http.Header)
  4340. for k, v := range c.header_ {
  4341. reqHeaders[k] = v
  4342. }
  4343. reqHeaders.Set("User-Agent", c.s.userAgent())
  4344. if c.ifNoneMatch_ != "" {
  4345. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4346. }
  4347. var body io.Reader = nil
  4348. c.urlParams_.Set("alt", alt)
  4349. c.urlParams_.Set("prettyPrint", "false")
  4350. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts")
  4351. urls += "?" + c.urlParams_.Encode()
  4352. req, err := http.NewRequest("GET", urls, body)
  4353. if err != nil {
  4354. return nil, err
  4355. }
  4356. req.Header = reqHeaders
  4357. googleapi.Expand(req.URL, map[string]string{
  4358. "userId": c.userId,
  4359. "blogId": c.blogId,
  4360. })
  4361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4362. }
  4363. // Do executes the "blogger.postUserInfos.list" call.
  4364. // Exactly one of *PostUserInfosList or error will be non-nil. Any
  4365. // non-2xx status code is an error. Response headers are in either
  4366. // *PostUserInfosList.ServerResponse.Header or (if a response was
  4367. // returned at all) in error.(*googleapi.Error).Header. Use
  4368. // googleapi.IsNotModified to check whether the returned error was
  4369. // because http.StatusNotModified was returned.
  4370. func (c *PostUserInfosListCall) Do(opts ...googleapi.CallOption) (*PostUserInfosList, error) {
  4371. gensupport.SetOptions(c.urlParams_, opts...)
  4372. res, err := c.doRequest("json")
  4373. if res != nil && res.StatusCode == http.StatusNotModified {
  4374. if res.Body != nil {
  4375. res.Body.Close()
  4376. }
  4377. return nil, &googleapi.Error{
  4378. Code: res.StatusCode,
  4379. Header: res.Header,
  4380. }
  4381. }
  4382. if err != nil {
  4383. return nil, err
  4384. }
  4385. defer googleapi.CloseBody(res)
  4386. if err := googleapi.CheckResponse(res); err != nil {
  4387. return nil, err
  4388. }
  4389. ret := &PostUserInfosList{
  4390. ServerResponse: googleapi.ServerResponse{
  4391. Header: res.Header,
  4392. HTTPStatusCode: res.StatusCode,
  4393. },
  4394. }
  4395. target := &ret
  4396. if err := gensupport.DecodeResponse(target, res); err != nil {
  4397. return nil, err
  4398. }
  4399. return ret, nil
  4400. // {
  4401. // "description": "Retrieves a list of post and user info pairs, possibly filtered.",
  4402. // "httpMethod": "GET",
  4403. // "id": "blogger.postUserInfos.list",
  4404. // "parameterOrder": [
  4405. // "userId",
  4406. // "blogId"
  4407. // ],
  4408. // "parameters": {
  4409. // "blogId": {
  4410. // "description": "ID of the blog to fetch posts from.",
  4411. // "location": "path",
  4412. // "required": true,
  4413. // "type": "string"
  4414. // },
  4415. // "endDate": {
  4416. // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.",
  4417. // "format": "date-time",
  4418. // "location": "query",
  4419. // "type": "string"
  4420. // },
  4421. // "fetchBodies": {
  4422. // "description": "Whether the body content of posts is included.",
  4423. // "location": "query",
  4424. // "type": "boolean"
  4425. // },
  4426. // "labels": {
  4427. // "description": "Comma-separated list of labels to search for.",
  4428. // "location": "query",
  4429. // "type": "string"
  4430. // },
  4431. // "maxResults": {
  4432. // "description": "Maximum number of posts to fetch.",
  4433. // "format": "uint32",
  4434. // "location": "query",
  4435. // "type": "integer"
  4436. // },
  4437. // "orderBy": {
  4438. // "default": "PUBLISHED",
  4439. // "description": "Sort search results",
  4440. // "enum": [
  4441. // "published",
  4442. // "updated"
  4443. // ],
  4444. // "enumDescriptions": [
  4445. // "Order by the date the post was published",
  4446. // "Order by the date the post was last updated"
  4447. // ],
  4448. // "location": "query",
  4449. // "type": "string"
  4450. // },
  4451. // "pageToken": {
  4452. // "description": "Continuation token if the request is paged.",
  4453. // "location": "query",
  4454. // "type": "string"
  4455. // },
  4456. // "startDate": {
  4457. // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.",
  4458. // "format": "date-time",
  4459. // "location": "query",
  4460. // "type": "string"
  4461. // },
  4462. // "statuses": {
  4463. // "enum": [
  4464. // "draft",
  4465. // "live",
  4466. // "scheduled"
  4467. // ],
  4468. // "enumDescriptions": [
  4469. // "Draft posts",
  4470. // "Published posts",
  4471. // "Posts that are scheduled to publish in future."
  4472. // ],
  4473. // "location": "query",
  4474. // "repeated": true,
  4475. // "type": "string"
  4476. // },
  4477. // "userId": {
  4478. // "description": "ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
  4479. // "location": "path",
  4480. // "required": true,
  4481. // "type": "string"
  4482. // },
  4483. // "view": {
  4484. // "enum": [
  4485. // "ADMIN",
  4486. // "AUTHOR",
  4487. // "READER"
  4488. // ],
  4489. // "enumDescriptions": [
  4490. // "Admin level detail",
  4491. // "Author level detail",
  4492. // "Reader level detail"
  4493. // ],
  4494. // "location": "query",
  4495. // "type": "string"
  4496. // }
  4497. // },
  4498. // "path": "users/{userId}/blogs/{blogId}/posts",
  4499. // "response": {
  4500. // "$ref": "PostUserInfosList"
  4501. // },
  4502. // "scopes": [
  4503. // "https://www.googleapis.com/auth/blogger",
  4504. // "https://www.googleapis.com/auth/blogger.readonly"
  4505. // ]
  4506. // }
  4507. }
  4508. // Pages invokes f for each page of results.
  4509. // A non-nil error returned from f will halt the iteration.
  4510. // The provided context supersedes any context provided to the Context method.
  4511. func (c *PostUserInfosListCall) Pages(ctx context.Context, f func(*PostUserInfosList) error) error {
  4512. c.ctx_ = ctx
  4513. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4514. for {
  4515. x, err := c.Do()
  4516. if err != nil {
  4517. return err
  4518. }
  4519. if err := f(x); err != nil {
  4520. return err
  4521. }
  4522. if x.NextPageToken == "" {
  4523. return nil
  4524. }
  4525. c.PageToken(x.NextPageToken)
  4526. }
  4527. }
  4528. // method id "blogger.posts.delete":
  4529. type PostsDeleteCall struct {
  4530. s *Service
  4531. blogId string
  4532. postId string
  4533. urlParams_ gensupport.URLParams
  4534. ctx_ context.Context
  4535. header_ http.Header
  4536. }
  4537. // Delete: Delete a post by id.
  4538. func (r *PostsService) Delete(blogId string, postId string) *PostsDeleteCall {
  4539. c := &PostsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4540. c.blogId = blogId
  4541. c.postId = postId
  4542. return c
  4543. }
  4544. // Fields allows partial responses to be retrieved. See
  4545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4546. // for more information.
  4547. func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall {
  4548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4549. return c
  4550. }
  4551. // Context sets the context to be used in this call's Do method. Any
  4552. // pending HTTP request will be aborted if the provided context is
  4553. // canceled.
  4554. func (c *PostsDeleteCall) Context(ctx context.Context) *PostsDeleteCall {
  4555. c.ctx_ = ctx
  4556. return c
  4557. }
  4558. // Header returns an http.Header that can be modified by the caller to
  4559. // add HTTP headers to the request.
  4560. func (c *PostsDeleteCall) Header() http.Header {
  4561. if c.header_ == nil {
  4562. c.header_ = make(http.Header)
  4563. }
  4564. return c.header_
  4565. }
  4566. func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4567. reqHeaders := make(http.Header)
  4568. for k, v := range c.header_ {
  4569. reqHeaders[k] = v
  4570. }
  4571. reqHeaders.Set("User-Agent", c.s.userAgent())
  4572. var body io.Reader = nil
  4573. c.urlParams_.Set("alt", alt)
  4574. c.urlParams_.Set("prettyPrint", "false")
  4575. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
  4576. urls += "?" + c.urlParams_.Encode()
  4577. req, err := http.NewRequest("DELETE", urls, body)
  4578. if err != nil {
  4579. return nil, err
  4580. }
  4581. req.Header = reqHeaders
  4582. googleapi.Expand(req.URL, map[string]string{
  4583. "blogId": c.blogId,
  4584. "postId": c.postId,
  4585. })
  4586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4587. }
  4588. // Do executes the "blogger.posts.delete" call.
  4589. func (c *PostsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4590. gensupport.SetOptions(c.urlParams_, opts...)
  4591. res, err := c.doRequest("json")
  4592. if err != nil {
  4593. return err
  4594. }
  4595. defer googleapi.CloseBody(res)
  4596. if err := googleapi.CheckResponse(res); err != nil {
  4597. return err
  4598. }
  4599. return nil
  4600. // {
  4601. // "description": "Delete a post by id.",
  4602. // "httpMethod": "DELETE",
  4603. // "id": "blogger.posts.delete",
  4604. // "parameterOrder": [
  4605. // "blogId",
  4606. // "postId"
  4607. // ],
  4608. // "parameters": {
  4609. // "blogId": {
  4610. // "description": "The Id of the Blog.",
  4611. // "location": "path",
  4612. // "required": true,
  4613. // "type": "string"
  4614. // },
  4615. // "postId": {
  4616. // "description": "The ID of the Post.",
  4617. // "location": "path",
  4618. // "required": true,
  4619. // "type": "string"
  4620. // }
  4621. // },
  4622. // "path": "blogs/{blogId}/posts/{postId}",
  4623. // "scopes": [
  4624. // "https://www.googleapis.com/auth/blogger"
  4625. // ]
  4626. // }
  4627. }
  4628. // method id "blogger.posts.get":
  4629. type PostsGetCall struct {
  4630. s *Service
  4631. blogId string
  4632. postId string
  4633. urlParams_ gensupport.URLParams
  4634. ifNoneMatch_ string
  4635. ctx_ context.Context
  4636. header_ http.Header
  4637. }
  4638. // Get: Get a post by id.
  4639. func (r *PostsService) Get(blogId string, postId string) *PostsGetCall {
  4640. c := &PostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4641. c.blogId = blogId
  4642. c.postId = postId
  4643. return c
  4644. }
  4645. // MaxComments sets the optional parameter "maxComments": Maximum number
  4646. // of comments to pull back on a post.
  4647. func (c *PostsGetCall) MaxComments(maxComments int64) *PostsGetCall {
  4648. c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
  4649. return c
  4650. }
  4651. // View sets the optional parameter "view":
  4652. //
  4653. // Possible values:
  4654. // "ADMIN" - Admin level detail
  4655. // "AUTHOR" - Author level detail
  4656. // "READER" - Admin level detail
  4657. func (c *PostsGetCall) View(view string) *PostsGetCall {
  4658. c.urlParams_.Set("view", view)
  4659. return c
  4660. }
  4661. // Fields allows partial responses to be retrieved. See
  4662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4663. // for more information.
  4664. func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall {
  4665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4666. return c
  4667. }
  4668. // IfNoneMatch sets the optional parameter which makes the operation
  4669. // fail if the object's ETag matches the given value. This is useful for
  4670. // getting updates only after the object has changed since the last
  4671. // request. Use googleapi.IsNotModified to check whether the response
  4672. // error from Do is the result of In-None-Match.
  4673. func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall {
  4674. c.ifNoneMatch_ = entityTag
  4675. return c
  4676. }
  4677. // Context sets the context to be used in this call's Do method. Any
  4678. // pending HTTP request will be aborted if the provided context is
  4679. // canceled.
  4680. func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall {
  4681. c.ctx_ = ctx
  4682. return c
  4683. }
  4684. // Header returns an http.Header that can be modified by the caller to
  4685. // add HTTP headers to the request.
  4686. func (c *PostsGetCall) Header() http.Header {
  4687. if c.header_ == nil {
  4688. c.header_ = make(http.Header)
  4689. }
  4690. return c.header_
  4691. }
  4692. func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) {
  4693. reqHeaders := make(http.Header)
  4694. for k, v := range c.header_ {
  4695. reqHeaders[k] = v
  4696. }
  4697. reqHeaders.Set("User-Agent", c.s.userAgent())
  4698. if c.ifNoneMatch_ != "" {
  4699. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4700. }
  4701. var body io.Reader = nil
  4702. c.urlParams_.Set("alt", alt)
  4703. c.urlParams_.Set("prettyPrint", "false")
  4704. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
  4705. urls += "?" + c.urlParams_.Encode()
  4706. req, err := http.NewRequest("GET", urls, body)
  4707. if err != nil {
  4708. return nil, err
  4709. }
  4710. req.Header = reqHeaders
  4711. googleapi.Expand(req.URL, map[string]string{
  4712. "blogId": c.blogId,
  4713. "postId": c.postId,
  4714. })
  4715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4716. }
  4717. // Do executes the "blogger.posts.get" call.
  4718. // Exactly one of *Post or error will be non-nil. Any non-2xx status
  4719. // code is an error. Response headers are in either
  4720. // *Post.ServerResponse.Header or (if a response was returned at all) in
  4721. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4722. // whether the returned error was because http.StatusNotModified was
  4723. // returned.
  4724. func (c *PostsGetCall) Do(opts ...googleapi.CallOption) (*Post, error) {
  4725. gensupport.SetOptions(c.urlParams_, opts...)
  4726. res, err := c.doRequest("json")
  4727. if res != nil && res.StatusCode == http.StatusNotModified {
  4728. if res.Body != nil {
  4729. res.Body.Close()
  4730. }
  4731. return nil, &googleapi.Error{
  4732. Code: res.StatusCode,
  4733. Header: res.Header,
  4734. }
  4735. }
  4736. if err != nil {
  4737. return nil, err
  4738. }
  4739. defer googleapi.CloseBody(res)
  4740. if err := googleapi.CheckResponse(res); err != nil {
  4741. return nil, err
  4742. }
  4743. ret := &Post{
  4744. ServerResponse: googleapi.ServerResponse{
  4745. Header: res.Header,
  4746. HTTPStatusCode: res.StatusCode,
  4747. },
  4748. }
  4749. target := &ret
  4750. if err := gensupport.DecodeResponse(target, res); err != nil {
  4751. return nil, err
  4752. }
  4753. return ret, nil
  4754. // {
  4755. // "description": "Get a post by id.",
  4756. // "httpMethod": "GET",
  4757. // "id": "blogger.posts.get",
  4758. // "parameterOrder": [
  4759. // "blogId",
  4760. // "postId"
  4761. // ],
  4762. // "parameters": {
  4763. // "blogId": {
  4764. // "description": "ID of the blog to fetch the post from.",
  4765. // "location": "path",
  4766. // "required": true,
  4767. // "type": "string"
  4768. // },
  4769. // "maxComments": {
  4770. // "description": "Maximum number of comments to pull back on a post.",
  4771. // "format": "uint32",
  4772. // "location": "query",
  4773. // "type": "integer"
  4774. // },
  4775. // "postId": {
  4776. // "description": "The ID of the post",
  4777. // "location": "path",
  4778. // "required": true,
  4779. // "type": "string"
  4780. // },
  4781. // "view": {
  4782. // "enum": [
  4783. // "ADMIN",
  4784. // "AUTHOR",
  4785. // "READER"
  4786. // ],
  4787. // "enumDescriptions": [
  4788. // "Admin level detail",
  4789. // "Author level detail",
  4790. // "Admin level detail"
  4791. // ],
  4792. // "location": "query",
  4793. // "type": "string"
  4794. // }
  4795. // },
  4796. // "path": "blogs/{blogId}/posts/{postId}",
  4797. // "response": {
  4798. // "$ref": "Post"
  4799. // },
  4800. // "scopes": [
  4801. // "https://www.googleapis.com/auth/blogger",
  4802. // "https://www.googleapis.com/auth/blogger.readonly"
  4803. // ]
  4804. // }
  4805. }
  4806. // method id "blogger.posts.getByPath":
  4807. type PostsGetByPathCall struct {
  4808. s *Service
  4809. blogId string
  4810. urlParams_ gensupport.URLParams
  4811. ifNoneMatch_ string
  4812. ctx_ context.Context
  4813. header_ http.Header
  4814. }
  4815. // GetByPath: Retrieve a Post by Path.
  4816. func (r *PostsService) GetByPath(blogId string, path string) *PostsGetByPathCall {
  4817. c := &PostsGetByPathCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4818. c.blogId = blogId
  4819. c.urlParams_.Set("path", path)
  4820. return c
  4821. }
  4822. // MaxComments sets the optional parameter "maxComments": Maximum number
  4823. // of comments to pull back on a post.
  4824. func (c *PostsGetByPathCall) MaxComments(maxComments int64) *PostsGetByPathCall {
  4825. c.urlParams_.Set("maxComments", fmt.Sprint(maxComments))
  4826. return c
  4827. }
  4828. // View sets the optional parameter "view":
  4829. //
  4830. // Possible values:
  4831. // "ADMIN" - Admin level detail
  4832. // "AUTHOR" - Author level detail
  4833. // "READER" - Admin level detail
  4834. func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall {
  4835. c.urlParams_.Set("view", view)
  4836. return c
  4837. }
  4838. // Fields allows partial responses to be retrieved. See
  4839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4840. // for more information.
  4841. func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall {
  4842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4843. return c
  4844. }
  4845. // IfNoneMatch sets the optional parameter which makes the operation
  4846. // fail if the object's ETag matches the given value. This is useful for
  4847. // getting updates only after the object has changed since the last
  4848. // request. Use googleapi.IsNotModified to check whether the response
  4849. // error from Do is the result of In-None-Match.
  4850. func (c *PostsGetByPathCall) IfNoneMatch(entityTag string) *PostsGetByPathCall {
  4851. c.ifNoneMatch_ = entityTag
  4852. return c
  4853. }
  4854. // Context sets the context to be used in this call's Do method. Any
  4855. // pending HTTP request will be aborted if the provided context is
  4856. // canceled.
  4857. func (c *PostsGetByPathCall) Context(ctx context.Context) *PostsGetByPathCall {
  4858. c.ctx_ = ctx
  4859. return c
  4860. }
  4861. // Header returns an http.Header that can be modified by the caller to
  4862. // add HTTP headers to the request.
  4863. func (c *PostsGetByPathCall) Header() http.Header {
  4864. if c.header_ == nil {
  4865. c.header_ = make(http.Header)
  4866. }
  4867. return c.header_
  4868. }
  4869. func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) {
  4870. reqHeaders := make(http.Header)
  4871. for k, v := range c.header_ {
  4872. reqHeaders[k] = v
  4873. }
  4874. reqHeaders.Set("User-Agent", c.s.userAgent())
  4875. if c.ifNoneMatch_ != "" {
  4876. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4877. }
  4878. var body io.Reader = nil
  4879. c.urlParams_.Set("alt", alt)
  4880. c.urlParams_.Set("prettyPrint", "false")
  4881. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath")
  4882. urls += "?" + c.urlParams_.Encode()
  4883. req, err := http.NewRequest("GET", urls, body)
  4884. if err != nil {
  4885. return nil, err
  4886. }
  4887. req.Header = reqHeaders
  4888. googleapi.Expand(req.URL, map[string]string{
  4889. "blogId": c.blogId,
  4890. })
  4891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4892. }
  4893. // Do executes the "blogger.posts.getByPath" call.
  4894. // Exactly one of *Post or error will be non-nil. Any non-2xx status
  4895. // code is an error. Response headers are in either
  4896. // *Post.ServerResponse.Header or (if a response was returned at all) in
  4897. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4898. // whether the returned error was because http.StatusNotModified was
  4899. // returned.
  4900. func (c *PostsGetByPathCall) Do(opts ...googleapi.CallOption) (*Post, error) {
  4901. gensupport.SetOptions(c.urlParams_, opts...)
  4902. res, err := c.doRequest("json")
  4903. if res != nil && res.StatusCode == http.StatusNotModified {
  4904. if res.Body != nil {
  4905. res.Body.Close()
  4906. }
  4907. return nil, &googleapi.Error{
  4908. Code: res.StatusCode,
  4909. Header: res.Header,
  4910. }
  4911. }
  4912. if err != nil {
  4913. return nil, err
  4914. }
  4915. defer googleapi.CloseBody(res)
  4916. if err := googleapi.CheckResponse(res); err != nil {
  4917. return nil, err
  4918. }
  4919. ret := &Post{
  4920. ServerResponse: googleapi.ServerResponse{
  4921. Header: res.Header,
  4922. HTTPStatusCode: res.StatusCode,
  4923. },
  4924. }
  4925. target := &ret
  4926. if err := gensupport.DecodeResponse(target, res); err != nil {
  4927. return nil, err
  4928. }
  4929. return ret, nil
  4930. // {
  4931. // "description": "Retrieve a Post by Path.",
  4932. // "httpMethod": "GET",
  4933. // "id": "blogger.posts.getByPath",
  4934. // "parameterOrder": [
  4935. // "blogId",
  4936. // "path"
  4937. // ],
  4938. // "parameters": {
  4939. // "blogId": {
  4940. // "description": "ID of the blog to fetch the post from.",
  4941. // "location": "path",
  4942. // "required": true,
  4943. // "type": "string"
  4944. // },
  4945. // "maxComments": {
  4946. // "description": "Maximum number of comments to pull back on a post.",
  4947. // "format": "uint32",
  4948. // "location": "query",
  4949. // "type": "integer"
  4950. // },
  4951. // "path": {
  4952. // "description": "Path of the Post to retrieve.",
  4953. // "location": "query",
  4954. // "required": true,
  4955. // "type": "string"
  4956. // },
  4957. // "view": {
  4958. // "enum": [
  4959. // "ADMIN",
  4960. // "AUTHOR",
  4961. // "READER"
  4962. // ],
  4963. // "enumDescriptions": [
  4964. // "Admin level detail",
  4965. // "Author level detail",
  4966. // "Admin level detail"
  4967. // ],
  4968. // "location": "query",
  4969. // "type": "string"
  4970. // }
  4971. // },
  4972. // "path": "blogs/{blogId}/posts/bypath",
  4973. // "response": {
  4974. // "$ref": "Post"
  4975. // },
  4976. // "scopes": [
  4977. // "https://www.googleapis.com/auth/blogger",
  4978. // "https://www.googleapis.com/auth/blogger.readonly"
  4979. // ]
  4980. // }
  4981. }
  4982. // method id "blogger.posts.insert":
  4983. type PostsInsertCall struct {
  4984. s *Service
  4985. blogId string
  4986. post *Post
  4987. urlParams_ gensupport.URLParams
  4988. ctx_ context.Context
  4989. header_ http.Header
  4990. }
  4991. // Insert: Add a post.
  4992. func (r *PostsService) Insert(blogId string, post *Post) *PostsInsertCall {
  4993. c := &PostsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4994. c.blogId = blogId
  4995. c.post = post
  4996. return c
  4997. }
  4998. // IsDraft sets the optional parameter "isDraft": Whether to create the
  4999. // post as a draft
  5000. func (c *PostsInsertCall) IsDraft(isDraft bool) *PostsInsertCall {
  5001. c.urlParams_.Set("isDraft", fmt.Sprint(isDraft))
  5002. return c
  5003. }
  5004. // Fields allows partial responses to be retrieved. See
  5005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5006. // for more information.
  5007. func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall {
  5008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5009. return c
  5010. }
  5011. // Context sets the context to be used in this call's Do method. Any
  5012. // pending HTTP request will be aborted if the provided context is
  5013. // canceled.
  5014. func (c *PostsInsertCall) Context(ctx context.Context) *PostsInsertCall {
  5015. c.ctx_ = ctx
  5016. return c
  5017. }
  5018. // Header returns an http.Header that can be modified by the caller to
  5019. // add HTTP headers to the request.
  5020. func (c *PostsInsertCall) Header() http.Header {
  5021. if c.header_ == nil {
  5022. c.header_ = make(http.Header)
  5023. }
  5024. return c.header_
  5025. }
  5026. func (c *PostsInsertCall) doRequest(alt string) (*http.Response, error) {
  5027. reqHeaders := make(http.Header)
  5028. for k, v := range c.header_ {
  5029. reqHeaders[k] = v
  5030. }
  5031. reqHeaders.Set("User-Agent", c.s.userAgent())
  5032. var body io.Reader = nil
  5033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
  5034. if err != nil {
  5035. return nil, err
  5036. }
  5037. reqHeaders.Set("Content-Type", "application/json")
  5038. c.urlParams_.Set("alt", alt)
  5039. c.urlParams_.Set("prettyPrint", "false")
  5040. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts")
  5041. urls += "?" + c.urlParams_.Encode()
  5042. req, err := http.NewRequest("POST", urls, body)
  5043. if err != nil {
  5044. return nil, err
  5045. }
  5046. req.Header = reqHeaders
  5047. googleapi.Expand(req.URL, map[string]string{
  5048. "blogId": c.blogId,
  5049. })
  5050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5051. }
  5052. // Do executes the "blogger.posts.insert" call.
  5053. // Exactly one of *Post or error will be non-nil. Any non-2xx status
  5054. // code is an error. Response headers are in either
  5055. // *Post.ServerResponse.Header or (if a response was returned at all) in
  5056. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5057. // whether the returned error was because http.StatusNotModified was
  5058. // returned.
  5059. func (c *PostsInsertCall) Do(opts ...googleapi.CallOption) (*Post, error) {
  5060. gensupport.SetOptions(c.urlParams_, opts...)
  5061. res, err := c.doRequest("json")
  5062. if res != nil && res.StatusCode == http.StatusNotModified {
  5063. if res.Body != nil {
  5064. res.Body.Close()
  5065. }
  5066. return nil, &googleapi.Error{
  5067. Code: res.StatusCode,
  5068. Header: res.Header,
  5069. }
  5070. }
  5071. if err != nil {
  5072. return nil, err
  5073. }
  5074. defer googleapi.CloseBody(res)
  5075. if err := googleapi.CheckResponse(res); err != nil {
  5076. return nil, err
  5077. }
  5078. ret := &Post{
  5079. ServerResponse: googleapi.ServerResponse{
  5080. Header: res.Header,
  5081. HTTPStatusCode: res.StatusCode,
  5082. },
  5083. }
  5084. target := &ret
  5085. if err := gensupport.DecodeResponse(target, res); err != nil {
  5086. return nil, err
  5087. }
  5088. return ret, nil
  5089. // {
  5090. // "description": "Add a post.",
  5091. // "httpMethod": "POST",
  5092. // "id": "blogger.posts.insert",
  5093. // "parameterOrder": [
  5094. // "blogId"
  5095. // ],
  5096. // "parameters": {
  5097. // "blogId": {
  5098. // "description": "ID of the blog to add the post to.",
  5099. // "location": "path",
  5100. // "required": true,
  5101. // "type": "string"
  5102. // },
  5103. // "isDraft": {
  5104. // "description": "Whether to create the post as a draft",
  5105. // "location": "query",
  5106. // "type": "boolean"
  5107. // }
  5108. // },
  5109. // "path": "blogs/{blogId}/posts",
  5110. // "request": {
  5111. // "$ref": "Post"
  5112. // },
  5113. // "response": {
  5114. // "$ref": "Post"
  5115. // },
  5116. // "scopes": [
  5117. // "https://www.googleapis.com/auth/blogger"
  5118. // ]
  5119. // }
  5120. }
  5121. // method id "blogger.posts.list":
  5122. type PostsListCall struct {
  5123. s *Service
  5124. blogId string
  5125. urlParams_ gensupport.URLParams
  5126. ifNoneMatch_ string
  5127. ctx_ context.Context
  5128. header_ http.Header
  5129. }
  5130. // List: Retrieves a list of posts, possibly filtered.
  5131. func (r *PostsService) List(blogId string) *PostsListCall {
  5132. c := &PostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5133. c.blogId = blogId
  5134. return c
  5135. }
  5136. // EndDate sets the optional parameter "endDate": Latest post date to
  5137. // fetch, a date-time with RFC 3339 formatting.
  5138. func (c *PostsListCall) EndDate(endDate string) *PostsListCall {
  5139. c.urlParams_.Set("endDate", endDate)
  5140. return c
  5141. }
  5142. // FetchBodies sets the optional parameter "fetchBodies": Whether the
  5143. // body content of posts is included (default: true). This should be set
  5144. // to false when the post bodies are not required, to help minimize
  5145. // traffic.
  5146. func (c *PostsListCall) FetchBodies(fetchBodies bool) *PostsListCall {
  5147. c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
  5148. return c
  5149. }
  5150. // FetchImages sets the optional parameter "fetchImages": Whether image
  5151. // URL metadata for each post is included.
  5152. func (c *PostsListCall) FetchImages(fetchImages bool) *PostsListCall {
  5153. c.urlParams_.Set("fetchImages", fmt.Sprint(fetchImages))
  5154. return c
  5155. }
  5156. // Labels sets the optional parameter "labels": Comma-separated list of
  5157. // labels to search for.
  5158. func (c *PostsListCall) Labels(labels string) *PostsListCall {
  5159. c.urlParams_.Set("labels", labels)
  5160. return c
  5161. }
  5162. // MaxResults sets the optional parameter "maxResults": Maximum number
  5163. // of posts to fetch.
  5164. func (c *PostsListCall) MaxResults(maxResults int64) *PostsListCall {
  5165. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5166. return c
  5167. }
  5168. // OrderBy sets the optional parameter "orderBy": Sort search results
  5169. //
  5170. // Possible values:
  5171. // "published" - Order by the date the post was published
  5172. // "updated" - Order by the date the post was last updated
  5173. func (c *PostsListCall) OrderBy(orderBy string) *PostsListCall {
  5174. c.urlParams_.Set("orderBy", orderBy)
  5175. return c
  5176. }
  5177. // PageToken sets the optional parameter "pageToken": Continuation token
  5178. // if the request is paged.
  5179. func (c *PostsListCall) PageToken(pageToken string) *PostsListCall {
  5180. c.urlParams_.Set("pageToken", pageToken)
  5181. return c
  5182. }
  5183. // StartDate sets the optional parameter "startDate": Earliest post date
  5184. // to fetch, a date-time with RFC 3339 formatting.
  5185. func (c *PostsListCall) StartDate(startDate string) *PostsListCall {
  5186. c.urlParams_.Set("startDate", startDate)
  5187. return c
  5188. }
  5189. // Statuses sets the optional parameter "statuses":
  5190. //
  5191. // Possible values:
  5192. // "draft" - Draft posts
  5193. // "live" - Published posts
  5194. // "scheduled" - Posts that are scheduled to publish in future.
  5195. func (c *PostsListCall) Statuses(statuses ...string) *PostsListCall {
  5196. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  5197. return c
  5198. }
  5199. // View sets the optional parameter "view":
  5200. //
  5201. // Possible values:
  5202. // "ADMIN" - Admin level detail
  5203. // "AUTHOR" - Author level detail
  5204. // "READER" - Reader level detail
  5205. func (c *PostsListCall) View(view string) *PostsListCall {
  5206. c.urlParams_.Set("view", view)
  5207. return c
  5208. }
  5209. // Fields allows partial responses to be retrieved. See
  5210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5211. // for more information.
  5212. func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall {
  5213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5214. return c
  5215. }
  5216. // IfNoneMatch sets the optional parameter which makes the operation
  5217. // fail if the object's ETag matches the given value. This is useful for
  5218. // getting updates only after the object has changed since the last
  5219. // request. Use googleapi.IsNotModified to check whether the response
  5220. // error from Do is the result of In-None-Match.
  5221. func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall {
  5222. c.ifNoneMatch_ = entityTag
  5223. return c
  5224. }
  5225. // Context sets the context to be used in this call's Do method. Any
  5226. // pending HTTP request will be aborted if the provided context is
  5227. // canceled.
  5228. func (c *PostsListCall) Context(ctx context.Context) *PostsListCall {
  5229. c.ctx_ = ctx
  5230. return c
  5231. }
  5232. // Header returns an http.Header that can be modified by the caller to
  5233. // add HTTP headers to the request.
  5234. func (c *PostsListCall) Header() http.Header {
  5235. if c.header_ == nil {
  5236. c.header_ = make(http.Header)
  5237. }
  5238. return c.header_
  5239. }
  5240. func (c *PostsListCall) doRequest(alt string) (*http.Response, error) {
  5241. reqHeaders := make(http.Header)
  5242. for k, v := range c.header_ {
  5243. reqHeaders[k] = v
  5244. }
  5245. reqHeaders.Set("User-Agent", c.s.userAgent())
  5246. if c.ifNoneMatch_ != "" {
  5247. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5248. }
  5249. var body io.Reader = nil
  5250. c.urlParams_.Set("alt", alt)
  5251. c.urlParams_.Set("prettyPrint", "false")
  5252. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts")
  5253. urls += "?" + c.urlParams_.Encode()
  5254. req, err := http.NewRequest("GET", urls, body)
  5255. if err != nil {
  5256. return nil, err
  5257. }
  5258. req.Header = reqHeaders
  5259. googleapi.Expand(req.URL, map[string]string{
  5260. "blogId": c.blogId,
  5261. })
  5262. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5263. }
  5264. // Do executes the "blogger.posts.list" call.
  5265. // Exactly one of *PostList or error will be non-nil. Any non-2xx status
  5266. // code is an error. Response headers are in either
  5267. // *PostList.ServerResponse.Header or (if a response was returned at
  5268. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5269. // to check whether the returned error was because
  5270. // http.StatusNotModified was returned.
  5271. func (c *PostsListCall) Do(opts ...googleapi.CallOption) (*PostList, error) {
  5272. gensupport.SetOptions(c.urlParams_, opts...)
  5273. res, err := c.doRequest("json")
  5274. if res != nil && res.StatusCode == http.StatusNotModified {
  5275. if res.Body != nil {
  5276. res.Body.Close()
  5277. }
  5278. return nil, &googleapi.Error{
  5279. Code: res.StatusCode,
  5280. Header: res.Header,
  5281. }
  5282. }
  5283. if err != nil {
  5284. return nil, err
  5285. }
  5286. defer googleapi.CloseBody(res)
  5287. if err := googleapi.CheckResponse(res); err != nil {
  5288. return nil, err
  5289. }
  5290. ret := &PostList{
  5291. ServerResponse: googleapi.ServerResponse{
  5292. Header: res.Header,
  5293. HTTPStatusCode: res.StatusCode,
  5294. },
  5295. }
  5296. target := &ret
  5297. if err := gensupport.DecodeResponse(target, res); err != nil {
  5298. return nil, err
  5299. }
  5300. return ret, nil
  5301. // {
  5302. // "description": "Retrieves a list of posts, possibly filtered.",
  5303. // "httpMethod": "GET",
  5304. // "id": "blogger.posts.list",
  5305. // "parameterOrder": [
  5306. // "blogId"
  5307. // ],
  5308. // "parameters": {
  5309. // "blogId": {
  5310. // "description": "ID of the blog to fetch posts from.",
  5311. // "location": "path",
  5312. // "required": true,
  5313. // "type": "string"
  5314. // },
  5315. // "endDate": {
  5316. // "description": "Latest post date to fetch, a date-time with RFC 3339 formatting.",
  5317. // "format": "date-time",
  5318. // "location": "query",
  5319. // "type": "string"
  5320. // },
  5321. // "fetchBodies": {
  5322. // "default": "true",
  5323. // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.",
  5324. // "location": "query",
  5325. // "type": "boolean"
  5326. // },
  5327. // "fetchImages": {
  5328. // "description": "Whether image URL metadata for each post is included.",
  5329. // "location": "query",
  5330. // "type": "boolean"
  5331. // },
  5332. // "labels": {
  5333. // "description": "Comma-separated list of labels to search for.",
  5334. // "location": "query",
  5335. // "type": "string"
  5336. // },
  5337. // "maxResults": {
  5338. // "description": "Maximum number of posts to fetch.",
  5339. // "format": "uint32",
  5340. // "location": "query",
  5341. // "type": "integer"
  5342. // },
  5343. // "orderBy": {
  5344. // "default": "PUBLISHED",
  5345. // "description": "Sort search results",
  5346. // "enum": [
  5347. // "published",
  5348. // "updated"
  5349. // ],
  5350. // "enumDescriptions": [
  5351. // "Order by the date the post was published",
  5352. // "Order by the date the post was last updated"
  5353. // ],
  5354. // "location": "query",
  5355. // "type": "string"
  5356. // },
  5357. // "pageToken": {
  5358. // "description": "Continuation token if the request is paged.",
  5359. // "location": "query",
  5360. // "type": "string"
  5361. // },
  5362. // "startDate": {
  5363. // "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.",
  5364. // "format": "date-time",
  5365. // "location": "query",
  5366. // "type": "string"
  5367. // },
  5368. // "statuses": {
  5369. // "enum": [
  5370. // "draft",
  5371. // "live",
  5372. // "scheduled"
  5373. // ],
  5374. // "enumDescriptions": [
  5375. // "Draft posts",
  5376. // "Published posts",
  5377. // "Posts that are scheduled to publish in future."
  5378. // ],
  5379. // "location": "query",
  5380. // "repeated": true,
  5381. // "type": "string"
  5382. // },
  5383. // "view": {
  5384. // "enum": [
  5385. // "ADMIN",
  5386. // "AUTHOR",
  5387. // "READER"
  5388. // ],
  5389. // "enumDescriptions": [
  5390. // "Admin level detail",
  5391. // "Author level detail",
  5392. // "Reader level detail"
  5393. // ],
  5394. // "location": "query",
  5395. // "type": "string"
  5396. // }
  5397. // },
  5398. // "path": "blogs/{blogId}/posts",
  5399. // "response": {
  5400. // "$ref": "PostList"
  5401. // },
  5402. // "scopes": [
  5403. // "https://www.googleapis.com/auth/blogger",
  5404. // "https://www.googleapis.com/auth/blogger.readonly"
  5405. // ]
  5406. // }
  5407. }
  5408. // Pages invokes f for each page of results.
  5409. // A non-nil error returned from f will halt the iteration.
  5410. // The provided context supersedes any context provided to the Context method.
  5411. func (c *PostsListCall) Pages(ctx context.Context, f func(*PostList) error) error {
  5412. c.ctx_ = ctx
  5413. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5414. for {
  5415. x, err := c.Do()
  5416. if err != nil {
  5417. return err
  5418. }
  5419. if err := f(x); err != nil {
  5420. return err
  5421. }
  5422. if x.NextPageToken == "" {
  5423. return nil
  5424. }
  5425. c.PageToken(x.NextPageToken)
  5426. }
  5427. }
  5428. // method id "blogger.posts.patch":
  5429. type PostsPatchCall struct {
  5430. s *Service
  5431. blogId string
  5432. postId string
  5433. post *Post
  5434. urlParams_ gensupport.URLParams
  5435. ctx_ context.Context
  5436. header_ http.Header
  5437. }
  5438. // Patch: Update a post. This method supports patch semantics.
  5439. func (r *PostsService) Patch(blogId string, postId string, post *Post) *PostsPatchCall {
  5440. c := &PostsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5441. c.blogId = blogId
  5442. c.postId = postId
  5443. c.post = post
  5444. return c
  5445. }
  5446. // Fields allows partial responses to be retrieved. See
  5447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5448. // for more information.
  5449. func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall {
  5450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5451. return c
  5452. }
  5453. // Context sets the context to be used in this call's Do method. Any
  5454. // pending HTTP request will be aborted if the provided context is
  5455. // canceled.
  5456. func (c *PostsPatchCall) Context(ctx context.Context) *PostsPatchCall {
  5457. c.ctx_ = ctx
  5458. return c
  5459. }
  5460. // Header returns an http.Header that can be modified by the caller to
  5461. // add HTTP headers to the request.
  5462. func (c *PostsPatchCall) Header() http.Header {
  5463. if c.header_ == nil {
  5464. c.header_ = make(http.Header)
  5465. }
  5466. return c.header_
  5467. }
  5468. func (c *PostsPatchCall) doRequest(alt string) (*http.Response, error) {
  5469. reqHeaders := make(http.Header)
  5470. for k, v := range c.header_ {
  5471. reqHeaders[k] = v
  5472. }
  5473. reqHeaders.Set("User-Agent", c.s.userAgent())
  5474. var body io.Reader = nil
  5475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
  5476. if err != nil {
  5477. return nil, err
  5478. }
  5479. reqHeaders.Set("Content-Type", "application/json")
  5480. c.urlParams_.Set("alt", alt)
  5481. c.urlParams_.Set("prettyPrint", "false")
  5482. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
  5483. urls += "?" + c.urlParams_.Encode()
  5484. req, err := http.NewRequest("PATCH", urls, body)
  5485. if err != nil {
  5486. return nil, err
  5487. }
  5488. req.Header = reqHeaders
  5489. googleapi.Expand(req.URL, map[string]string{
  5490. "blogId": c.blogId,
  5491. "postId": c.postId,
  5492. })
  5493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5494. }
  5495. // Do executes the "blogger.posts.patch" call.
  5496. // Exactly one of *Post or error will be non-nil. Any non-2xx status
  5497. // code is an error. Response headers are in either
  5498. // *Post.ServerResponse.Header or (if a response was returned at all) in
  5499. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5500. // whether the returned error was because http.StatusNotModified was
  5501. // returned.
  5502. func (c *PostsPatchCall) Do(opts ...googleapi.CallOption) (*Post, error) {
  5503. gensupport.SetOptions(c.urlParams_, opts...)
  5504. res, err := c.doRequest("json")
  5505. if res != nil && res.StatusCode == http.StatusNotModified {
  5506. if res.Body != nil {
  5507. res.Body.Close()
  5508. }
  5509. return nil, &googleapi.Error{
  5510. Code: res.StatusCode,
  5511. Header: res.Header,
  5512. }
  5513. }
  5514. if err != nil {
  5515. return nil, err
  5516. }
  5517. defer googleapi.CloseBody(res)
  5518. if err := googleapi.CheckResponse(res); err != nil {
  5519. return nil, err
  5520. }
  5521. ret := &Post{
  5522. ServerResponse: googleapi.ServerResponse{
  5523. Header: res.Header,
  5524. HTTPStatusCode: res.StatusCode,
  5525. },
  5526. }
  5527. target := &ret
  5528. if err := gensupport.DecodeResponse(target, res); err != nil {
  5529. return nil, err
  5530. }
  5531. return ret, nil
  5532. // {
  5533. // "description": "Update a post. This method supports patch semantics.",
  5534. // "httpMethod": "PATCH",
  5535. // "id": "blogger.posts.patch",
  5536. // "parameterOrder": [
  5537. // "blogId",
  5538. // "postId"
  5539. // ],
  5540. // "parameters": {
  5541. // "blogId": {
  5542. // "description": "The ID of the Blog.",
  5543. // "location": "path",
  5544. // "required": true,
  5545. // "type": "string"
  5546. // },
  5547. // "postId": {
  5548. // "description": "The ID of the Post.",
  5549. // "location": "path",
  5550. // "required": true,
  5551. // "type": "string"
  5552. // }
  5553. // },
  5554. // "path": "blogs/{blogId}/posts/{postId}",
  5555. // "request": {
  5556. // "$ref": "Post"
  5557. // },
  5558. // "response": {
  5559. // "$ref": "Post"
  5560. // },
  5561. // "scopes": [
  5562. // "https://www.googleapis.com/auth/blogger"
  5563. // ]
  5564. // }
  5565. }
  5566. // method id "blogger.posts.publish":
  5567. type PostsPublishCall struct {
  5568. s *Service
  5569. blogId string
  5570. postId string
  5571. urlParams_ gensupport.URLParams
  5572. ctx_ context.Context
  5573. header_ http.Header
  5574. }
  5575. // Publish: Publish a draft post.
  5576. func (r *PostsService) Publish(blogId string, postId string) *PostsPublishCall {
  5577. c := &PostsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5578. c.blogId = blogId
  5579. c.postId = postId
  5580. return c
  5581. }
  5582. // PublishDate sets the optional parameter "publishDate": The date and
  5583. // time to schedule the publishing of the Blog.
  5584. func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall {
  5585. c.urlParams_.Set("publishDate", publishDate)
  5586. return c
  5587. }
  5588. // Fields allows partial responses to be retrieved. See
  5589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5590. // for more information.
  5591. func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall {
  5592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5593. return c
  5594. }
  5595. // Context sets the context to be used in this call's Do method. Any
  5596. // pending HTTP request will be aborted if the provided context is
  5597. // canceled.
  5598. func (c *PostsPublishCall) Context(ctx context.Context) *PostsPublishCall {
  5599. c.ctx_ = ctx
  5600. return c
  5601. }
  5602. // Header returns an http.Header that can be modified by the caller to
  5603. // add HTTP headers to the request.
  5604. func (c *PostsPublishCall) Header() http.Header {
  5605. if c.header_ == nil {
  5606. c.header_ = make(http.Header)
  5607. }
  5608. return c.header_
  5609. }
  5610. func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) {
  5611. reqHeaders := make(http.Header)
  5612. for k, v := range c.header_ {
  5613. reqHeaders[k] = v
  5614. }
  5615. reqHeaders.Set("User-Agent", c.s.userAgent())
  5616. var body io.Reader = nil
  5617. c.urlParams_.Set("alt", alt)
  5618. c.urlParams_.Set("prettyPrint", "false")
  5619. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish")
  5620. urls += "?" + c.urlParams_.Encode()
  5621. req, err := http.NewRequest("POST", urls, body)
  5622. if err != nil {
  5623. return nil, err
  5624. }
  5625. req.Header = reqHeaders
  5626. googleapi.Expand(req.URL, map[string]string{
  5627. "blogId": c.blogId,
  5628. "postId": c.postId,
  5629. })
  5630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5631. }
  5632. // Do executes the "blogger.posts.publish" call.
  5633. // Exactly one of *Post or error will be non-nil. Any non-2xx status
  5634. // code is an error. Response headers are in either
  5635. // *Post.ServerResponse.Header or (if a response was returned at all) in
  5636. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5637. // whether the returned error was because http.StatusNotModified was
  5638. // returned.
  5639. func (c *PostsPublishCall) Do(opts ...googleapi.CallOption) (*Post, error) {
  5640. gensupport.SetOptions(c.urlParams_, opts...)
  5641. res, err := c.doRequest("json")
  5642. if res != nil && res.StatusCode == http.StatusNotModified {
  5643. if res.Body != nil {
  5644. res.Body.Close()
  5645. }
  5646. return nil, &googleapi.Error{
  5647. Code: res.StatusCode,
  5648. Header: res.Header,
  5649. }
  5650. }
  5651. if err != nil {
  5652. return nil, err
  5653. }
  5654. defer googleapi.CloseBody(res)
  5655. if err := googleapi.CheckResponse(res); err != nil {
  5656. return nil, err
  5657. }
  5658. ret := &Post{
  5659. ServerResponse: googleapi.ServerResponse{
  5660. Header: res.Header,
  5661. HTTPStatusCode: res.StatusCode,
  5662. },
  5663. }
  5664. target := &ret
  5665. if err := gensupport.DecodeResponse(target, res); err != nil {
  5666. return nil, err
  5667. }
  5668. return ret, nil
  5669. // {
  5670. // "description": "Publish a draft post.",
  5671. // "httpMethod": "POST",
  5672. // "id": "blogger.posts.publish",
  5673. // "parameterOrder": [
  5674. // "blogId",
  5675. // "postId"
  5676. // ],
  5677. // "parameters": {
  5678. // "blogId": {
  5679. // "description": "The ID of the Blog.",
  5680. // "location": "path",
  5681. // "required": true,
  5682. // "type": "string"
  5683. // },
  5684. // "postId": {
  5685. // "description": "The ID of the Post.",
  5686. // "location": "path",
  5687. // "required": true,
  5688. // "type": "string"
  5689. // },
  5690. // "publishDate": {
  5691. // "description": "The date and time to schedule the publishing of the Blog.",
  5692. // "format": "date-time",
  5693. // "location": "query",
  5694. // "type": "string"
  5695. // }
  5696. // },
  5697. // "path": "blogs/{blogId}/posts/{postId}/publish",
  5698. // "response": {
  5699. // "$ref": "Post"
  5700. // },
  5701. // "scopes": [
  5702. // "https://www.googleapis.com/auth/blogger"
  5703. // ]
  5704. // }
  5705. }
  5706. // method id "blogger.posts.revert":
  5707. type PostsRevertCall struct {
  5708. s *Service
  5709. blogId string
  5710. postId string
  5711. urlParams_ gensupport.URLParams
  5712. ctx_ context.Context
  5713. header_ http.Header
  5714. }
  5715. // Revert: Revert a published or scheduled post to draft state.
  5716. func (r *PostsService) Revert(blogId string, postId string) *PostsRevertCall {
  5717. c := &PostsRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5718. c.blogId = blogId
  5719. c.postId = postId
  5720. return c
  5721. }
  5722. // Fields allows partial responses to be retrieved. See
  5723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5724. // for more information.
  5725. func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall {
  5726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5727. return c
  5728. }
  5729. // Context sets the context to be used in this call's Do method. Any
  5730. // pending HTTP request will be aborted if the provided context is
  5731. // canceled.
  5732. func (c *PostsRevertCall) Context(ctx context.Context) *PostsRevertCall {
  5733. c.ctx_ = ctx
  5734. return c
  5735. }
  5736. // Header returns an http.Header that can be modified by the caller to
  5737. // add HTTP headers to the request.
  5738. func (c *PostsRevertCall) Header() http.Header {
  5739. if c.header_ == nil {
  5740. c.header_ = make(http.Header)
  5741. }
  5742. return c.header_
  5743. }
  5744. func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) {
  5745. reqHeaders := make(http.Header)
  5746. for k, v := range c.header_ {
  5747. reqHeaders[k] = v
  5748. }
  5749. reqHeaders.Set("User-Agent", c.s.userAgent())
  5750. var body io.Reader = nil
  5751. c.urlParams_.Set("alt", alt)
  5752. c.urlParams_.Set("prettyPrint", "false")
  5753. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert")
  5754. urls += "?" + c.urlParams_.Encode()
  5755. req, err := http.NewRequest("POST", urls, body)
  5756. if err != nil {
  5757. return nil, err
  5758. }
  5759. req.Header = reqHeaders
  5760. googleapi.Expand(req.URL, map[string]string{
  5761. "blogId": c.blogId,
  5762. "postId": c.postId,
  5763. })
  5764. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5765. }
  5766. // Do executes the "blogger.posts.revert" call.
  5767. // Exactly one of *Post or error will be non-nil. Any non-2xx status
  5768. // code is an error. Response headers are in either
  5769. // *Post.ServerResponse.Header or (if a response was returned at all) in
  5770. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5771. // whether the returned error was because http.StatusNotModified was
  5772. // returned.
  5773. func (c *PostsRevertCall) Do(opts ...googleapi.CallOption) (*Post, error) {
  5774. gensupport.SetOptions(c.urlParams_, opts...)
  5775. res, err := c.doRequest("json")
  5776. if res != nil && res.StatusCode == http.StatusNotModified {
  5777. if res.Body != nil {
  5778. res.Body.Close()
  5779. }
  5780. return nil, &googleapi.Error{
  5781. Code: res.StatusCode,
  5782. Header: res.Header,
  5783. }
  5784. }
  5785. if err != nil {
  5786. return nil, err
  5787. }
  5788. defer googleapi.CloseBody(res)
  5789. if err := googleapi.CheckResponse(res); err != nil {
  5790. return nil, err
  5791. }
  5792. ret := &Post{
  5793. ServerResponse: googleapi.ServerResponse{
  5794. Header: res.Header,
  5795. HTTPStatusCode: res.StatusCode,
  5796. },
  5797. }
  5798. target := &ret
  5799. if err := gensupport.DecodeResponse(target, res); err != nil {
  5800. return nil, err
  5801. }
  5802. return ret, nil
  5803. // {
  5804. // "description": "Revert a published or scheduled post to draft state.",
  5805. // "httpMethod": "POST",
  5806. // "id": "blogger.posts.revert",
  5807. // "parameterOrder": [
  5808. // "blogId",
  5809. // "postId"
  5810. // ],
  5811. // "parameters": {
  5812. // "blogId": {
  5813. // "description": "The ID of the Blog.",
  5814. // "location": "path",
  5815. // "required": true,
  5816. // "type": "string"
  5817. // },
  5818. // "postId": {
  5819. // "description": "The ID of the Post.",
  5820. // "location": "path",
  5821. // "required": true,
  5822. // "type": "string"
  5823. // }
  5824. // },
  5825. // "path": "blogs/{blogId}/posts/{postId}/revert",
  5826. // "response": {
  5827. // "$ref": "Post"
  5828. // },
  5829. // "scopes": [
  5830. // "https://www.googleapis.com/auth/blogger"
  5831. // ]
  5832. // }
  5833. }
  5834. // method id "blogger.posts.search":
  5835. type PostsSearchCall struct {
  5836. s *Service
  5837. blogId string
  5838. urlParams_ gensupport.URLParams
  5839. ifNoneMatch_ string
  5840. ctx_ context.Context
  5841. header_ http.Header
  5842. }
  5843. // Search: Search for a post.
  5844. func (r *PostsService) Search(blogId string, q string) *PostsSearchCall {
  5845. c := &PostsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5846. c.blogId = blogId
  5847. c.urlParams_.Set("q", q)
  5848. return c
  5849. }
  5850. // FetchBodies sets the optional parameter "fetchBodies": Whether the
  5851. // body content of posts is included (default: true). This should be set
  5852. // to false when the post bodies are not required, to help minimize
  5853. // traffic.
  5854. func (c *PostsSearchCall) FetchBodies(fetchBodies bool) *PostsSearchCall {
  5855. c.urlParams_.Set("fetchBodies", fmt.Sprint(fetchBodies))
  5856. return c
  5857. }
  5858. // OrderBy sets the optional parameter "orderBy": Sort search results
  5859. //
  5860. // Possible values:
  5861. // "published" - Order by the date the post was published
  5862. // "updated" - Order by the date the post was last updated
  5863. func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall {
  5864. c.urlParams_.Set("orderBy", orderBy)
  5865. return c
  5866. }
  5867. // Fields allows partial responses to be retrieved. See
  5868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5869. // for more information.
  5870. func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall {
  5871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5872. return c
  5873. }
  5874. // IfNoneMatch sets the optional parameter which makes the operation
  5875. // fail if the object's ETag matches the given value. This is useful for
  5876. // getting updates only after the object has changed since the last
  5877. // request. Use googleapi.IsNotModified to check whether the response
  5878. // error from Do is the result of In-None-Match.
  5879. func (c *PostsSearchCall) IfNoneMatch(entityTag string) *PostsSearchCall {
  5880. c.ifNoneMatch_ = entityTag
  5881. return c
  5882. }
  5883. // Context sets the context to be used in this call's Do method. Any
  5884. // pending HTTP request will be aborted if the provided context is
  5885. // canceled.
  5886. func (c *PostsSearchCall) Context(ctx context.Context) *PostsSearchCall {
  5887. c.ctx_ = ctx
  5888. return c
  5889. }
  5890. // Header returns an http.Header that can be modified by the caller to
  5891. // add HTTP headers to the request.
  5892. func (c *PostsSearchCall) Header() http.Header {
  5893. if c.header_ == nil {
  5894. c.header_ = make(http.Header)
  5895. }
  5896. return c.header_
  5897. }
  5898. func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) {
  5899. reqHeaders := make(http.Header)
  5900. for k, v := range c.header_ {
  5901. reqHeaders[k] = v
  5902. }
  5903. reqHeaders.Set("User-Agent", c.s.userAgent())
  5904. if c.ifNoneMatch_ != "" {
  5905. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5906. }
  5907. var body io.Reader = nil
  5908. c.urlParams_.Set("alt", alt)
  5909. c.urlParams_.Set("prettyPrint", "false")
  5910. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search")
  5911. urls += "?" + c.urlParams_.Encode()
  5912. req, err := http.NewRequest("GET", urls, body)
  5913. if err != nil {
  5914. return nil, err
  5915. }
  5916. req.Header = reqHeaders
  5917. googleapi.Expand(req.URL, map[string]string{
  5918. "blogId": c.blogId,
  5919. })
  5920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5921. }
  5922. // Do executes the "blogger.posts.search" call.
  5923. // Exactly one of *PostList or error will be non-nil. Any non-2xx status
  5924. // code is an error. Response headers are in either
  5925. // *PostList.ServerResponse.Header or (if a response was returned at
  5926. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5927. // to check whether the returned error was because
  5928. // http.StatusNotModified was returned.
  5929. func (c *PostsSearchCall) Do(opts ...googleapi.CallOption) (*PostList, error) {
  5930. gensupport.SetOptions(c.urlParams_, opts...)
  5931. res, err := c.doRequest("json")
  5932. if res != nil && res.StatusCode == http.StatusNotModified {
  5933. if res.Body != nil {
  5934. res.Body.Close()
  5935. }
  5936. return nil, &googleapi.Error{
  5937. Code: res.StatusCode,
  5938. Header: res.Header,
  5939. }
  5940. }
  5941. if err != nil {
  5942. return nil, err
  5943. }
  5944. defer googleapi.CloseBody(res)
  5945. if err := googleapi.CheckResponse(res); err != nil {
  5946. return nil, err
  5947. }
  5948. ret := &PostList{
  5949. ServerResponse: googleapi.ServerResponse{
  5950. Header: res.Header,
  5951. HTTPStatusCode: res.StatusCode,
  5952. },
  5953. }
  5954. target := &ret
  5955. if err := gensupport.DecodeResponse(target, res); err != nil {
  5956. return nil, err
  5957. }
  5958. return ret, nil
  5959. // {
  5960. // "description": "Search for a post.",
  5961. // "httpMethod": "GET",
  5962. // "id": "blogger.posts.search",
  5963. // "parameterOrder": [
  5964. // "blogId",
  5965. // "q"
  5966. // ],
  5967. // "parameters": {
  5968. // "blogId": {
  5969. // "description": "ID of the blog to fetch the post from.",
  5970. // "location": "path",
  5971. // "required": true,
  5972. // "type": "string"
  5973. // },
  5974. // "fetchBodies": {
  5975. // "default": "true",
  5976. // "description": "Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic.",
  5977. // "location": "query",
  5978. // "type": "boolean"
  5979. // },
  5980. // "orderBy": {
  5981. // "default": "PUBLISHED",
  5982. // "description": "Sort search results",
  5983. // "enum": [
  5984. // "published",
  5985. // "updated"
  5986. // ],
  5987. // "enumDescriptions": [
  5988. // "Order by the date the post was published",
  5989. // "Order by the date the post was last updated"
  5990. // ],
  5991. // "location": "query",
  5992. // "type": "string"
  5993. // },
  5994. // "q": {
  5995. // "description": "Query terms to search this blog for matching posts.",
  5996. // "location": "query",
  5997. // "required": true,
  5998. // "type": "string"
  5999. // }
  6000. // },
  6001. // "path": "blogs/{blogId}/posts/search",
  6002. // "response": {
  6003. // "$ref": "PostList"
  6004. // },
  6005. // "scopes": [
  6006. // "https://www.googleapis.com/auth/blogger",
  6007. // "https://www.googleapis.com/auth/blogger.readonly"
  6008. // ]
  6009. // }
  6010. }
  6011. // method id "blogger.posts.update":
  6012. type PostsUpdateCall struct {
  6013. s *Service
  6014. blogId string
  6015. postId string
  6016. post *Post
  6017. urlParams_ gensupport.URLParams
  6018. ctx_ context.Context
  6019. header_ http.Header
  6020. }
  6021. // Update: Update a post.
  6022. func (r *PostsService) Update(blogId string, postId string, post *Post) *PostsUpdateCall {
  6023. c := &PostsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6024. c.blogId = blogId
  6025. c.postId = postId
  6026. c.post = post
  6027. return c
  6028. }
  6029. // Fields allows partial responses to be retrieved. See
  6030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6031. // for more information.
  6032. func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall {
  6033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6034. return c
  6035. }
  6036. // Context sets the context to be used in this call's Do method. Any
  6037. // pending HTTP request will be aborted if the provided context is
  6038. // canceled.
  6039. func (c *PostsUpdateCall) Context(ctx context.Context) *PostsUpdateCall {
  6040. c.ctx_ = ctx
  6041. return c
  6042. }
  6043. // Header returns an http.Header that can be modified by the caller to
  6044. // add HTTP headers to the request.
  6045. func (c *PostsUpdateCall) Header() http.Header {
  6046. if c.header_ == nil {
  6047. c.header_ = make(http.Header)
  6048. }
  6049. return c.header_
  6050. }
  6051. func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6052. reqHeaders := make(http.Header)
  6053. for k, v := range c.header_ {
  6054. reqHeaders[k] = v
  6055. }
  6056. reqHeaders.Set("User-Agent", c.s.userAgent())
  6057. var body io.Reader = nil
  6058. body, err := googleapi.WithoutDataWrapper.JSONReader(c.post)
  6059. if err != nil {
  6060. return nil, err
  6061. }
  6062. reqHeaders.Set("Content-Type", "application/json")
  6063. c.urlParams_.Set("alt", alt)
  6064. c.urlParams_.Set("prettyPrint", "false")
  6065. urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}")
  6066. urls += "?" + c.urlParams_.Encode()
  6067. req, err := http.NewRequest("PUT", urls, body)
  6068. if err != nil {
  6069. return nil, err
  6070. }
  6071. req.Header = reqHeaders
  6072. googleapi.Expand(req.URL, map[string]string{
  6073. "blogId": c.blogId,
  6074. "postId": c.postId,
  6075. })
  6076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6077. }
  6078. // Do executes the "blogger.posts.update" call.
  6079. // Exactly one of *Post or error will be non-nil. Any non-2xx status
  6080. // code is an error. Response headers are in either
  6081. // *Post.ServerResponse.Header or (if a response was returned at all) in
  6082. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6083. // whether the returned error was because http.StatusNotModified was
  6084. // returned.
  6085. func (c *PostsUpdateCall) Do(opts ...googleapi.CallOption) (*Post, error) {
  6086. gensupport.SetOptions(c.urlParams_, opts...)
  6087. res, err := c.doRequest("json")
  6088. if res != nil && res.StatusCode == http.StatusNotModified {
  6089. if res.Body != nil {
  6090. res.Body.Close()
  6091. }
  6092. return nil, &googleapi.Error{
  6093. Code: res.StatusCode,
  6094. Header: res.Header,
  6095. }
  6096. }
  6097. if err != nil {
  6098. return nil, err
  6099. }
  6100. defer googleapi.CloseBody(res)
  6101. if err := googleapi.CheckResponse(res); err != nil {
  6102. return nil, err
  6103. }
  6104. ret := &Post{
  6105. ServerResponse: googleapi.ServerResponse{
  6106. Header: res.Header,
  6107. HTTPStatusCode: res.StatusCode,
  6108. },
  6109. }
  6110. target := &ret
  6111. if err := gensupport.DecodeResponse(target, res); err != nil {
  6112. return nil, err
  6113. }
  6114. return ret, nil
  6115. // {
  6116. // "description": "Update a post.",
  6117. // "httpMethod": "PUT",
  6118. // "id": "blogger.posts.update",
  6119. // "parameterOrder": [
  6120. // "blogId",
  6121. // "postId"
  6122. // ],
  6123. // "parameters": {
  6124. // "blogId": {
  6125. // "description": "The ID of the Blog.",
  6126. // "location": "path",
  6127. // "required": true,
  6128. // "type": "string"
  6129. // },
  6130. // "postId": {
  6131. // "description": "The ID of the Post.",
  6132. // "location": "path",
  6133. // "required": true,
  6134. // "type": "string"
  6135. // }
  6136. // },
  6137. // "path": "blogs/{blogId}/posts/{postId}",
  6138. // "request": {
  6139. // "$ref": "Post"
  6140. // },
  6141. // "response": {
  6142. // "$ref": "Post"
  6143. // },
  6144. // "scopes": [
  6145. // "https://www.googleapis.com/auth/blogger"
  6146. // ]
  6147. // }
  6148. }
  6149. // method id "blogger.users.get":
  6150. type UsersGetCall struct {
  6151. s *Service
  6152. userId string
  6153. urlParams_ gensupport.URLParams
  6154. ifNoneMatch_ string
  6155. ctx_ context.Context
  6156. header_ http.Header
  6157. }
  6158. // Get: Gets one user by id.
  6159. func (r *UsersService) Get(userId string) *UsersGetCall {
  6160. c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6161. c.userId = userId
  6162. return c
  6163. }
  6164. // Fields allows partial responses to be retrieved. See
  6165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6166. // for more information.
  6167. func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
  6168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6169. return c
  6170. }
  6171. // IfNoneMatch sets the optional parameter which makes the operation
  6172. // fail if the object's ETag matches the given value. This is useful for
  6173. // getting updates only after the object has changed since the last
  6174. // request. Use googleapi.IsNotModified to check whether the response
  6175. // error from Do is the result of In-None-Match.
  6176. func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
  6177. c.ifNoneMatch_ = entityTag
  6178. return c
  6179. }
  6180. // Context sets the context to be used in this call's Do method. Any
  6181. // pending HTTP request will be aborted if the provided context is
  6182. // canceled.
  6183. func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
  6184. c.ctx_ = ctx
  6185. return c
  6186. }
  6187. // Header returns an http.Header that can be modified by the caller to
  6188. // add HTTP headers to the request.
  6189. func (c *UsersGetCall) Header() http.Header {
  6190. if c.header_ == nil {
  6191. c.header_ = make(http.Header)
  6192. }
  6193. return c.header_
  6194. }
  6195. func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
  6196. reqHeaders := make(http.Header)
  6197. for k, v := range c.header_ {
  6198. reqHeaders[k] = v
  6199. }
  6200. reqHeaders.Set("User-Agent", c.s.userAgent())
  6201. if c.ifNoneMatch_ != "" {
  6202. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6203. }
  6204. var body io.Reader = nil
  6205. c.urlParams_.Set("alt", alt)
  6206. c.urlParams_.Set("prettyPrint", "false")
  6207. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}")
  6208. urls += "?" + c.urlParams_.Encode()
  6209. req, err := http.NewRequest("GET", urls, body)
  6210. if err != nil {
  6211. return nil, err
  6212. }
  6213. req.Header = reqHeaders
  6214. googleapi.Expand(req.URL, map[string]string{
  6215. "userId": c.userId,
  6216. })
  6217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6218. }
  6219. // Do executes the "blogger.users.get" call.
  6220. // Exactly one of *User or error will be non-nil. Any non-2xx status
  6221. // code is an error. Response headers are in either
  6222. // *User.ServerResponse.Header or (if a response was returned at all) in
  6223. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6224. // whether the returned error was because http.StatusNotModified was
  6225. // returned.
  6226. func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
  6227. gensupport.SetOptions(c.urlParams_, opts...)
  6228. res, err := c.doRequest("json")
  6229. if res != nil && res.StatusCode == http.StatusNotModified {
  6230. if res.Body != nil {
  6231. res.Body.Close()
  6232. }
  6233. return nil, &googleapi.Error{
  6234. Code: res.StatusCode,
  6235. Header: res.Header,
  6236. }
  6237. }
  6238. if err != nil {
  6239. return nil, err
  6240. }
  6241. defer googleapi.CloseBody(res)
  6242. if err := googleapi.CheckResponse(res); err != nil {
  6243. return nil, err
  6244. }
  6245. ret := &User{
  6246. ServerResponse: googleapi.ServerResponse{
  6247. Header: res.Header,
  6248. HTTPStatusCode: res.StatusCode,
  6249. },
  6250. }
  6251. target := &ret
  6252. if err := gensupport.DecodeResponse(target, res); err != nil {
  6253. return nil, err
  6254. }
  6255. return ret, nil
  6256. // {
  6257. // "description": "Gets one user by id.",
  6258. // "httpMethod": "GET",
  6259. // "id": "blogger.users.get",
  6260. // "parameterOrder": [
  6261. // "userId"
  6262. // ],
  6263. // "parameters": {
  6264. // "userId": {
  6265. // "description": "The ID of the user to get.",
  6266. // "location": "path",
  6267. // "required": true,
  6268. // "type": "string"
  6269. // }
  6270. // },
  6271. // "path": "users/{userId}",
  6272. // "response": {
  6273. // "$ref": "User"
  6274. // },
  6275. // "scopes": [
  6276. // "https://www.googleapis.com/auth/blogger",
  6277. // "https://www.googleapis.com/auth/blogger.readonly"
  6278. // ]
  6279. // }
  6280. }