1// Copyright 2015 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        v3.12.2
19// source: google/api/context.proto
20
21package serviceconfig
22
23import (
24	reflect "reflect"
25	sync "sync"
26
27	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
28	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
29)
30
31const (
32	// Verify that this generated code is sufficiently up-to-date.
33	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
34	// Verify that runtime/protoimpl is sufficiently up-to-date.
35	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
36)
37
38// `Context` defines which contexts an API requests.
39//
40// Example:
41//
42//     context:
43//       rules:
44//       - selector: "*"
45//         requested:
46//         - google.rpc.context.ProjectContext
47//         - google.rpc.context.OriginContext
48//
49// The above specifies that all methods in the API request
50// `google.rpc.context.ProjectContext` and
51// `google.rpc.context.OriginContext`.
52//
53// Available context types are defined in package
54// `google.rpc.context`.
55//
56// This also provides mechanism to allowlist any protobuf message extension that
57// can be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and
58// “x-goog-ext-<extension_id>-jspb” format. For example, list any service
59// specific protobuf types that can appear in grpc metadata as follows in your
60// yaml file:
61//
62// Example:
63//
64//     context:
65//       rules:
66//        - selector: "google.example.library.v1.LibraryService.CreateBook"
67//          allowed_request_extensions:
68//          - google.foo.v1.NewExtension
69//          allowed_response_extensions:
70//          - google.foo.v1.NewExtension
71//
72// You can also specify extension ID instead of fully qualified extension name
73// here.
74type Context struct {
75	state         protoimpl.MessageState
76	sizeCache     protoimpl.SizeCache
77	unknownFields protoimpl.UnknownFields
78
79	// A list of RPC context rules that apply to individual API methods.
80	//
81	// **NOTE:** All service configuration rules follow "last one wins" order.
82	Rules []*ContextRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
83}
84
85func (x *Context) Reset() {
86	*x = Context{}
87	if protoimpl.UnsafeEnabled {
88		mi := &file_google_api_context_proto_msgTypes[0]
89		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
90		ms.StoreMessageInfo(mi)
91	}
92}
93
94func (x *Context) String() string {
95	return protoimpl.X.MessageStringOf(x)
96}
97
98func (*Context) ProtoMessage() {}
99
100func (x *Context) ProtoReflect() protoreflect.Message {
101	mi := &file_google_api_context_proto_msgTypes[0]
102	if protoimpl.UnsafeEnabled && x != nil {
103		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
104		if ms.LoadMessageInfo() == nil {
105			ms.StoreMessageInfo(mi)
106		}
107		return ms
108	}
109	return mi.MessageOf(x)
110}
111
112// Deprecated: Use Context.ProtoReflect.Descriptor instead.
113func (*Context) Descriptor() ([]byte, []int) {
114	return file_google_api_context_proto_rawDescGZIP(), []int{0}
115}
116
117func (x *Context) GetRules() []*ContextRule {
118	if x != nil {
119		return x.Rules
120	}
121	return nil
122}
123
124// A context rule provides information about the context for an individual API
125// element.
126type ContextRule struct {
127	state         protoimpl.MessageState
128	sizeCache     protoimpl.SizeCache
129	unknownFields protoimpl.UnknownFields
130
131	// Selects the methods to which this rule applies.
132	//
133	// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
134	Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
135	// A list of full type names of requested contexts.
136	Requested []string `protobuf:"bytes,2,rep,name=requested,proto3" json:"requested,omitempty"`
137	// A list of full type names of provided contexts.
138	Provided []string `protobuf:"bytes,3,rep,name=provided,proto3" json:"provided,omitempty"`
139	// A list of full type names or extension IDs of extensions allowed in grpc
140	// side channel from client to backend.
141	AllowedRequestExtensions []string `protobuf:"bytes,4,rep,name=allowed_request_extensions,json=allowedRequestExtensions,proto3" json:"allowed_request_extensions,omitempty"`
142	// A list of full type names or extension IDs of extensions allowed in grpc
143	// side channel from backend to client.
144	AllowedResponseExtensions []string `protobuf:"bytes,5,rep,name=allowed_response_extensions,json=allowedResponseExtensions,proto3" json:"allowed_response_extensions,omitempty"`
145}
146
147func (x *ContextRule) Reset() {
148	*x = ContextRule{}
149	if protoimpl.UnsafeEnabled {
150		mi := &file_google_api_context_proto_msgTypes[1]
151		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
152		ms.StoreMessageInfo(mi)
153	}
154}
155
156func (x *ContextRule) String() string {
157	return protoimpl.X.MessageStringOf(x)
158}
159
160func (*ContextRule) ProtoMessage() {}
161
162func (x *ContextRule) ProtoReflect() protoreflect.Message {
163	mi := &file_google_api_context_proto_msgTypes[1]
164	if protoimpl.UnsafeEnabled && x != nil {
165		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
166		if ms.LoadMessageInfo() == nil {
167			ms.StoreMessageInfo(mi)
168		}
169		return ms
170	}
171	return mi.MessageOf(x)
172}
173
174// Deprecated: Use ContextRule.ProtoReflect.Descriptor instead.
175func (*ContextRule) Descriptor() ([]byte, []int) {
176	return file_google_api_context_proto_rawDescGZIP(), []int{1}
177}
178
179func (x *ContextRule) GetSelector() string {
180	if x != nil {
181		return x.Selector
182	}
183	return ""
184}
185
186func (x *ContextRule) GetRequested() []string {
187	if x != nil {
188		return x.Requested
189	}
190	return nil
191}
192
193func (x *ContextRule) GetProvided() []string {
194	if x != nil {
195		return x.Provided
196	}
197	return nil
198}
199
200func (x *ContextRule) GetAllowedRequestExtensions() []string {
201	if x != nil {
202		return x.AllowedRequestExtensions
203	}
204	return nil
205}
206
207func (x *ContextRule) GetAllowedResponseExtensions() []string {
208	if x != nil {
209		return x.AllowedResponseExtensions
210	}
211	return nil
212}
213
214var File_google_api_context_proto protoreflect.FileDescriptor
215
216var file_google_api_context_proto_rawDesc = []byte{
217	0x0a, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e,
218	0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67,
219	0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x38, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
220	0x74, 0x12, 0x2d, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
221	0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f,
222	0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73,
223	0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x75, 0x6c, 0x65,
224	0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
225	0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09,
226	0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
227	0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72,
228	0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72,
229	0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x1a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65,
230	0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
231	0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x18, 0x61, 0x6c, 0x6c, 0x6f,
232	0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
233	0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x1b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f,
234	0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
235	0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
236	0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
237	0x69, 0x6f, 0x6e, 0x73, 0x42, 0x6e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
238	0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50,
239	0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67,
240	0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f,
241	0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70,
242	0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3b,
243	0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0xa2, 0x02, 0x04,
244	0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
245}
246
247var (
248	file_google_api_context_proto_rawDescOnce sync.Once
249	file_google_api_context_proto_rawDescData = file_google_api_context_proto_rawDesc
250)
251
252func file_google_api_context_proto_rawDescGZIP() []byte {
253	file_google_api_context_proto_rawDescOnce.Do(func() {
254		file_google_api_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_context_proto_rawDescData)
255	})
256	return file_google_api_context_proto_rawDescData
257}
258
259var file_google_api_context_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
260var file_google_api_context_proto_goTypes = []interface{}{
261	(*Context)(nil),     // 0: google.api.Context
262	(*ContextRule)(nil), // 1: google.api.ContextRule
263}
264var file_google_api_context_proto_depIdxs = []int32{
265	1, // 0: google.api.Context.rules:type_name -> google.api.ContextRule
266	1, // [1:1] is the sub-list for method output_type
267	1, // [1:1] is the sub-list for method input_type
268	1, // [1:1] is the sub-list for extension type_name
269	1, // [1:1] is the sub-list for extension extendee
270	0, // [0:1] is the sub-list for field type_name
271}
272
273func init() { file_google_api_context_proto_init() }
274func file_google_api_context_proto_init() {
275	if File_google_api_context_proto != nil {
276		return
277	}
278	if !protoimpl.UnsafeEnabled {
279		file_google_api_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
280			switch v := v.(*Context); i {
281			case 0:
282				return &v.state
283			case 1:
284				return &v.sizeCache
285			case 2:
286				return &v.unknownFields
287			default:
288				return nil
289			}
290		}
291		file_google_api_context_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
292			switch v := v.(*ContextRule); i {
293			case 0:
294				return &v.state
295			case 1:
296				return &v.sizeCache
297			case 2:
298				return &v.unknownFields
299			default:
300				return nil
301			}
302		}
303	}
304	type x struct{}
305	out := protoimpl.TypeBuilder{
306		File: protoimpl.DescBuilder{
307			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
308			RawDescriptor: file_google_api_context_proto_rawDesc,
309			NumEnums:      0,
310			NumMessages:   2,
311			NumExtensions: 0,
312			NumServices:   0,
313		},
314		GoTypes:           file_google_api_context_proto_goTypes,
315		DependencyIndexes: file_google_api_context_proto_depIdxs,
316		MessageInfos:      file_google_api_context_proto_msgTypes,
317	}.Build()
318	File_google_api_context_proto = out.File
319	file_google_api_context_proto_rawDesc = nil
320	file_google_api_context_proto_goTypes = nil
321	file_google_api_context_proto_depIdxs = nil
322}
323