http.pb.go 24 KB

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