|
| 1 | +// Copyright 2020 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 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +import "google/api/annotations.proto"; |
| 18 | +import "google/api/client.proto"; |
| 19 | +import "google/api/resource.proto"; |
| 20 | +import "google/protobuf/field_mask.proto"; |
| 21 | + |
| 22 | +service Library { |
| 23 | + // Get the configuration for a author. |
| 24 | + rpc GetConfig(GetConfigRequest) returns (Config) { |
| 25 | + option (google.api.http) = { |
| 26 | + get: "/v1/{name=authors/*/config}" |
| 27 | + }; |
| 28 | + option (google.api.method_signature) = "name"; |
| 29 | + } |
| 30 | + |
| 31 | + // Update the configuration for a author. |
| 32 | + rpc UpdateConfig(UpdateConfigRequest) returns (Config) { |
| 33 | + option (google.api.http) = { |
| 34 | + patch: "/v1/{config.name=authors/*/config}" |
| 35 | + body: "config" |
| 36 | + }; |
| 37 | + option (google.api.method_signature) = "config,update_mask"; |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +// Request message to get a author's config. |
| 42 | +message GetConfigRequest { |
| 43 | + // The name of the config. |
| 44 | + // Format: authors/{author}/config |
| 45 | + string name = 1 [(google.api.resource_reference) = { |
| 46 | + type: "library.googleapis.com/Config" |
| 47 | + }]; |
| 48 | +} |
| 49 | + |
| 50 | +// Request message to update a author's config. |
| 51 | +message UpdateConfigRequest { |
| 52 | + // The new config object. |
| 53 | + Config config = 1; |
| 54 | + |
| 55 | + // The list of fields to be updated. |
| 56 | + google.protobuf.FieldMask update_mask = 2; |
| 57 | +} |
| 58 | + |
| 59 | +// The configuration options for a author. |
| 60 | +message Config { |
| 61 | + option (google.api.resource) = { |
| 62 | + type: "library.googleapis.com/Config" |
| 63 | + pattern: "authors/{author}/config" |
| 64 | + }; |
| 65 | + |
| 66 | + // The name of the config. |
| 67 | + // Format: authors/{author}/config |
| 68 | + string name = 1; |
| 69 | + |
| 70 | + // The author's preferred language. |
| 71 | + string language_code = 2; |
| 72 | + |
| 73 | + // The time zone where the author resides. |
| 74 | + string time_zone = 3; |
| 75 | +} |
0 commit comments