/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: peer/events.proto */

#ifndef PROTOBUF_C_peer_2fevents_2eproto__INCLUDED
#define PROTOBUF_C_peer_2fevents_2eproto__INCLUDED

#include <protobuf-c/protobuf-c.h>

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1000000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif

#include "common/common.pb-c.h"
#include "google/protobuf/timestamp.pb-c.h"
#include "peer/chaincode_event.pb-c.h"
#include "peer/transaction.pb-c.h"

typedef struct _Protos__FilteredBlock Protos__FilteredBlock;
typedef struct _Protos__FilteredTransaction Protos__FilteredTransaction;
typedef struct _Protos__FilteredTransactionActions Protos__FilteredTransactionActions;
typedef struct _Protos__FilteredChaincodeAction Protos__FilteredChaincodeAction;
typedef struct _Protos__DeliverResponse Protos__DeliverResponse;


/* --- enums --- */


/* --- messages --- */

/*
 * FilteredBlock is a minimal set of information about a block
 */
struct  _Protos__FilteredBlock
{
  ProtobufCMessage base;
  char *channel_id;
  /*
   * The position in the blockchain
   */
  protobuf_c_boolean has_number;
  uint64_t number;
  size_t n_filtered_transactions;
  Protos__FilteredTransaction **filtered_transactions;
};
#define PROTOS__FILTERED_BLOCK__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__filtered_block__descriptor) \
    , NULL, 0,0, 0,NULL }


typedef enum {
  PROTOS__FILTERED_TRANSACTION__DATA__NOT_SET = 0,
  PROTOS__FILTERED_TRANSACTION__DATA_TRANSACTION_ACTIONS = 4,
} Protos__FilteredTransaction__DataCase;

/*
 * FilteredTransaction is a minimal set of information about a transaction
 * within a block
 */
struct  _Protos__FilteredTransaction
{
  ProtobufCMessage base;
  char *txid;
  protobuf_c_boolean has_type;
  Common__HeaderType type;
  protobuf_c_boolean has_tx_validation_code;
  Protos__TxValidationCode tx_validation_code;
  Protos__FilteredTransaction__DataCase data_case;
  union {
    Protos__FilteredTransactionActions *transaction_actions;
  };
};
#define PROTOS__FILTERED_TRANSACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__filtered_transaction__descriptor) \
    , NULL, 0,0, 0,0, PROTOS__FILTERED_TRANSACTION__DATA__NOT_SET, {0} }


/*
 * FilteredTransactionActions is a wrapper for array of TransactionAction
 * message from regular block
 */
struct  _Protos__FilteredTransactionActions
{
  ProtobufCMessage base;
  size_t n_chaincode_actions;
  Protos__FilteredChaincodeAction **chaincode_actions;
};
#define PROTOS__FILTERED_TRANSACTION_ACTIONS__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__filtered_transaction_actions__descriptor) \
    , 0,NULL }


/*
 * FilteredChaincodeAction is a minimal set of information about an action
 * within a transaction
 */
struct  _Protos__FilteredChaincodeAction
{
  ProtobufCMessage base;
  Protos__ChaincodeEvent *chaincode_event;
};
#define PROTOS__FILTERED_CHAINCODE_ACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__filtered_chaincode_action__descriptor) \
    , NULL }


typedef enum {
  PROTOS__DELIVER_RESPONSE__TYPE__NOT_SET = 0,
  PROTOS__DELIVER_RESPONSE__TYPE_STATUS = 1,
  PROTOS__DELIVER_RESPONSE__TYPE_BLOCK = 2,
  PROTOS__DELIVER_RESPONSE__TYPE_FILTERED_BLOCK = 3,
} Protos__DeliverResponse__TypeCase;

/*
 * DeliverResponse
 */
struct  _Protos__DeliverResponse
{
  ProtobufCMessage base;
  Protos__DeliverResponse__TypeCase type_case;
  union {
    Common__Status status;
    Common__Block *block;
    Protos__FilteredBlock *filtered_block;
  };
};
#define PROTOS__DELIVER_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__deliver_response__descriptor) \
    , PROTOS__DELIVER_RESPONSE__TYPE__NOT_SET, {0} }


/* Protos__FilteredBlock methods */
void   protos__filtered_block__init
                     (Protos__FilteredBlock         *message);
size_t protos__filtered_block__get_packed_size
                     (const Protos__FilteredBlock   *message);
size_t protos__filtered_block__pack
                     (const Protos__FilteredBlock   *message,
                      uint8_t             *out);
size_t protos__filtered_block__pack_to_buffer
                     (const Protos__FilteredBlock   *message,
                      ProtobufCBuffer     *buffer);
Protos__FilteredBlock *
       protos__filtered_block__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__filtered_block__free_unpacked
                     (Protos__FilteredBlock *message,
                      ProtobufCAllocator *allocator);
/* Protos__FilteredTransaction methods */
void   protos__filtered_transaction__init
                     (Protos__FilteredTransaction         *message);
size_t protos__filtered_transaction__get_packed_size
                     (const Protos__FilteredTransaction   *message);
size_t protos__filtered_transaction__pack
                     (const Protos__FilteredTransaction   *message,
                      uint8_t             *out);
