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.
 
 
 

1254 lines
41 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package libraryagent provides access to the Library Agent API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/docs/quota
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/libraryagent/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // libraryagentService, err := libraryagent.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // libraryagentService, err := libraryagent.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // libraryagentService, err := libraryagent.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package libraryagent // import "google.golang.org/api/libraryagent/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "libraryagent:v1"
  67. const apiName = "libraryagent"
  68. const apiVersion = "v1"
  69. const basePath = "https://libraryagent.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Shelves = NewShelvesService(s)
  106. return s, nil
  107. }
  108. type Service struct {
  109. client *http.Client
  110. BasePath string // API endpoint base URL
  111. UserAgent string // optional additional User-Agent fragment
  112. Shelves *ShelvesService
  113. }
  114. func (s *Service) userAgent() string {
  115. if s.UserAgent == "" {
  116. return googleapi.UserAgent
  117. }
  118. return googleapi.UserAgent + " " + s.UserAgent
  119. }
  120. func NewShelvesService(s *Service) *ShelvesService {
  121. rs := &ShelvesService{s: s}
  122. rs.Books = NewShelvesBooksService(s)
  123. return rs
  124. }
  125. type ShelvesService struct {
  126. s *Service
  127. Books *ShelvesBooksService
  128. }
  129. func NewShelvesBooksService(s *Service) *ShelvesBooksService {
  130. rs := &ShelvesBooksService{s: s}
  131. return rs
  132. }
  133. type ShelvesBooksService struct {
  134. s *Service
  135. }
  136. // GoogleExampleLibraryagentV1Book: A single book in the library.
  137. type GoogleExampleLibraryagentV1Book struct {
  138. // Author: The name of the book author.
  139. Author string `json:"author,omitempty"`
  140. // Name: The resource name of the book.
  141. // Book names have the form `shelves/{shelf_id}/books/{book_id}`.
  142. // The name is ignored when creating a book.
  143. Name string `json:"name,omitempty"`
  144. // Read: Value indicating whether the book has been read.
  145. Read bool `json:"read,omitempty"`
  146. // Title: The title of the book.
  147. Title string `json:"title,omitempty"`
  148. // ServerResponse contains the HTTP response code and headers from the
  149. // server.
  150. googleapi.ServerResponse `json:"-"`
  151. // ForceSendFields is a list of field names (e.g. "Author") to
  152. // unconditionally include in API requests. By default, fields with
  153. // empty values are omitted from API requests. However, any non-pointer,
  154. // non-interface field appearing in ForceSendFields will be sent to the
  155. // server regardless of whether the field is empty or not. This may be
  156. // used to include empty fields in Patch requests.
  157. ForceSendFields []string `json:"-"`
  158. // NullFields is a list of field names (e.g. "Author") to include in API
  159. // requests with the JSON null value. By default, fields with empty
  160. // values are omitted from API requests. However, any field with an
  161. // empty value appearing in NullFields will be sent to the server as
  162. // null. It is an error if a field in this list has a non-empty value.
  163. // This may be used to include null fields in Patch requests.
  164. NullFields []string `json:"-"`
  165. }
  166. func (s *GoogleExampleLibraryagentV1Book) MarshalJSON() ([]byte, error) {
  167. type NoMethod GoogleExampleLibraryagentV1Book
  168. raw := NoMethod(*s)
  169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  170. }
  171. // GoogleExampleLibraryagentV1ListBooksResponse: Response message for
  172. // LibraryAgent.ListBooks.
  173. type GoogleExampleLibraryagentV1ListBooksResponse struct {
  174. // Books: The list of books.
  175. Books []*GoogleExampleLibraryagentV1Book `json:"books,omitempty"`
  176. // NextPageToken: A token to retrieve next page of results.
  177. // Pass this value in the
  178. // ListBooksRequest.page_token
  179. // field in the subsequent call to `ListBooks` method to retrieve the
  180. // next
  181. // page of results.
  182. NextPageToken string `json:"nextPageToken,omitempty"`
  183. // ServerResponse contains the HTTP response code and headers from the
  184. // server.
  185. googleapi.ServerResponse `json:"-"`
  186. // ForceSendFields is a list of field names (e.g. "Books") to
  187. // unconditionally include in API requests. By default, fields with
  188. // empty values are omitted from API requests. However, any non-pointer,
  189. // non-interface field appearing in ForceSendFields will be sent to the
  190. // server regardless of whether the field is empty or not. This may be
  191. // used to include empty fields in Patch requests.
  192. ForceSendFields []string `json:"-"`
  193. // NullFields is a list of field names (e.g. "Books") to include in API
  194. // requests with the JSON null value. By default, fields with empty
  195. // values are omitted from API requests. However, any field with an
  196. // empty value appearing in NullFields will be sent to the server as
  197. // null. It is an error if a field in this list has a non-empty value.
  198. // This may be used to include null fields in Patch requests.
  199. NullFields []string `json:"-"`
  200. }
  201. func (s *GoogleExampleLibraryagentV1ListBooksResponse) MarshalJSON() ([]byte, error) {
  202. type NoMethod GoogleExampleLibraryagentV1ListBooksResponse
  203. raw := NoMethod(*s)
  204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  205. }
  206. // GoogleExampleLibraryagentV1ListShelvesResponse: Response message for
  207. // LibraryAgent.ListShelves.
  208. type GoogleExampleLibraryagentV1ListShelvesResponse struct {
  209. // NextPageToken: A token to retrieve next page of results.
  210. // Pass this value in the
  211. // ListShelvesRequest.page_token
  212. // field in the subsequent call to `ListShelves` method to retrieve the
  213. // next
  214. // page of results.
  215. NextPageToken string `json:"nextPageToken,omitempty"`
  216. // Shelves: The list of shelves.
  217. Shelves []*GoogleExampleLibraryagentV1Shelf `json:"shelves,omitempty"`
  218. // ServerResponse contains the HTTP response code and headers from the
  219. // server.
  220. googleapi.ServerResponse `json:"-"`
  221. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  222. // unconditionally include in API requests. By default, fields with
  223. // empty values are omitted from API requests. However, any non-pointer,
  224. // non-interface field appearing in ForceSendFields will be sent to the
  225. // server regardless of whether the field is empty or not. This may be
  226. // used to include empty fields in Patch requests.
  227. ForceSendFields []string `json:"-"`
  228. // NullFields is a list of field names (e.g. "NextPageToken") to include
  229. // in API requests with the JSON null value. By default, fields with
  230. // empty values are omitted from API requests. However, any field with
  231. // an empty value appearing in NullFields will be sent to the server as
  232. // null. It is an error if a field in this list has a non-empty value.
  233. // This may be used to include null fields in Patch requests.
  234. NullFields []string `json:"-"`
  235. }
  236. func (s *GoogleExampleLibraryagentV1ListShelvesResponse) MarshalJSON() ([]byte, error) {
  237. type NoMethod GoogleExampleLibraryagentV1ListShelvesResponse
  238. raw := NoMethod(*s)
  239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  240. }
  241. // GoogleExampleLibraryagentV1Shelf: A Shelf contains a collection of
  242. // books with a theme.
  243. type GoogleExampleLibraryagentV1Shelf struct {
  244. // Name: Output only. The resource name of the shelf.
  245. // Shelf names have the form `shelves/{shelf_id}`.
  246. // The name is ignored when creating a shelf.
  247. Name string `json:"name,omitempty"`
  248. // Theme: The theme of the shelf
  249. Theme string `json:"theme,omitempty"`
  250. // ServerResponse contains the HTTP response code and headers from the
  251. // server.
  252. googleapi.ServerResponse `json:"-"`
  253. // ForceSendFields is a list of field names (e.g. "Name") to
  254. // unconditionally include in API requests. By default, fields with
  255. // empty values are omitted from API requests. However, any non-pointer,
  256. // non-interface field appearing in ForceSendFields will be sent to the
  257. // server regardless of whether the field is empty or not. This may be
  258. // used to include empty fields in Patch requests.
  259. ForceSendFields []string `json:"-"`
  260. // NullFields is a list of field names (e.g. "Name") to include in API
  261. // requests with the JSON null value. By default, fields with empty
  262. // values are omitted from API requests. However, any field with an
  263. // empty value appearing in NullFields will be sent to the server as
  264. // null. It is an error if a field in this list has a non-empty value.
  265. // This may be used to include null fields in Patch requests.
  266. NullFields []string `json:"-"`
  267. }
  268. func (s *GoogleExampleLibraryagentV1Shelf) MarshalJSON() ([]byte, error) {
  269. type NoMethod GoogleExampleLibraryagentV1Shelf
  270. raw := NoMethod(*s)
  271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  272. }
  273. // method id "libraryagent.shelves.get":
  274. type ShelvesGetCall struct {
  275. s *Service
  276. name string
  277. urlParams_ gensupport.URLParams
  278. ifNoneMatch_ string
  279. ctx_ context.Context
  280. header_ http.Header
  281. }
  282. // Get: Gets a shelf. Returns NOT_FOUND if the shelf does not exist.
  283. func (r *ShelvesService) Get(name string) *ShelvesGetCall {
  284. c := &ShelvesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  285. c.name = name
  286. return c
  287. }
  288. // Fields allows partial responses to be retrieved. See
  289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  290. // for more information.
  291. func (c *ShelvesGetCall) Fields(s ...googleapi.Field) *ShelvesGetCall {
  292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  293. return c
  294. }
  295. // IfNoneMatch sets the optional parameter which makes the operation
  296. // fail if the object's ETag matches the given value. This is useful for
  297. // getting updates only after the object has changed since the last
  298. // request. Use googleapi.IsNotModified to check whether the response
  299. // error from Do is the result of In-None-Match.
  300. func (c *ShelvesGetCall) IfNoneMatch(entityTag string) *ShelvesGetCall {
  301. c.ifNoneMatch_ = entityTag
  302. return c
  303. }
  304. // Context sets the context to be used in this call's Do method. Any
  305. // pending HTTP request will be aborted if the provided context is
  306. // canceled.
  307. func (c *ShelvesGetCall) Context(ctx context.Context) *ShelvesGetCall {
  308. c.ctx_ = ctx
  309. return c
  310. }
  311. // Header returns an http.Header that can be modified by the caller to
  312. // add HTTP headers to the request.
  313. func (c *ShelvesGetCall) Header() http.Header {
  314. if c.header_ == nil {
  315. c.header_ = make(http.Header)
  316. }
  317. return c.header_
  318. }
  319. func (c *ShelvesGetCall) doRequest(alt string) (*http.Response, error) {
  320. reqHeaders := make(http.Header)
  321. for k, v := range c.header_ {
  322. reqHeaders[k] = v
  323. }
  324. reqHeaders.Set("User-Agent", c.s.userAgent())
  325. if c.ifNoneMatch_ != "" {
  326. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  327. }
  328. var body io.Reader = nil
  329. c.urlParams_.Set("alt", alt)
  330. c.urlParams_.Set("prettyPrint", "false")
  331. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  332. urls += "?" + c.urlParams_.Encode()
  333. req, err := http.NewRequest("GET", urls, body)
  334. if err != nil {
  335. return nil, err
  336. }
  337. req.Header = reqHeaders
  338. googleapi.Expand(req.URL, map[string]string{
  339. "name": c.name,
  340. })
  341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  342. }
  343. // Do executes the "libraryagent.shelves.get" call.
  344. // Exactly one of *GoogleExampleLibraryagentV1Shelf or error will be
  345. // non-nil. Any non-2xx status code is an error. Response headers are in
  346. // either *GoogleExampleLibraryagentV1Shelf.ServerResponse.Header or (if
  347. // a response was returned at all) in error.(*googleapi.Error).Header.
  348. // Use googleapi.IsNotModified to check whether the returned error was
  349. // because http.StatusNotModified was returned.
  350. func (c *ShelvesGetCall) Do(opts ...googleapi.CallOption) (*GoogleExampleLibraryagentV1Shelf, error) {
  351. gensupport.SetOptions(c.urlParams_, opts...)
  352. res, err := c.doRequest("json")
  353. if res != nil && res.StatusCode == http.StatusNotModified {
  354. if res.Body != nil {
  355. res.Body.Close()
  356. }
  357. return nil, &googleapi.Error{
  358. Code: res.StatusCode,
  359. Header: res.Header,
  360. }
  361. }
  362. if err != nil {
  363. return nil, err
  364. }
  365. defer googleapi.CloseBody(res)
  366. if err := googleapi.CheckResponse(res); err != nil {
  367. return nil, err
  368. }
  369. ret := &GoogleExampleLibraryagentV1Shelf{
  370. ServerResponse: googleapi.ServerResponse{
  371. Header: res.Header,
  372. HTTPStatusCode: res.StatusCode,
  373. },
  374. }
  375. target := &ret
  376. if err := gensupport.DecodeResponse(target, res); err != nil {
  377. return nil, err
  378. }
  379. return ret, nil
  380. // {
  381. // "description": "Gets a shelf. Returns NOT_FOUND if the shelf does not exist.",
  382. // "flatPath": "v1/shelves/{shelvesId}",
  383. // "httpMethod": "GET",
  384. // "id": "libraryagent.shelves.get",
  385. // "parameterOrder": [
  386. // "name"
  387. // ],
  388. // "parameters": {
  389. // "name": {
  390. // "description": "The name of the shelf to retrieve.",
  391. // "location": "path",
  392. // "pattern": "^shelves/[^/]+$",
  393. // "required": true,
  394. // "type": "string"
  395. // }
  396. // },
  397. // "path": "v1/{+name}",
  398. // "response": {
  399. // "$ref": "GoogleExampleLibraryagentV1Shelf"
  400. // },
  401. // "scopes": [
  402. // "https://www.googleapis.com/auth/cloud-platform"
  403. // ]
  404. // }
  405. }
  406. // method id "libraryagent.shelves.list":
  407. type ShelvesListCall struct {
  408. s *Service
  409. urlParams_ gensupport.URLParams
  410. ifNoneMatch_ string
  411. ctx_ context.Context
  412. header_ http.Header
  413. }
  414. // List: Lists shelves. The order is unspecified but deterministic.
  415. // Newly created
  416. // shelves will not necessarily be added to the end of this list.
  417. func (r *ShelvesService) List() *ShelvesListCall {
  418. c := &ShelvesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  419. return c
  420. }
  421. // PageSize sets the optional parameter "pageSize": Requested page size.
  422. // Server may return fewer shelves than requested.
  423. // If unspecified, server will pick an appropriate default.
  424. func (c *ShelvesListCall) PageSize(pageSize int64) *ShelvesListCall {
  425. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  426. return c
  427. }
  428. // PageToken sets the optional parameter "pageToken": A token
  429. // identifying a page of results the server should return.
  430. // Typically, this is the value
  431. // of
  432. // ListShelvesResponse.next_page_token
  433. // returned from the previous call to `ListShelves` method.
  434. func (c *ShelvesListCall) PageToken(pageToken string) *ShelvesListCall {
  435. c.urlParams_.Set("pageToken", pageToken)
  436. return c
  437. }
  438. // Fields allows partial responses to be retrieved. See
  439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  440. // for more information.
  441. func (c *ShelvesListCall) Fields(s ...googleapi.Field) *ShelvesListCall {
  442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  443. return c
  444. }
  445. // IfNoneMatch sets the optional parameter which makes the operation
  446. // fail if the object's ETag matches the given value. This is useful for
  447. // getting updates only after the object has changed since the last
  448. // request. Use googleapi.IsNotModified to check whether the response
  449. // error from Do is the result of In-None-Match.
  450. func (c *ShelvesListCall) IfNoneMatch(entityTag string) *ShelvesListCall {
  451. c.ifNoneMatch_ = entityTag
  452. return c
  453. }
  454. // Context sets the context to be used in this call's Do method. Any
  455. // pending HTTP request will be aborted if the provided context is
  456. // canceled.
  457. func (c *ShelvesListCall) Context(ctx context.Context) *ShelvesListCall {
  458. c.ctx_ = ctx
  459. return c
  460. }
  461. // Header returns an http.Header that can be modified by the caller to
  462. // add HTTP headers to the request.
  463. func (c *ShelvesListCall) Header() http.Header {
  464. if c.header_ == nil {
  465. c.header_ = make(http.Header)
  466. }
  467. return c.header_
  468. }
  469. func (c *ShelvesListCall) doRequest(alt string) (*http.Response, error) {
  470. reqHeaders := make(http.Header)
  471. for k, v := range c.header_ {
  472. reqHeaders[k] = v
  473. }
  474. reqHeaders.Set("User-Agent", c.s.userAgent())
  475. if c.ifNoneMatch_ != "" {
  476. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  477. }
  478. var body io.Reader = nil
  479. c.urlParams_.Set("alt", alt)
  480. c.urlParams_.Set("prettyPrint", "false")
  481. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/shelves")
  482. urls += "?" + c.urlParams_.Encode()
  483. req, err := http.NewRequest("GET", urls, body)
  484. if err != nil {
  485. return nil, err
  486. }
  487. req.Header = reqHeaders
  488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  489. }
  490. // Do executes the "libraryagent.shelves.list" call.
  491. // Exactly one of *GoogleExampleLibraryagentV1ListShelvesResponse or
  492. // error will be non-nil. Any non-2xx status code is an error. Response
  493. // headers are in either
  494. // *GoogleExampleLibraryagentV1ListShelvesResponse.ServerResponse.Header
  495. // or (if a response was returned at all) in
  496. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  497. // whether the returned error was because http.StatusNotModified was
  498. // returned.
  499. func (c *ShelvesListCall) Do(opts ...googleapi.CallOption) (*GoogleExampleLibraryagentV1ListShelvesResponse, error) {
  500. gensupport.SetOptions(c.urlParams_, opts...)
  501. res, err := c.doRequest("json")
  502. if res != nil && res.StatusCode == http.StatusNotModified {
  503. if res.Body != nil {
  504. res.Body.Close()
  505. }
  506. return nil, &googleapi.Error{
  507. Code: res.StatusCode,
  508. Header: res.Header,
  509. }
  510. }
  511. if err != nil {
  512. return nil, err
  513. }
  514. defer googleapi.CloseBody(res)
  515. if err := googleapi.CheckResponse(res); err != nil {
  516. return nil, err
  517. }
  518. ret := &GoogleExampleLibraryagentV1ListShelvesResponse{
  519. ServerResponse: googleapi.ServerResponse{
  520. Header: res.Header,
  521. HTTPStatusCode: res.StatusCode,
  522. },
  523. }
  524. target := &ret
  525. if err := gensupport.DecodeResponse(target, res); err != nil {
  526. return nil, err
  527. }
  528. return ret, nil
  529. // {
  530. // "description": "Lists shelves. The order is unspecified but deterministic. Newly created\nshelves will not necessarily be added to the end of this list.",
  531. // "flatPath": "v1/shelves",
  532. // "httpMethod": "GET",
  533. // "id": "libraryagent.shelves.list",
  534. // "parameterOrder": [],
  535. // "parameters": {
  536. // "pageSize": {
  537. // "description": "Requested page size. Server may return fewer shelves than requested.\nIf unspecified, server will pick an appropriate default.",
  538. // "format": "int32",
  539. // "location": "query",
  540. // "type": "integer"
  541. // },
  542. // "pageToken": {
  543. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListShelvesResponse.next_page_token\nreturned from the previous call to `ListShelves` method.",
  544. // "location": "query",
  545. // "type": "string"
  546. // }
  547. // },
  548. // "path": "v1/shelves",
  549. // "response": {
  550. // "$ref": "GoogleExampleLibraryagentV1ListShelvesResponse"
  551. // },
  552. // "scopes": [
  553. // "https://www.googleapis.com/auth/cloud-platform"
  554. // ]
  555. // }
  556. }
  557. // Pages invokes f for each page of results.
  558. // A non-nil error returned from f will halt the iteration.
  559. // The provided context supersedes any context provided to the Context method.
  560. func (c *ShelvesListCall) Pages(ctx context.Context, f func(*GoogleExampleLibraryagentV1ListShelvesResponse) error) error {
  561. c.ctx_ = ctx
  562. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  563. for {
  564. x, err := c.Do()
  565. if err != nil {
  566. return err
  567. }
  568. if err := f(x); err != nil {
  569. return err
  570. }
  571. if x.NextPageToken == "" {
  572. return nil
  573. }
  574. c.PageToken(x.NextPageToken)
  575. }
  576. }
  577. // method id "libraryagent.shelves.books.borrow":
  578. type ShelvesBooksBorrowCall struct {
  579. s *Service
  580. name string
  581. urlParams_ gensupport.URLParams
  582. ctx_ context.Context
  583. header_ http.Header
  584. }
  585. // Borrow: Borrow a book from the library. Returns the book if it is
  586. // borrowed
  587. // successfully. Returns NOT_FOUND if the book does not exist in the
  588. // library.
  589. // Returns quota exceeded error if the amount of books borrowed
  590. // exceeds
  591. // allocation quota in any dimensions.
  592. func (r *ShelvesBooksService) Borrow(name string) *ShelvesBooksBorrowCall {
  593. c := &ShelvesBooksBorrowCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  594. c.name = name
  595. return c
  596. }
  597. // Fields allows partial responses to be retrieved. See
  598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  599. // for more information.
  600. func (c *ShelvesBooksBorrowCall) Fields(s ...googleapi.Field) *ShelvesBooksBorrowCall {
  601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  602. return c
  603. }
  604. // Context sets the context to be used in this call's Do method. Any
  605. // pending HTTP request will be aborted if the provided context is
  606. // canceled.
  607. func (c *ShelvesBooksBorrowCall) Context(ctx context.Context) *ShelvesBooksBorrowCall {
  608. c.ctx_ = ctx
  609. return c
  610. }
  611. // Header returns an http.Header that can be modified by the caller to
  612. // add HTTP headers to the request.
  613. func (c *ShelvesBooksBorrowCall) Header() http.Header {
  614. if c.header_ == nil {
  615. c.header_ = make(http.Header)
  616. }
  617. return c.header_
  618. }
  619. func (c *ShelvesBooksBorrowCall) doRequest(alt string) (*http.Response, error) {
  620. reqHeaders := make(http.Header)
  621. for k, v := range c.header_ {
  622. reqHeaders[k] = v
  623. }
  624. reqHeaders.Set("User-Agent", c.s.userAgent())
  625. var body io.Reader = nil
  626. c.urlParams_.Set("alt", alt)
  627. c.urlParams_.Set("prettyPrint", "false")
  628. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:borrow")
  629. urls += "?" + c.urlParams_.Encode()
  630. req, err := http.NewRequest("POST", urls, body)
  631. if err != nil {
  632. return nil, err
  633. }
  634. req.Header = reqHeaders
  635. googleapi.Expand(req.URL, map[string]string{
  636. "name": c.name,
  637. })
  638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  639. }
  640. // Do executes the "libraryagent.shelves.books.borrow" call.
  641. // Exactly one of *GoogleExampleLibraryagentV1Book or error will be
  642. // non-nil. Any non-2xx status code is an error. Response headers are in
  643. // either *GoogleExampleLibraryagentV1Book.ServerResponse.Header or (if
  644. // a response was returned at all) in error.(*googleapi.Error).Header.
  645. // Use googleapi.IsNotModified to check whether the returned error was
  646. // because http.StatusNotModified was returned.
  647. func (c *ShelvesBooksBorrowCall) Do(opts ...googleapi.CallOption) (*GoogleExampleLibraryagentV1Book, error) {
  648. gensupport.SetOptions(c.urlParams_, opts...)
  649. res, err := c.doRequest("json")
  650. if res != nil && res.StatusCode == http.StatusNotModified {
  651. if res.Body != nil {
  652. res.Body.Close()
  653. }
  654. return nil, &googleapi.Error{
  655. Code: res.StatusCode,
  656. Header: res.Header,
  657. }
  658. }
  659. if err != nil {
  660. return nil, err
  661. }
  662. defer googleapi.CloseBody(res)
  663. if err := googleapi.CheckResponse(res); err != nil {
  664. return nil, err
  665. }
  666. ret := &GoogleExampleLibraryagentV1Book{
  667. ServerResponse: googleapi.ServerResponse{
  668. Header: res.Header,
  669. HTTPStatusCode: res.StatusCode,
  670. },
  671. }
  672. target := &ret
  673. if err := gensupport.DecodeResponse(target, res); err != nil {
  674. return nil, err
  675. }
  676. return ret, nil
  677. // {
  678. // "description": "Borrow a book from the library. Returns the book if it is borrowed\nsuccessfully. Returns NOT_FOUND if the book does not exist in the library.\nReturns quota exceeded error if the amount of books borrowed exceeds\nallocation quota in any dimensions.",
  679. // "flatPath": "v1/shelves/{shelvesId}/books/{booksId}:borrow",
  680. // "httpMethod": "POST",
  681. // "id": "libraryagent.shelves.books.borrow",
  682. // "parameterOrder": [
  683. // "name"
  684. // ],
  685. // "parameters": {
  686. // "name": {
  687. // "description": "The name of the book to borrow.",
  688. // "location": "path",
  689. // "pattern": "^shelves/[^/]+/books/[^/]+$",
  690. // "required": true,
  691. // "type": "string"
  692. // }
  693. // },
  694. // "path": "v1/{+name}:borrow",
  695. // "response": {
  696. // "$ref": "GoogleExampleLibraryagentV1Book"
  697. // },
  698. // "scopes": [
  699. // "https://www.googleapis.com/auth/cloud-platform"
  700. // ]
  701. // }
  702. }
  703. // method id "libraryagent.shelves.books.get":
  704. type ShelvesBooksGetCall struct {
  705. s *Service
  706. name string
  707. urlParams_ gensupport.URLParams
  708. ifNoneMatch_ string
  709. ctx_ context.Context
  710. header_ http.Header
  711. }
  712. // Get: Gets a book. Returns NOT_FOUND if the book does not exist.
  713. func (r *ShelvesBooksService) Get(name string) *ShelvesBooksGetCall {
  714. c := &ShelvesBooksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  715. c.name = name
  716. return c
  717. }
  718. // Fields allows partial responses to be retrieved. See
  719. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  720. // for more information.
  721. func (c *ShelvesBooksGetCall) Fields(s ...googleapi.Field) *ShelvesBooksGetCall {
  722. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  723. return c
  724. }
  725. // IfNoneMatch sets the optional parameter which makes the operation
  726. // fail if the object's ETag matches the given value. This is useful for
  727. // getting updates only after the object has changed since the last
  728. // request. Use googleapi.IsNotModified to check whether the response
  729. // error from Do is the result of In-None-Match.
  730. func (c *ShelvesBooksGetCall) IfNoneMatch(entityTag string) *ShelvesBooksGetCall {
  731. c.ifNoneMatch_ = entityTag
  732. return c
  733. }
  734. // Context sets the context to be used in this call's Do method. Any
  735. // pending HTTP request will be aborted if the provided context is
  736. // canceled.
  737. func (c *ShelvesBooksGetCall) Context(ctx context.Context) *ShelvesBooksGetCall {
  738. c.ctx_ = ctx
  739. return c
  740. }
  741. // Header returns an http.Header that can be modified by the caller to
  742. // add HTTP headers to the request.
  743. func (c *ShelvesBooksGetCall) Header() http.Header {
  744. if c.header_ == nil {
  745. c.header_ = make(http.Header)
  746. }
  747. return c.header_
  748. }
  749. func (c *ShelvesBooksGetCall) doRequest(alt string) (*http.Response, error) {
  750. reqHeaders := make(http.Header)
  751. for k, v := range c.header_ {
  752. reqHeaders[k] = v
  753. }
  754. reqHeaders.Set("User-Agent", c.s.userAgent())
  755. if c.ifNoneMatch_ != "" {
  756. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  757. }
  758. var body io.Reader = nil
  759. c.urlParams_.Set("alt", alt)
  760. c.urlParams_.Set("prettyPrint", "false")
  761. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  762. urls += "?" + c.urlParams_.Encode()
  763. req, err := http.NewRequest("GET", urls, body)
  764. if err != nil {
  765. return nil, err
  766. }
  767. req.Header = reqHeaders
  768. googleapi.Expand(req.URL, map[string]string{
  769. "name": c.name,
  770. })
  771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  772. }
  773. // Do executes the "libraryagent.shelves.books.get" call.
  774. // Exactly one of *GoogleExampleLibraryagentV1Book or error will be
  775. // non-nil. Any non-2xx status code is an error. Response headers are in
  776. // either *GoogleExampleLibraryagentV1Book.ServerResponse.Header or (if
  777. // a response was returned at all) in error.(*googleapi.Error).Header.
  778. // Use googleapi.IsNotModified to check whether the returned error was
  779. // because http.StatusNotModified was returned.
  780. func (c *ShelvesBooksGetCall) Do(opts ...googleapi.CallOption) (*GoogleExampleLibraryagentV1Book, error) {
  781. gensupport.SetOptions(c.urlParams_, opts...)
  782. res, err := c.doRequest("json")
  783. if res != nil && res.StatusCode == http.StatusNotModified {
  784. if res.Body != nil {
  785. res.Body.Close()
  786. }
  787. return nil, &googleapi.Error{
  788. Code: res.StatusCode,
  789. Header: res.Header,
  790. }
  791. }
  792. if err != nil {
  793. return nil, err
  794. }
  795. defer googleapi.CloseBody(res)
  796. if err := googleapi.CheckResponse(res); err != nil {
  797. return nil, err
  798. }
  799. ret := &GoogleExampleLibraryagentV1Book{
  800. ServerResponse: googleapi.ServerResponse{
  801. Header: res.Header,
  802. HTTPStatusCode: res.StatusCode,
  803. },
  804. }
  805. target := &ret
  806. if err := gensupport.DecodeResponse(target, res); err != nil {
  807. return nil, err
  808. }
  809. return ret, nil
  810. // {
  811. // "description": "Gets a book. Returns NOT_FOUND if the book does not exist.",
  812. // "flatPath": "v1/shelves/{shelvesId}/books/{booksId}",
  813. // "httpMethod": "GET",
  814. // "id": "libraryagent.shelves.books.get",
  815. // "parameterOrder": [
  816. // "name"
  817. // ],
  818. // "parameters": {
  819. // "name": {
  820. // "description": "The name of the book to retrieve.",
  821. // "location": "path",
  822. // "pattern": "^shelves/[^/]+/books/[^/]+$",
  823. // "required": true,
  824. // "type": "string"
  825. // }
  826. // },
  827. // "path": "v1/{+name}",
  828. // "response": {
  829. // "$ref": "GoogleExampleLibraryagentV1Book"
  830. // },
  831. // "scopes": [
  832. // "https://www.googleapis.com/auth/cloud-platform"
  833. // ]
  834. // }
  835. }
  836. // method id "libraryagent.shelves.books.list":
  837. type ShelvesBooksListCall struct {
  838. s *Service
  839. parent string
  840. urlParams_ gensupport.URLParams
  841. ifNoneMatch_ string
  842. ctx_ context.Context
  843. header_ http.Header
  844. }
  845. // List: Lists books in a shelf. The order is unspecified but
  846. // deterministic. Newly
  847. // created books will not necessarily be added to the end of this
  848. // list.
  849. // Returns NOT_FOUND if the shelf does not exist.
  850. func (r *ShelvesBooksService) List(parent string) *ShelvesBooksListCall {
  851. c := &ShelvesBooksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  852. c.parent = parent
  853. return c
  854. }
  855. // PageSize sets the optional parameter "pageSize": Requested page size.
  856. // Server may return fewer books than requested.
  857. // If unspecified, server will pick an appropriate default.
  858. func (c *ShelvesBooksListCall) PageSize(pageSize int64) *ShelvesBooksListCall {
  859. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  860. return c
  861. }
  862. // PageToken sets the optional parameter "pageToken": A token
  863. // identifying a page of results the server should return.
  864. // Typically, this is the value
  865. // of
  866. // ListBooksResponse.next_page_token.
  867. // returned from the previous call to `ListBooks` method.
  868. func (c *ShelvesBooksListCall) PageToken(pageToken string) *ShelvesBooksListCall {
  869. c.urlParams_.Set("pageToken", pageToken)
  870. return c
  871. }
  872. // Fields allows partial responses to be retrieved. See
  873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  874. // for more information.
  875. func (c *ShelvesBooksListCall) Fields(s ...googleapi.Field) *ShelvesBooksListCall {
  876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  877. return c
  878. }
  879. // IfNoneMatch sets the optional parameter which makes the operation
  880. // fail if the object's ETag matches the given value. This is useful for
  881. // getting updates only after the object has changed since the last
  882. // request. Use googleapi.IsNotModified to check whether the response
  883. // error from Do is the result of In-None-Match.
  884. func (c *ShelvesBooksListCall) IfNoneMatch(entityTag string) *ShelvesBooksListCall {
  885. c.ifNoneMatch_ = entityTag
  886. return c
  887. }
  888. // Context sets the context to be used in this call's Do method. Any
  889. // pending HTTP request will be aborted if the provided context is
  890. // canceled.
  891. func (c *ShelvesBooksListCall) Context(ctx context.Context) *ShelvesBooksListCall {
  892. c.ctx_ = ctx
  893. return c
  894. }
  895. // Header returns an http.Header that can be modified by the caller to
  896. // add HTTP headers to the request.
  897. func (c *ShelvesBooksListCall) Header() http.Header {
  898. if c.header_ == nil {
  899. c.header_ = make(http.Header)
  900. }
  901. return c.header_
  902. }
  903. func (c *ShelvesBooksListCall) doRequest(alt string) (*http.Response, error) {
  904. reqHeaders := make(http.Header)
  905. for k, v := range c.header_ {
  906. reqHeaders[k] = v
  907. }
  908. reqHeaders.Set("User-Agent", c.s.userAgent())
  909. if c.ifNoneMatch_ != "" {
  910. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  911. }
  912. var body io.Reader = nil
  913. c.urlParams_.Set("alt", alt)
  914. c.urlParams_.Set("prettyPrint", "false")
  915. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/books")
  916. urls += "?" + c.urlParams_.Encode()
  917. req, err := http.NewRequest("GET", urls, body)
  918. if err != nil {
  919. return nil, err
  920. }
  921. req.Header = reqHeaders
  922. googleapi.Expand(req.URL, map[string]string{
  923. "parent": c.parent,
  924. })
  925. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  926. }
  927. // Do executes the "libraryagent.shelves.books.list" call.
  928. // Exactly one of *GoogleExampleLibraryagentV1ListBooksResponse or error
  929. // will be non-nil. Any non-2xx status code is an error. Response
  930. // headers are in either
  931. // *GoogleExampleLibraryagentV1ListBooksResponse.ServerResponse.Header
  932. // or (if a response was returned at all) in
  933. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  934. // whether the returned error was because http.StatusNotModified was
  935. // returned.
  936. func (c *ShelvesBooksListCall) Do(opts ...googleapi.CallOption) (*GoogleExampleLibraryagentV1ListBooksResponse, error) {
  937. gensupport.SetOptions(c.urlParams_, opts...)
  938. res, err := c.doRequest("json")
  939. if res != nil && res.StatusCode == http.StatusNotModified {
  940. if res.Body != nil {
  941. res.Body.Close()
  942. }
  943. return nil, &googleapi.Error{
  944. Code: res.StatusCode,
  945. Header: res.Header,
  946. }
  947. }
  948. if err != nil {
  949. return nil, err
  950. }
  951. defer googleapi.CloseBody(res)
  952. if err := googleapi.CheckResponse(res); err != nil {
  953. return nil, err
  954. }
  955. ret := &GoogleExampleLibraryagentV1ListBooksResponse{
  956. ServerResponse: googleapi.ServerResponse{
  957. Header: res.Header,
  958. HTTPStatusCode: res.StatusCode,
  959. },
  960. }
  961. target := &ret
  962. if err := gensupport.DecodeResponse(target, res); err != nil {
  963. return nil, err
  964. }
  965. return ret, nil
  966. // {
  967. // "description": "Lists books in a shelf. The order is unspecified but deterministic. Newly\ncreated books will not necessarily be added to the end of this list.\nReturns NOT_FOUND if the shelf does not exist.",
  968. // "flatPath": "v1/shelves/{shelvesId}/books",
  969. // "httpMethod": "GET",
  970. // "id": "libraryagent.shelves.books.list",
  971. // "parameterOrder": [
  972. // "parent"
  973. // ],
  974. // "parameters": {
  975. // "pageSize": {
  976. // "description": "Requested page size. Server may return fewer books than requested.\nIf unspecified, server will pick an appropriate default.",
  977. // "format": "int32",
  978. // "location": "query",
  979. // "type": "integer"
  980. // },
  981. // "pageToken": {
  982. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBooksResponse.next_page_token.\nreturned from the previous call to `ListBooks` method.",
  983. // "location": "query",
  984. // "type": "string"
  985. // },
  986. // "parent": {
  987. // "description": "The name of the shelf whose books we'd like to list.",
  988. // "location": "path",
  989. // "pattern": "^shelves/[^/]+$",
  990. // "required": true,
  991. // "type": "string"
  992. // }
  993. // },
  994. // "path": "v1/{+parent}/books",
  995. // "response": {
  996. // "$ref": "GoogleExampleLibraryagentV1ListBooksResponse"
  997. // },
  998. // "scopes": [
  999. // "https://www.googleapis.com/auth/cloud-platform"
  1000. // ]
  1001. // }
  1002. }
  1003. // Pages invokes f for each page of results.
  1004. // A non-nil error returned from f will halt the iteration.
  1005. // The provided context supersedes any context provided to the Context method.
  1006. func (c *ShelvesBooksListCall) Pages(ctx context.Context, f func(*GoogleExampleLibraryagentV1ListBooksResponse) error) error {
  1007. c.ctx_ = ctx
  1008. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1009. for {
  1010. x, err := c.Do()
  1011. if err != nil {
  1012. return err
  1013. }
  1014. if err := f(x); err != nil {
  1015. return err
  1016. }
  1017. if x.NextPageToken == "" {
  1018. return nil
  1019. }
  1020. c.PageToken(x.NextPageToken)
  1021. }
  1022. }
  1023. // method id "libraryagent.shelves.books.return":
  1024. type ShelvesBooksReturnCall struct {
  1025. s *Service
  1026. name string
  1027. urlParams_ gensupport.URLParams
  1028. ctx_ context.Context
  1029. header_ http.Header
  1030. }
  1031. // Return: Return a book to the library. Returns the book if it is
  1032. // returned to the
  1033. // library successfully.
  1034. // Returns error if the book does not belong to the library
  1035. // or the users didn't borrow before.
  1036. func (r *ShelvesBooksService) Return(name string) *ShelvesBooksReturnCall {
  1037. c := &ShelvesBooksReturnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1038. c.name = name
  1039. return c
  1040. }
  1041. // Fields allows partial responses to be retrieved. See
  1042. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1043. // for more information.
  1044. func (c *ShelvesBooksReturnCall) Fields(s ...googleapi.Field) *ShelvesBooksReturnCall {
  1045. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1046. return c
  1047. }
  1048. // Context sets the context to be used in this call's Do method. Any
  1049. // pending HTTP request will be aborted if the provided context is
  1050. // canceled.
  1051. func (c *ShelvesBooksReturnCall) Context(ctx context.Context) *ShelvesBooksReturnCall {
  1052. c.ctx_ = ctx
  1053. return c
  1054. }
  1055. // Header returns an http.Header that can be modified by the caller to
  1056. // add HTTP headers to the request.
  1057. func (c *ShelvesBooksReturnCall) Header() http.Header {
  1058. if c.header_ == nil {
  1059. c.header_ = make(http.Header)
  1060. }
  1061. return c.header_
  1062. }
  1063. func (c *ShelvesBooksReturnCall) doRequest(alt string) (*http.Response, error) {
  1064. reqHeaders := make(http.Header)
  1065. for k, v := range c.header_ {
  1066. reqHeaders[k] = v
  1067. }
  1068. reqHeaders.Set("User-Agent", c.s.userAgent())
  1069. var body io.Reader = nil
  1070. c.urlParams_.Set("alt", alt)
  1071. c.urlParams_.Set("prettyPrint", "false")
  1072. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:return")
  1073. urls += "?" + c.urlParams_.Encode()
  1074. req, err := http.NewRequest("POST", urls, body)
  1075. if err != nil {
  1076. return nil, err
  1077. }
  1078. req.Header = reqHeaders
  1079. googleapi.Expand(req.URL, map[string]string{
  1080. "name": c.name,
  1081. })
  1082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1083. }
  1084. // Do executes the "libraryagent.shelves.books.return" call.
  1085. // Exactly one of *GoogleExampleLibraryagentV1Book or error will be
  1086. // non-nil. Any non-2xx status code is an error. Response headers are in
  1087. // either *GoogleExampleLibraryagentV1Book.ServerResponse.Header or (if
  1088. // a response was returned at all) in error.(*googleapi.Error).Header.
  1089. // Use googleapi.IsNotModified to check whether the returned error was
  1090. // because http.StatusNotModified was returned.
  1091. func (c *ShelvesBooksReturnCall) Do(opts ...googleapi.CallOption) (*GoogleExampleLibraryagentV1Book, error) {
  1092. gensupport.SetOptions(c.urlParams_, opts...)
  1093. res, err := c.doRequest("json")
  1094. if res != nil && res.StatusCode == http.StatusNotModified {
  1095. if res.Body != nil {
  1096. res.Body.Close()
  1097. }
  1098. return nil, &googleapi.Error{
  1099. Code: res.StatusCode,
  1100. Header: res.Header,
  1101. }
  1102. }
  1103. if err != nil {
  1104. return nil, err
  1105. }
  1106. defer googleapi.CloseBody(res)
  1107. if err := googleapi.CheckResponse(res); err != nil {
  1108. return nil, err
  1109. }
  1110. ret := &GoogleExampleLibraryagentV1Book{
  1111. ServerResponse: googleapi.ServerResponse{
  1112. Header: res.Header,
  1113. HTTPStatusCode: res.StatusCode,
  1114. },
  1115. }
  1116. target := &ret
  1117. if err := gensupport.DecodeResponse(target, res); err != nil {
  1118. return nil, err
  1119. }
  1120. return ret, nil
  1121. // {
  1122. // "description": "Return a book to the library. Returns the book if it is returned to the\nlibrary successfully.\nReturns error if the book does not belong to the library\nor the users didn't borrow before.",
  1123. // "flatPath": "v1/shelves/{shelvesId}/books/{booksId}:return",
  1124. // "httpMethod": "POST",
  1125. // "id": "libraryagent.shelves.books.return",
  1126. // "parameterOrder": [
  1127. // "name"
  1128. // ],
  1129. // "parameters": {
  1130. // "name": {
  1131. // "description": "The name of the book to return.",
  1132. // "location": "path",
  1133. // "pattern": "^shelves/[^/]+/books/[^/]+$",
  1134. // "required": true,
  1135. // "type": "string"
  1136. // }
  1137. // },
  1138. // "path": "v1/{+name}:return",
  1139. // "response": {
  1140. // "$ref": "GoogleExampleLibraryagentV1Book"
  1141. // },
  1142. // "scopes": [
  1143. // "https://www.googleapis.com/auth/cloud-platform"
  1144. // ]
  1145. // }
  1146. }