1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.essentialcontacts.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/essentialcontacts/v1/enums.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/essentialcontacts/v1;essentialcontacts";
option java_multiple_files = true;
option java_package = "com.google.cloud.essentialcontacts.v1";
option csharp_namespace = "Google.Cloud.EssentialContacts.V1";
option php_namespace = "Google\\Cloud\\EssentialContacts\\V1";
option ruby_package = "Google::Cloud::EssentialContacts::V1";
// Manages contacts for important Google Cloud notifications.
service EssentialContactsService {
option (google.api.default_host) = "essentialcontacts.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Adds a new contact for a resource.
rpc CreateContact(CreateContactRequest) returns (Contact) {
option (google.api.http) = {
post: "/v1/{parent=projects/*}/contacts"
body: "contact"
additional_bindings {
post: "/v1/{parent=folders/*}/contacts"
body: "contact"
}
additional_bindings {
post: "/v1/{parent=organizations/*}/contacts"
body: "contact"
}
};
option (google.api.method_signature) = "parent,contact";
}
// Updates a contact.
// Note: A contact's email address cannot be changed.
rpc UpdateContact(UpdateContactRequest) returns (Contact) {
option (google.api.http) = {
patch: "/v1/{contact.name=projects/*/contacts/*}"
body: "contact"
additional_bindings {
patch: "/v1/{contact.name=folders/*/contacts/*}"
body: "contact"
}
additional_bindings {
patch: "/v1/{contact.name=organizations/*/contacts/*}"
body: "contact"
}
};
option (google.api.method_signature) = "contact,update_mask";
}
// Lists the contacts that have been set on a resource.
rpc ListContacts(ListContactsRequest) returns (ListContactsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*}/contacts"
additional_bindings { get: "/v1/{parent=folders/*}/contacts" }
additional_bindings { get: "/v1/{parent=organizations/*}/contacts" }
};
option (google.api.method_signature) = "parent";
}
// Gets a single contact.
rpc GetContact(GetContactRequest) returns (Contact) {
option (google.api.http) = {
get: "/v1/{name=projects/*/contacts/*}"
additional_bindings { get: "/v1/{name=folders/*/contacts/*}" }
additional_bindings { get: "/v1/{name=organizations/*/contacts/*}" }
};
option (google.api.method_signature) = "name";
}
// Deletes a contact.
rpc DeleteContact(DeleteContactRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/contacts/*}"
additional_bindings { delete: "/v1/{name=folders/*/contacts/*}" }
additional_bindings { delete: "/v1/{name=organizations/*/contacts/*}" }
};
option (google.api.method_signature) = "name";
}
// Lists all contacts for the resource that are subscribed to the
// specified notification categories, including contacts inherited from
// any parent resources.
rpc ComputeContacts(ComputeContactsRequest)
returns (ComputeContactsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*}/contacts:compute"
additional_bindings { get: "/v1/{parent=folders/*}/contacts:compute" }
additional_bindings {
get: "/v1/{parent=organizations/*}/contacts:compute"
}
};
}
// Allows a contact admin to send a test message to contact to verify that it
// has been configured correctly.
rpc SendTestMessage(SendTestMessageRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{resource=projects/*}/contacts:sendTestMessage"
body: "*"
additional_bindings {
post: "/v1/{resource=folders/*}/contacts:sendTestMessage"
body: "*"
}
additional_bindings {
post: "/v1/{resource=organizations/*}/contacts:sendTestMessage"
body: "*"
}
};
}
}
// A contact that will receive notifications from Google Cloud.
message Contact {
option (google.api.resource) = {
type: "essentialcontacts.googleapis.com/Contact"
pattern: "projects/{project}/contacts/{contact}"
pattern: "folders/{folder}/contacts/{contact}"
pattern: "organizations/{organization}/contacts/{contact}"
};
// The identifier for the contact.
// Format: {resource_type}/{resource_id}/contacts/{contact_id}
string name = 1;
// Required. The email address to send notifications to. This does not need to
// be a Google account.
string email = 2;
// The categories of notifications that the contact will receive
// communications for.
repeated NotificationCategory notification_category_subscriptions = 3;
// The preferred language for notifications, as a ISO 639-1 language code. See
// [Supported
// languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
// for a list of supported languages.
string language_tag = 4;
// The validity of the contact. A contact is considered valid if it is the
// correct recipient for notifications for a particular resource.
ValidationState validation_state = 8;
// The last time the validation_state was updated, either manually or
// automatically. A contact is considered stale if its validation state was
// updated more than 1 year ago.
google.protobuf.Timestamp validate_time = 9;
}
// Request message for the ListContacts method.
message ListContactsRequest {
// Required. The parent resource name.
// Format: organizations/{organization_id}, folders/{folder_id} or
// projects/{project_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "essentialcontacts.googleapis.com/Contact"
}
];
// Optional. The maximum number of results to return from this request.
// Non-positive values are ignored. The presence of `next_page_token` in the
// response indicates that more results might be available.
// If not specified, the default page_size is 100.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. If present, retrieves the next batch of results from the
// preceding call to this method. `page_token` must be the value of
// `next_page_token` from the previous response. The values of other method
// parameters should be identical to those in the previous call.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}
// Response message for the ListContacts method.
message ListContactsResponse {
// The contacts for the specified resource.
repeated Contact contacts = 1;
// If there are more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token` and the
// rest of the parameters the same as the original request.
string next_page_token = 2;
}
// Request message for the GetContact method.
message GetContactRequest {
// Required. The name of the contact to retrieve.
// Format: organizations/{organization_id}/contacts/{contact_id},
// folders/{folder_id}/contacts/{contact_id} or
// projects/{project_id}/contacts/{contact_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "essentialcontacts.googleapis.com/Contact"
}
];
}
// Request message for the DeleteContact method.
message DeleteContactRequest {
// Required. The name of the contact to delete.
// Format: organizations/{organization_id}/contacts/{contact_id},
// folders/{folder_id}/contacts/{contact_id} or
// projects/{project_id}/contacts/{contact_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "essentialcontacts.googleapis.com/Contact"
}
];
}
// Request message for the CreateContact method.
message CreateContactRequest {
// Required. The resource to save this contact for.
// Format: organizations/{organization_id}, folders/{folder_id} or
// projects/{project_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "essentialcontacts.googleapis.com/Contact"
}
];
// Required. The contact to create. Must specify an email address and language
// tag.
Contact contact = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for the UpdateContact method.
message UpdateContactRequest {
// Required. The contact resource to replace the existing saved contact. Note:
// the email address of the contact cannot be modified.
Contact contact = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. The update mask applied to the resource. For the `FieldMask`
// definition, see
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
google.protobuf.FieldMask update_mask = 3
[(google.api.field_behavior) = OPTIONAL];
}
// Request message for the ComputeContacts method.
message ComputeContactsRequest {
// Required. The name of the resource to compute contacts for.
// Format: organizations/{organization_id},
// folders/{folder_id} or projects/{project_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "essentialcontacts.googleapis.com/Contact"
}
];
// The categories of notifications to compute contacts for. If ALL is included
// in this list, contacts subscribed to any notification category will be
// returned.
repeated NotificationCategory notification_categories = 6;
// Optional. The maximum number of results to return from this request.
// Non-positive values are ignored. The presence of `next_page_token` in the
// response indicates that more results might be available.
// If not specified, the default page_size is 100.
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. If present, retrieves the next batch of results from the
// preceding call to this method. `page_token` must be the value of
// `next_page_token` from the previous response. The values of other method
// parameters should be identical to those in the previous call.
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
}
// Response message for the ComputeContacts method.
message ComputeContactsResponse {
// All contacts for the resource that are subscribed to the specified
// notification categories, including contacts inherited from any parent
// resources.
repeated Contact contacts = 1;
// If there are more results than those appearing in this response, then
// `next_page_token` is included. To get the next set of results, call this
// method again using the value of `next_page_token` as `page_token` and the
// rest of the parameters the same as the original request.
string next_page_token = 2;
}
// Request message for the SendTestMessage method.
message SendTestMessageRequest {
// Required. The list of names of the contacts to send a test message to.
// Format: organizations/{organization_id}/contacts/{contact_id},
// folders/{folder_id}/contacts/{contact_id} or
// projects/{project_id}/contacts/{contact_id}
repeated string contacts = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "essentialcontacts.googleapis.com/Contact"
}
];
// Required. The name of the resource to send the test message for. All
// contacts must either be set directly on this resource or inherited from
// another resource that is an ancestor of this one. Format:
// organizations/{organization_id}, folders/{folder_id} or
// projects/{project_id}
string resource = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "essentialcontacts.googleapis.com/Contact"
}
];
// Required. The notification category to send the test message for. All
// contacts must be subscribed to this category.
NotificationCategory notification_category = 3
[(google.api.field_behavior) = REQUIRED];
}
|