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/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/gaming/v1/common.proto";
22import "google/protobuf/field_mask.proto";
23import "google/protobuf/timestamp.proto";
24
25option go_package = "cloud.google.com/go/gaming/apiv1/gamingpb;gamingpb";
26option java_multiple_files = true;
27option java_package = "com.google.cloud.gaming.v1";
28
29// Request message for RealmsService.ListRealms.
30message ListRealmsRequest {
31  // Required. The parent resource name, in the following form:
32  // `projects/{project}/locations/{location}`.
33  string parent = 1 [
34    (google.api.field_behavior) = REQUIRED,
35    (google.api.resource_reference) = {
36      child_type: "gameservices.googleapis.com/Realm"
37    }
38  ];
39
40  // Optional. The maximum number of items to return.  If unspecified, server
41  // will pick an appropriate default. Server may return fewer items than
42  // requested. A caller should only rely on response's
43  // [next_page_token][google.cloud.gaming.v1.ListRealmsResponse.next_page_token] to
44  // determine if there are more realms left to be queried.
45  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
46
47  // Optional. The next_page_token value returned from a previous List request,
48  // if any.
49  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
50
51  // Optional. The filter to apply to list results.
52  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
53
54  // Optional. Specifies the ordering of results following syntax at
55  // https://cloud.google.com/apis/design/design_patterns#sorting_order.
56  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
57}
58
59// Response message for RealmsService.ListRealms.
60message ListRealmsResponse {
61  // The list of realms.
62  repeated Realm realms = 1;
63
64  // Token to retrieve the next page of results, or empty if there are no more
65  // results in the list.
66  string next_page_token = 2;
67
68  // List of locations that could not be reached.
69  repeated string unreachable = 3;
70}
71
72// Request message for RealmsService.GetRealm.
73message GetRealmRequest {
74  // Required. The name of the realm to retrieve, in the following form:
75  // `projects/{project}/locations/{location}/realms/{realm}`.
76  string name = 1 [
77    (google.api.field_behavior) = REQUIRED,
78    (google.api.resource_reference) = {
79      type: "gameservices.googleapis.com/Realm"
80    }
81  ];
82}
83
84// Request message for RealmsService.CreateRealm.
85message CreateRealmRequest {
86  // Required. The parent resource name, in the following form:
87  // `projects/{project}/locations/{location}`.
88  string parent = 1 [
89    (google.api.field_behavior) = REQUIRED,
90    (google.api.resource_reference) = {
91      child_type: "gameservices.googleapis.com/Realm"
92    }
93  ];
94
95  // Required. The ID of the realm resource to be created.
96  string realm_id = 2 [(google.api.field_behavior) = REQUIRED];
97
98  // Required. The realm resource to be created.
99  Realm realm = 3 [(google.api.field_behavior) = REQUIRED];
100}
101
102// Request message for RealmsService.DeleteRealm.
103message DeleteRealmRequest {
104  // Required. The name of the realm to delete, in the following form:
105  // `projects/{project}/locations/{location}/realms/{realm}`.
106  string name = 1 [
107    (google.api.field_behavior) = REQUIRED,
108    (google.api.resource_reference) = {
109      type: "gameservices.googleapis.com/Realm"
110    }
111  ];
112}
113
114// Request message for RealmsService.UpdateRealm.
115message UpdateRealmRequest {
116  // Required. The realm to be updated.
117  // Only fields specified in update_mask are updated.
118  Realm realm = 1 [(google.api.field_behavior) = REQUIRED];
119
120  // Required. The update mask applies to the resource. For the `FieldMask`
121  // definition, see
122  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
123  google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
124}
125
126// Request message for RealmsService.PreviewRealmUpdate.
127message PreviewRealmUpdateRequest {
128  // Required. The realm to be updated.
129  // Only fields specified in update_mask are updated.
130  Realm realm = 1 [(google.api.field_behavior) = REQUIRED];
131
132  // Required. The update mask applies to the resource. For the `FieldMask`
133  // definition, see
134  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
135  google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
136
137  // Optional. The target timestamp to compute the preview.
138  google.protobuf.Timestamp preview_time = 3 [(google.api.field_behavior) = OPTIONAL];
139}
140
141// Response message for RealmsService.PreviewRealmUpdate.
142message PreviewRealmUpdateResponse {
143  // ETag of the realm.
144  string etag = 2;
145
146  // The target state.
147  TargetState target_state = 3;
148}
149
150// A realm resource.
151message Realm {
152  option (google.api.resource) = {
153    type: "gameservices.googleapis.com/Realm"
154    pattern: "projects/{project}/locations/{location}/realms/{realm}"
155  };
156
157  // The resource name of the realm, in the following form:
158  // `projects/{project}/locations/{location}/realms/{realm}`. For
159  // example, `projects/my-project/locations/{location}/realms/my-realm`.
160  string name = 1;
161
162  // Output only. The creation time.
163  google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
164
165  // Output only. The last-modified time.
166  google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
167
168  // The labels associated with this realm. Each label is a key-value pair.
169  map<string, string> labels = 4;
170
171  // Required. Time zone where all policies targeting this realm are evaluated. The value
172  // of this field must be from the IANA time zone database:
173  // https://www.iana.org/time-zones.
174  string time_zone = 6 [(google.api.field_behavior) = REQUIRED];
175
176  // ETag of the resource.
177  string etag = 7;
178
179  // Human readable description of the realm.
180  string description = 8;
181}
182