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

#ifndef PROTOBUF_C_common_2frequest_2eproto__INCLUDED
#define PROTOBUF_C_common_2frequest_2eproto__INCLUDED

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

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1003000
# 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 1003003 < 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/member.pb-c.h"

typedef struct _Common__TxRequest Common__TxRequest;
typedef struct _Common__RawTxRequest Common__RawTxRequest;
typedef struct _Common__ChainmakerPayload Common__ChainmakerPayload;
typedef struct _Common__EndorsementEntry Common__EndorsementEntry;
typedef struct _Common__KeyValuePair Common__KeyValuePair;
typedef struct _Common__Limit Common__Limit;


/* --- enums --- */

/*
 * transaction type definition
 */
typedef enum _Common__TxType {
  /*
   * call a pre created contract, tx included in block
   */
  COMMON__TX_TYPE__INVOKE_CONTRACT = 0,
  /*
   * query a pre-created  contract, tx not included in block
   */
  COMMON__TX_TYPE__QUERY_CONTRACT = 1,
  /*
   * subscribe block info,tx info and contract info. tx not included in block
   */
  COMMON__TX_TYPE__SUBSCRIBE = 2,
  /*
   * archive/restore block, tx not included in block
   */
  COMMON__TX_TYPE__ARCHIVE = 3
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(COMMON__TX_TYPE)
} Common__TxType;

/* --- messages --- */

/*
 * transaction request proposed by user
 */
struct  _Common__TxRequest
{
  ProtobufCMessage base;
  /*
   * payload
   */
  Common__ChainmakerPayload *payload;
  /*
   * sender account and sender's signature
   */
  Common__EndorsementEntry *sender;
  /*
   * endorsers account and signatures
   */
  size_t n_endorsers;
  Common__EndorsementEntry **endorsers;
};
#define COMMON__TX_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__tx_request__descriptor) \
    , NULL, NULL, 0,NULL }


struct  _Common__RawTxRequest
{
  ProtobufCMessage base;
  ProtobufCBinaryData rawtx;
};
#define COMMON__RAW_TX_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__raw_tx_request__descriptor) \
    , {0,NULL} }


/*
 *transaction payload
 */
struct  _Common__ChainmakerPayload
{
  ProtobufCMessage base;
  /*
   * blockchain identifier
   */
  char *chain_id;
  /*
   * transaction type
   */
  Common__TxType tx_type;
  /*
   * transaction id set by sender, should be unique
   */
  char *tx_id;
  /*
   * transaction timestamp, in unix timestamp format, seconds
   */
  int64_t timestamp;
  /*
   * expiration timestamp in unix timestamp format
   * after that the transaction is invalid if it is not included in block yet
   */
  int64_t expiration_time;
  /*
   * smart contract name
   */
  char *contract_name;
  /*
   * invoke method
   */
  char *method;
  /*
   * invoke parameters in k-v format
   */
  size_t n_parameters;
  Common__KeyValuePair **parameters;
  /*
   * sequence number, default is 0
   */
  uint64_t sequence;
  /*
   * transaction limitation
   */
  Common__Limit *limit;
};
#define COMMON__CHAINMAKER_PAYLOAD__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__chainmaker_payload__descriptor) \
    , (char *)protobuf_c_empty_string, COMMON__TX_TYPE__INVOKE_CONTRACT, (char *)protobuf_c_empty_string, 0, 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0,NULL, 0, NULL }


/*
 * endorsement info, including a signer and his signature
 */
struct  _Common__EndorsementEntry
{
  ProtobufCMessage base;
  /*
   * signer
   */
  Accesscontrol__Member *signer;
  /*
   * signature
   */
  ProtobufCBinaryData signature;
};
#define COMMON__ENDORSEMENT_ENTRY__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__endorsement_entry__descriptor) \
    , NULL, {0,NULL} }


/*
 * a k-v pair
 */
struct  _Common__KeyValuePair
{
  ProtobufCMessage base;
  char *key;
  ProtobufCBinaryData value;
};
#define COMMON__KEY_VALUE_PAIR__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__key_value_pair__descriptor) \
    , (char *)protobuf_c_empty_string, {0,NULL} }


/*
 * Limit defines transaction limitation, Limit as a message for easy expansion
 */
struct  _Common__Limit
{
  ProtobufCMessage base;
  /*
   * gas limit
   */
  uint64_t gas_limit;
};
#define COMMON__LIMIT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__limit__descriptor) \
    , 0 }


/* Common__TxRequest methods */
void   common__tx_request__init
                     (Common__TxRequest         *message);
size_t common__tx_request__get_packed_size
                     (const Common__TxRequest   *message);
size_t common__tx_request__pack
                     (const Common__TxRequest   *message,
                      uint8_t             *out);
