// Creates a shelf in the library, and returns the new Shelf.
rpc CreateShelf(CreateShelfRequest) returns (Shelf) {
option (google.api.http) = { post: "/v1/shelves" body: "shelf" };
}
documentation:
summary: Gets and lists social activities
overview: A simple example service that lets you get and list possible social activities
rules:
- selector: google.social.Social.GetActivity
description: Gets a social activity. If the activity does not exist, returns Code.NOT_FOUND.
...
Updates a calendar event with the data included in the request.
Deletes a location record from the authenticated user's location history.
Creates or updates a location record in the authenticated user's location history using the data included in the request. If a location resource already exists with the same timestamp value, the data provided overwrites the existing data.
描述的检查清单
你要确保每个描述都是简短但完整的,同时也要可以被那些不太了解你的API的用户看懂。在大多数情况下,不能只是重申显而易见的信息,例如series.insert方法的描述不能只是"Inserts a series"。虽然你的命名应该已经表明它是做什么的了,但大多数读者之所以会阅读你的描述是因为他们想要获取更多的详细信息。如果你不确定描述中要写什么,试着回答以下相关的问题:
它是什么?
成功时会做什么?失败时会做什么?怎样原因会导致失败?
它是幂等的吗?
单位是什么?(例如:米、度、像素。)
接受值的范围?范围是开区间还是闭区间?
副作用是什么?
如何使用?
常见错误是什么?
是否会一直存在?(例如: "Container for voting information. Present only when voting information is recorded.")
// Manages books and shelves in a simple digital library.
service LibraryService {
...
}
// A book resource in the Library API.
message Book {
...
}
message Table {
// Required. The resource name of the table.
string name = 1;
// Input only. Whether to dry run the table creation.
bool dryrun = 2;
// Output only. The timestamp when the table was created. Assigned by
// the server.
Timestamp create_time = 3;
// The display name of the table.
string display_name = 4;
}