books
Creates, updates, deletes, gets or lists a books
resource.
Overview
Name | books |
Type | Resource |
Id | google.libraryagent.books |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the book. Book names have the form shelves/{shelf_id}/books/{book_id} . The name is ignored when creating a book. |
author | string | The name of the book author. |
read | boolean | Value indicating whether the book has been read. |
title | string | The title of the book. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | booksId, shelvesId | Gets a book. Returns NOT_FOUND if the book does not exist. |
list | SELECT | shelvesId | Lists books in a shelf. The order is unspecified but deterministic. Newly created books will not necessarily be added to the end of this list. Returns NOT_FOUND if the shelf does not exist. |
borrow | EXEC | booksId, shelvesId | Borrow a book from the library. Returns the book if it is borrowed successfully. Returns NOT_FOUND if the book does not exist in the library. Returns quota exceeded error if the amount of books borrowed exceeds allocation quota in any dimensions. |
return | EXEC | booksId, shelvesId | Return a book to the library. Returns the book if it is returned to the library successfully. Returns error if the book does not belong to the library or the users didn't borrow before. |
SELECT
examples
Lists books in a shelf. The order is unspecified but deterministic. Newly created books will not necessarily be added to the end of this list. Returns NOT_FOUND if the shelf does not exist.
SELECT
name,
author,
read,
title
FROM google.libraryagent.books
WHERE shelvesId = '{{ shelvesId }}';