Debian Codegraph @

googleapis/api/serviceconfig/policy.pb.go

raw
1 // Copyright 2026 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/api/policy.proto
20
21 package serviceconfig
22
23 import (
24 reflect "reflect"
25 sync "sync"
26
27 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
28 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
29 descriptorpb "google.golang.org/protobuf/types/descriptorpb"
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 // Google API Policy Annotation
40 //
41 // This message defines a simple API policy annotation that can be used to
42 // annotate API request and response message fields with applicable policies.
43 // One field may have multiple applicable policies that must all be satisfied
44 // before a request can be processed. This policy annotation is used to
45 // generate the overall policy that will be used for automatic runtime
46 // policy enforcement and documentation generation.
47 type FieldPolicy struct {
48 state protoimpl.MessageState
49 sizeCache protoimpl.SizeCache
50 unknownFields protoimpl.UnknownFields
51
52 // Selects one or more request or response message fields to apply this
53 // `FieldPolicy`.
54 //
55 // When a `FieldPolicy` is used in proto annotation, the selector must
56 // be left as empty. The service config generator will automatically fill
57 // the correct value.
58 //
59 // When a `FieldPolicy` is used in service config, the selector must be a
60 // comma-separated string with valid request or response field paths,
61 // such as "foo.bar" or "foo.bar,foo.baz".
62 Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
63 // Specifies the required permission(s) for the resource referred to by the
64 // field. It requires the field contains a valid resource reference, and
65 // the request must pass the permission checks to proceed. For example,
66 // "resourcemanager.projects.get".
67 ResourcePermission string `protobuf:"bytes,2,opt,name=resource_permission,json=resourcePermission,proto3" json:"resource_permission,omitempty"`
68 // Specifies the resource type for the resource referred to by the field.
69 ResourceType string `protobuf:"bytes,3,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
70 }
71
72 func (x *FieldPolicy) Reset() {
73 *x = FieldPolicy{}
74 if protoimpl.UnsafeEnabled {
75 mi := &file_google_api_policy_proto_msgTypes[0]
76 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
77 ms.StoreMessageInfo(mi)
78 }
79 }
80
81 func (x *FieldPolicy) String() string {
82 return protoimpl.X.MessageStringOf(x)
83 }
84
85 func (*FieldPolicy) ProtoMessage() {}
86
87 func (x *FieldPolicy) ProtoReflect() protoreflect.Message {
88 mi := &file_google_api_policy_proto_msgTypes[0]
89 if protoimpl.UnsafeEnabled && x != nil {
90 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
91 if ms.LoadMessageInfo() == nil {
92 ms.StoreMessageInfo(mi)
93 }
94 return ms
95 }
96 return mi.MessageOf(x)
97 }
98
99 // Deprecated: Use FieldPolicy.ProtoReflect.Descriptor instead.
100 func (*FieldPolicy) Descriptor() ([]byte, []int) {
101 return file_google_api_policy_proto_rawDescGZIP(), []int{0}
102 }
103
104 func (x *FieldPolicy) GetSelector() string {
105 if x != nil {
106 return x.Selector
107 }
108 return ""
109 }
110
111 func (x *FieldPolicy) GetResourcePermission() string {
112 if x != nil {
113 return x.ResourcePermission
114 }
115 return ""
116 }
117
118 func (x *FieldPolicy) GetResourceType() string {
119 if x != nil {
120 return x.ResourceType
121 }
122 return ""
123 }
124
125 // Defines policies applying to an RPC method.
126 type MethodPolicy struct {
127 state protoimpl.MessageState
128 sizeCache protoimpl.SizeCache
129 unknownFields protoimpl.UnknownFields
130
131 // Selects a method to which these policies should be enforced, for example,
132 // "google.pubsub.v1.Subscriber.CreateSubscription".
133 //
134 // Refer to [selector][google.api.DocumentationRule.selector] for syntax
135 // details.
136 //
137 // NOTE: This field must not be set in the proto annotation. It will be
138 // automatically filled by the service config compiler .
139 Selector string `protobuf:"bytes,9,opt,name=selector,proto3" json:"selector,omitempty"`
140 // Policies that are applicable to the request message.
141 RequestPolicies []*FieldPolicy `protobuf:"bytes,2,rep,name=request_policies,json=requestPolicies,proto3" json:"request_policies,omitempty"`
142 }
143
144 func (x *MethodPolicy) Reset() {
145 *x = MethodPolicy{}
146 if protoimpl.UnsafeEnabled {
147 mi := &file_google_api_policy_proto_msgTypes[1]
148 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
149 ms.StoreMessageInfo(mi)
150 }
151 }
152
153 func (x *MethodPolicy) String() string {
154 return protoimpl.X.MessageStringOf(x)
155 }
156
157 func (*MethodPolicy) ProtoMessage() {}
158
159 func (x *MethodPolicy) ProtoReflect() protoreflect.Message {
160 mi := &file_google_api_policy_proto_msgTypes[1]
161 if protoimpl.UnsafeEnabled && x != nil {
162 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
163 if ms.LoadMessageInfo() == nil {
164 ms.StoreMessageInfo(mi)
165 }
166 return ms
167 }
168 return mi.MessageOf(x)
169 }
170
171 // Deprecated: Use MethodPolicy.ProtoReflect.Descriptor instead.
172 func (*MethodPolicy) Descriptor() ([]byte, []int) {
173 return file_google_api_policy_proto_rawDescGZIP(), []int{1}
174 }
175
176 func (x *MethodPolicy) GetSelector() string {
177 if x != nil {
178 return x.Selector
179 }
180 return ""
181 }
182
183 func (x *MethodPolicy) GetRequestPolicies() []*FieldPolicy {
184 if x != nil {
185 return x.RequestPolicies
186 }
187 return nil
188 }
189
190 var file_google_api_policy_proto_extTypes = []protoimpl.ExtensionInfo{
191 {
192 ExtendedType: (*descriptorpb.FieldOptions)(nil),
193 ExtensionType: (*FieldPolicy)(nil),
194 Field: 158361448,
195 Name: "google.api.field_policy",
196 Tag: "bytes,158361448,opt,name=field_policy",
197 Filename: "google/api/policy.proto",
198 },
199 {
200 ExtendedType: (*descriptorpb.MethodOptions)(nil),
201 ExtensionType: (*MethodPolicy)(nil),
202 Field: 161893301,
203 Name: "google.api.method_policy",
204 Tag: "bytes,161893301,opt,name=method_policy",
205 Filename: "google/api/policy.proto",
206 },
207 }
208
209 // Extension fields to descriptorpb.FieldOptions.
210 var (
211 // See [FieldPolicy][].
212 //
213 // optional google.api.FieldPolicy field_policy = 158361448;
214 E_FieldPolicy = &file_google_api_policy_proto_extTypes[0]
215 )
216
217 // Extension fields to descriptorpb.MethodOptions.
218 var (
219 // See [MethodPolicy][].
220 //
221 // optional google.api.MethodPolicy method_policy = 161893301;
222 E_MethodPolicy = &file_google_api_policy_proto_extTypes[1]
223 )
224
225 var File_google_api_policy_proto protoreflect.FileDescriptor
226
227 var file_google_api_policy_proto_rawDesc = []byte{
228 0x0a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6c,
229 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
230 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
231 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
232 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7f, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64,
233 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
234 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
235 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70,
236 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
237 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
238 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f,
239 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f,
240 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6e, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x68,
241 0x6f, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65,
242 0x63, 0x74, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65,
243 0x63, 0x74, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f,
244 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17,
245 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c,
246 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
247 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x3a, 0x5c, 0x0a, 0x0c, 0x66, 0x69, 0x65, 0x6c,
248 0x64, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
249 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64,
250 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe8, 0xce, 0xc1, 0x4b, 0x20, 0x01, 0x28, 0x0b,
251 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69,
252 0x65, 0x6c, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64,
253 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x3a, 0x60, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,
254 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
255 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,
256 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb5, 0x97, 0x99, 0x4d, 0x20, 0x01, 0x28, 0x0b,
257 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65,
258 0x74, 0x68, 0x6f, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x68,
259 0x6f, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x6d, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e,
260 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0b, 0x50, 0x6f, 0x6c, 0x69,
261 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
262 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e,
263 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73,
264 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66,
265 0x69, 0x67, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
266 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
267 }
268
269 var (
270 file_google_api_policy_proto_rawDescOnce sync.Once
271 file_google_api_policy_proto_rawDescData = file_google_api_policy_proto_rawDesc
272 )
273
274 func file_google_api_policy_proto_rawDescGZIP() []byte {
275 file_google_api_policy_proto_rawDescOnce.Do(func() {
276 file_google_api_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_policy_proto_rawDescData)
277 })
278 return file_google_api_policy_proto_rawDescData
279 }
280
281 var file_google_api_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
282 var file_google_api_policy_proto_goTypes = []interface{}{
283 (*FieldPolicy)(nil), // 0: google.api.FieldPolicy
284 (*MethodPolicy)(nil), // 1: google.api.MethodPolicy
285 (*descriptorpb.FieldOptions)(nil), // 2: google.protobuf.FieldOptions
286 (*descriptorpb.MethodOptions)(nil), // 3: google.protobuf.MethodOptions
287 }
288 var file_google_api_policy_proto_depIdxs = []int32{
289 0, // 0: google.api.MethodPolicy.request_policies:type_name -> google.api.FieldPolicy
290 2, // 1: google.api.field_policy:extendee -> google.protobuf.FieldOptions
291 3, // 2: google.api.method_policy:extendee -> google.protobuf.MethodOptions
292 0, // 3: google.api.field_policy:type_name -> google.api.FieldPolicy
293 1, // 4: google.api.method_policy:type_name -> google.api.MethodPolicy
294 5, // [5:5] is the sub-list for method output_type
295 5, // [5:5] is the sub-list for method input_type
296 3, // [3:5] is the sub-list for extension type_name
297 1, // [1:3] is the sub-list for extension extendee
298 0, // [0:1] is the sub-list for field type_name
299 }
300
301 func init() { file_google_api_policy_proto_init() }
302 func file_google_api_policy_proto_init() {
303 if File_google_api_policy_proto != nil {
304 return
305 }
306 if !protoimpl.UnsafeEnabled {
307 file_google_api_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
308 switch v := v.(*FieldPolicy); i {
309 case 0:
310 return &v.state
311 case 1:
312 return &v.sizeCache
313 case 2:
314 return &v.unknownFields
315 default:
316 return nil
317 }
318 }
319 file_google_api_policy_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
320 switch v := v.(*MethodPolicy); i {
321 case 0:
322 return &v.state
323 case 1:
324 return &v.sizeCache
325 case 2:
326 return &v.unknownFields
327 default:
328 return nil
329 }
330 }
331 }
332 type x struct{}
333 out := protoimpl.TypeBuilder{
334 File: protoimpl.DescBuilder{
335 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
336 RawDescriptor: file_google_api_policy_proto_rawDesc,
337 NumEnums: 0,
338 NumMessages: 2,
339 NumExtensions: 2,
340 NumServices: 0,
341 },
342 GoTypes: file_google_api_policy_proto_goTypes,
343 DependencyIndexes: file_google_api_policy_proto_depIdxs,
344 MessageInfos: file_google_api_policy_proto_msgTypes,
345 ExtensionInfos: file_google_api_policy_proto_extTypes,
346 }.Build()
347 File_google_api_policy_proto = out.File
348 file_google_api_policy_proto_rawDesc = nil
349 file_google_api_policy_proto_goTypes = nil
350 file_google_api_policy_proto_depIdxs = nil
351 }