• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17import "google/api/annotations.proto";
18import "google/api/client.proto";
19import "google/api/field_behavior.proto";
20
21package google.bookshop.v1beta1;
22
23option go_package = "github.com/googleapis/gapic-showcase/server/genproto";
24option java_package = "com.google.bookshop.v1beta1";
25option java_outer_classname = "BookshopProto";
26option java_multiple_files = true;
27
28// Exercises name conflict behavior in Java.
29service Bookshop {
30  // This service is meant to only run locally on the port 7469 (keypad digits
31  // for "book").
32  option (google.api.default_host) = "localhost:2665";
33  option (google.api.oauth_scopes) =
34      "https://www.googleapis.com/auth/cloud-platform";
35
36  // This method simply echos the request. This method is showcases unary rpcs.
37  rpc GetBook(GetBookRequest) returns (Book) {
38    option (google.api.http) = {
39      post: "/v1beta1/echo:echo"
40      body: "*"
41    };
42    option (google.api.method_signature) = "books_count,books";
43    option (google.api.method_signature) = "books_list,books";
44  }
45}
46
47message GetBookRequest {
48  // The number of books.
49  int32 books_count = 1;
50
51  // The name of the book list.
52  string books_list = 2;
53
54  // The books.
55  repeated Book books = 3;
56}
57
58message Book {
59  // The bookk title.
60  string title = 1;
61}
62