/* This file was generated by upb_generator from the input file:
 *
 *     envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.proto
 *
 * Do not edit -- your changes will be discarded when the file is
 * regenerated.
 * NO CHECKED-IN PROTOBUF GENCODE */

#ifndef ENVOY_EXTENSIONS_GRPC_SERVICE_CHANNEL_CREDENTIALS_XDS_V3_XDS_CREDENTIALS_PROTO_UPB_H__UPB_H_
#define ENVOY_EXTENSIONS_GRPC_SERVICE_CHANNEL_CREDENTIALS_XDS_V3_XDS_CREDENTIALS_PROTO_UPB_H__UPB_H_

#include "upb/generated_code_support.h"
#include "envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h"
#include "google/protobuf/any.upb_minitable.h"
#include "udpa/annotations/status.upb_minitable.h"

// Must be last.
#include "upb/port/def.inc"

#ifdef __cplusplus
extern "C" {
#endif
typedef struct envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials {
  upb_Message UPB_PRIVATE(base);
} envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials;

struct google_protobuf_Any;



/* envoy.extensions.grpc_service.channel_credentials.xds.v3.XdsCredentials */
UPB_INLINE envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_new(upb_Arena* arena) {
  return (envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials*)_upb_Message_New(&envoy__extensions__grpc_0service__channel_0credentials__xds__v3__XdsCredentials_msg_init, arena);
}
UPB_INLINE envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_parse(const char* buf, size_t size,
                                        upb_Arena* arena) {
  envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* ret = envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__grpc_0service__channel_0credentials__xds__v3__XdsCredentials_msg_init, NULL, 0,
                 arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_parse_ex(
    const char* buf, size_t size, const upb_ExtensionRegistry* extreg,
    int options, upb_Arena* arena) {
  envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* ret = envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__grpc_0service__channel_0credentials__xds__v3__XdsCredentials_msg_init, extreg,
                 options, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_serialize(const envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* msg,
                                      upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__grpc_0service__channel_0credentials__xds__v3__XdsCredentials_msg_init, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_serialize_ex(const envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* msg,
                                         int options, upb_Arena* arena,
                                         size_t* len) {
  char* ptr;
  (void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__grpc_0service__channel_0credentials__xds__v3__XdsCredentials_msg_init, options, arena, &ptr, len);
  return ptr;
}
UPB_INLINE void envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_clear_fallback_credentials(envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* msg) {
  const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, UPB_SIZE(3, 4), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
  upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const struct google_protobuf_Any* envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_fallback_credentials(const envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* msg) {
  const struct google_protobuf_Any* default_val = NULL;
  const struct google_protobuf_Any* ret;
  const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, UPB_SIZE(3, 4), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
  UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__Any_msg_init);
  _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
                                    &default_val, &ret);
  return ret;
}
UPB_INLINE bool envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_has_fallback_credentials(const envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* msg) {
  const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, UPB_SIZE(3, 4), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
  return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}

UPB_INLINE void envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_set_fallback_credentials(envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* msg, struct google_protobuf_Any* value) {
  const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, UPB_SIZE(3, 4), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
  UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__Any_msg_init);
  upb_Message_SetBaseField((upb_Message*)msg, &field, &value);
}
UPB_INLINE struct google_protobuf_Any* envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_mutable_fallback_credentials(
    envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials* msg, upb_Arena* arena) {
  struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_fallback_credentials(msg);
  if (sub == NULL) {
    sub = (struct google_protobuf_Any*)_upb_Message_New(&google__protobuf__Any_msg_init, arena);
    if (sub) envoy_extensions_grpc_service_channel_credentials_xds_v3_XdsCredentials_set_fallback_credentials(msg, sub);
  }
  return sub;
}

#ifdef __cplusplus
              } /* extern "C" */
#endif

#include "upb/port/undef.inc"

#endif /* ENVOY_EXTENSIONS_GRPC_SERVICE_CHANNEL_CREDENTIALS_XDS_V3_XDS_CREDENTIALS_PROTO_UPB_H__UPB_H_ */
