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

#ifndef PROTOBUF_C_token_2ftransaction_2eproto__INCLUDED
#define PROTOBUF_C_token_2ftransaction_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


typedef struct _TokenTransaction TokenTransaction;
typedef struct _PlainTokenAction PlainTokenAction;
typedef struct _PlainImport PlainImport;
typedef struct _PlainTransfer PlainTransfer;
typedef struct _PlainApprove PlainApprove;
typedef struct _PlainTransferFrom PlainTransferFrom;
typedef struct _PlainOutput PlainOutput;
typedef struct _InputId InputId;
typedef struct _PlainDelegatedOutput PlainDelegatedOutput;


/* --- enums --- */


/* --- messages --- */

typedef enum {
  TOKEN_TRANSACTION__ACTION__NOT_SET = 0,
  TOKEN_TRANSACTION__ACTION_PLAIN_ACTION = 1,
} TokenTransaction__ActionCase;

/*
 * TokenTransaction governs the structure of Payload.data, when
 * the transaction's envelope header indicates a transaction of type
 * "Token"
 */
struct  _TokenTransaction
{
  ProtobufCMessage base;
  TokenTransaction__ActionCase action_case;
  union {
    PlainTokenAction *plain_action;
  };
};
#define TOKEN_TRANSACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&token_transaction__descriptor) \
    , TOKEN_TRANSACTION__ACTION__NOT_SET, {0} }


typedef enum {
  PLAIN_TOKEN_ACTION__DATA__NOT_SET = 0,
  PLAIN_TOKEN_ACTION__DATA_PLAIN_IMPORT = 1,
  PLAIN_TOKEN_ACTION__DATA_PLAIN_TRANSFER = 2,
  PLAIN_TOKEN_ACTION__DATA_PLAIN_REDEEM = 3,
  PLAIN_TOKEN_ACTION__DATA_PLAIN_APPROVE = 4,
  PLAIN_TOKEN_ACTION__DATA_PLAIN_TRANSFER__FROM = 5,
} PlainTokenAction__DataCase;

/*
 * PlainTokenAction governs the structure of a token action that is
 * subjected to no privacy restrictions
 */
struct  _PlainTokenAction
{
  ProtobufCMessage base;
  PlainTokenAction__DataCase data_case;
  union {
    /*
     * A plaintext token import transaction
     */
    PlainImport *plain_import;
    /*
     * A plaintext token transfer transaction
     */
    PlainTransfer *plain_transfer;
    /*
     * A plaintext token redeem transaction
     */
    PlainTransfer *plain_redeem;
    /*
     * A plaintext token approve transaction
     */
    PlainApprove *plain_approve;
    /*
     * A plaintext token transfer from transaction
     */
    PlainTransferFrom *plain_transfer_from;
  };
};
#define PLAIN_TOKEN_ACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&plain_token_action__descriptor) \
    , PLAIN_TOKEN_ACTION__DATA__NOT_SET, {0} }


/*
 * PlainImport specifies an import of one or more tokens in plaintext format
 */
struct  _PlainImport
{
  ProtobufCMessage base;
  /*
   * An import transaction may contain one or more outputs
   */
  size_t n_outputs;
  PlainOutput **outputs;
};
#define PLAIN_IMPORT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&plain_import__descriptor) \
    , 0,NULL }


/*
 * PlainTransfer specifies a transfer of one or more plaintext tokens to one or more outputs
 */
struct  _PlainTransfer
{
  ProtobufCMessage base;
  /*
   * The inputs to the transfer transaction are specified by their ID
   */
  size_t n_inputs;
  InputId **inputs;
  /*
   * A transfer transaction may contain one or more outputs
   */
  size_t n_outputs;
  PlainOutput **outputs;
};
#define PLAIN_TRANSFER__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&plain_transfer__descriptor) \
    , 0,NULL, 0,NULL }


/*
 * PlainApprove specifies an approve of one or more tokens in plaintext format
 */
struct  _PlainApprove
{
  ProtobufCMessage base;
  /*
   * The inputs to the transfer transaction are specified by their ID
   */
  size_t n_inputs;
  InputId **inputs;
  /*
   * An approve transaction contains one or more plain delegated outputs
   */
  size_t n_delegated_outputs;
  PlainDelegatedOutput **delegated_outputs;
  /*
   * An approve transaction contains one plain output
   */
  PlainOutput *output;
};
#define PLAIN_APPROVE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&plain_approve__descriptor) \
    , 0,NULL, 0,NULL, NULL }


/*
 * PlainTransferFrom specifies a transfer of one or more plaintext delegated tokens to one or more outputs
 * an to a delegated output
 */
