/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2019 Erik Moqvist
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/**
 * This file was generated by pbtools.
 */

#ifndef FIELD_NAMES_H
#define FIELD_NAMES_H

#ifdef __cplusplus
extern "C" {
#endif

#include "pbtools.h"

/**
 * Enum field_names.Enum.
 */
enum field_names_enum_e {
    field_names_enum_a_e = 0,
    field_names_enum_b_e = 1
};

/**
 * Message field_names.Message.
 */
struct field_names_message_repeated_t {
    int length;
    struct field_names_message_t *items_p;
};

struct field_names_message_t {
    struct pbtools_message_base_t base;
    bool my_value;
};

/**
 * Message field_names.MessageCamelCase.
 */
struct field_names_message_camel_case_repeated_t {
    int length;
    struct field_names_message_camel_case_t *items_p;
};

struct field_names_message_camel_case_t {
    struct pbtools_message_base_t base;
    int32_t my_int32;
    int64_t my_int64;
    int32_t my_sint32;
    int64_t my_sint64;
    uint32_t my_uint32;
    uint64_t my_uint64;
    uint32_t my_fixed32;
    uint64_t my_fixed64;
    int32_t my_sfixed32;
    int64_t my_sfixed64;
    float my_float;
    double my_double;
    bool my_bool;
    char *my_string_p;
    struct pbtools_bytes_t my_bytes;
    enum field_names_enum_e my_enum;
    struct field_names_message_t my_message;
};

/**
 * Message field_names.MessagePascalCase.
 */
struct field_names_message_pascal_case_repeated_t {
    int length;
    struct field_names_message_pascal_case_t *items_p;
};

struct field_names_message_pascal_case_t {
    struct pbtools_message_base_t base;
    int32_t my_int32;
    int64_t my_int64;
    int32_t my_sint32;
    int64_t my_sint64;
    uint32_t my_uint32;
    uint64_t my_uint64;
    uint32_t my_fixed32;
    uint64_t my_fixed64;
    int32_t my_sfixed32;
    int64_t my_sfixed64;
    float my_float;
    double my_double;
    bool my_bool;
    char *my_string_p;
    struct pbtools_bytes_t my_bytes;
    enum field_names_enum_e my_enum;
    struct field_names_message_t my_message;
};

/**
 * Message field_names.RepeatedMessageCamelCase.
 */
struct field_names_repeated_message_camel_case_repeated_t {
    int length;
    struct field_names_repeated_message_camel_case_t *items_p;
};

struct field_names_repeated_message_camel_case_t {
    struct pbtools_message_base_t base;
    struct pbtools_repeated_int32_t my_int32;
    struct pbtools_repeated_int64_t my_int64;
    struct pbtools_repeated_int32_t my_sint32;
    struct pbtools_repeated_int64_t my_sint64;
    struct pbtools_repeated_uint32_t my_uint32;
    struct pbtools_repeated_uint64_t my_uint64;
    struct pbtools_repeated_uint32_t my_fixed32;
    struct pbtools_repeated_uint64_t my_fixed64;
    struct pbtools_repeated_int32_t my_sfixed32;
    struct pbtools_repeated_int64_t my_sfixed64;
    struct pbtools_repeated_float_t my_float;
    struct pbtools_repeated_double_t my_double;
    struct pbtools_repeated_bool_t my_bool;
    struct pbtools_repeated_string_t my_string;
    struct pbtools_repeated_bytes_t my_bytes;
    struct pbtools_repeated_int32_t my_enum;
    struct field_names_message_repeated_t my_message;
};

/**
 * Message field_names.RepeatedMessagePascalCase.
 */
struct field_names_repeated_message_pascal_case_repeated_t {
    int length;
    struct field_names_repeated_message_pascal_case_t *items_p;
};

struct field_names_repeated_message_pascal_case_t {
    struct pbtools_message_base_t base;
    struct pbtools_repeated_int32_t my_int32;
    struct pbtools_repeated_int64_t my_int64;
    struct pbtools_repeated_int32_t my_sint32;
    struct pbtools_repeated_int64_t my_sint64;
    struct pbtools_repeated_uint32_t my_uint32;
    struct pbtools_repeated_uint64_t my_uint64;
    struct pbtools_repeated_uint32_t my_fixed32;
    struct pbtools_repeated_uint64_t my_fixed64;
    struct pbtools_repeated_int32_t my_sfixed32;
    struct pbtools_repeated_int64_t my_sfixed64;
    struct pbtools_repeated_float_t my_float;
    struct pbtools_repeated_double_t my_double;
    struct pbtools_repeated_bool_t my_bool;
    struct pbtools_repeated_string_t my_string;
    struct pbtools_repeated_bytes_t my_bytes;
    struct pbtools_repeated_int32_t my_enum;
    struct field_names_message_repeated_t my_message;
};

/**
 * Enum field_names.MessageOneOf.OneOf.
 */
enum field_names_message_one_of_one_of_choice_e {
    field_names_message_one_of_one_of_choice_none_e = 0,
    field_names_message_one_of_one_of_choice_camel_case_message_e = 1,
    field_names_message_one_of_one_of_choice_pascal_case_message_e = 2,
    field_names_message_one_of_one_of_choice_camel_case_message_repeated_e = 3,
    field_names_message_one_of_one_of_choice_pascal_case_message_repeated_e = 4,
    field_names_message_one_of_one_of_choice_my_int32_e = 5,
    field_names_message_one_of_one_of_choice_my_string_e = 6,
    field_names_message_one_of_one_of_choice_my_bytes_e = 7
};

/**
 * Oneof field_names.MessageOneOf.OneOf.
 */
struct field_names_message_one_of_one_of_oneof_t {
    enum field_names_message_one_of_one_of_choice_e choice;
    union {
        struct field_names_message_camel_case_t camel_case_message;
        struct field_names_message_pascal_case_t pascal_case_message;
        struct field_names_repeated_message_camel_case_t camel_case_message_repeated;
        struct field_names_repeated_message_pascal_case_t pascal_case_message_repeated;
        int32_t my_int32;
        char *my_string_p;
        struct pbtools_bytes_t my_bytes;
    } value;
};

/**
 * Message field_names.MessageOneOf.
 */
struct field_names_message_one_of_repeated_t {
    int length;
    struct field_names_message_one_of_t *items_p;
};

struct field_names_message_one_of_t {
    struct pbtools_message_base_t base;
    struct field_names_message_one_of_one_of_oneof_t one_of;
};

/**
 * Encoding and decoding of field_names.Message.
 */
struct field_names_message_t *
field_names_message_new(
    void *workspace_p,
    size_t size);

int field_names_message_encode(
    struct field_names_message_t *self_p,
    uint8_t *encoded_p,
    size_t size);

int field_names_message_decode(
    struct field_names_message_t *self_p,
    const uint8_t *encoded_p,
    size_t size);

/**
 * Encoding and decoding of field_names.MessageCamelCase.
 */
struct field_names_message_camel_case_t *
field_names_message_camel_case_new(
    void *workspace_p,
    size_t size);

int field_names_message_camel_case_encode(
    struct field_names_message_camel_case_t *self_p,
    uint8_t *encoded_p,
    size_t size);

int field_names_message_camel_case_decode(
    struct field_names_message_camel_case_t *self_p,
    const uint8_t *encoded_p,
    size_t size);

/**
 * Encoding and decoding of field_names.MessagePascalCase.
 */
struct field_names_message_pascal_case_t *
field_names_message_pascal_case_new(
    void *workspace_p,
    size_t size);

int field_names_message_pascal_case_encode(
    struct field_names_message_pascal_case_t *self_p,
    uint8_t *encoded_p,
    size_t size);

int field_names_message_pascal_case_decode(
    struct field_names_message_pascal_case_t *self_p,
    const uint8_t *encoded_p,
    size_t size);

int field_names_repeated_message_camel_case_my_int32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_int64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_sint32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_sint64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_uint32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_uint64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_fixed32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_fixed64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_sfixed32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_sfixed64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_float_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_double_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_bool_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_string_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_bytes_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_enum_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

int field_names_repeated_message_camel_case_my_message_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length);

