Debian Codegraph @

googleapis/apps/drive/labels/v2/label_permission.pb.go

raw symbols SCIP
1 // Copyright 2025 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
15 // Code generated by protoc-gen-go. DO NOT EDIT.
16 // versions:
17 // protoc-gen-go v1.26.0
18 // protoc v4.24.4
19 // source: google/apps/drive/labels/v2/label_permission.proto
20
21 package labels
22
23 import (
24 reflect "reflect"
25 sync "sync"
26
27 _ "google.golang.org/genproto/googleapis/api/annotations"
28 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
29 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
30 )
31
32 const (
33 // Verify that this generated code is sufficiently up-to-date.
34 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
35 // Verify that runtime/protoimpl is sufficiently up-to-date.
36 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
37 )
38
39 // Roles are concentric with subsequent role.
40 type LabelPermission_LabelRole int32
41
42 const (
43 // Unknown role.
44 LabelPermission_LABEL_ROLE_UNSPECIFIED LabelPermission_LabelRole = 0
45 // A reader can read the label and associated metadata applied to Drive
46 // items.
47 LabelPermission_READER LabelPermission_LabelRole = 1
48 // An applier can write associated metadata on Drive items in which they
49 // also have write access to. Implies `READER`.
50 LabelPermission_APPLIER LabelPermission_LabelRole = 2
51 // An organizer can pin this label in shared drives they manage
52 // and add new appliers to the label.
53 LabelPermission_ORGANIZER LabelPermission_LabelRole = 3
54 // Editors can make any update including deleting the label which
55 // also deletes the associated Drive item metadata. Implies `APPLIER`.
56 LabelPermission_EDITOR LabelPermission_LabelRole = 4
57 )
58
59 // Enum value maps for LabelPermission_LabelRole.
60 var (
61 LabelPermission_LabelRole_name = map[int32]string{
62 0: "LABEL_ROLE_UNSPECIFIED",
63 1: "READER",
64 2: "APPLIER",
65 3: "ORGANIZER",
66 4: "EDITOR",
67 }
68 LabelPermission_LabelRole_value = map[string]int32{
69 "LABEL_ROLE_UNSPECIFIED": 0,
70 "READER": 1,
71 "APPLIER": 2,
72 "ORGANIZER": 3,
73 "EDITOR": 4,
74 }
75 )
76
77 func (x LabelPermission_LabelRole) Enum() *LabelPermission_LabelRole {
78 p := new(LabelPermission_LabelRole)
79 *p = x
80 return p
81 }
82
83 func (x LabelPermission_LabelRole) String() string {
84 return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
85 }
86
87 func (LabelPermission_LabelRole) Descriptor() protoreflect.EnumDescriptor {
88 return file_google_apps_drive_labels_v2_label_permission_proto_enumTypes[0].Descriptor()
89 }
90
91 func (LabelPermission_LabelRole) Type() protoreflect.EnumType {
92 return &file_google_apps_drive_labels_v2_label_permission_proto_enumTypes[0]
93 }
94
95 func (x LabelPermission_LabelRole) Number() protoreflect.EnumNumber {
96 return protoreflect.EnumNumber(x)
97 }
98
99 // Deprecated: Use LabelPermission_LabelRole.Descriptor instead.
100 func (LabelPermission_LabelRole) EnumDescriptor() ([]byte, []int) {
101 return file_google_apps_drive_labels_v2_label_permission_proto_rawDescGZIP(), []int{0, 0}
102 }
103
104 // The permission that applies to a principal (user, group, audience) on a
105 // label.
106 type LabelPermission struct {
107 state protoimpl.MessageState
108 sizeCache protoimpl.SizeCache
109 unknownFields protoimpl.UnknownFields
110
111 // The principal this permission applies to. Must be either an email, user,
112 // group, or audience.
113 // Example:
114 // * people/12345
115 // * groups/45678
116 // * audiences/default
117 //
118 // Types that are assignable to Principal:
119 //
120 // *LabelPermission_Person
121 // *LabelPermission_Group
122 // *LabelPermission_Audience
123 Principal isLabelPermission_Principal `protobuf_oneof:"principal"`
124 // Resource name of this permission.
125 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
126 // Specifies the email address for a user or group pricinpal. Not populated
127 // for audience principals. User and Group permissions may only be inserted
128 // using email address. On update requests, if email address is specified,
129 // no principal should be specified.
130 Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
131 // The role the principal should have.
132 Role LabelPermission_LabelRole `protobuf:"varint,6,opt,name=role,proto3,enum=google.apps.drive.labels.v2.LabelPermission_LabelRole" json:"role,omitempty"`
133 }
134
135 func (x *LabelPermission) Reset() {
136 *x = LabelPermission{}
137 if protoimpl.UnsafeEnabled {
138 mi := &file_google_apps_drive_labels_v2_label_permission_proto_msgTypes[0]
139 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
140 ms.StoreMessageInfo(mi)
141 }
142 }
143
144 func (x *LabelPermission) String() string {
145 return protoimpl.X.MessageStringOf(x)
146 }
147
148 func (*LabelPermission) ProtoMessage() {}
149
150 func (x *LabelPermission) ProtoReflect() protoreflect.Message {
151 mi := &file_google_apps_drive_labels_v2_label_permission_proto_msgTypes[0]
152 if protoimpl.UnsafeEnabled && x != nil {
153 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
154 if ms.LoadMessageInfo() == nil {
155 ms.StoreMessageInfo(mi)
156 }
157 return ms
158 }
159 return mi.MessageOf(x)
160 }
161
162 // Deprecated: Use LabelPermission.ProtoReflect.Descriptor instead.
163 func (*LabelPermission) Descriptor() ([]byte, []int) {
164 return file_google_apps_drive_labels_v2_label_permission_proto_rawDescGZIP(), []int{0}
165 }
166
167 func (m *LabelPermission) GetPrincipal() isLabelPermission_Principal {
168 if m != nil {
169 return m.Principal
170 }
171 return nil
172 }
173
174 func (x *LabelPermission) GetPerson() string {
175 if x, ok := x.GetPrincipal().(*LabelPermission_Person); ok {
176 return x.Person
177 }
178 return ""
179 }
180
181 func (x *LabelPermission) GetGroup() string {
182 if x, ok := x.GetPrincipal().(*LabelPermission_Group); ok {
183 return x.Group
184 }
185 return ""
186 }
187
188 func (x *LabelPermission) GetAudience() string {
189 if x, ok := x.GetPrincipal().(*LabelPermission_Audience); ok {
190 return x.Audience
191 }
192 return ""
193 }
194
195 func (x *LabelPermission) GetName() string {
196 if x != nil {
197 return x.Name
198 }
199 return ""
200 }
201
202 func (x *LabelPermission) GetEmail() string {
203 if x != nil {
204 return x.Email
205 }
206 return ""
207 }
208
209 func (x *LabelPermission) GetRole() LabelPermission_LabelRole {
210 if x != nil {
211 return x.Role
212 }
213 return LabelPermission_LABEL_ROLE_UNSPECIFIED
214 }
215
216 type isLabelPermission_Principal interface {
217 isLabelPermission_Principal()
218 }
219
220 type LabelPermission_Person struct {
221 // Person resource name.
222 Person string `protobuf:"bytes,3,opt,name=person,proto3,oneof"`
223 }
224
225 type LabelPermission_Group struct {
226 // Group resource name.
227 Group string `protobuf:"bytes,4,opt,name=group,proto3,oneof"`
228 }
229
230 type LabelPermission_Audience struct {
231 // Audience to grant a role to. The magic value of `audiences/default` may
232 // be used to apply the role to the default audience in the context of the
233 // organization that owns the Label.
234 Audience string `protobuf:"bytes,5,opt,name=audience,proto3,oneof"`
235 }
236
237 func (*LabelPermission_Person) isLabelPermission_Principal() {}
238
239 func (*LabelPermission_Group) isLabelPermission_Principal() {}
240
241 func (*LabelPermission_Audience) isLabelPermission_Principal() {}
242
243 var File_google_apps_drive_labels_v2_label_permission_proto protoreflect.FileDescriptor
244
245 var file_google_apps_drive_labels_v2_label_permission_proto_rawDesc = []byte{
246 0x0a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x64, 0x72,
247 0x69, 0x76, 0x65, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x6c, 0x61,
248 0x62, 0x65, 0x6c, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
249 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x70,
250 0x73, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x76,
251 0x32, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65,
252 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x03, 0x0a,
253 0x0f, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
254 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
255 0x42, 0x21, 0xfa, 0x41, 0x1e, 0x0a, 0x1c, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x2e, 0x67, 0x6f,
256 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x65, 0x72,
257 0x73, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x38, 0x0a,
258 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x20, 0xfa, 0x41,
259 0x1d, 0x0a, 0x1b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
260 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x00,
261 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65,
262 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x61, 0x75, 0x64,
263 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
264 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61,
265 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12,
266 0x4a, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e,
267 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x73, 0x2e, 0x64, 0x72, 0x69, 0x76,
268 0x65, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x61, 0x62, 0x65,
269 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x62, 0x65,
270 0x6c, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x5b, 0x0a, 0x09, 0x4c,
271 0x61, 0x62, 0x65, 0x6c, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4c, 0x41, 0x42, 0x45,
272 0x4c, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
273 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x01,
274 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x45, 0x52, 0x10, 0x02, 0x12, 0x0d, 0x0a,
275 0x09, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x45, 0x52, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06,
276 0x45, 0x44, 0x49, 0x54, 0x4f, 0x52, 0x10, 0x04, 0x3a, 0x58, 0xea, 0x41, 0x55, 0x0a, 0x2a, 0x64,
277 0x72, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
278 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50,
279 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x6c, 0x61, 0x62, 0x65, 0x6c,
280 0x73, 0x2f, 0x7b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x7d, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73,
281 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
282 0x6e, 0x7d, 0x42, 0x0b, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x42,
283 0xb3, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
284 0x70, 0x70, 0x73, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73,
285 0x2e, 0x76, 0x32, 0x42, 0x14, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
286 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f,
287 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67,
288 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
289 0x69, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x2f, 0x6c, 0x61,
290 0x62, 0x65, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0xa2, 0x02,
291 0x04, 0x44, 0x4c, 0x42, 0x4c, 0xea, 0x41, 0x2d, 0x0a, 0x1b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73,
292 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
293 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67,
294 0x72, 0x6f, 0x75, 0x70, 0x7d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
295 }
296
297 var (
298 file_google_apps_drive_labels_v2_label_permission_proto_rawDescOnce sync.Once
299 file_google_apps_drive_labels_v2_label_permission_proto_rawDescData = file_google_apps_drive_labels_v2_label_permission_proto_rawDesc
300 )
301
302 func file_google_apps_drive_labels_v2_label_permission_proto_rawDescGZIP() []byte {
303 file_google_apps_drive_labels_v2_label_permission_proto_rawDescOnce.Do(func() {
304 file_google_apps_drive_labels_v2_label_permission_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_apps_drive_labels_v2_label_permission_proto_rawDescData)
305 })
306 return file_google_apps_drive_labels_v2_label_permission_proto_rawDescData
307 }
308
309 var file_google_apps_drive_labels_v2_label_permission_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
310 var file_google_apps_drive_labels_v2_label_permission_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
311 var file_google_apps_drive_labels_v2_label_permission_proto_goTypes = []interface{}{
312 (LabelPermission_LabelRole)(0), // 0: google.apps.drive.labels.v2.LabelPermission.LabelRole
313 (*LabelPermission)(nil), // 1: google.apps.drive.labels.v2.LabelPermission
314 }
315 var file_google_apps_drive_labels_v2_label_permission_proto_depIdxs = []int32{
316 0, // 0: google.apps.drive.labels.v2.LabelPermission.role:type_name -> google.apps.drive.labels.v2.LabelPermission.LabelRole
317 1, // [1:1] is the sub-list for method output_type
318 1, // [1:1] is the sub-list for method input_type
319 1, // [1:1] is the sub-list for extension type_name
320 1, // [1:1] is the sub-list for extension extendee
321 0, // [0:1] is the sub-list for field type_name
322 }
323
324 func init() { file_google_apps_drive_labels_v2_label_permission_proto_init() }
325 func file_google_apps_drive_labels_v2_label_permission_proto_init() {
326 if File_google_apps_drive_labels_v2_label_permission_proto != nil {
327 return
328 }
329 if !protoimpl.UnsafeEnabled {
330 file_google_apps_drive_labels_v2_label_permission_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
331 switch v := v.(*LabelPermission); i {
332 case 0:
333 return &v.state
334 case 1:
335 return &v.sizeCache
336 case 2:
337 return &v.unknownFields
338 default:
339 return nil
340 }
341 }
342 }
343 file_google_apps_drive_labels_v2_label_permission_proto_msgTypes[0].OneofWrappers = []interface{}{
344 (*LabelPermission_Person)(nil),
345 (*LabelPermission_Group)(nil),
346 (*LabelPermission_Audience)(nil),
347 }
348 type x struct{}
349 out := protoimpl.TypeBuilder{
350 File: protoimpl.DescBuilder{
351 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
352 RawDescriptor: file_google_apps_drive_labels_v2_label_permission_proto_rawDesc,
353 NumEnums: 1,
354 NumMessages: 1,
355 NumExtensions: 0,
356 NumServices: 0,
357 },
358 GoTypes: file_google_apps_drive_labels_v2_label_permission_proto_goTypes,
359 DependencyIndexes: file_google_apps_drive_labels_v2_label_permission_proto_depIdxs,
360 EnumInfos: file_google_apps_drive_labels_v2_label_permission_proto_enumTypes,
361 MessageInfos: file_google_apps_drive_labels_v2_label_permission_proto_msgTypes,
362 }.Build()
363 File_google_apps_drive_labels_v2_label_permission_proto = out.File
364 file_google_apps_drive_labels_v2_label_permission_proto_rawDesc = nil
365 file_google_apps_drive_labels_v2_label_permission_proto_goTypes = nil
366 file_google_apps_drive_labels_v2_label_permission_proto_depIdxs = nil
367 }