No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

750 líneas
26 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/api/http.proto
  3. package annotations // import "google.golang.org/genproto/googleapis/api/annotations"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. // Reference imports to suppress errors if they are not otherwise used.
  8. var _ = proto.Marshal
  9. var _ = fmt.Errorf
  10. var _ = math.Inf
  11. // This is a compile-time assertion to ensure that this generated file
  12. // is compatible with the proto package it is being compiled against.
  13. // A compilation error at this line likely means your copy of the
  14. // proto package needs to be updated.
  15. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  16. // Defines the HTTP configuration for an API service. It contains a list of
  17. // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
  18. // to one or more HTTP REST API methods.
  19. type Http struct {
  20. // A list of HTTP configuration rules that apply to individual API methods.
  21. //
  22. // **NOTE:** All service configuration rules follow "last one wins" order.
  23. Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
  24. // When set to true, URL path parmeters will be fully URI-decoded except in
  25. // cases of single segment matches in reserved expansion, where "%2F" will be
  26. // left encoded.
  27. //
  28. // The default behavior is to not decode RFC 6570 reserved characters in multi
  29. // segment matches.
  30. FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"`
  31. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  32. XXX_unrecognized []byte `json:"-"`
  33. XXX_sizecache int32 `json:"-"`
  34. }
  35. func (m *Http) Reset() { *m = Http{} }
  36. func (m *Http) String() string { return proto.CompactTextString(m) }
  37. func (*Http) ProtoMessage() {}
  38. func (*Http) Descriptor() ([]byte, []int) {
  39. return fileDescriptor_http_6617e93ffeeff0ad, []int{0}
  40. }
  41. func (m *Http) XXX_Unmarshal(b []byte) error {
  42. return xxx_messageInfo_Http.Unmarshal(m, b)
  43. }
  44. func (m *Http) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  45. return xxx_messageInfo_Http.Marshal(b, m, deterministic)
  46. }
  47. func (dst *Http) XXX_Merge(src proto.Message) {
  48. xxx_messageInfo_Http.Merge(dst, src)
  49. }
  50. func (m *Http) XXX_Size() int {
  51. return xxx_messageInfo_Http.Size(m)
  52. }
  53. func (m *Http) XXX_DiscardUnknown() {
  54. xxx_messageInfo_Http.DiscardUnknown(m)
  55. }
  56. var xxx_messageInfo_Http proto.InternalMessageInfo
  57. func (m *Http) GetRules() []*HttpRule {
  58. if m != nil {
  59. return m.Rules
  60. }
  61. return nil
  62. }
  63. func (m *Http) GetFullyDecodeReservedExpansion() bool {
  64. if m != nil {
  65. return m.FullyDecodeReservedExpansion
  66. }
  67. return false
  68. }
  69. // # gRPC Transcoding
  70. //
  71. // gRPC Transcoding is a feature for mapping between a gRPC method and one or
  72. // more HTTP REST endpoints. It allows developers to build a single API service
  73. // that supports both gRPC APIs and REST APIs. Many systems, including [Google
  74. // APIs](https://github.com/googleapis/googleapis),
  75. // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
  76. // Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
  77. // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
  78. // and use it for large scale production services.
  79. //
  80. // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
  81. // how different portions of the gRPC request message are mapped to the URL
  82. // path, URL query parameters, and HTTP request body. It also controls how the
  83. // gRPC response message is mapped to the HTTP response body. `HttpRule` is
  84. // typically specified as an `google.api.http` annotation on the gRPC method.
  85. //
  86. // Each mapping specifies a URL path template and an HTTP method. The path
  87. // template may refer to one or more fields in the gRPC request message, as long
  88. // as each field is a non-repeated field with a primitive (non-message) type.
  89. // The path template controls how fields of the request message are mapped to
  90. // the URL path.
  91. //
  92. // Example:
  93. //
  94. // service Messaging {
  95. // rpc GetMessage(GetMessageRequest) returns (Message) {
  96. // option (google.api.http) = {
  97. // get: "/v1/{name=messages/*}"
  98. // };
  99. // }
  100. // }
  101. // message GetMessageRequest {
  102. // string name = 1; // Mapped to URL path.
  103. // }
  104. // message Message {
  105. // string text = 1; // The resource content.
  106. // }
  107. //
  108. // This enables an HTTP REST to gRPC mapping as below:
  109. //
  110. // HTTP | gRPC
  111. // -----|-----
  112. // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
  113. //
  114. // Any fields in the request message which are not bound by the path template
  115. // automatically become HTTP query parameters if there is no HTTP request body.
  116. // For example:
  117. //
  118. // service Messaging {
  119. // rpc GetMessage(GetMessageRequest) returns (Message) {
  120. // option (google.api.http) = {
  121. // get:"/v1/messages/{message_id}"
  122. // };
  123. // }
  124. // }
  125. // message GetMessageRequest {
  126. // message SubMessage {
  127. // string subfield = 1;
  128. // }
  129. // string message_id = 1; // Mapped to URL path.
  130. // int64 revision = 2; // Mapped to URL query parameter `revision`.
  131. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
  132. // }
  133. //
  134. // This enables a HTTP JSON to RPC mapping as below:
  135. //
  136. // HTTP | gRPC
  137. // -----|-----
  138. // `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
  139. // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
  140. // "foo"))`
  141. //
  142. // Note that fields which are mapped to URL query parameters must have a
  143. // primitive type or a repeated primitive type or a non-repeated message type.
  144. // In the case of a repeated type, the parameter can be repeated in the URL
  145. // as `...?param=A&param=B`. In the case of a message type, each field of the
  146. // message is mapped to a separate parameter, such as
  147. // `...?foo.a=A&foo.b=B&foo.c=C`.
  148. //
  149. // For HTTP methods that allow a request body, the `body` field
  150. // specifies the mapping. Consider a REST update method on the
  151. // message resource collection:
  152. //
  153. // service Messaging {
  154. // rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
  155. // option (google.api.http) = {
  156. // patch: "/v1/messages/{message_id}"
  157. // body: "message"
  158. // };
  159. // }
  160. // }
  161. // message UpdateMessageRequest {
  162. // string message_id = 1; // mapped to the URL
  163. // Message message = 2; // mapped to the body
  164. // }
  165. //
  166. // The following HTTP JSON to RPC mapping is enabled, where the
  167. // representation of the JSON in the request body is determined by
  168. // protos JSON encoding:
  169. //
  170. // HTTP | gRPC
  171. // -----|-----
  172. // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
  173. // "123456" message { text: "Hi!" })`
  174. //
  175. // The special name `*` can be used in the body mapping to define that
  176. // every field not bound by the path template should be mapped to the
  177. // request body. This enables the following alternative definition of
  178. // the update method:
  179. //
  180. // service Messaging {
  181. // rpc UpdateMessage(Message) returns (Message) {
  182. // option (google.api.http) = {
  183. // patch: "/v1/messages/{message_id}"
  184. // body: "*"
  185. // };
  186. // }
  187. // }
  188. // message Message {
  189. // string message_id = 1;
  190. // string text = 2;
  191. // }
  192. //
  193. //
  194. // The following HTTP JSON to RPC mapping is enabled:
  195. //
  196. // HTTP | gRPC
  197. // -----|-----
  198. // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
  199. // "123456" text: "Hi!")`
  200. //
  201. // Note that when using `*` in the body mapping, it is not possible to
  202. // have HTTP parameters, as all fields not bound by the path end in
  203. // the body. This makes this option more rarely used in practice when
  204. // defining REST APIs. The common usage of `*` is in custom methods
  205. // which don't use the URL at all for transferring data.
  206. //
  207. // It is possible to define multiple HTTP methods for one RPC by using
  208. // the `additional_bindings` option. Example:
  209. //
  210. // service Messaging {
  211. // rpc GetMessage(GetMessageRequest) returns (Message) {
  212. // option (google.api.http) = {
  213. // get: "/v1/messages/{message_id}"
  214. // additional_bindings {
  215. // get: "/v1/users/{user_id}/messages/{message_id}"
  216. // }
  217. // };
  218. // }
  219. // }
  220. // message GetMessageRequest {
  221. // string message_id = 1;
  222. // string user_id = 2;
  223. // }
  224. //
  225. // This enables the following two alternative HTTP JSON to RPC mappings:
  226. //
  227. // HTTP | gRPC
  228. // -----|-----
  229. // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
  230. // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
  231. // "123456")`
  232. //
  233. // ## Rules for HTTP mapping
  234. //
  235. // 1. Leaf request fields (recursive expansion nested messages in the request
  236. // message) are classified into three categories:
  237. // - Fields referred by the path template. They are passed via the URL path.
  238. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
  239. // are passed via the HTTP
  240. // request body.
  241. // - All other fields are passed via the URL query parameters, and the
  242. // parameter name is the field path in the request message. A repeated
  243. // field can be represented as multiple query parameters under the same
  244. // name.
  245. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
  246. // query parameter, all fields
  247. // are passed via URL path and HTTP request body.
  248. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
  249. // request body, all
  250. // fields are passed via URL path and URL query parameters.
  251. //
  252. // ### Path template syntax
  253. //
  254. // Template = "/" Segments [ Verb ] ;
  255. // Segments = Segment { "/" Segment } ;
  256. // Segment = "*" | "**" | LITERAL | Variable ;
  257. // Variable = "{" FieldPath [ "=" Segments ] "}" ;
  258. // FieldPath = IDENT { "." IDENT } ;
  259. // Verb = ":" LITERAL ;
  260. //
  261. // The syntax `*` matches a single URL path segment. The syntax `**` matches
  262. // zero or more URL path segments, which must be the last part of the URL path
  263. // except the `Verb`.
  264. //
  265. // The syntax `Variable` matches part of the URL path as specified by its
  266. // template. A variable template must not contain other variables. If a variable
  267. // matches a single path segment, its template may be omitted, e.g. `{var}`
  268. // is equivalent to `{var=*}`.
  269. //
  270. // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
  271. // contains any reserved character, such characters should be percent-encoded
  272. // before the matching.
  273. //
  274. // If a variable contains exactly one path segment, such as `"{var}"` or
  275. // `"{var=*}"`, when such a variable is expanded into a URL path on the client
  276. // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
  277. // server side does the reverse decoding. Such variables show up in the
  278. // [Discovery
  279. // Document](https://developers.google.com/discovery/v1/reference/apis) as
  280. // `{var}`.
  281. //
  282. // If a variable contains multiple path segments, such as `"{var=foo/*}"`
  283. // or `"{var=**}"`, when such a variable is expanded into a URL path on the
  284. // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
  285. // The server side does the reverse decoding, except "%2F" and "%2f" are left
  286. // unchanged. Such variables show up in the
  287. // [Discovery
  288. // Document](https://developers.google.com/discovery/v1/reference/apis) as
  289. // `{+var}`.
  290. //
  291. // ## Using gRPC API Service Configuration
  292. //
  293. // gRPC API Service Configuration (service config) is a configuration language
  294. // for configuring a gRPC service to become a user-facing product. The
  295. // service config is simply the YAML representation of the `google.api.Service`
  296. // proto message.
  297. //
  298. // As an alternative to annotating your proto file, you can configure gRPC
  299. // transcoding in your service config YAML files. You do this by specifying a
  300. // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
  301. // effect as the proto annotation. This can be particularly useful if you
  302. // have a proto that is reused in multiple services. Note that any transcoding
  303. // specified in the service config will override any matching transcoding
  304. // configuration in the proto.
  305. //
  306. // Example:
  307. //
  308. // http:
  309. // rules:
  310. // # Selects a gRPC method and applies HttpRule to it.
  311. // - selector: example.v1.Messaging.GetMessage
  312. // get: /v1/messages/{message_id}/{sub.subfield}
  313. //
  314. // ## Special notes
  315. //
  316. // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
  317. // proto to JSON conversion must follow the [proto3
  318. // specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
  319. //
  320. // While the single segment variable follows the semantics of
  321. // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
  322. // Expansion, the multi segment variable **does not** follow RFC 6570 Section
  323. // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
  324. // does not expand special characters like `?` and `#`, which would lead
  325. // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
  326. // for multi segment variables.
  327. //
  328. // The path variables **must not** refer to any repeated or mapped field,
  329. // because client libraries are not capable of handling such variable expansion.
  330. //
  331. // The path variables **must not** capture the leading "/" character. The reason
  332. // is that the most common use case "{var}" does not capture the leading "/"
  333. // character. For consistency, all path variables must share the same behavior.
  334. //
  335. // Repeated message fields must not be mapped to URL query parameters, because
  336. // no client library can support such complicated mapping.
  337. //
  338. // If an API needs to use a JSON array for request or response body, it can map
  339. // the request or response body to a repeated field. However, some gRPC
  340. // Transcoding implementations may not support this feature.
  341. type HttpRule struct {
  342. // Selects a method to which this rule applies.
  343. //
  344. // Refer to [selector][google.api.DocumentationRule.selector] for syntax
  345. // details.
  346. Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
  347. // Determines the URL pattern is matched by this rules. This pattern can be
  348. // used with any of the {get|put|post|delete|patch} methods. A custom method
  349. // can be defined using the 'custom' field.
  350. //
  351. // Types that are valid to be assigned to Pattern:
  352. // *HttpRule_Get
  353. // *HttpRule_Put
  354. // *HttpRule_Post
  355. // *HttpRule_Delete
  356. // *HttpRule_Patch
  357. // *HttpRule_Custom
  358. Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"`
  359. // The name of the request field whose value is mapped to the HTTP request
  360. // body, or `*` for mapping all request fields not captured by the path
  361. // pattern to the HTTP body, or omitted for not having any HTTP request body.
  362. //
  363. // NOTE: the referred field must be present at the top-level of the request
  364. // message type.
  365. Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"`
  366. // Optional. The name of the response field whose value is mapped to the HTTP
  367. // response body. When omitted, the entire response message will be used
  368. // as the HTTP response body.
  369. //
  370. // NOTE: The referred field must be present at the top-level of the response
  371. // message type.
  372. ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"`
  373. // Additional HTTP bindings for the selector. Nested bindings must
  374. // not contain an `additional_bindings` field themselves (that is,
  375. // the nesting may only be one level deep).
  376. AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"`
  377. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  378. XXX_unrecognized []byte `json:"-"`
  379. XXX_sizecache int32 `json:"-"`
  380. }
  381. func (m *HttpRule) Reset() { *m = HttpRule{} }
  382. func (m *HttpRule) String() string { return proto.CompactTextString(m) }
  383. func (*HttpRule) ProtoMessage() {}
  384. func (*HttpRule) Descriptor() ([]byte, []int) {
  385. return fileDescriptor_http_6617e93ffeeff0ad, []int{1}
  386. }
  387. func (m *HttpRule) XXX_Unmarshal(b []byte) error {
  388. return xxx_messageInfo_HttpRule.Unmarshal(m, b)
  389. }
  390. func (m *HttpRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  391. return xxx_messageInfo_HttpRule.Marshal(b, m, deterministic)
  392. }
  393. func (dst *HttpRule) XXX_Merge(src proto.Message) {
  394. xxx_messageInfo_HttpRule.Merge(dst, src)
  395. }
  396. func (m *HttpRule) XXX_Size() int {
  397. return xxx_messageInfo_HttpRule.Size(m)
  398. }
  399. func (m *HttpRule) XXX_DiscardUnknown() {
  400. xxx_messageInfo_HttpRule.DiscardUnknown(m)
  401. }
  402. var xxx_messageInfo_HttpRule proto.InternalMessageInfo
  403. func (m *HttpRule) GetSelector() string {
  404. if m != nil {
  405. return m.Selector
  406. }
  407. return ""
  408. }
  409. type isHttpRule_Pattern interface {
  410. isHttpRule_Pattern()
  411. }
  412. type HttpRule_Get struct {
  413. Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof"`
  414. }
  415. type HttpRule_Put struct {
  416. Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof"`
  417. }
  418. type HttpRule_Post struct {
  419. Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof"`
  420. }
  421. type HttpRule_Delete struct {
  422. Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof"`
  423. }
  424. type HttpRule_Patch struct {
  425. Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof"`
  426. }
  427. type HttpRule_Custom struct {
  428. Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof"`
  429. }
  430. func (*HttpRule_Get) isHttpRule_Pattern() {}
  431. func (*HttpRule_Put) isHttpRule_Pattern() {}
  432. func (*HttpRule_Post) isHttpRule_Pattern() {}
  433. func (*HttpRule_Delete) isHttpRule_Pattern() {}
  434. func (*HttpRule_Patch) isHttpRule_Pattern() {}
  435. func (*HttpRule_Custom) isHttpRule_Pattern() {}
  436. func (m *HttpRule) GetPattern() isHttpRule_Pattern {
  437. if m != nil {
  438. return m.Pattern
  439. }
  440. return nil
  441. }
  442. func (m *HttpRule) GetGet() string {
  443. if x, ok := m.GetPattern().(*HttpRule_Get); ok {
  444. return x.Get
  445. }
  446. return ""
  447. }
  448. func (m *HttpRule) GetPut() string {
  449. if x, ok := m.GetPattern().(*HttpRule_Put); ok {
  450. return x.Put
  451. }
  452. return ""
  453. }
  454. func (m *HttpRule) GetPost() string {
  455. if x, ok := m.GetPattern().(*HttpRule_Post); ok {
  456. return x.Post
  457. }
  458. return ""
  459. }
  460. func (m *HttpRule) GetDelete() string {
  461. if x, ok := m.GetPattern().(*HttpRule_Delete); ok {
  462. return x.Delete
  463. }
  464. return ""
  465. }
  466. func (m *HttpRule) GetPatch() string {
  467. if x, ok := m.GetPattern().(*HttpRule_Patch); ok {
  468. return x.Patch
  469. }
  470. return ""
  471. }
  472. func (m *HttpRule) GetCustom() *CustomHttpPattern {
  473. if x, ok := m.GetPattern().(*HttpRule_Custom); ok {
  474. return x.Custom
  475. }
  476. return nil
  477. }
  478. func (m *HttpRule) GetBody() string {
  479. if m != nil {
  480. return m.Body
  481. }
  482. return ""
  483. }
  484. func (m *HttpRule) GetResponseBody() string {
  485. if m != nil {
  486. return m.ResponseBody
  487. }
  488. return ""
  489. }
  490. func (m *HttpRule) GetAdditionalBindings() []*HttpRule {
  491. if m != nil {
  492. return m.AdditionalBindings
  493. }
  494. return nil
  495. }
  496. // XXX_OneofFuncs is for the internal use of the proto package.
  497. func (*HttpRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  498. return _HttpRule_OneofMarshaler, _HttpRule_OneofUnmarshaler, _HttpRule_OneofSizer, []interface{}{
  499. (*HttpRule_Get)(nil),
  500. (*HttpRule_Put)(nil),
  501. (*HttpRule_Post)(nil),
  502. (*HttpRule_Delete)(nil),
  503. (*HttpRule_Patch)(nil),
  504. (*HttpRule_Custom)(nil),
  505. }
  506. }
  507. func _HttpRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  508. m := msg.(*HttpRule)
  509. // pattern
  510. switch x := m.Pattern.(type) {
  511. case *HttpRule_Get:
  512. b.EncodeVarint(2<<3 | proto.WireBytes)
  513. b.EncodeStringBytes(x.Get)
  514. case *HttpRule_Put:
  515. b.EncodeVarint(3<<3 | proto.WireBytes)
  516. b.EncodeStringBytes(x.Put)
  517. case *HttpRule_Post:
  518. b.EncodeVarint(4<<3 | proto.WireBytes)
  519. b.EncodeStringBytes(x.Post)
  520. case *HttpRule_Delete:
  521. b.EncodeVarint(5<<3 | proto.WireBytes)
  522. b.EncodeStringBytes(x.Delete)
  523. case *HttpRule_Patch:
  524. b.EncodeVarint(6<<3 | proto.WireBytes)
  525. b.EncodeStringBytes(x.Patch)
  526. case *HttpRule_Custom:
  527. b.EncodeVarint(8<<3 | proto.WireBytes)
  528. if err := b.EncodeMessage(x.Custom); err != nil {
  529. return err
  530. }
  531. case nil:
  532. default:
  533. return fmt.Errorf("HttpRule.Pattern has unexpected type %T", x)
  534. }
  535. return nil
  536. }
  537. func _HttpRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  538. m := msg.(*HttpRule)
  539. switch tag {
  540. case 2: // pattern.get
  541. if wire != proto.WireBytes {
  542. return true, proto.ErrInternalBadWireType
  543. }
  544. x, err := b.DecodeStringBytes()
  545. m.Pattern = &HttpRule_Get{x}
  546. return true, err
  547. case 3: // pattern.put
  548. if wire != proto.WireBytes {
  549. return true, proto.ErrInternalBadWireType
  550. }
  551. x, err := b.DecodeStringBytes()
  552. m.Pattern = &HttpRule_Put{x}
  553. return true, err
  554. case 4: // pattern.post
  555. if wire != proto.WireBytes {
  556. return true, proto.ErrInternalBadWireType
  557. }
  558. x, err := b.DecodeStringBytes()
  559. m.Pattern = &HttpRule_Post{x}
  560. return true, err
  561. case 5: // pattern.delete
  562. if wire != proto.WireBytes {
  563. return true, proto.ErrInternalBadWireType
  564. }
  565. x, err := b.DecodeStringBytes()
  566. m.Pattern = &HttpRule_Delete{x}
  567. return true, err
  568. case 6: // pattern.patch
  569. if wire != proto.WireBytes {
  570. return true, proto.ErrInternalBadWireType
  571. }
  572. x, err := b.DecodeStringBytes()
  573. m.Pattern = &HttpRule_Patch{x}
  574. return true, err
  575. case 8: // pattern.custom
  576. if wire != proto.WireBytes {
  577. return true, proto.ErrInternalBadWireType
  578. }
  579. msg := new(CustomHttpPattern)
  580. err := b.DecodeMessage(msg)
  581. m.Pattern = &HttpRule_Custom{msg}
  582. return true, err
  583. default:
  584. return false, nil
  585. }
  586. }
  587. func _HttpRule_OneofSizer(msg proto.Message) (n int) {
  588. m := msg.(*HttpRule)
  589. // pattern
  590. switch x := m.Pattern.(type) {
  591. case *HttpRule_Get:
  592. n += 1 // tag and wire
  593. n += proto.SizeVarint(uint64(len(x.Get)))
  594. n += len(x.Get)
  595. case *HttpRule_Put:
  596. n += 1 // tag and wire
  597. n += proto.SizeVarint(uint64(len(x.Put)))
  598. n += len(x.Put)
  599. case *HttpRule_Post:
  600. n += 1 // tag and wire
  601. n += proto.SizeVarint(uint64(len(x.Post)))
  602. n += len(x.Post)
  603. case *HttpRule_Delete:
  604. n += 1 // tag and wire
  605. n += proto.SizeVarint(uint64(len(x.Delete)))
  606. n += len(x.Delete)
  607. case *HttpRule_Patch:
  608. n += 1 // tag and wire
  609. n += proto.SizeVarint(uint64(len(x.Patch)))
  610. n += len(x.Patch)
  611. case *HttpRule_Custom:
  612. s := proto.Size(x.Custom)
  613. n += 1 // tag and wire
  614. n += proto.SizeVarint(uint64(s))
  615. n += s
  616. case nil:
  617. default:
  618. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  619. }
  620. return n
  621. }
  622. // A custom pattern is used for defining custom HTTP verb.
  623. type CustomHttpPattern struct {
  624. // The name of this custom HTTP verb.
  625. Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
  626. // The path matched by this custom verb.
  627. Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
  628. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  629. XXX_unrecognized []byte `json:"-"`
  630. XXX_sizecache int32 `json:"-"`
  631. }
  632. func (m *CustomHttpPattern) Reset() { *m = CustomHttpPattern{} }
  633. func (m *CustomHttpPattern) String() string { return proto.CompactTextString(m) }
  634. func (*CustomHttpPattern) ProtoMessage() {}
  635. func (*CustomHttpPattern) Descriptor() ([]byte, []int) {
  636. return fileDescriptor_http_6617e93ffeeff0ad, []int{2}
  637. }
  638. func (m *CustomHttpPattern) XXX_Unmarshal(b []byte) error {
  639. return xxx_messageInfo_CustomHttpPattern.Unmarshal(m, b)
  640. }
  641. func (m *CustomHttpPattern) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  642. return xxx_messageInfo_CustomHttpPattern.Marshal(b, m, deterministic)
  643. }
  644. func (dst *CustomHttpPattern) XXX_Merge(src proto.Message) {
  645. xxx_messageInfo_CustomHttpPattern.Merge(dst, src)
  646. }
  647. func (m *CustomHttpPattern) XXX_Size() int {
  648. return xxx_messageInfo_CustomHttpPattern.Size(m)
  649. }
  650. func (m *CustomHttpPattern) XXX_DiscardUnknown() {
  651. xxx_messageInfo_CustomHttpPattern.DiscardUnknown(m)
  652. }
  653. var xxx_messageInfo_CustomHttpPattern proto.InternalMessageInfo
  654. func (m *CustomHttpPattern) GetKind() string {
  655. if m != nil {
  656. return m.Kind
  657. }
  658. return ""
  659. }
  660. func (m *CustomHttpPattern) GetPath() string {
  661. if m != nil {
  662. return m.Path
  663. }
  664. return ""
  665. }
  666. func init() {
  667. proto.RegisterType((*Http)(nil), "google.api.Http")
  668. proto.RegisterType((*HttpRule)(nil), "google.api.HttpRule")
  669. proto.RegisterType((*CustomHttpPattern)(nil), "google.api.CustomHttpPattern")
  670. }
  671. func init() { proto.RegisterFile("google/api/http.proto", fileDescriptor_http_6617e93ffeeff0ad) }
  672. var fileDescriptor_http_6617e93ffeeff0ad = []byte{
  673. // 419 bytes of a gzipped FileDescriptorProto
  674. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x8e, 0xd3, 0x30,
  675. 0x10, 0x86, 0x49, 0x9b, 0x76, 0xdb, 0xe9, 0x82, 0x84, 0x59, 0x90, 0x85, 0x40, 0x54, 0xe5, 0x52,
  676. 0x71, 0x48, 0xa5, 0xe5, 0xc0, 0x61, 0x4f, 0x1b, 0xa8, 0x58, 0x6e, 0x55, 0x8e, 0x5c, 0x22, 0x37,
  677. 0x1e, 0x52, 0x83, 0xd7, 0xb6, 0xe2, 0x09, 0xa2, 0xaf, 0xc3, 0x63, 0xf1, 0x24, 0x1c, 0x91, 0x9d,
  678. 0x84, 0x56, 0x42, 0xe2, 0x36, 0xf3, 0xff, 0x9f, 0xa7, 0x7f, 0x27, 0x03, 0x4f, 0x6b, 0x6b, 0x6b,
  679. 0x8d, 0x1b, 0xe1, 0xd4, 0xe6, 0x40, 0xe4, 0x32, 0xd7, 0x58, 0xb2, 0x0c, 0x3a, 0x39, 0x13, 0x4e,
  680. 0xad, 0x8e, 0x90, 0xde, 0x11, 0x39, 0xf6, 0x06, 0x26, 0x4d, 0xab, 0xd1, 0xf3, 0x64, 0x39, 0x5e,
  681. 0x2f, 0xae, 0xaf, 0xb2, 0x13, 0x93, 0x05, 0xa0, 0x68, 0x35, 0x16, 0x1d, 0xc2, 0xb6, 0xf0, 0xea,
  682. 0x4b, 0xab, 0xf5, 0xb1, 0x94, 0x58, 0x59, 0x89, 0x65, 0x83, 0x1e, 0x9b, 0xef, 0x28, 0x4b, 0xfc,
  683. 0xe1, 0x84, 0xf1, 0xca, 0x1a, 0x3e, 0x5a, 0x26, 0xeb, 0x59, 0xf1, 0x22, 0x62, 0x1f, 0x22, 0x55,
  684. 0xf4, 0xd0, 0x76, 0x60, 0x56, 0xbf, 0x46, 0x30, 0x1b, 0x46, 0xb3, 0xe7, 0x30, 0xf3, 0xa8, 0xb1,
  685. 0x22, 0xdb, 0xf0, 0x64, 0x99, 0xac, 0xe7, 0xc5, 0xdf, 0x9e, 0x31, 0x18, 0xd7, 0x48, 0x71, 0xe6,
  686. 0xfc, 0xee, 0x41, 0x11, 0x9a, 0xa0, 0xb9, 0x96, 0xf8, 0x78, 0xd0, 0x5c, 0x4b, 0xec, 0x0a, 0x52,
  687. 0x67, 0x3d, 0xf1, 0xb4, 0x17, 0x63, 0xc7, 0x38, 0x4c, 0x25, 0x6a, 0x24, 0xe4, 0x93, 0x5e, 0xef,
  688. 0x7b, 0xf6, 0x0c, 0x26, 0x4e, 0x50, 0x75, 0xe0, 0xd3, 0xde, 0xe8, 0x5a, 0xf6, 0x0e, 0xa6, 0x55,
  689. 0xeb, 0xc9, 0xde, 0xf3, 0xd9, 0x32, 0x59, 0x2f, 0xae, 0x5f, 0x9e, 0x2f, 0xe3, 0x7d, 0x74, 0x42,
  690. 0xee, 0x9d, 0x20, 0xc2, 0xc6, 0x84, 0x81, 0x1d, 0xce, 0x18, 0xa4, 0x7b, 0x2b, 0x8f, 0xfc, 0x22,
  691. 0xfe, 0x81, 0x58, 0xb3, 0xd7, 0xf0, 0xb0, 0x41, 0xef, 0xac, 0xf1, 0x58, 0x46, 0xf3, 0x32, 0x9a,
  692. 0x97, 0x83, 0x98, 0x07, 0x68, 0x0b, 0x4f, 0x84, 0x94, 0x8a, 0x94, 0x35, 0x42, 0x97, 0x7b, 0x65,
  693. 0xa4, 0x32, 0xb5, 0xe7, 0x8b, 0xff, 0x7c, 0x0b, 0x76, 0x7a, 0x90, 0xf7, 0x7c, 0x3e, 0x87, 0x0b,
  694. 0xd7, 0x85, 0x5a, 0xdd, 0xc0, 0xe3, 0x7f, 0x92, 0x86, 0x7c, 0xdf, 0x94, 0x91, 0xfd, 0x82, 0x63,
  695. 0x1d, 0x34, 0x27, 0xe8, 0xd0, 0x6d, 0xb7, 0x88, 0x75, 0xfe, 0x15, 0x1e, 0x55, 0xf6, 0xfe, 0xec,
  696. 0x67, 0xf3, 0x79, 0x1c, 0x13, 0xae, 0x67, 0x97, 0x7c, 0xbe, 0xed, 0x8d, 0xda, 0x6a, 0x61, 0xea,
  697. 0xcc, 0x36, 0xf5, 0xa6, 0x46, 0x13, 0x6f, 0x6b, 0xd3, 0x59, 0xc2, 0x29, 0x1f, 0xaf, 0x4e, 0x18,
  698. 0x63, 0x49, 0x84, 0x98, 0xfe, 0xe6, 0xac, 0xfe, 0x9d, 0x24, 0x3f, 0x47, 0xe9, 0xc7, 0xdb, 0xdd,
  699. 0xa7, 0xfd, 0x34, 0xbe, 0x7b, 0xfb, 0x27, 0x00, 0x00, 0xff, 0xff, 0xae, 0xde, 0xa1, 0xd0, 0xac,
  700. 0x02, 0x00, 0x00,
  701. }