struct  _PlainTransferFrom
{
  ProtobufCMessage base;
  /*
   * The inputs to the transfer transaction are specified by their ID
   */
  size_t n_inputs;
  InputId **inputs;
  /*
   * A transferFrom transaction contains multiple outputs
   */
  size_t n_outputs;
  PlainOutput **outputs;
  /*
   * A transferFrom transaction may contain one delegatable output
   */
  PlainDelegatedOutput *delegated_output;
};
#define PLAIN_TRANSFER_FROM__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&plain_transfer_from__descriptor) \
    , 0,NULL, 0,NULL, NULL }


/*
 * A PlainOutput is the result of import and transfer transactions using plaintext tokens
 */
struct  _PlainOutput
{
  ProtobufCMessage base;
  /*
   * The owner is the serialization of a SerializedIdentity struct
   */
  protobuf_c_boolean has_owner;
  ProtobufCBinaryData owner;
  /*
   * The token type
   */
  char *type;
  /*
   * The quantity of tokens
   */
  protobuf_c_boolean has_quantity;
  uint64_t quantity;
};
#define PLAIN_OUTPUT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&plain_output__descriptor) \
    , 0,{0,NULL}, NULL, 0,0 }


/*
 * An InputId specifies an output using the transaction ID and the index of the output in the transaction
 */
struct  _InputId
{
  ProtobufCMessage base;
  /*
   * The transaction ID
   */
  char *tx_id;
  /*
   * The index of the output in the transaction
   */
  protobuf_c_boolean has_index;
  uint32_t index;
};
#define INPUT_ID__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&input_id__descriptor) \
    , NULL, 0,0 }


/*
 * A PlainDelegatedOutput is the result of approve transactions using plaintext tokens
 */
struct  _PlainDelegatedOutput
{
  ProtobufCMessage base;
  /*
   * The owner is the serialization of a SerializedIdentity struct
   */
  protobuf_c_boolean has_owner;
  ProtobufCBinaryData owner;
  /*
   * The delegatees is an arrary of the serialized identities that can spend the output on behalf
   * the owner
   */
  size_t n_delegatees;
  ProtobufCBinaryData *delegatees;
  /*
   * The token type
   */
  char *type;
  /*
   * The quantity of tokens
   */
  protobuf_c_boolean has_quantity;
  uint64_t quantity;
};
#define PLAIN_DELEGATED_OUTPUT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&plain_delegated_output__descriptor) \
    , 0,{0,NULL}, 0,NULL, NULL, 0,0 }


/* TokenTransaction methods */
void   token_transaction__init
                     (TokenTransaction         *message);
size_t token_transaction__get_packed_size
                     (const TokenTransaction   *message);
size_t token_transaction__pack
                     (const TokenTransaction   *message,
                      uint8_t             *out);
size_t token_transaction__pack_to_buffer
                     (const TokenTransaction   *message,
                      ProtobufCBuffer     *buffer);
TokenTransaction *
       token_transaction__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   token_transaction__free_unpacked
                     (TokenTransaction *message,
                      ProtobufCAllocator *allocator);
/* PlainTokenAction methods */
void   plain_token_action__init
                     (PlainTokenAction         *message);
size_t plain_token_action__get_packed_size
                     (const PlainTokenAction   *message);
size_t plain_token_action__pack
                     (const PlainTokenAction   *message,
                      uint8_t             *out);
size_t plain_token_action__pack_to_buffer
                     (const PlainTokenAction   *message,
                      ProtobufCBuffer     *buffer);
PlainTokenAction *
       plain_token_action__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   plain_token_action__free_unpacked
                     (PlainTokenAction *message,
                      ProtobufCAllocator *allocator);
/* PlainImport methods */
void   plain_import__init
                     (PlainImport         *message);
size_t plain_import__get_packed_size
                     (const PlainImport   *message);
size_t plain_import__pack
                     (const PlainImport   *message,
                      uint8_t             *out);
size_t plain_import__pack_to_buffer
                     (const PlainImport   *message,
                      ProtobufCBuffer     *buffer);
PlainImport *
       plain_import__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   plain_import__free_unpacked
                     (PlainImport *message,
                      ProtobufCAllocator *allocator);
/* PlainTransfer methods */
void   plain_transfer__init
                     (PlainTransfer         *message);
size_t plain_transfer__get_packed_size
                     (const PlainTransfer   *message);
size_t plain_transfer__pack
                     (const PlainTransfer   *message,
                      uint8_t             *out);
size_t plain_transfer__pack_to_buffer
                     (const PlainTransfer   *message,
                      ProtobufCBuffer     *buffer);