size_t common__tx_request__pack_to_buffer
                     (const Common__TxRequest   *message,
                      ProtobufCBuffer     *buffer);
Common__TxRequest *
       common__tx_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__tx_request__free_unpacked
                     (Common__TxRequest *message,
                      ProtobufCAllocator *allocator);
/* Common__RawTxRequest methods */
void   common__raw_tx_request__init
                     (Common__RawTxRequest         *message);
size_t common__raw_tx_request__get_packed_size
                     (const Common__RawTxRequest   *message);
size_t common__raw_tx_request__pack
                     (const Common__RawTxRequest   *message,
                      uint8_t             *out);
size_t common__raw_tx_request__pack_to_buffer
                     (const Common__RawTxRequest   *message,
                      ProtobufCBuffer     *buffer);
Common__RawTxRequest *
       common__raw_tx_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__raw_tx_request__free_unpacked
                     (Common__RawTxRequest *message,
                      ProtobufCAllocator *allocator);
/* Common__ChainmakerPayload methods */
void   common__chainmaker_payload__init
                     (Common__ChainmakerPayload         *message);
size_t common__chainmaker_payload__get_packed_size
                     (const Common__ChainmakerPayload   *message);
size_t common__chainmaker_payload__pack
                     (const Common__ChainmakerPayload   *message,
                      uint8_t             *out);
size_t common__chainmaker_payload__pack_to_buffer
                     (const Common__ChainmakerPayload   *message,
                      ProtobufCBuffer     *buffer);
Common__ChainmakerPayload *
       common__chainmaker_payload__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__chainmaker_payload__free_unpacked
                     (Common__ChainmakerPayload *message,
                      ProtobufCAllocator *allocator);
/* Common__EndorsementEntry methods */
void   common__endorsement_entry__init
                     (Common__EndorsementEntry         *message);
size_t common__endorsement_entry__get_packed_size
                     (const Common__EndorsementEntry   *message);
size_t common__endorsement_entry__pack
                     (const Common__EndorsementEntry   *message,
                      uint8_t             *out);
size_t common__endorsement_entry__pack_to_buffer
                     (const Common__EndorsementEntry   *message,
                      ProtobufCBuffer     *buffer);
Common__EndorsementEntry *
       common__endorsement_entry__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__endorsement_entry__free_unpacked
                     (Common__EndorsementEntry *message,
                      ProtobufCAllocator *allocator);
/* Common__KeyValuePair methods */
void   common__key_value_pair__init
                     (Common__KeyValuePair         *message);
size_t common__key_value_pair__get_packed_size
                     (const Common__KeyValuePair   *message);
size_t common__key_value_pair__pack
                     (const Common__KeyValuePair   *message,
                      uint8_t             *out);
size_t common__key_value_pair__pack_to_buffer
                     (const Common__KeyValuePair   *message,
                      ProtobufCBuffer     *buffer);
Common__KeyValuePair *
       common__key_value_pair__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__key_value_pair__free_unpacked
                     (Common__KeyValuePair *message,
                      ProtobufCAllocator *allocator);
/* Common__Limit methods */
void   common__limit__init
                     (Common__Limit         *message);
size_t common__limit__get_packed_size
                     (const Common__Limit   *message);
size_t common__limit__pack
                     (const Common__Limit   *message,
                      uint8_t             *out);
size_t common__limit__pack_to_buffer
                     (const Common__Limit   *message,
                      ProtobufCBuffer     *buffer);
Common__Limit *
       common__limit__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__limit__free_unpacked
                     (Common__Limit *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Common__TxRequest_Closure)
                 (const Common__TxRequest *message,
                  void *closure_data);
typedef void (*Common__RawTxRequest_Closure)
                 (const Common__RawTxRequest *message,
                  void *closure_data);
typedef void (*Common__ChainmakerPayload_Closure)
                 (const Common__ChainmakerPayload *message,
                  void *closure_data);
typedef void (*Common__EndorsementEntry_Closure)
                 (const Common__EndorsementEntry *message,
                  void *closure_data);
typedef void (*Common__KeyValuePair_Closure)
                 (const Common__KeyValuePair *message,
                  void *closure_data);
typedef void (*Common__Limit_Closure)
                 (const Common__Limit *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCEnumDescriptor    common__tx_type__descriptor;
extern const ProtobufCMessageDescriptor common__tx_request__descriptor;
extern const ProtobufCMessageDescriptor common__raw_tx_request__descriptor;
extern const ProtobufCMessageDescriptor common__chainmaker_payload__descriptor;
extern const ProtobufCMessageDescriptor common__endorsement_entry__descriptor;
extern const ProtobufCMessageDescriptor common__key_value_pair__descriptor;
extern const ProtobufCMessageDescriptor common__limit__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_common_2frequest_2eproto__INCLUDED */
