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//     http://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
17package google.cloud.gaming.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/cloud/gaming/v1/realms.proto";
22import "google/longrunning/operations.proto";
23
24option go_package = "cloud.google.com/go/gaming/apiv1/gamingpb;gamingpb";
25option java_multiple_files = true;
26option java_package = "com.google.cloud.gaming.v1";
27
28// A realm is a grouping of game server clusters that are considered
29// interchangeable.
30service RealmsService {
31  option (google.api.default_host) = "gameservices.googleapis.com";
32  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
33
34  // Lists realms in a given project and location.
35  rpc ListRealms(ListRealmsRequest) returns (ListRealmsResponse) {
36    option (google.api.http) = {
37      get: "/v1/{parent=projects/*/locations/*}/realms"
38    };
39    option (google.api.method_signature) = "parent";
40  }
41
42  // Gets details of a single realm.
43  rpc GetRealm(GetRealmRequest) returns (Realm) {
44    option (google.api.http) = {
45      get: "/v1/{name=projects/*/locations/*/realms/*}"
46    };
47    option (google.api.method_signature) = "name";
48  }
49
50  // Creates a new realm in a given project and location.
51  rpc CreateRealm(CreateRealmRequest) returns (google.longrunning.Operation) {
52    option (google.api.http) = {
53      post: "/v1/{parent=projects/*/locations/*}/realms"
54      body: "realm"
55    };
56    option (google.api.method_signature) = "parent,realm,realm_id";
57    option (google.longrunning.operation_info) = {
58      response_type: "Realm"
59      metadata_type: "OperationMetadata"
60    };
61  }
62
63  // Deletes a single realm.
64  rpc DeleteRealm(DeleteRealmRequest) returns (google.longrunning.Operation) {
65    option (google.api.http) = {
66      delete: "/v1/{name=projects/*/locations/*/realms/*}"
67    };
68    option (google.api.method_signature) = "name";
69    option (google.longrunning.operation_info) = {
70      response_type: "google.protobuf.Empty"
71      metadata_type: "OperationMetadata"
72    };
73  }
74
75  // Patches a single realm.
76  rpc UpdateRealm(UpdateRealmRequest) returns (google.longrunning.Operation) {
77    option (google.api.http) = {
78      patch: "/v1/{realm.name=projects/*/locations/*/realms/*}"
79      body: "realm"
80    };
81    option (google.api.method_signature) = "realm,update_mask";
82    option (google.longrunning.operation_info) = {
83      response_type: "Realm"
84      metadata_type: "OperationMetadata"
85    };
86  }
87
88  // Previews patches to a single realm.
89  rpc PreviewRealmUpdate(PreviewRealmUpdateRequest) returns (PreviewRealmUpdateResponse) {
90    option (google.api.http) = {
91      patch: "/v1/{realm.name=projects/*/locations/*/realms/*}:previewUpdate"
92      body: "realm"
93    };
94  }
95}
96