add: story, actor, and scenes
This commit is contained in:
@@ -49,6 +49,78 @@ service WebstoryService {
|
||||
option (google.api.http) = {delete: "/v1/{name=stories/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
|
||||
// GetScene retrieves a scene by its resource name.
|
||||
rpc GetScene(GetSceneRequest) returns (Scene) {
|
||||
option (google.api.http) = {get: "/v1/{name=stories/*/scenes/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
|
||||
// ListScenes returns a list of scenes for a story.
|
||||
rpc ListScenes(ListScenesRequest) returns (ListScenesResponse) {
|
||||
option (google.api.http) = {get: "/v1/{parent=stories/*}/scenes"};
|
||||
option (google.api.method_signature) = "parent";
|
||||
}
|
||||
|
||||
// CreateScene creates a new scene in a story.
|
||||
rpc CreateScene(CreateSceneRequest) returns (Scene) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/{parent=stories/*}/scenes"
|
||||
body: "scene"
|
||||
};
|
||||
option (google.api.method_signature) = "parent,scene_id,scene";
|
||||
}
|
||||
|
||||
// UpdateScene updates an existing scene.
|
||||
rpc UpdateScene(UpdateSceneRequest) returns (Scene) {
|
||||
option (google.api.http) = {
|
||||
put: "/v1/{scene.name}"
|
||||
body: "scene"
|
||||
};
|
||||
option (google.api.method_signature) = "scene";
|
||||
}
|
||||
|
||||
// DeleteScene deletes a scene.
|
||||
rpc DeleteScene(DeleteSceneRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/v1/{name=stories/*/scenes/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
|
||||
// GetActor retrieves an actor by its resource name.
|
||||
rpc GetActor(GetActorRequest) returns (Actor) {
|
||||
option (google.api.http) = {get: "/v1/{name=stories/*/actors/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
|
||||
// ListActors returns a list of actors for a story.
|
||||
rpc ListActors(ListActorsRequest) returns (ListActorsResponse) {
|
||||
option (google.api.http) = {get: "/v1/{parent=stories/*}/actors"};
|
||||
option (google.api.method_signature) = "parent";
|
||||
}
|
||||
|
||||
// CreateActor creates a new actor in a story.
|
||||
rpc CreateActor(CreateActorRequest) returns (Actor) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/{parent=stories/*}/actors"
|
||||
body: "actor"
|
||||
};
|
||||
option (google.api.method_signature) = "parent,actor_id,actor";
|
||||
}
|
||||
|
||||
// UpdateActor updates an existing actor.
|
||||
rpc UpdateActor(UpdateActorRequest) returns (Actor) {
|
||||
option (google.api.http) = {
|
||||
put: "/v1/{actor.name}"
|
||||
body: "actor"
|
||||
};
|
||||
option (google.api.method_signature) = "actor";
|
||||
}
|
||||
|
||||
// DeleteActor deletes an actor.
|
||||
rpc DeleteActor(DeleteActorRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {delete: "/v1/{name=stories/*/actors/*}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
||||
|
||||
// Story represents a story resource in the webstory service.
|
||||
@@ -88,6 +160,12 @@ message Story {
|
||||
|
||||
// Output only. The version of the story for concurrency control.
|
||||
string etag = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// The scenes contained in this story.
|
||||
repeated Scene scenes = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// The actors in this story.
|
||||
repeated Actor actors = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
}
|
||||
|
||||
// GetStoryRequest is the request message for GetStory RPC.
|
||||
@@ -169,3 +247,256 @@ message DeleteStoryRequest {
|
||||
(google.api.resource_reference) = {type: "webstory.googleapis.com/Story"}
|
||||
];
|
||||
}
|
||||
|
||||
// Scene represents a scene resource in the webstory service.
|
||||
message Scene {
|
||||
option (google.api.resource) = {
|
||||
type: "webstory.googleapis.com/Scene"
|
||||
pattern: "stories/{story}/scenes/{scene}"
|
||||
plural: "scenes"
|
||||
};
|
||||
|
||||
// The resource name of the scene.
|
||||
// Format: stories/{story}/scenes/{scene}
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = OUTPUT_ONLY,
|
||||
(google.api.field_behavior) = IDENTIFIER
|
||||
];
|
||||
|
||||
// The ID of the scene, used as the final component of the resource name.
|
||||
string scene_id = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The scene number within the story.
|
||||
int32 scene_number = 3 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The title of the scene.
|
||||
string title = 4 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The content of the scene.
|
||||
string content = 5;
|
||||
|
||||
// The description of the scene.
|
||||
string description = 6;
|
||||
|
||||
// Output only. The time when the scene was created.
|
||||
google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// Output only. The time when the scene was last updated.
|
||||
google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// Output only. The version of the scene for concurrency control.
|
||||
string etag = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
}
|
||||
|
||||
// GetSceneRequest is the request message for GetScene RPC.
|
||||
message GetSceneRequest {
|
||||
// The resource name of the scene to retrieve.
|
||||
// Format: stories/{story}/scenes/{scene}
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {type: "webstory.googleapis.com/Scene"}
|
||||
];
|
||||
}
|
||||
|
||||
// ListScenesRequest is the request message for ListScenes RPC.
|
||||
message ListScenesRequest {
|
||||
// The parent story that owns this collection of scenes.
|
||||
// Format: stories/{story}
|
||||
string parent = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The maximum number of scenes to return. The service may return fewer than
|
||||
// this value. If unspecified, at most 50 scenes will be returned.
|
||||
// The maximum value is 1000; values above 1000 will be coerced to 1000.
|
||||
int32 page_size = 2;
|
||||
|
||||
// A page token, received from a previous ListScenes call.
|
||||
// Provide this to retrieve the subsequent page.
|
||||
// When paginating, all other parameters provided to ListScenes must match
|
||||
// the call that provided the page token.
|
||||
string page_token = 3;
|
||||
|
||||
// Optional. A filter expression that filters the scenes listed in the response.
|
||||
// Supported fields: scene_number, title.
|
||||
// Example: scene_number:>5 AND title:"climax"
|
||||
string filter = 4;
|
||||
|
||||
// Optional. The field to order the results by.
|
||||
// Supported fields: scene_number, create_time, title.
|
||||
// Default: scene_number (ascending order).
|
||||
string order_by = 5;
|
||||
}
|
||||
|
||||
// ListScenesResponse is the response message for ListScenes RPC.
|
||||
message ListScenesResponse {
|
||||
// The list of scenes.
|
||||
repeated Scene scenes = 1;
|
||||
|
||||
// A token, which can be sent as page_token to retrieve the next page.
|
||||
// If this field is omitted, there are no subsequent pages.
|
||||
string next_page_token = 2;
|
||||
|
||||
// The total number of scenes matching the filter.
|
||||
// This value may be an estimate.
|
||||
int32 total_size = 3;
|
||||
}
|
||||
|
||||
// CreateSceneRequest is the request message for CreateScene RPC.
|
||||
message CreateSceneRequest {
|
||||
// The parent story where this scene will be created.
|
||||
// Format: stories/{story}
|
||||
string parent = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The ID to use for the scene, which will become the final component of
|
||||
// the scene's resource name.
|
||||
// This value should be 4-63 characters, and valid characters are
|
||||
// /[a-z][0-9]-/.
|
||||
string scene_id = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The scene to create.
|
||||
Scene scene = 3 [(google.api.field_behavior) = REQUIRED];
|
||||
}
|
||||
|
||||
// UpdateSceneRequest is the request message for UpdateScene RPC.
|
||||
message UpdateSceneRequest {
|
||||
// The scene to update.
|
||||
// The scene's name field is used to specify the resource to update.
|
||||
Scene scene = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The list of fields to update.
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
// DeleteSceneRequest is the request message for DeleteScene RPC.
|
||||
message DeleteSceneRequest {
|
||||
// The resource name of the scene to delete.
|
||||
// Format: stories/{story}/scenes/{scene}
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {type: "webstory.googleapis.com/Scene"}
|
||||
];
|
||||
}
|
||||
|
||||
// Actor represents an actor resource in the webstory service.
|
||||
message Actor {
|
||||
option (google.api.resource) = {
|
||||
type: "webstory.googleapis.com/Actor"
|
||||
pattern: "stories/{story}/actors/{actor}"
|
||||
plural: "actors"
|
||||
};
|
||||
|
||||
// The resource name of the actor.
|
||||
// Format: stories/{story}/actors/{actor}
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = OUTPUT_ONLY,
|
||||
(google.api.field_behavior) = IDENTIFIER
|
||||
];
|
||||
|
||||
// The ID of the actor, used as the final component of the resource name.
|
||||
string actor_id = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The name of the actor.
|
||||
string name_value = 3 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The role or character name this actor plays in the story.
|
||||
string role = 4;
|
||||
|
||||
// Optional notes about the actor.
|
||||
string notes = 5;
|
||||
|
||||
// Output only. The time when the actor was created.
|
||||
google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// Output only. The time when the actor was last updated.
|
||||
google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// Output only. The version of the actor for concurrency control.
|
||||
string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
}
|
||||
|
||||
// GetActorRequest is the request message for GetActor RPC.
|
||||
message GetActorRequest {
|
||||
// The resource name of the actor to retrieve.
|
||||
// Format: stories/{story}/actors/{actor}
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {type: "webstory.googleapis.com/Actor"}
|
||||
];
|
||||
}
|
||||
|
||||
// ListActorsRequest is the request message for ListActors RPC.
|
||||
message ListActorsRequest {
|
||||
// The parent story that owns this collection of actors.
|
||||
// Format: stories/{story}
|
||||
string parent = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The maximum number of actors to return. The service may return fewer than
|
||||
// this value. If unspecified, at most 50 actors will be returned.
|
||||
// The maximum value is 1000; values above 1000 will be coerced to 1000.
|
||||
int32 page_size = 2;
|
||||
|
||||
// A page token, received from a previous ListActors call.
|
||||
// Provide this to retrieve the subsequent page.
|
||||
// When paginating, all other parameters provided to ListActors must match
|
||||
// the call that provided the page token.
|
||||
string page_token = 3;
|
||||
|
||||
// Optional. A filter expression that filters the actors listed in the response.
|
||||
// Supported fields: name_value, role.
|
||||
// Example: role:"protagonist"
|
||||
string filter = 4;
|
||||
|
||||
// Optional. The field to order the results by.
|
||||
// Supported fields: name_value, create_time.
|
||||
// Default: name_value (ascending order).
|
||||
string order_by = 5;
|
||||
}
|
||||
|
||||
// ListActorsResponse is the response message for ListActors RPC.
|
||||
message ListActorsResponse {
|
||||
// The list of actors.
|
||||
repeated Actor actors = 1;
|
||||
|
||||
// A token, which can be sent as page_token to retrieve the next page.
|
||||
// If this field is omitted, there are no subsequent pages.
|
||||
string next_page_token = 2;
|
||||
|
||||
// The total number of actors matching the filter.
|
||||
// This value may be an estimate.
|
||||
int32 total_size = 3;
|
||||
}
|
||||
|
||||
// CreateActorRequest is the request message for CreateActor RPC.
|
||||
message CreateActorRequest {
|
||||
// The parent story where this actor will be created.
|
||||
// Format: stories/{story}
|
||||
string parent = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The ID to use for the actor, which will become the final component of
|
||||
// the actor's resource name.
|
||||
// This value should be 4-63 characters, and valid characters are
|
||||
// /[a-z][0-9]-/.
|
||||
string actor_id = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The actor to create.
|
||||
Actor actor = 3 [(google.api.field_behavior) = REQUIRED];
|
||||
}
|
||||
|
||||
// UpdateActorRequest is the request message for UpdateActor RPC.
|
||||
message UpdateActorRequest {
|
||||
// The actor to update.
|
||||
// The actor's name field is used to specify the resource to update.
|
||||
Actor actor = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// The list of fields to update.
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
// DeleteActorRequest is the request message for DeleteActor RPC.
|
||||
message DeleteActorRequest {
|
||||
// The resource name of the actor to delete.
|
||||
// Format: stories/{story}/actors/{actor}
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {type: "webstory.googleapis.com/Actor"}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user