/**
 * Encoding and decoding of field_names.RepeatedMessageCamelCase.
 */
struct field_names_repeated_message_camel_case_t *
field_names_repeated_message_camel_case_new(
    void *workspace_p,
    size_t size);

int field_names_repeated_message_camel_case_encode(
    struct field_names_repeated_message_camel_case_t *self_p,
    uint8_t *encoded_p,
    size_t size);

int field_names_repeated_message_camel_case_decode(
    struct field_names_repeated_message_camel_case_t *self_p,
    const uint8_t *encoded_p,
    size_t size);

int field_names_repeated_message_pascal_case_my_int32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_int64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_sint32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_sint64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_uint32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_uint64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_fixed32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_fixed64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_sfixed32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_sfixed64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_float_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_double_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_bool_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_string_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_bytes_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_enum_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

int field_names_repeated_message_pascal_case_my_message_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length);

/**
 * Encoding and decoding of field_names.RepeatedMessagePascalCase.
 */
struct field_names_repeated_message_pascal_case_t *
field_names_repeated_message_pascal_case_new(
    void *workspace_p,
    size_t size);

int field_names_repeated_message_pascal_case_encode(
    struct field_names_repeated_message_pascal_case_t *self_p,
    uint8_t *encoded_p,
    size_t size);

int field_names_repeated_message_pascal_case_decode(
    struct field_names_repeated_message_pascal_case_t *self_p,
    const uint8_t *encoded_p,
    size_t size);

