blogger-gen.go 68 KB

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