• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* This file was generated by upb_generator from the input file:
2  *
3  *     google/api/annotations.proto
4  *
5  * Do not edit -- your changes will be discarded when the file is
6  * regenerated.
7  * NO CHECKED-IN PROTOBUF GENCODE */
8 
9 #ifndef GOOGLE_API_ANNOTATIONS_PROTO_UPB_H__UPB_H_
10 #define GOOGLE_API_ANNOTATIONS_PROTO_UPB_H__UPB_H_
11 
12 #include "upb/generated_code_support.h"
13 
14 #include "google/api/annotations.upb_minitable.h"
15 
16 #include "google/api/http.upb_minitable.h"
17 #include "google/protobuf/descriptor.upb_minitable.h"
18 
19 // Must be last.
20 #include "upb/port/def.inc"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct google_protobuf_MethodOptions;
27 
28 
google_api_has_http(const struct google_protobuf_MethodOptions * msg)29 UPB_INLINE bool google_api_has_http(const struct google_protobuf_MethodOptions* msg) {
30   return upb_Message_HasExtension((upb_Message*)msg, &google_api_http_ext);
31 }
google_api_clear_http(struct google_protobuf_MethodOptions * msg)32 UPB_INLINE void google_api_clear_http(struct google_protobuf_MethodOptions* msg) {
33   upb_Message_ClearExtension((upb_Message*)msg, &google_api_http_ext);
34 }
google_api_http(const struct google_protobuf_MethodOptions * msg)35 UPB_INLINE const struct google_api_HttpRule* google_api_http(const struct google_protobuf_MethodOptions* msg) {
36   const upb_MiniTableExtension* ext = &google_api_http_ext;
37   UPB_ASSUME(upb_MiniTableField_IsScalar(&ext->UPB_PRIVATE(field)));
38   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(
39                  &ext->UPB_PRIVATE(field)) == UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
40   const struct google_api_HttpRule* default_val = NULL;
41   const struct google_api_HttpRule* ret;
42   _upb_Message_GetExtensionField((upb_Message*)msg, ext, &default_val, &ret);
43   return ret;
44 }
google_api_set_http(struct google_protobuf_MethodOptions * msg,const struct google_api_HttpRule * val,upb_Arena * arena)45 UPB_INLINE void google_api_set_http(struct google_protobuf_MethodOptions* msg, const struct google_api_HttpRule* val, upb_Arena* arena) {
46   const upb_MiniTableExtension* ext = &google_api_http_ext;
47   UPB_ASSUME(upb_MiniTableField_IsScalar(&ext->UPB_PRIVATE(field)));
48   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(
49                  &ext->UPB_PRIVATE(field)) == UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
50   bool ok = upb_Message_SetExtension((upb_Message*)msg, ext, &val, arena);
51   UPB_ASSERT(ok);
52 }
google_api_mutable_http(struct google_protobuf_MethodOptions * msg,upb_Arena * arena)53 UPB_INLINE struct google_api_HttpRule* google_api_mutable_http(struct google_protobuf_MethodOptions* msg,
54                                     upb_Arena* arena) {
55   struct google_api_HttpRule* sub = (struct google_api_HttpRule*)google_api_http(msg);
56   if (sub == NULL) {
57     sub = (struct google_api_HttpRule*)_upb_Message_New(&google__api__HttpRule_msg_init, arena);
58     if (sub) google_api_set_http(msg, sub, arena);
59   }
60   return sub;
61 }
62 #ifdef __cplusplus
63 }  /* extern "C" */
64 #endif
65 
66 #include "upb/port/undef.inc"
67 
68 #endif  /* GOOGLE_API_ANNOTATIONS_PROTO_UPB_H__UPB_H_ */
69