[e3d4e0a] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * Copyright 2014 Google Inc.
|
---|
| 4 | *
|
---|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
| 6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
| 7 | * the License at
|
---|
| 8 | *
|
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 10 | *
|
---|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
| 14 | * License for the specific language governing permissions and limitations under
|
---|
| 15 | * the License.
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 | namespace Google\Service\Libraryagent\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Libraryagent\GoogleExampleLibraryagentV1Book;
|
---|
| 21 | use Google\Service\Libraryagent\GoogleExampleLibraryagentV1ListBooksResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "books" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $libraryagentService = new Google\Service\Libraryagent(...);
|
---|
| 28 | * $books = $libraryagentService->shelves_books;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class ShelvesBooks extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Borrow a book from the library. Returns the book if it is borrowed
|
---|
| 35 | * successfully. Returns NOT_FOUND if the book does not exist in the library.
|
---|
| 36 | * Returns quota exceeded error if the amount of books borrowed exceeds
|
---|
| 37 | * allocation quota in any dimensions. (books.borrow)
|
---|
| 38 | *
|
---|
| 39 | * @param string $name Required. The name of the book to borrow.
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | * @return GoogleExampleLibraryagentV1Book
|
---|
| 42 | * @throws \Google\Service\Exception
|
---|
| 43 | */
|
---|
| 44 | public function borrow($name, $optParams = [])
|
---|
| 45 | {
|
---|
| 46 | $params = ['name' => $name];
|
---|
| 47 | $params = array_merge($params, $optParams);
|
---|
| 48 | return $this->call('borrow', [$params], GoogleExampleLibraryagentV1Book::class);
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * Gets a book. Returns NOT_FOUND if the book does not exist. (books.get)
|
---|
| 52 | *
|
---|
| 53 | * @param string $name Required. The name of the book to retrieve.
|
---|
| 54 | * @param array $optParams Optional parameters.
|
---|
| 55 | * @return GoogleExampleLibraryagentV1Book
|
---|
| 56 | * @throws \Google\Service\Exception
|
---|
| 57 | */
|
---|
| 58 | public function get($name, $optParams = [])
|
---|
| 59 | {
|
---|
| 60 | $params = ['name' => $name];
|
---|
| 61 | $params = array_merge($params, $optParams);
|
---|
| 62 | return $this->call('get', [$params], GoogleExampleLibraryagentV1Book::class);
|
---|
| 63 | }
|
---|
| 64 | /**
|
---|
| 65 | * Lists books in a shelf. The order is unspecified but deterministic. Newly
|
---|
| 66 | * created books will not necessarily be added to the end of this list. Returns
|
---|
| 67 | * NOT_FOUND if the shelf does not exist. (books.listShelvesBooks)
|
---|
| 68 | *
|
---|
| 69 | * @param string $parent Required. The name of the shelf whose books we'd like
|
---|
| 70 | * to list.
|
---|
| 71 | * @param array $optParams Optional parameters.
|
---|
| 72 | *
|
---|
| 73 | * @opt_param int pageSize Requested page size. Server may return fewer books
|
---|
| 74 | * than requested. If unspecified, server will pick an appropriate default.
|
---|
| 75 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
| 76 | * should return. Typically, this is the value of
|
---|
| 77 | * ListBooksResponse.next_page_token. returned from the previous call to
|
---|
| 78 | * `ListBooks` method.
|
---|
| 79 | * @return GoogleExampleLibraryagentV1ListBooksResponse
|
---|
| 80 | * @throws \Google\Service\Exception
|
---|
| 81 | */
|
---|
| 82 | public function listShelvesBooks($parent, $optParams = [])
|
---|
| 83 | {
|
---|
| 84 | $params = ['parent' => $parent];
|
---|
| 85 | $params = array_merge($params, $optParams);
|
---|
| 86 | return $this->call('list', [$params], GoogleExampleLibraryagentV1ListBooksResponse::class);
|
---|
| 87 | }
|
---|
| 88 | /**
|
---|
| 89 | * Return a book to the library. Returns the book if it is returned to the
|
---|
| 90 | * library successfully. Returns error if the book does not belong to the
|
---|
| 91 | * library or the users didn't borrow before. (books.returnShelvesBooks)
|
---|
| 92 | *
|
---|
| 93 | * @param string $name Required. The name of the book to return.
|
---|
| 94 | * @param array $optParams Optional parameters.
|
---|
| 95 | * @return GoogleExampleLibraryagentV1Book
|
---|
| 96 | * @throws \Google\Service\Exception
|
---|
| 97 | */
|
---|
| 98 | public function returnShelvesBooks($name, $optParams = [])
|
---|
| 99 | {
|
---|
| 100 | $params = ['name' => $name];
|
---|
| 101 | $params = array_merge($params, $optParams);
|
---|
| 102 | return $this->call('return', [$params], GoogleExampleLibraryagentV1Book::class);
|
---|
| 103 | }
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 107 | class_alias(ShelvesBooks::class, 'Google_Service_Libraryagent_Resource_ShelvesBooks');
|
---|