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

#ifndef PROTOBUF_C_peer_2fproposal_5fresponse_2eproto__INCLUDED
#define PROTOBUF_C_peer_2fproposal_5fresponse_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 "google/protobuf/timestamp.pb-c.h"

typedef struct _Protos__ProposalResponse Protos__ProposalResponse;
typedef struct _Protos__Response Protos__Response;
typedef struct _Protos__ProposalResponsePayload Protos__ProposalResponsePayload;
typedef struct _Protos__Endorsement Protos__Endorsement;


/* --- enums --- */


/* --- messages --- */

/*
 * A ProposalResponse is returned from an endorser to the proposal submitter.
 * The idea is that this message contains the endorser's response to the
 * request of a client to perform an action over a chaincode (or more
 * generically on the ledger); the response might be success/error (conveyed in
 * the Response field) together with a description of the action and a
 * signature over it by that endorser.  If a sufficient number of distinct
 * endorsers agree on the same action and produce signature to that effect, a
 * transaction can be generated and sent for ordering.
 */
struct  _Protos__ProposalResponse
{
  ProtobufCMessage base;
  /*
   * Version indicates message protocol version
   */
  protobuf_c_boolean has_version;
  int32_t version;
  /*
   * Timestamp is the time that the message
   * was created as  defined by the sender
   */
  Google__Protobuf__Timestamp *timestamp;
  /*
   * A response message indicating whether the
   * endorsement of the action was successful
   */
  Protos__Response *response;
  /*
   * The payload of response. It is the bytes of ProposalResponsePayload
   */
  protobuf_c_boolean has_payload;
  ProtobufCBinaryData payload;
  /*
   * The endorsement of the proposal, basically
   * the endorser's signature over the payload
   */
  Protos__Endorsement *endorsement;
};
#define PROTOS__PROPOSAL_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__proposal_response__descriptor) \
    , 0,0, NULL, NULL, 0,{0,NULL}, NULL }


/*
 * A response with a representation similar to an HTTP response that can
 * be used within another message.
 */
struct  _Protos__Response
{
  ProtobufCMessage base;
  /*
   * A status code that should follow the HTTP status codes.
   */
  protobuf_c_boolean has_status;
  int32_t status;
  /*
   * A message associated with the response code.
   */
  char *message;
  /*
   * A payload that can be used to include metadata with this response.
   */
  protobuf_c_boolean has_payload;
  ProtobufCBinaryData payload;
};
#define PROTOS__RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__response__descriptor) \
    , 0,0, NULL, 0,{0,NULL} }


/*
 * ProposalResponsePayload is the payload of a proposal response.  This message
 * is the "bridge" between the client's request and the endorser's action in
 * response to that request. Concretely, for chaincodes, it contains a hashed
 * representation of the proposal (proposalHash) and a representation of the
 * chaincode state changes and events inside the extension field.
 */
struct  _Protos__ProposalResponsePayload
{
  ProtobufCMessage base;
  /*
   * Hash of the proposal that triggered this response. The hash is used to
   * link a response with its proposal, both for bookeeping purposes on an
   * asynchronous system and for security reasons (accountability,
   * non-repudiation). The hash usually covers the entire Proposal message
   * (byte-by-byte). However this implies that the hash can only be verified
   * if the entire proposal message is available when ProposalResponsePayload is
   * included in a transaction or stored in the ledger. For confidentiality
   * reasons, with chaincodes it might be undesirable to store the proposal
   * payload in the ledger.  If the type is CHAINCODE, this is handled by
   * separating the proposal's header and
   * the payload: the header is always hashed in its entirety whereas the
   * payload can either be hashed fully, or only its hash may be hashed, or
   * nothing from the payload can be hashed. The PayloadVisibility field in the
   * Header's extension controls to which extent the proposal payload is
   * "visible" in the sense that was just explained.
   */
  protobuf_c_boolean has_proposal_hash;
  ProtobufCBinaryData proposal_hash;
  /*
   * Extension should be unmarshaled to a type-specific message. The type of
   * the extension in any proposal response depends on the type of the proposal
   * that the client selected when the proposal was initially sent out.  In
   * particular, this information is stored in the type field of a Header.  For
   * chaincode, it's a ChaincodeAction message
   */
  protobuf_c_boolean has_extension;
  ProtobufCBinaryData extension;
};
#define PROTOS__PROPOSAL_RESPONSE_PAYLOAD__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__proposal_response_payload__descriptor) \
    , 0,{0,NULL}, 0,{0,NULL} }


