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/usage.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// Configuration controlling usage of a service. 39type Usage struct { 40 state protoimpl.MessageState 41 sizeCache protoimpl.SizeCache 42 unknownFields protoimpl.UnknownFields 43 44 // Requirements that must be satisfied before a consumer project can use the 45 // service. Each requirement is of the form <service.name>/<requirement-id>; 46 // for example 'serviceusage.googleapis.com/billing-enabled'. 47 // 48 // For Google APIs, a Terms of Service requirement must be included here. 49 // Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". 50 // Other Google APIs should include 51 // "serviceusage.googleapis.com/tos/universal". Additional ToS can be 52 // included based on the business needs. 53 Requirements []string `protobuf:"bytes,1,rep,name=requirements,proto3" json:"requirements,omitempty"` 54 // A list of usage rules that apply to individual API methods. 55 // 56 // **NOTE:** All service configuration rules follow "last one wins" order. 57 Rules []*UsageRule `protobuf:"bytes,6,rep,name=rules,proto3" json:"rules,omitempty"` 58 // The full resource name of a channel used for sending notifications to the 59 // service producer. 60 // 61 // Google Service Management currently only supports 62 // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification 63 // channel. To use Google Cloud Pub/Sub as the channel, this must be the name 64 // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format 65 // documented in https://cloud.google.com/pubsub/docs/overview. 66 ProducerNotificationChannel string `protobuf:"bytes,7,opt,name=producer_notification_channel,json=producerNotificationChannel,proto3" json:"producer_notification_channel,omitempty"` 67} 68 69func (x *Usage) Reset() { 70 *x = Usage{} 71 if protoimpl.UnsafeEnabled { 72 mi := &file_google_api_usage_proto_msgTypes[0] 73 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 74 ms.StoreMessageInfo(mi) 75 } 76} 77 78func (x *Usage) String() string { 79 return protoimpl.X.MessageStringOf(x) 80} 81 82func (*Usage) ProtoMessage() {} 83 84func (x *Usage) ProtoReflect() protoreflect.Message { 85 mi := &file_google_api_usage_proto_msgTypes[0] 86 if protoimpl.UnsafeEnabled && x != nil { 87 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 88 if ms.LoadMessageInfo() == nil { 89 ms.StoreMessageInfo(mi) 90 } 91 return ms 92 } 93 return mi.MessageOf(x) 94} 95 96// Deprecated: Use Usage.ProtoReflect.Descriptor instead. 97func (*Usage) Descriptor() ([]byte, []int) { 98 return file_google_api_usage_proto_rawDescGZIP(), []int{0} 99} 100 101func (x *Usage) GetRequirements() []string { 102 if x != nil { 103 return x.Requirements 104 } 105 return nil 106} 107 108func (x *Usage) GetRules() []*UsageRule { 109 if x != nil { 110 return x.Rules 111 } 112 return nil 113} 114 115func (x *Usage) GetProducerNotificationChannel() string { 116 if x != nil { 117 return x.ProducerNotificationChannel 118 } 119 return "" 120} 121 122// Usage configuration rules for the service. 123// 124// NOTE: Under development. 125// 126// 127// Use this rule to configure unregistered calls for the service. Unregistered 128// calls are calls that do not contain consumer project identity. 129// (Example: calls that do not contain an API key). 130// By default, API methods do not allow unregistered calls, and each method call 131// must be identified by a consumer project identity. Use this rule to 132// allow/disallow unregistered calls. 133// 134// Example of an API that wants to allow unregistered calls for entire service. 135// 136// usage: 137// rules: 138// - selector: "*" 139// allow_unregistered_calls: true 140// 141// Example of a method that wants to allow unregistered calls. 142// 143// usage: 144// rules: 145// - selector: "google.example.library.v1.LibraryService.CreateBook" 146// allow_unregistered_calls: true 147type UsageRule struct { 148 state protoimpl.MessageState 149 sizeCache protoimpl.SizeCache 150 unknownFields protoimpl.UnknownFields 151 152 // Selects the methods to which this rule applies. Use '*' to indicate all 153 // methods in all APIs. 154 // 155 // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. 156 Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` 157 // If true, the selected method allows unregistered calls, e.g. calls 158 // that don't identify any user or application. 159 AllowUnregisteredCalls bool `protobuf:"varint,2,opt,name=allow_unregistered_calls,json=allowUnregisteredCalls,proto3" json:"allow_unregistered_calls,omitempty"` 160 // If true, the selected method should skip service control and the control 161 // plane features, such as quota and billing, will not be available. 162 // This flag is used by Google Cloud Endpoints to bypass checks for internal 163 // methods, such as service health check methods. 164 SkipServiceControl bool `protobuf:"varint,3,opt,name=skip_service_control,json=skipServiceControl,proto3" json:"skip_service_control,omitempty"` 165} 166 167func (x *UsageRule) Reset() { 168 *x = UsageRule{} 169 if protoimpl.UnsafeEnabled { 170 mi := &file_google_api_usage_proto_msgTypes[1] 171 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 172 ms.StoreMessageInfo(mi) 173 } 174} 175 176func (x *UsageRule) String() string { 177 return protoimpl.X.MessageStringOf(x) 178} 179 180func (*UsageRule) ProtoMessage() {} 181 182func (x *UsageRule) ProtoReflect() protoreflect.Message { 183 mi := &file_google_api_usage_proto_msgTypes[1] 184 if protoimpl.UnsafeEnabled && x != nil { 185 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 186 if ms.LoadMessageInfo() == nil { 187 ms.StoreMessageInfo(mi) 188 } 189 return ms 190 } 191 return mi.MessageOf(x) 192} 193 194// Deprecated: Use UsageRule.ProtoReflect.Descriptor instead. 195func (*UsageRule) Descriptor() ([]byte, []int) { 196 return file_google_api_usage_proto_rawDescGZIP(), []int{1} 197} 198 199func (x *UsageRule) GetSelector() string { 200 if x != nil { 201 return x.Selector 202 } 203 return "" 204} 205 206func (x *UsageRule) GetAllowUnregisteredCalls() bool { 207 if x != nil { 208 return x.AllowUnregisteredCalls 209 } 210 return false 211} 212 213func (x *UsageRule) GetSkipServiceControl() bool { 214 if x != nil { 215 return x.SkipServiceControl 216 } 217 return false 218} 219 220var File_google_api_usage_proto protoreflect.FileDescriptor 221 222var file_google_api_usage_proto_rawDesc = []byte{ 223 0x0a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x61, 224 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 225 0x2e, 0x61, 0x70, 0x69, 0x22, 0x9c, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, 226 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 227 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 228 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 229 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 230 0x73, 0x61, 0x67, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 231 0x42, 0x0a, 0x1d, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 232 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 233 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 234 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 235 0x6e, 0x65, 0x6c, 0x22, 0x93, 0x01, 0x0a, 0x09, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x75, 0x6c, 236 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 237 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x38, 0x0a, 238 0x18, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 239 0x72, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 240 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 241 0x65, 0x64, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x6b, 0x69, 0x70, 0x5f, 242 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 243 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x6b, 0x69, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 244 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x6c, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 245 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0a, 0x55, 0x73, 0x61, 246 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 247 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 248 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 249 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 250 0x69, 0x67, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 251 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 252} 253 254var ( 255 file_google_api_usage_proto_rawDescOnce sync.Once 256 file_google_api_usage_proto_rawDescData = file_google_api_usage_proto_rawDesc 257) 258 259func file_google_api_usage_proto_rawDescGZIP() []byte { 260 file_google_api_usage_proto_rawDescOnce.Do(func() { 261 file_google_api_usage_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_usage_proto_rawDescData) 262 }) 263 return file_google_api_usage_proto_rawDescData 264} 265 266var file_google_api_usage_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 267var file_google_api_usage_proto_goTypes = []interface{}{ 268 (*Usage)(nil), // 0: google.api.Usage 269 (*UsageRule)(nil), // 1: google.api.UsageRule 270} 271var file_google_api_usage_proto_depIdxs = []int32{ 272 1, // 0: google.api.Usage.rules:type_name -> google.api.UsageRule 273 1, // [1:1] is the sub-list for method output_type 274 1, // [1:1] is the sub-list for method input_type 275 1, // [1:1] is the sub-list for extension type_name 276 1, // [1:1] is the sub-list for extension extendee 277 0, // [0:1] is the sub-list for field type_name 278} 279 280func init() { file_google_api_usage_proto_init() } 281func file_google_api_usage_proto_init() { 282 if File_google_api_usage_proto != nil { 283 return 284 } 285 if !protoimpl.UnsafeEnabled { 286 file_google_api_usage_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 287 switch v := v.(*Usage); i { 288 case 0: 289 return &v.state 290 case 1: 291 return &v.sizeCache 292 case 2: 293 return &v.unknownFields 294 default: 295 return nil 296 } 297 } 298 file_google_api_usage_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 299 switch v := v.(*UsageRule); i { 300 case 0: 301 return &v.state 302 case 1: 303 return &v.sizeCache 304 case 2: 305 return &v.unknownFields 306 default: 307 return nil 308 } 309 } 310 } 311 type x struct{} 312 out := protoimpl.TypeBuilder{ 313 File: protoimpl.DescBuilder{ 314 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 315 RawDescriptor: file_google_api_usage_proto_rawDesc, 316 NumEnums: 0, 317 NumMessages: 2, 318 NumExtensions: 0, 319 NumServices: 0, 320 }, 321 GoTypes: file_google_api_usage_proto_goTypes, 322 DependencyIndexes: file_google_api_usage_proto_depIdxs, 323 MessageInfos: file_google_api_usage_proto_msgTypes, 324 }.Build() 325 File_google_api_usage_proto = out.File 326 file_google_api_usage_proto_rawDesc = nil 327 file_google_api_usage_proto_goTypes = nil 328 file_google_api_usage_proto_depIdxs = nil 329} 330