void field_names_message_one_of_one_of_camel_case_message_init(
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_one_of_pascal_case_message_init(
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_one_of_camel_case_message_repeated_init(
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_one_of_pascal_case_message_repeated_init(
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_one_of_my_int32_init(
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_one_of_my_string_init(
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_one_of_my_bytes_init(
    struct field_names_message_one_of_t *self_p);

/**
 * Encoding and decoding of field_names.MessageOneOf.
 */
struct field_names_message_one_of_t *
field_names_message_one_of_new(
    void *workspace_p,
    size_t size);

int field_names_message_one_of_encode(
    struct field_names_message_one_of_t *self_p,
    uint8_t *encoded_p,
    size_t size);

int field_names_message_one_of_decode(
    struct field_names_message_one_of_t *self_p,
    const uint8_t *encoded_p,
    size_t size);

/* Internal functions. Do not use! */

void field_names_message_init(
    struct field_names_message_t *self_p,
    struct pbtools_heap_t *heap_p);

void field_names_message_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_message_t *self_p);

void field_names_message_decode_inner(
    struct pbtools_decoder_t *decoder_p,
    struct field_names_message_t *self_p);

void field_names_message_encode_repeated_inner(
    struct pbtools_encoder_t *encoder_p,
    int field_number,
    struct field_names_message_repeated_t *repeated_p);

void field_names_message_decode_repeated_inner(
    struct pbtools_decoder_t *decoder_p,
    struct pbtools_repeated_info_t *repeated_info_p,
    struct field_names_message_repeated_t *repeated_p);

void field_names_message_camel_case_init(
    struct field_names_message_camel_case_t *self_p,
    struct pbtools_heap_t *heap_p);

void field_names_message_camel_case_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_message_camel_case_t *self_p);

void field_names_message_camel_case_decode_inner(
    struct pbtools_decoder_t *decoder_p,
    struct field_names_message_camel_case_t *self_p);

void field_names_message_camel_case_encode_repeated_inner(
    struct pbtools_encoder_t *encoder_p,
    int field_number,
    struct field_names_message_camel_case_repeated_t *repeated_p);

void field_names_message_camel_case_decode_repeated_inner(
    struct pbtools_decoder_t *decoder_p,
    struct pbtools_repeated_info_t *repeated_info_p,
    struct field_names_message_camel_case_repeated_t *repeated_p);

void field_names_message_pascal_case_init(
    struct field_names_message_pascal_case_t *self_p,
    struct pbtools_heap_t *heap_p);

void field_names_message_pascal_case_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_message_pascal_case_t *self_p);

void field_names_message_pascal_case_decode_inner(
    struct pbtools_decoder_t *decoder_p,
    struct field_names_message_pascal_case_t *self_p);

void field_names_message_pascal_case_encode_repeated_inner(
    struct pbtools_encoder_t *encoder_p,
    int field_number,
    struct field_names_message_pascal_case_repeated_t *repeated_p);

void field_names_message_pascal_case_decode_repeated_inner(
    struct pbtools_decoder_t *decoder_p,
    struct pbtools_repeated_info_t *repeated_info_p,
    struct field_names_message_pascal_case_repeated_t *repeated_p);

void field_names_repeated_message_camel_case_init(
    struct field_names_repeated_message_camel_case_t *self_p,
    struct pbtools_heap_t *heap_p);

void field_names_repeated_message_camel_case_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_repeated_message_camel_case_t *self_p);

void field_names_repeated_message_camel_case_decode_inner(
    struct pbtools_decoder_t *decoder_p,
    struct field_names_repeated_message_camel_case_t *self_p);

void field_names_repeated_message_camel_case_encode_repeated_inner(
    struct pbtools_encoder_t *encoder_p,
    int field_number,
    struct field_names_repeated_message_camel_case_repeated_t *repeated_p);

void field_names_repeated_message_camel_case_decode_repeated_inner(
    struct pbtools_decoder_t *decoder_p,
    struct pbtools_repeated_info_t *repeated_info_p,
    struct field_names_repeated_message_camel_case_repeated_t *repeated_p);

void field_names_repeated_message_pascal_case_init(
    struct field_names_repeated_message_pascal_case_t *self_p,
    struct pbtools_heap_t *heap_p);

void field_names_repeated_message_pascal_case_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_repeated_message_pascal_case_t *self_p);

void field_names_repeated_message_pascal_case_decode_inner(
    struct pbtools_decoder_t *decoder_p,
    struct field_names_repeated_message_pascal_case_t *self_p);

void field_names_repeated_message_pascal_case_encode_repeated_inner(
    struct pbtools_encoder_t *encoder_p,
    int field_number,
    struct field_names_repeated_message_pascal_case_repeated_t *repeated_p);

void field_names_repeated_message_pascal_case_decode_repeated_inner(
    struct pbtools_decoder_t *decoder_p,
    struct pbtools_repeated_info_t *repeated_info_p,
    struct field_names_repeated_message_pascal_case_repeated_t *repeated_p);

void field_names_message_one_of_init(
    struct field_names_message_one_of_t *self_p,
    struct pbtools_heap_t *heap_p);

void field_names_message_one_of_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_decode_inner(
    struct pbtools_decoder_t *decoder_p,
    struct field_names_message_one_of_t *self_p);

void field_names_message_one_of_encode_repeated_inner(
    struct pbtools_encoder_t *encoder_p,
    int field_number,
    struct field_names_message_one_of_repeated_t *repeated_p);

void field_names_message_one_of_decode_repeated_inner(
    struct pbtools_decoder_t *decoder_p,
    struct pbtools_repeated_info_t *repeated_info_p,
    struct field_names_message_one_of_repeated_t *repeated_p);

#ifdef __cplusplus
}
#endif

#endif
