...

Source file src/google.golang.org/genproto/googleapis/api/serviceconfig/context.pb.go

Documentation: google.golang.org/genproto/googleapis/api/serviceconfig

     1  // Copyright 2024 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/context.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  )
    30  
    31  const (
    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.
    74  type 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  
    85  func (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  
    94  func (x *Context) String() string {
    95  	return protoimpl.X.MessageStringOf(x)
    96  }
    97  
    98  func (*Context) ProtoMessage() {}
    99  
   100  func (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.
   113  func (*Context) Descriptor() ([]byte, []int) {
   114  	return file_google_api_context_proto_rawDescGZIP(), []int{0}
   115  }
   116  
   117  func (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.
   126  type 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
   134  	// details.
   135  	Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
   136  	// A list of full type names of requested contexts.
   137  	Requested []string `protobuf:"bytes,2,rep,name=requested,proto3" json:"requested,omitempty"`
   138  	// A list of full type names of provided contexts.
   139  	Provided []string `protobuf:"bytes,3,rep,name=provided,proto3" json:"provided,omitempty"`
   140  	// A list of full type names or extension IDs of extensions allowed in grpc
   141  	// side channel from client to backend.
   142  	AllowedRequestExtensions []string `protobuf:"bytes,4,rep,name=allowed_request_extensions,json=allowedRequestExtensions,proto3" json:"allowed_request_extensions,omitempty"`
   143  	// A list of full type names or extension IDs of extensions allowed in grpc
   144  	// side channel from backend to client.
   145  	AllowedResponseExtensions []string `protobuf:"bytes,5,rep,name=allowed_response_extensions,json=allowedResponseExtensions,proto3" json:"allowed_response_extensions,omitempty"`
   146  }
   147  
   148  func (x *ContextRule) Reset() {
   149  	*x = ContextRule{}
   150  	if protoimpl.UnsafeEnabled {
   151  		mi := &file_google_api_context_proto_msgTypes[1]
   152  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   153  		ms.StoreMessageInfo(mi)
   154  	}
   155  }
   156  
   157  func (x *ContextRule) String() string {
   158  	return protoimpl.X.MessageStringOf(x)
   159  }
   160  
   161  func (*ContextRule) ProtoMessage() {}
   162  
   163  func (x *ContextRule) ProtoReflect() protoreflect.Message {
   164  	mi := &file_google_api_context_proto_msgTypes[1]
   165  	if protoimpl.UnsafeEnabled && x != nil {
   166  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   167  		if ms.LoadMessageInfo() == nil {
   168  			ms.StoreMessageInfo(mi)
   169  		}
   170  		return ms
   171  	}
   172  	return mi.MessageOf(x)
   173  }
   174  
   175  // Deprecated: Use ContextRule.ProtoReflect.Descriptor instead.
   176  func (*ContextRule) Descriptor() ([]byte, []int) {
   177  	return file_google_api_context_proto_rawDescGZIP(), []int{1}
   178  }
   179  
   180  func (x *ContextRule) GetSelector() string {
   181  	if x != nil {
   182  		return x.Selector
   183  	}
   184  	return ""
   185  }
   186  
   187  func (x *ContextRule) GetRequested() []string {
   188  	if x != nil {
   189  		return x.Requested
   190  	}
   191  	return nil
   192  }
   193  
   194  func (x *ContextRule) GetProvided() []string {
   195  	if x != nil {
   196  		return x.Provided
   197  	}
   198  	return nil
   199  }
   200  
   201  func (x *ContextRule) GetAllowedRequestExtensions() []string {
   202  	if x != nil {
   203  		return x.AllowedRequestExtensions
   204  	}
   205  	return nil
   206  }
   207  
   208  func (x *ContextRule) GetAllowedResponseExtensions() []string {
   209  	if x != nil {
   210  		return x.AllowedResponseExtensions
   211  	}
   212  	return nil
   213  }
   214  
   215  var File_google_api_context_proto protoreflect.FileDescriptor
   216  
   217  var file_google_api_context_proto_rawDesc = []byte{
   218  	0x0a, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e,
   219  	0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67,
   220  	0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x38, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
   221  	0x74, 0x12, 0x2d, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
   222  	0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f,
   223  	0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73,
   224  	0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x75, 0x6c, 0x65,
   225  	0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
   226  	0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09,
   227  	0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
   228  	0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72,
   229  	0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72,
   230  	0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x1a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65,
   231  	0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
   232  	0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x18, 0x61, 0x6c, 0x6c, 0x6f,
   233  	0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
   234  	0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x1b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f,
   235  	0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
   236  	0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
   237  	0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
   238  	0x69, 0x6f, 0x6e, 0x73, 0x42, 0x6e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
   239  	0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50,
   240  	0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67,
   241  	0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f,
   242  	0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70,
   243  	0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3b,
   244  	0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0xa2, 0x02, 0x04,
   245  	0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   246  }
   247  
   248  var (
   249  	file_google_api_context_proto_rawDescOnce sync.Once
   250  	file_google_api_context_proto_rawDescData = file_google_api_context_proto_rawDesc
   251  )
   252  
   253  func file_google_api_context_proto_rawDescGZIP() []byte {
   254  	file_google_api_context_proto_rawDescOnce.Do(func() {
   255  		file_google_api_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_context_proto_rawDescData)
   256  	})
   257  	return file_google_api_context_proto_rawDescData
   258  }
   259  
   260  var file_google_api_context_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
   261  var file_google_api_context_proto_goTypes = []interface{}{
   262  	(*Context)(nil),     // 0: google.api.Context
   263  	(*ContextRule)(nil), // 1: google.api.ContextRule
   264  }
   265  var file_google_api_context_proto_depIdxs = []int32{
   266  	1, // 0: google.api.Context.rules:type_name -> google.api.ContextRule
   267  	1, // [1:1] is the sub-list for method output_type
   268  	1, // [1:1] is the sub-list for method input_type
   269  	1, // [1:1] is the sub-list for extension type_name
   270  	1, // [1:1] is the sub-list for extension extendee
   271  	0, // [0:1] is the sub-list for field type_name
   272  }
   273  
   274  func init() { file_google_api_context_proto_init() }
   275  func file_google_api_context_proto_init() {
   276  	if File_google_api_context_proto != nil {
   277  		return
   278  	}
   279  	if !protoimpl.UnsafeEnabled {
   280  		file_google_api_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   281  			switch v := v.(*Context); i {
   282  			case 0:
   283  				return &v.state
   284  			case 1:
   285  				return &v.sizeCache
   286  			case 2:
   287  				return &v.unknownFields
   288  			default:
   289  				return nil
   290  			}
   291  		}
   292  		file_google_api_context_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
   293  			switch v := v.(*ContextRule); i {
   294  			case 0:
   295  				return &v.state
   296  			case 1:
   297  				return &v.sizeCache
   298  			case 2:
   299  				return &v.unknownFields
   300  			default:
   301  				return nil
   302  			}
   303  		}
   304  	}
   305  	type x struct{}
   306  	out := protoimpl.TypeBuilder{
   307  		File: protoimpl.DescBuilder{
   308  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   309  			RawDescriptor: file_google_api_context_proto_rawDesc,
   310  			NumEnums:      0,
   311  			NumMessages:   2,
   312  			NumExtensions: 0,
   313  			NumServices:   0,
   314  		},
   315  		GoTypes:           file_google_api_context_proto_goTypes,
   316  		DependencyIndexes: file_google_api_context_proto_depIdxs,
   317  		MessageInfos:      file_google_api_context_proto_msgTypes,
   318  	}.Build()
   319  	File_google_api_context_proto = out.File
   320  	file_google_api_context_proto_rawDesc = nil
   321  	file_google_api_context_proto_goTypes = nil
   322  	file_google_api_context_proto_depIdxs = nil
   323  }
   324  

View as plain text