size_t protos__filtered_transaction__pack_to_buffer
                     (const Protos__FilteredTransaction   *message,
                      ProtobufCBuffer     *buffer);
Protos__FilteredTransaction *
       protos__filtered_transaction__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__filtered_transaction__free_unpacked
                     (Protos__FilteredTransaction *message,
                      ProtobufCAllocator *allocator);
/* Protos__FilteredTransactionActions methods */
void   protos__filtered_transaction_actions__init
                     (Protos__FilteredTransactionActions         *message);
size_t protos__filtered_transaction_actions__get_packed_size
                     (const Protos__FilteredTransactionActions   *message);
size_t protos__filtered_transaction_actions__pack
                     (const Protos__FilteredTransactionActions   *message,
                      uint8_t             *out);
size_t protos__filtered_transaction_actions__pack_to_buffer
                     (const Protos__FilteredTransactionActions   *message,
                      ProtobufCBuffer     *buffer);
Protos__FilteredTransactionActions *
       protos__filtered_transaction_actions__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__filtered_transaction_actions__free_unpacked
                     (Protos__FilteredTransactionActions *message,
                      ProtobufCAllocator *allocator);
/* Protos__FilteredChaincodeAction methods */
void   protos__filtered_chaincode_action__init
                     (Protos__FilteredChaincodeAction         *message);
size_t protos__filtered_chaincode_action__get_packed_size
                     (const Protos__FilteredChaincodeAction   *message);
size_t protos__filtered_chaincode_action__pack
                     (const Protos__FilteredChaincodeAction   *message,
                      uint8_t             *out);
size_t protos__filtered_chaincode_action__pack_to_buffer
                     (const Protos__FilteredChaincodeAction   *message,
                      ProtobufCBuffer     *buffer);
Protos__FilteredChaincodeAction *
       protos__filtered_chaincode_action__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__filtered_chaincode_action__free_unpacked
                     (Protos__FilteredChaincodeAction *message,
                      ProtobufCAllocator *allocator);
/* Protos__DeliverResponse methods */
void   protos__deliver_response__init
                     (Protos__DeliverResponse         *message);
size_t protos__deliver_response__get_packed_size
                     (const Protos__DeliverResponse   *message);
size_t protos__deliver_response__pack
                     (const Protos__DeliverResponse   *message,
                      uint8_t             *out);
size_t protos__deliver_response__pack_to_buffer
                     (const Protos__DeliverResponse   *message,
                      ProtobufCBuffer     *buffer);
Protos__DeliverResponse *
       protos__deliver_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__deliver_response__free_unpacked
                     (Protos__DeliverResponse *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Protos__FilteredBlock_Closure)
                 (const Protos__FilteredBlock *message,
                  void *closure_data);
typedef void (*Protos__FilteredTransaction_Closure)
                 (const Protos__FilteredTransaction *message,
                  void *closure_data);
typedef void (*Protos__FilteredTransactionActions_Closure)
                 (const Protos__FilteredTransactionActions *message,
                  void *closure_data);
typedef void (*Protos__FilteredChaincodeAction_Closure)
                 (const Protos__FilteredChaincodeAction *message,
                  void *closure_data);
typedef void (*Protos__DeliverResponse_Closure)
                 (const Protos__DeliverResponse *message,
                  void *closure_data);

/* --- services --- */

typedef struct _Protos__Deliver_Service Protos__Deliver_Service;
struct _Protos__Deliver_Service
{
  ProtobufCService base;
  void (*deliver)(Protos__Deliver_Service *service,
                  const Common__Envelope *input,
                  Protos__DeliverResponse_Closure closure,
                  void *closure_data);
  void (*deliver_filtered)(Protos__Deliver_Service *service,
                           const Common__Envelope *input,
                           Protos__DeliverResponse_Closure closure,
                           void *closure_data);
};
typedef void (*Protos__Deliver_ServiceDestroy)(Protos__Deliver_Service *);
void protos__deliver__init (Protos__Deliver_Service *service,
                            Protos__Deliver_ServiceDestroy destroy);
#define PROTOS__DELIVER__BASE_INIT \
    { &protos__deliver__descriptor, protobuf_c_service_invoke_internal, NULL }
#define PROTOS__DELIVER__INIT(function_prefix__) \
    { PROTOS__DELIVER__BASE_INIT,\
      function_prefix__ ## deliver,\
      function_prefix__ ## deliver_filtered  }
void protos__deliver__deliver(ProtobufCService *service,
                              const Common__Envelope *input,
                              Protos__DeliverResponse_Closure closure,
                              void *closure_data);
void protos__deliver__deliver_filtered(ProtobufCService *service,
                                       const Common__Envelope *input,
                                       Protos__DeliverResponse_Closure closure,
                                       void *closure_data);

/* --- descriptors --- */

extern const ProtobufCMessageDescriptor protos__filtered_block__descriptor;
extern const ProtobufCMessageDescriptor protos__filtered_transaction__descriptor;
extern const ProtobufCMessageDescriptor protos__filtered_transaction_actions__descriptor;
extern const ProtobufCMessageDescriptor protos__filtered_chaincode_action__descriptor;
extern const ProtobufCMessageDescriptor protos__deliver_response__descriptor;
extern const ProtobufCServiceDescriptor protos__deliver__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_peer_2fevents_2eproto__INCLUDED */