/*
 * An endorsement is a signature of an endorser over a proposal response.  By
 * producing an endorsement message, an endorser implicitly "approves" that
 * proposal response and the actions contained therein. When enough
 * endorsements have been collected, a transaction can be generated out of a
 * set of proposal responses.  Note that this message only contains an identity
 * and a signature but no signed payload. This is intentional because
 * endorsements are supposed to be collected in a transaction, and they are all
 * expected to endorse a single proposal response/action (many endorsements
 * over a single proposal response)
 */
struct  _Protos__Endorsement
{
  ProtobufCMessage base;
  /*
   * Identity of the endorser (e.g. its certificate)
   */
  protobuf_c_boolean has_endorser;
  ProtobufCBinaryData endorser;
  /*
   * Signature of the payload included in ProposalResponse concatenated with
   * the endorser's certificate; ie, sign(ProposalResponse.payload + endorser)
   */
  protobuf_c_boolean has_signature;
  ProtobufCBinaryData signature;
};
#define PROTOS__ENDORSEMENT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__endorsement__descriptor) \
    , 0,{0,NULL}, 0,{0,NULL} }


/* Protos__ProposalResponse methods */
void   protos__proposal_response__init
                     (Protos__ProposalResponse         *message);
size_t protos__proposal_response__get_packed_size
                     (const Protos__ProposalResponse   *message);
size_t protos__proposal_response__pack
                     (const Protos__ProposalResponse   *message,
                      uint8_t             *out);
size_t protos__proposal_response__pack_to_buffer
                     (const Protos__ProposalResponse   *message,
                      ProtobufCBuffer     *buffer);
Protos__ProposalResponse *
       protos__proposal_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__proposal_response__free_unpacked
                     (Protos__ProposalResponse *message,
                      ProtobufCAllocator *allocator);
/* Protos__Response methods */
void   protos__response__init
                     (Protos__Response         *message);
size_t protos__response__get_packed_size
                     (const Protos__Response   *message);
size_t protos__response__pack
                     (const Protos__Response   *message,
                      uint8_t             *out);
size_t protos__response__pack_to_buffer
                     (const Protos__Response   *message,
                      ProtobufCBuffer     *buffer);
Protos__Response *
       protos__response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__response__free_unpacked
                     (Protos__Response *message,
                      ProtobufCAllocator *allocator);
/* Protos__ProposalResponsePayload methods */
void   protos__proposal_response_payload__init
                     (Protos__ProposalResponsePayload         *message);
size_t protos__proposal_response_payload__get_packed_size
                     (const Protos__ProposalResponsePayload   *message);
size_t protos__proposal_response_payload__pack
                     (const Protos__ProposalResponsePayload   *message,
                      uint8_t             *out);
size_t protos__proposal_response_payload__pack_to_buffer
                     (const Protos__ProposalResponsePayload   *message,
                      ProtobufCBuffer     *buffer);
Protos__ProposalResponsePayload *
       protos__proposal_response_payload__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__proposal_response_payload__free_unpacked
                     (Protos__ProposalResponsePayload *message,
                      ProtobufCAllocator *allocator);
/* Protos__Endorsement methods */
void   protos__endorsement__init
                     (Protos__Endorsement         *message);
size_t protos__endorsement__get_packed_size
                     (const Protos__Endorsement   *message);
size_t protos__endorsement__pack
                     (const Protos__Endorsement   *message,
                      uint8_t             *out);
size_t protos__endorsement__pack_to_buffer
                     (const Protos__Endorsement   *message,
                      ProtobufCBuffer     *buffer);
Protos__Endorsement *
       protos__endorsement__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__endorsement__free_unpacked
                     (Protos__Endorsement *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Protos__ProposalResponse_Closure)
                 (const Protos__ProposalResponse *message,
                  void *closure_data);
typedef void (*Protos__Response_Closure)
                 (const Protos__Response *message,
                  void *closure_data);
typedef void (*Protos__ProposalResponsePayload_Closure)
                 (const Protos__ProposalResponsePayload *message,
                  void *closure_data);
typedef void (*Protos__Endorsement_Closure)
                 (const Protos__Endorsement *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor protos__proposal_response__descriptor;
extern const ProtobufCMessageDescriptor protos__response__descriptor;
extern const ProtobufCMessageDescriptor protos__proposal_response_payload__descriptor;
extern const ProtobufCMessageDescriptor protos__endorsement__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_peer_2fproposal_5fresponse_2eproto__INCLUDED */