PlainTransfer *
       plain_transfer__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   plain_transfer__free_unpacked
                     (PlainTransfer *message,
                      ProtobufCAllocator *allocator);
/* PlainApprove methods */
void   plain_approve__init
                     (PlainApprove         *message);
size_t plain_approve__get_packed_size
                     (const PlainApprove   *message);
size_t plain_approve__pack
                     (const PlainApprove   *message,
                      uint8_t             *out);
size_t plain_approve__pack_to_buffer
                     (const PlainApprove   *message,
                      ProtobufCBuffer     *buffer);
PlainApprove *
       plain_approve__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   plain_approve__free_unpacked
                     (PlainApprove *message,
                      ProtobufCAllocator *allocator);
/* PlainTransferFrom methods */
void   plain_transfer_from__init
                     (PlainTransferFrom         *message);
size_t plain_transfer_from__get_packed_size
                     (const PlainTransferFrom   *message);
size_t plain_transfer_from__pack
                     (const PlainTransferFrom   *message,
                      uint8_t             *out);
size_t plain_transfer_from__pack_to_buffer
                     (const PlainTransferFrom   *message,
                      ProtobufCBuffer     *buffer);
PlainTransferFrom *
       plain_transfer_from__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   plain_transfer_from__free_unpacked
                     (PlainTransferFrom *message,
                      ProtobufCAllocator *allocator);
/* PlainOutput methods */
void   plain_output__init
                     (PlainOutput         *message);
size_t plain_output__get_packed_size
                     (const PlainOutput   *message);
size_t plain_output__pack
                     (const PlainOutput   *message,
                      uint8_t             *out);
size_t plain_output__pack_to_buffer
                     (const PlainOutput   *message,
                      ProtobufCBuffer     *buffer);
PlainOutput *
       plain_output__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   plain_output__free_unpacked
                     (PlainOutput *message,
                      ProtobufCAllocator *allocator);
/* InputId methods */
void   input_id__init
                     (InputId         *message);
size_t input_id__get_packed_size
                     (const InputId   *message);
size_t input_id__pack
                     (const InputId   *message,
                      uint8_t             *out);
size_t input_id__pack_to_buffer
                     (const InputId   *message,
                      ProtobufCBuffer     *buffer);
InputId *
       input_id__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   input_id__free_unpacked
                     (InputId *message,
                      ProtobufCAllocator *allocator);
/* PlainDelegatedOutput methods */
void   plain_delegated_output__init
                     (PlainDelegatedOutput         *message);
size_t plain_delegated_output__get_packed_size
                     (const PlainDelegatedOutput   *message);
size_t plain_delegated_output__pack
                     (const PlainDelegatedOutput   *message,
                      uint8_t             *out);
size_t plain_delegated_output__pack_to_buffer
                     (const PlainDelegatedOutput   *message,
                      ProtobufCBuffer     *buffer);
PlainDelegatedOutput *
       plain_delegated_output__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   plain_delegated_output__free_unpacked
                     (PlainDelegatedOutput *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*TokenTransaction_Closure)
                 (const TokenTransaction *message,
                  void *closure_data);
typedef void (*PlainTokenAction_Closure)
                 (const PlainTokenAction *message,
                  void *closure_data);
typedef void (*PlainImport_Closure)
                 (const PlainImport *message,
                  void *closure_data);
typedef void (*PlainTransfer_Closure)
                 (const PlainTransfer *message,
                  void *closure_data);
typedef void (*PlainApprove_Closure)
                 (const PlainApprove *message,
                  void *closure_data);
typedef void (*PlainTransferFrom_Closure)
                 (const PlainTransferFrom *message,
                  void *closure_data);
typedef void (*PlainOutput_Closure)
                 (const PlainOutput *message,
                  void *closure_data);
typedef void (*InputId_Closure)
                 (const InputId *message,
                  void *closure_data);
typedef void (*PlainDelegatedOutput_Closure)
                 (const PlainDelegatedOutput *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor token_transaction__descriptor;
extern const ProtobufCMessageDescriptor plain_token_action__descriptor;
extern const ProtobufCMessageDescriptor plain_import__descriptor;
extern const ProtobufCMessageDescriptor plain_transfer__descriptor;
extern const ProtobufCMessageDescriptor plain_approve__descriptor;
extern const ProtobufCMessageDescriptor plain_transfer_from__descriptor;
extern const ProtobufCMessageDescriptor plain_output__descriptor;
extern const ProtobufCMessageDescriptor input_id__descriptor;
extern const ProtobufCMessageDescriptor plain_delegated_output__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_token_2ftransaction_2eproto__INCLUDED */
