/**
 * 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.
 */

#include <limits.h>
#include "field_names.h"

#if CHAR_BIT != 8
#    error "Number of bits in a char must be 8."
#endif

void field_names_message_init(
    struct field_names_message_t *self_p,
    struct pbtools_heap_t *heap_p)
{
    self_p->base.heap_p = heap_p;
    self_p->my_value = 0;
}

void field_names_message_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_message_t *self_p)
{
    pbtools_encoder_write_bool(encoder_p, 1, self_p->my_value);
}

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

    while (pbtools_decoder_available(decoder_p)) {
        switch (pbtools_decoder_read_tag(decoder_p, &wire_type)) {

        case 1:
            self_p->my_value = pbtools_decoder_read_bool(decoder_p, wire_type);
            break;

        default:
            pbtools_decoder_skip_field(decoder_p, wire_type);
            break;
        }
    }
}

void field_names_message_encode_repeated_inner(
    struct pbtools_encoder_t *encoder_p,
    int field_number,
    struct field_names_message_repeated_t *repeated_p)
{
    pbtools_encode_repeated_inner(
        encoder_p,
        field_number,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_t),
        (pbtools_message_encode_inner_t)field_names_message_encode_inner);
}

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)
{
    pbtools_decode_repeated_inner(
        decoder_p,
        repeated_info_p,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_t),
        (pbtools_message_init_t)field_names_message_init,
        (pbtools_message_decode_inner_t)field_names_message_decode_inner);
}

struct field_names_message_t *
field_names_message_new(
    void *workspace_p,
    size_t size)
{
    return (pbtools_message_new(
                workspace_p,
                size,
                sizeof(struct field_names_message_t),
                (pbtools_message_init_t)field_names_message_init));
}

int field_names_message_encode(
    struct field_names_message_t *self_p,
    uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_encode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_encode_inner_t)field_names_message_encode_inner));
}

int field_names_message_decode(
    struct field_names_message_t *self_p,
    const uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_decode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_decode_inner_t)field_names_message_decode_inner));
}

void field_names_message_camel_case_init(
    struct field_names_message_camel_case_t *self_p,
    struct pbtools_heap_t *heap_p)
{
    self_p->base.heap_p = heap_p;
    self_p->my_int32 = 0;
    self_p->my_int64 = 0;
    self_p->my_sint32 = 0;
    self_p->my_sint64 = 0;
    self_p->my_uint32 = 0;
    self_p->my_uint64 = 0;
    self_p->my_fixed32 = 0;
    self_p->my_fixed64 = 0;
    self_p->my_sfixed32 = 0;
    self_p->my_sfixed64 = 0;
    self_p->my_float = 0;
    self_p->my_double = 0;
    self_p->my_bool = 0;
    self_p->my_string_p = "";
    pbtools_bytes_init(&self_p->my_bytes);
    self_p->my_enum = 0;
    field_names_message_init(&self_p->my_message, 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)
{
    pbtools_encoder_sub_message_encode(
        encoder_p,
        17,
        &self_p->my_message.base,
        (pbtools_message_encode_inner_t)field_names_message_encode_inner);
    pbtools_encoder_write_enum(encoder_p, 16, self_p->my_enum);
    pbtools_encoder_write_bytes(encoder_p, 15, &self_p->my_bytes);
    pbtools_encoder_write_string(encoder_p, 14, self_p->my_string_p);
    pbtools_encoder_write_bool(encoder_p, 13, self_p->my_bool);
    pbtools_encoder_write_double(encoder_p, 12, self_p->my_double);
    pbtools_encoder_write_float(encoder_p, 11, self_p->my_float);
    pbtools_encoder_write_sfixed64(encoder_p, 10, self_p->my_sfixed64);
    pbtools_encoder_write_sfixed32(encoder_p, 9, self_p->my_sfixed32);
    pbtools_encoder_write_fixed64(encoder_p, 8, self_p->my_fixed64);
    pbtools_encoder_write_fixed32(encoder_p, 7, self_p->my_fixed32);
    pbtools_encoder_write_uint64(encoder_p, 6, self_p->my_uint64);
    pbtools_encoder_write_uint32(encoder_p, 5, self_p->my_uint32);
    pbtools_encoder_write_sint64(encoder_p, 4, self_p->my_sint64);
    pbtools_encoder_write_sint32(encoder_p, 3, self_p->my_sint32);
    pbtools_encoder_write_int64(encoder_p, 2, self_p->my_int64);
    pbtools_encoder_write_int32(encoder_p, 1, self_p->my_int32);
}

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

    while (pbtools_decoder_available(decoder_p)) {
        switch (pbtools_decoder_read_tag(decoder_p, &wire_type)) {

        case 1:
            self_p->my_int32 = pbtools_decoder_read_int32(decoder_p, wire_type);
            break;

        case 2:
            self_p->my_int64 = pbtools_decoder_read_int64(decoder_p, wire_type);
            break;

        case 3:
            self_p->my_sint32 = pbtools_decoder_read_sint32(decoder_p, wire_type);
            break;

        case 4:
            self_p->my_sint64 = pbtools_decoder_read_sint64(decoder_p, wire_type);
            break;

        case 5:
            self_p->my_uint32 = pbtools_decoder_read_uint32(decoder_p, wire_type);
            break;

        case 6:
            self_p->my_uint64 = pbtools_decoder_read_uint64(decoder_p, wire_type);
            break;

        case 7:
            self_p->my_fixed32 = pbtools_decoder_read_fixed32(decoder_p, wire_type);
            break;

        case 8:
            self_p->my_fixed64 = pbtools_decoder_read_fixed64(decoder_p, wire_type);
            break;

        case 9:
            self_p->my_sfixed32 = pbtools_decoder_read_sfixed32(decoder_p, wire_type);
            break;

        case 10:
            self_p->my_sfixed64 = pbtools_decoder_read_sfixed64(decoder_p, wire_type);
            break;

        case 11:
            self_p->my_float = pbtools_decoder_read_float(decoder_p, wire_type);
            break;

        case 12:
            self_p->my_double = pbtools_decoder_read_double(decoder_p, wire_type);
            break;

        case 13:
            self_p->my_bool = pbtools_decoder_read_bool(decoder_p, wire_type);
            break;

        case 14:
            pbtools_decoder_read_string(decoder_p, wire_type, &self_p->my_string_p);
            break;

        case 15:
            pbtools_decoder_read_bytes(decoder_p, wire_type, &self_p->my_bytes);
            break;

        case 16:
            self_p->my_enum = pbtools_decoder_read_enum(decoder_p, wire_type);
            break;

        case 17:
            pbtools_decoder_sub_message_decode(
                decoder_p,
                wire_type,
                &self_p->my_message.base,
                (pbtools_message_decode_inner_t)field_names_message_decode_inner);
            break;

        default:
            pbtools_decoder_skip_field(decoder_p, wire_type);
            break;
        }
    }
}

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)
{
    pbtools_encode_repeated_inner(
        encoder_p,
        field_number,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_camel_case_t),
        (pbtools_message_encode_inner_t)field_names_message_camel_case_encode_inner);
}

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)
{
    pbtools_decode_repeated_inner(
        decoder_p,
        repeated_info_p,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_camel_case_t),
        (pbtools_message_init_t)field_names_message_camel_case_init,
        (pbtools_message_decode_inner_t)field_names_message_camel_case_decode_inner);
}

struct field_names_message_camel_case_t *
field_names_message_camel_case_new(
    void *workspace_p,
    size_t size)
{
    return (pbtools_message_new(
                workspace_p,
                size,
                sizeof(struct field_names_message_camel_case_t),
                (pbtools_message_init_t)field_names_message_camel_case_init));
}

int field_names_message_camel_case_encode(
    struct field_names_message_camel_case_t *self_p,
    uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_encode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_encode_inner_t)field_names_message_camel_case_encode_inner));
}

int field_names_message_camel_case_decode(
    struct field_names_message_camel_case_t *self_p,
    const uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_decode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_decode_inner_t)field_names_message_camel_case_decode_inner));
}

void field_names_message_pascal_case_init(
    struct field_names_message_pascal_case_t *self_p,
    struct pbtools_heap_t *heap_p)
{
    self_p->base.heap_p = heap_p;
    self_p->my_int32 = 0;
    self_p->my_int64 = 0;
    self_p->my_sint32 = 0;
    self_p->my_sint64 = 0;
    self_p->my_uint32 = 0;
    self_p->my_uint64 = 0;
    self_p->my_fixed32 = 0;
    self_p->my_fixed64 = 0;
    self_p->my_sfixed32 = 0;
    self_p->my_sfixed64 = 0;
    self_p->my_float = 0;
    self_p->my_double = 0;
    self_p->my_bool = 0;
    self_p->my_string_p = "";
    pbtools_bytes_init(&self_p->my_bytes);
    self_p->my_enum = 0;
    field_names_message_init(&self_p->my_message, 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)
{
    pbtools_encoder_sub_message_encode(
        encoder_p,
        17,
        &self_p->my_message.base,
        (pbtools_message_encode_inner_t)field_names_message_encode_inner);
    pbtools_encoder_write_enum(encoder_p, 16, self_p->my_enum);
    pbtools_encoder_write_bytes(encoder_p, 15, &self_p->my_bytes);
    pbtools_encoder_write_string(encoder_p, 14, self_p->my_string_p);
    pbtools_encoder_write_bool(encoder_p, 13, self_p->my_bool);
    pbtools_encoder_write_double(encoder_p, 12, self_p->my_double);
    pbtools_encoder_write_float(encoder_p, 11, self_p->my_float);
    pbtools_encoder_write_sfixed64(encoder_p, 10, self_p->my_sfixed64);
    pbtools_encoder_write_sfixed32(encoder_p, 9, self_p->my_sfixed32);
    pbtools_encoder_write_fixed64(encoder_p, 8, self_p->my_fixed64);
    pbtools_encoder_write_fixed32(encoder_p, 7, self_p->my_fixed32);
    pbtools_encoder_write_uint64(encoder_p, 6, self_p->my_uint64);
    pbtools_encoder_write_uint32(encoder_p, 5, self_p->my_uint32);
    pbtools_encoder_write_sint64(encoder_p, 4, self_p->my_sint64);
    pbtools_encoder_write_sint32(encoder_p, 3, self_p->my_sint32);
    pbtools_encoder_write_int64(encoder_p, 2, self_p->my_int64);
    pbtools_encoder_write_int32(encoder_p, 1, self_p->my_int32);
}

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

    while (pbtools_decoder_available(decoder_p)) {
        switch (pbtools_decoder_read_tag(decoder_p, &wire_type)) {

        case 1:
            self_p->my_int32 = pbtools_decoder_read_int32(decoder_p, wire_type);
            break;

        case 2:
            self_p->my_int64 = pbtools_decoder_read_int64(decoder_p, wire_type);
            break;

        case 3:
            self_p->my_sint32 = pbtools_decoder_read_sint32(decoder_p, wire_type);
            break;

        case 4:
            self_p->my_sint64 = pbtools_decoder_read_sint64(decoder_p, wire_type);
            break;

        case 5:
            self_p->my_uint32 = pbtools_decoder_read_uint32(decoder_p, wire_type);
            break;

        case 6:
            self_p->my_uint64 = pbtools_decoder_read_uint64(decoder_p, wire_type);
            break;

        case 7:
            self_p->my_fixed32 = pbtools_decoder_read_fixed32(decoder_p, wire_type);
            break;

        case 8:
            self_p->my_fixed64 = pbtools_decoder_read_fixed64(decoder_p, wire_type);
            break;

        case 9:
            self_p->my_sfixed32 = pbtools_decoder_read_sfixed32(decoder_p, wire_type);
            break;

        case 10:
            self_p->my_sfixed64 = pbtools_decoder_read_sfixed64(decoder_p, wire_type);
            break;

        case 11:
            self_p->my_float = pbtools_decoder_read_float(decoder_p, wire_type);
            break;

        case 12:
            self_p->my_double = pbtools_decoder_read_double(decoder_p, wire_type);
            break;

        case 13:
            self_p->my_bool = pbtools_decoder_read_bool(decoder_p, wire_type);
            break;

        case 14:
            pbtools_decoder_read_string(decoder_p, wire_type, &self_p->my_string_p);
            break;

        case 15:
            pbtools_decoder_read_bytes(decoder_p, wire_type, &self_p->my_bytes);
            break;

        case 16:
            self_p->my_enum = pbtools_decoder_read_enum(decoder_p, wire_type);
            break;

        case 17:
            pbtools_decoder_sub_message_decode(
                decoder_p,
                wire_type,
                &self_p->my_message.base,
                (pbtools_message_decode_inner_t)field_names_message_decode_inner);
            break;

        default:
            pbtools_decoder_skip_field(decoder_p, wire_type);
            break;
        }
    }
}

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)
{
    pbtools_encode_repeated_inner(
        encoder_p,
        field_number,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_pascal_case_t),
        (pbtools_message_encode_inner_t)field_names_message_pascal_case_encode_inner);
}

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)
{
    pbtools_decode_repeated_inner(
        decoder_p,
        repeated_info_p,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_pascal_case_t),
        (pbtools_message_init_t)field_names_message_pascal_case_init,
        (pbtools_message_decode_inner_t)field_names_message_pascal_case_decode_inner);
}

struct field_names_message_pascal_case_t *
field_names_message_pascal_case_new(
    void *workspace_p,
    size_t size)
{
    return (pbtools_message_new(
                workspace_p,
                size,
                sizeof(struct field_names_message_pascal_case_t),
                (pbtools_message_init_t)field_names_message_pascal_case_init));
}

int field_names_message_pascal_case_encode(
    struct field_names_message_pascal_case_t *self_p,
    uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_encode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_encode_inner_t)field_names_message_pascal_case_encode_inner));
}

int field_names_message_pascal_case_decode(
    struct field_names_message_pascal_case_t *self_p,
    const uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_decode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_decode_inner_t)field_names_message_pascal_case_decode_inner));
}

void field_names_repeated_message_camel_case_init(
    struct field_names_repeated_message_camel_case_t *self_p,
    struct pbtools_heap_t *heap_p)
{
    self_p->base.heap_p = heap_p;
    self_p->my_int32.length = 0;
    self_p->my_int64.length = 0;
    self_p->my_sint32.length = 0;
    self_p->my_sint64.length = 0;
    self_p->my_uint32.length = 0;
    self_p->my_uint64.length = 0;
    self_p->my_fixed32.length = 0;
    self_p->my_fixed64.length = 0;
    self_p->my_sfixed32.length = 0;
    self_p->my_sfixed64.length = 0;
    self_p->my_float.length = 0;
    self_p->my_double.length = 0;
    self_p->my_bool.length = 0;
    self_p->my_string.length = 0;
    self_p->my_bytes.length = 0;
    self_p->my_enum.length = 0;
    self_p->my_message.length = 0;
}

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)
{
    field_names_message_encode_repeated_inner(
        encoder_p,
        17,
        &self_p->my_message);
    pbtools_encoder_write_repeated_int32(encoder_p, 16, &self_p->my_enum);
    pbtools_encoder_write_repeated_bytes(encoder_p, 15, &self_p->my_bytes);
    pbtools_encoder_write_repeated_string(encoder_p, 14, &self_p->my_string);
    pbtools_encoder_write_repeated_bool(encoder_p, 13, &self_p->my_bool);
    pbtools_encoder_write_repeated_double(encoder_p, 12, &self_p->my_double);
    pbtools_encoder_write_repeated_float(encoder_p, 11, &self_p->my_float);
    pbtools_encoder_write_repeated_sfixed64(encoder_p, 10, &self_p->my_sfixed64);
    pbtools_encoder_write_repeated_sfixed32(encoder_p, 9, &self_p->my_sfixed32);
    pbtools_encoder_write_repeated_fixed64(encoder_p, 8, &self_p->my_fixed64);
    pbtools_encoder_write_repeated_fixed32(encoder_p, 7, &self_p->my_fixed32);
    pbtools_encoder_write_repeated_uint64(encoder_p, 6, &self_p->my_uint64);
    pbtools_encoder_write_repeated_uint32(encoder_p, 5, &self_p->my_uint32);
    pbtools_encoder_write_repeated_sint64(encoder_p, 4, &self_p->my_sint64);
    pbtools_encoder_write_repeated_sint32(encoder_p, 3, &self_p->my_sint32);
    pbtools_encoder_write_repeated_int64(encoder_p, 2, &self_p->my_int64);
    pbtools_encoder_write_repeated_int32(encoder_p, 1, &self_p->my_int32);
}

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)
{
    int wire_type;
    struct pbtools_repeated_info_t repeated_info_my_int32;
    struct pbtools_repeated_info_t repeated_info_my_int64;
    struct pbtools_repeated_info_t repeated_info_my_sint32;
    struct pbtools_repeated_info_t repeated_info_my_sint64;
    struct pbtools_repeated_info_t repeated_info_my_uint32;
    struct pbtools_repeated_info_t repeated_info_my_uint64;
    struct pbtools_repeated_info_t repeated_info_my_fixed32;
    struct pbtools_repeated_info_t repeated_info_my_fixed64;
    struct pbtools_repeated_info_t repeated_info_my_sfixed32;
    struct pbtools_repeated_info_t repeated_info_my_sfixed64;
    struct pbtools_repeated_info_t repeated_info_my_float;
    struct pbtools_repeated_info_t repeated_info_my_double;
    struct pbtools_repeated_info_t repeated_info_my_bool;
    struct pbtools_repeated_info_t repeated_info_my_string;
    struct pbtools_repeated_info_t repeated_info_my_bytes;
    struct pbtools_repeated_info_t repeated_info_my_enum;
    struct pbtools_repeated_info_t repeated_info_my_message;

    pbtools_repeated_info_init(&repeated_info_my_int32, 1);
    pbtools_repeated_info_init(&repeated_info_my_int64, 2);
    pbtools_repeated_info_init(&repeated_info_my_sint32, 3);
    pbtools_repeated_info_init(&repeated_info_my_sint64, 4);
    pbtools_repeated_info_init(&repeated_info_my_uint32, 5);
    pbtools_repeated_info_init(&repeated_info_my_uint64, 6);
    pbtools_repeated_info_init(&repeated_info_my_fixed32, 7);
    pbtools_repeated_info_init(&repeated_info_my_fixed64, 8);
    pbtools_repeated_info_init(&repeated_info_my_sfixed32, 9);
    pbtools_repeated_info_init(&repeated_info_my_sfixed64, 10);
    pbtools_repeated_info_init(&repeated_info_my_float, 11);
    pbtools_repeated_info_init(&repeated_info_my_double, 12);
    pbtools_repeated_info_init(&repeated_info_my_bool, 13);
    pbtools_repeated_info_init(&repeated_info_my_string, 14);
    pbtools_repeated_info_init(&repeated_info_my_bytes, 15);
    pbtools_repeated_info_init(&repeated_info_my_enum, 16);
    pbtools_repeated_info_init(&repeated_info_my_message, 17);

    while (pbtools_decoder_available(decoder_p)) {
        switch (pbtools_decoder_read_tag(decoder_p, &wire_type)) {

        case 1:
            pbtools_repeated_info_decode_int32(
                &repeated_info_my_int32,
                decoder_p,
                wire_type);
            break;

        case 2:
            pbtools_repeated_info_decode_int64(
                &repeated_info_my_int64,
                decoder_p,
                wire_type);
            break;

        case 3:
            pbtools_repeated_info_decode_sint32(
                &repeated_info_my_sint32,
                decoder_p,
                wire_type);
            break;

        case 4:
            pbtools_repeated_info_decode_sint64(
                &repeated_info_my_sint64,
                decoder_p,
                wire_type);
            break;

        case 5:
            pbtools_repeated_info_decode_uint32(
                &repeated_info_my_uint32,
                decoder_p,
                wire_type);
            break;

        case 6:
            pbtools_repeated_info_decode_uint64(
                &repeated_info_my_uint64,
                decoder_p,
                wire_type);
            break;

        case 7:
            pbtools_repeated_info_decode_fixed32(
                &repeated_info_my_fixed32,
                decoder_p,
                wire_type);
            break;

        case 8:
            pbtools_repeated_info_decode_fixed64(
                &repeated_info_my_fixed64,
                decoder_p,
                wire_type);
            break;

        case 9:
            pbtools_repeated_info_decode_sfixed32(
                &repeated_info_my_sfixed32,
                decoder_p,
                wire_type);
            break;

        case 10:
            pbtools_repeated_info_decode_sfixed64(
                &repeated_info_my_sfixed64,
                decoder_p,
                wire_type);
            break;

        case 11:
            pbtools_repeated_info_decode_float(
                &repeated_info_my_float,
                decoder_p,
                wire_type);
            break;

        case 12:
            pbtools_repeated_info_decode_double(
                &repeated_info_my_double,
                decoder_p,
                wire_type);
            break;

        case 13:
            pbtools_repeated_info_decode_bool(
                &repeated_info_my_bool,
                decoder_p,
                wire_type);
            break;

        case 14:
            pbtools_repeated_info_decode_string(
                &repeated_info_my_string,
                decoder_p,
                wire_type);
            break;

        case 15:
            pbtools_repeated_info_decode_bytes(
                &repeated_info_my_bytes,
                decoder_p,
                wire_type);
            break;

        case 16:
            pbtools_repeated_info_decode_int32(
                &repeated_info_my_enum,
                decoder_p,
                wire_type);
            break;

        case 17:
            pbtools_repeated_info_decode(&repeated_info_my_message,
                                         decoder_p,
                                         wire_type);
            break;

        default:
            pbtools_decoder_skip_field(decoder_p, wire_type);
            break;
        }
    }

    pbtools_decoder_decode_repeated_int32(
        decoder_p,
        &repeated_info_my_int32,
        &self_p->my_int32);
    pbtools_decoder_decode_repeated_int64(
        decoder_p,
        &repeated_info_my_int64,
        &self_p->my_int64);
    pbtools_decoder_decode_repeated_sint32(
        decoder_p,
        &repeated_info_my_sint32,
        &self_p->my_sint32);
    pbtools_decoder_decode_repeated_sint64(
        decoder_p,
        &repeated_info_my_sint64,
        &self_p->my_sint64);
    pbtools_decoder_decode_repeated_uint32(
        decoder_p,
        &repeated_info_my_uint32,
        &self_p->my_uint32);
    pbtools_decoder_decode_repeated_uint64(
        decoder_p,
        &repeated_info_my_uint64,
        &self_p->my_uint64);
    pbtools_decoder_decode_repeated_fixed32(
        decoder_p,
        &repeated_info_my_fixed32,
        &self_p->my_fixed32);
    pbtools_decoder_decode_repeated_fixed64(
        decoder_p,
        &repeated_info_my_fixed64,
        &self_p->my_fixed64);
    pbtools_decoder_decode_repeated_sfixed32(
        decoder_p,
        &repeated_info_my_sfixed32,
        &self_p->my_sfixed32);
    pbtools_decoder_decode_repeated_sfixed64(
        decoder_p,
        &repeated_info_my_sfixed64,
        &self_p->my_sfixed64);
    pbtools_decoder_decode_repeated_float(
        decoder_p,
        &repeated_info_my_float,
        &self_p->my_float);
    pbtools_decoder_decode_repeated_double(
        decoder_p,
        &repeated_info_my_double,
        &self_p->my_double);
    pbtools_decoder_decode_repeated_bool(
        decoder_p,
        &repeated_info_my_bool,
        &self_p->my_bool);
    pbtools_decoder_decode_repeated_string(
        decoder_p,
        &repeated_info_my_string,
        &self_p->my_string);
    pbtools_decoder_decode_repeated_bytes(
        decoder_p,
        &repeated_info_my_bytes,
        &self_p->my_bytes);
    pbtools_decoder_decode_repeated_int32(
        decoder_p,
        &repeated_info_my_enum,
        &self_p->my_enum);
    field_names_message_decode_repeated_inner(
        decoder_p,
        &repeated_info_my_message,
        &self_p->my_message);
}

int field_names_repeated_message_camel_case_my_int32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_int32(
                &self_p->base,
                length,
                &self_p->my_int32));
}

int field_names_repeated_message_camel_case_my_int64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_int64(
                &self_p->base,
                length,
                &self_p->my_int64));
}

int field_names_repeated_message_camel_case_my_sint32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sint32(
                &self_p->base,
                length,
                &self_p->my_sint32));
}

int field_names_repeated_message_camel_case_my_sint64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sint64(
                &self_p->base,
                length,
                &self_p->my_sint64));
}

int field_names_repeated_message_camel_case_my_uint32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_uint32(
                &self_p->base,
                length,
                &self_p->my_uint32));
}

int field_names_repeated_message_camel_case_my_uint64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_uint64(
                &self_p->base,
                length,
                &self_p->my_uint64));
}

int field_names_repeated_message_camel_case_my_fixed32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_fixed32(
                &self_p->base,
                length,
                &self_p->my_fixed32));
}

int field_names_repeated_message_camel_case_my_fixed64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_fixed64(
                &self_p->base,
                length,
                &self_p->my_fixed64));
}

int field_names_repeated_message_camel_case_my_sfixed32_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sfixed32(
                &self_p->base,
                length,
                &self_p->my_sfixed32));
}

int field_names_repeated_message_camel_case_my_sfixed64_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sfixed64(
                &self_p->base,
                length,
                &self_p->my_sfixed64));
}

int field_names_repeated_message_camel_case_my_float_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_float(
                &self_p->base,
                length,
                &self_p->my_float));
}

int field_names_repeated_message_camel_case_my_double_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_double(
                &self_p->base,
                length,
                &self_p->my_double));
}

int field_names_repeated_message_camel_case_my_bool_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_bool(
                &self_p->base,
                length,
                &self_p->my_bool));
}

int field_names_repeated_message_camel_case_my_string_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_string(
                &self_p->base,
                length,
                &self_p->my_string));
}

int field_names_repeated_message_camel_case_my_bytes_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_bytes(
                &self_p->base,
                length,
                &self_p->my_bytes));
}

int field_names_repeated_message_camel_case_my_enum_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_int32(
                &self_p->base,
                length,
                &self_p->my_enum));
}

int field_names_repeated_message_camel_case_my_message_alloc(
    struct field_names_repeated_message_camel_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated(
                (struct pbtools_repeated_message_t *)&self_p->my_message,
                length,
                self_p->base.heap_p,
                sizeof(struct field_names_message_t),
                (pbtools_message_init_t)field_names_message_init));
}

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)
{
    pbtools_encode_repeated_inner(
        encoder_p,
        field_number,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_repeated_message_camel_case_t),
        (pbtools_message_encode_inner_t)field_names_repeated_message_camel_case_encode_inner);
}

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)
{
    pbtools_decode_repeated_inner(
        decoder_p,
        repeated_info_p,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_repeated_message_camel_case_t),
        (pbtools_message_init_t)field_names_repeated_message_camel_case_init,
        (pbtools_message_decode_inner_t)field_names_repeated_message_camel_case_decode_inner);
}

struct field_names_repeated_message_camel_case_t *
field_names_repeated_message_camel_case_new(
    void *workspace_p,
    size_t size)
{
    return (pbtools_message_new(
                workspace_p,
                size,
                sizeof(struct field_names_repeated_message_camel_case_t),
                (pbtools_message_init_t)field_names_repeated_message_camel_case_init));
}

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)
{
    return (pbtools_message_encode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_encode_inner_t)field_names_repeated_message_camel_case_encode_inner));
}

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)
{
    return (pbtools_message_decode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_decode_inner_t)field_names_repeated_message_camel_case_decode_inner));
}

void field_names_repeated_message_pascal_case_init(
    struct field_names_repeated_message_pascal_case_t *self_p,
    struct pbtools_heap_t *heap_p)
{
    self_p->base.heap_p = heap_p;
    self_p->my_int32.length = 0;
    self_p->my_int64.length = 0;
    self_p->my_sint32.length = 0;
    self_p->my_sint64.length = 0;
    self_p->my_uint32.length = 0;
    self_p->my_uint64.length = 0;
    self_p->my_fixed32.length = 0;
    self_p->my_fixed64.length = 0;
    self_p->my_sfixed32.length = 0;
    self_p->my_sfixed64.length = 0;
    self_p->my_float.length = 0;
    self_p->my_double.length = 0;
    self_p->my_bool.length = 0;
    self_p->my_string.length = 0;
    self_p->my_bytes.length = 0;
    self_p->my_enum.length = 0;
    self_p->my_message.length = 0;
}

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)
{
    field_names_message_encode_repeated_inner(
        encoder_p,
        17,
        &self_p->my_message);
    pbtools_encoder_write_repeated_int32(encoder_p, 16, &self_p->my_enum);
    pbtools_encoder_write_repeated_bytes(encoder_p, 15, &self_p->my_bytes);
    pbtools_encoder_write_repeated_string(encoder_p, 14, &self_p->my_string);
    pbtools_encoder_write_repeated_bool(encoder_p, 13, &self_p->my_bool);
    pbtools_encoder_write_repeated_double(encoder_p, 12, &self_p->my_double);
    pbtools_encoder_write_repeated_float(encoder_p, 11, &self_p->my_float);
    pbtools_encoder_write_repeated_sfixed64(encoder_p, 10, &self_p->my_sfixed64);
    pbtools_encoder_write_repeated_sfixed32(encoder_p, 9, &self_p->my_sfixed32);
    pbtools_encoder_write_repeated_fixed64(encoder_p, 8, &self_p->my_fixed64);
    pbtools_encoder_write_repeated_fixed32(encoder_p, 7, &self_p->my_fixed32);
    pbtools_encoder_write_repeated_uint64(encoder_p, 6, &self_p->my_uint64);
    pbtools_encoder_write_repeated_uint32(encoder_p, 5, &self_p->my_uint32);
    pbtools_encoder_write_repeated_sint64(encoder_p, 4, &self_p->my_sint64);
    pbtools_encoder_write_repeated_sint32(encoder_p, 3, &self_p->my_sint32);
    pbtools_encoder_write_repeated_int64(encoder_p, 2, &self_p->my_int64);
    pbtools_encoder_write_repeated_int32(encoder_p, 1, &self_p->my_int32);
}

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)
{
    int wire_type;
    struct pbtools_repeated_info_t repeated_info_my_int32;
    struct pbtools_repeated_info_t repeated_info_my_int64;
    struct pbtools_repeated_info_t repeated_info_my_sint32;
    struct pbtools_repeated_info_t repeated_info_my_sint64;
    struct pbtools_repeated_info_t repeated_info_my_uint32;
    struct pbtools_repeated_info_t repeated_info_my_uint64;
    struct pbtools_repeated_info_t repeated_info_my_fixed32;
    struct pbtools_repeated_info_t repeated_info_my_fixed64;
    struct pbtools_repeated_info_t repeated_info_my_sfixed32;
    struct pbtools_repeated_info_t repeated_info_my_sfixed64;
    struct pbtools_repeated_info_t repeated_info_my_float;
    struct pbtools_repeated_info_t repeated_info_my_double;
    struct pbtools_repeated_info_t repeated_info_my_bool;
    struct pbtools_repeated_info_t repeated_info_my_string;
    struct pbtools_repeated_info_t repeated_info_my_bytes;
    struct pbtools_repeated_info_t repeated_info_my_enum;
    struct pbtools_repeated_info_t repeated_info_my_message;

    pbtools_repeated_info_init(&repeated_info_my_int32, 1);
    pbtools_repeated_info_init(&repeated_info_my_int64, 2);
    pbtools_repeated_info_init(&repeated_info_my_sint32, 3);
    pbtools_repeated_info_init(&repeated_info_my_sint64, 4);
    pbtools_repeated_info_init(&repeated_info_my_uint32, 5);
    pbtools_repeated_info_init(&repeated_info_my_uint64, 6);
    pbtools_repeated_info_init(&repeated_info_my_fixed32, 7);
    pbtools_repeated_info_init(&repeated_info_my_fixed64, 8);
    pbtools_repeated_info_init(&repeated_info_my_sfixed32, 9);
    pbtools_repeated_info_init(&repeated_info_my_sfixed64, 10);
    pbtools_repeated_info_init(&repeated_info_my_float, 11);
    pbtools_repeated_info_init(&repeated_info_my_double, 12);
    pbtools_repeated_info_init(&repeated_info_my_bool, 13);
    pbtools_repeated_info_init(&repeated_info_my_string, 14);
    pbtools_repeated_info_init(&repeated_info_my_bytes, 15);
    pbtools_repeated_info_init(&repeated_info_my_enum, 16);
    pbtools_repeated_info_init(&repeated_info_my_message, 17);

    while (pbtools_decoder_available(decoder_p)) {
        switch (pbtools_decoder_read_tag(decoder_p, &wire_type)) {

        case 1:
            pbtools_repeated_info_decode_int32(
                &repeated_info_my_int32,
                decoder_p,
                wire_type);
            break;

        case 2:
            pbtools_repeated_info_decode_int64(
                &repeated_info_my_int64,
                decoder_p,
                wire_type);
            break;

        case 3:
            pbtools_repeated_info_decode_sint32(
                &repeated_info_my_sint32,
                decoder_p,
                wire_type);
            break;

        case 4:
            pbtools_repeated_info_decode_sint64(
                &repeated_info_my_sint64,
                decoder_p,
                wire_type);
            break;

        case 5:
            pbtools_repeated_info_decode_uint32(
                &repeated_info_my_uint32,
                decoder_p,
                wire_type);
            break;

        case 6:
            pbtools_repeated_info_decode_uint64(
                &repeated_info_my_uint64,
                decoder_p,
                wire_type);
            break;

        case 7:
            pbtools_repeated_info_decode_fixed32(
                &repeated_info_my_fixed32,
                decoder_p,
                wire_type);
            break;

        case 8:
            pbtools_repeated_info_decode_fixed64(
                &repeated_info_my_fixed64,
                decoder_p,
                wire_type);
            break;

        case 9:
            pbtools_repeated_info_decode_sfixed32(
                &repeated_info_my_sfixed32,
                decoder_p,
                wire_type);
            break;

        case 10:
            pbtools_repeated_info_decode_sfixed64(
                &repeated_info_my_sfixed64,
                decoder_p,
                wire_type);
            break;

        case 11:
            pbtools_repeated_info_decode_float(
                &repeated_info_my_float,
                decoder_p,
                wire_type);
            break;

        case 12:
            pbtools_repeated_info_decode_double(
                &repeated_info_my_double,
                decoder_p,
                wire_type);
            break;

        case 13:
            pbtools_repeated_info_decode_bool(
                &repeated_info_my_bool,
                decoder_p,
                wire_type);
            break;

        case 14:
            pbtools_repeated_info_decode_string(
                &repeated_info_my_string,
                decoder_p,
                wire_type);
            break;

        case 15:
            pbtools_repeated_info_decode_bytes(
                &repeated_info_my_bytes,
                decoder_p,
                wire_type);
            break;

        case 16:
            pbtools_repeated_info_decode_int32(
                &repeated_info_my_enum,
                decoder_p,
                wire_type);
            break;

        case 17:
            pbtools_repeated_info_decode(&repeated_info_my_message,
                                         decoder_p,
                                         wire_type);
            break;

        default:
            pbtools_decoder_skip_field(decoder_p, wire_type);
            break;
        }
    }

    pbtools_decoder_decode_repeated_int32(
        decoder_p,
        &repeated_info_my_int32,
        &self_p->my_int32);
    pbtools_decoder_decode_repeated_int64(
        decoder_p,
        &repeated_info_my_int64,
        &self_p->my_int64);
    pbtools_decoder_decode_repeated_sint32(
        decoder_p,
        &repeated_info_my_sint32,
        &self_p->my_sint32);
    pbtools_decoder_decode_repeated_sint64(
        decoder_p,
        &repeated_info_my_sint64,
        &self_p->my_sint64);
    pbtools_decoder_decode_repeated_uint32(
        decoder_p,
        &repeated_info_my_uint32,
        &self_p->my_uint32);
    pbtools_decoder_decode_repeated_uint64(
        decoder_p,
        &repeated_info_my_uint64,
        &self_p->my_uint64);
    pbtools_decoder_decode_repeated_fixed32(
        decoder_p,
        &repeated_info_my_fixed32,
        &self_p->my_fixed32);
    pbtools_decoder_decode_repeated_fixed64(
        decoder_p,
        &repeated_info_my_fixed64,
        &self_p->my_fixed64);
    pbtools_decoder_decode_repeated_sfixed32(
        decoder_p,
        &repeated_info_my_sfixed32,
        &self_p->my_sfixed32);
    pbtools_decoder_decode_repeated_sfixed64(
        decoder_p,
        &repeated_info_my_sfixed64,
        &self_p->my_sfixed64);
    pbtools_decoder_decode_repeated_float(
        decoder_p,
        &repeated_info_my_float,
        &self_p->my_float);
    pbtools_decoder_decode_repeated_double(
        decoder_p,
        &repeated_info_my_double,
        &self_p->my_double);
    pbtools_decoder_decode_repeated_bool(
        decoder_p,
        &repeated_info_my_bool,
        &self_p->my_bool);
    pbtools_decoder_decode_repeated_string(
        decoder_p,
        &repeated_info_my_string,
        &self_p->my_string);
    pbtools_decoder_decode_repeated_bytes(
        decoder_p,
        &repeated_info_my_bytes,
        &self_p->my_bytes);
    pbtools_decoder_decode_repeated_int32(
        decoder_p,
        &repeated_info_my_enum,
        &self_p->my_enum);
    field_names_message_decode_repeated_inner(
        decoder_p,
        &repeated_info_my_message,
        &self_p->my_message);
}

int field_names_repeated_message_pascal_case_my_int32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_int32(
                &self_p->base,
                length,
                &self_p->my_int32));
}

int field_names_repeated_message_pascal_case_my_int64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_int64(
                &self_p->base,
                length,
                &self_p->my_int64));
}

int field_names_repeated_message_pascal_case_my_sint32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sint32(
                &self_p->base,
                length,
                &self_p->my_sint32));
}

int field_names_repeated_message_pascal_case_my_sint64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sint64(
                &self_p->base,
                length,
                &self_p->my_sint64));
}

int field_names_repeated_message_pascal_case_my_uint32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_uint32(
                &self_p->base,
                length,
                &self_p->my_uint32));
}

int field_names_repeated_message_pascal_case_my_uint64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_uint64(
                &self_p->base,
                length,
                &self_p->my_uint64));
}

int field_names_repeated_message_pascal_case_my_fixed32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_fixed32(
                &self_p->base,
                length,
                &self_p->my_fixed32));
}

int field_names_repeated_message_pascal_case_my_fixed64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_fixed64(
                &self_p->base,
                length,
                &self_p->my_fixed64));
}

int field_names_repeated_message_pascal_case_my_sfixed32_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sfixed32(
                &self_p->base,
                length,
                &self_p->my_sfixed32));
}

int field_names_repeated_message_pascal_case_my_sfixed64_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_sfixed64(
                &self_p->base,
                length,
                &self_p->my_sfixed64));
}

int field_names_repeated_message_pascal_case_my_float_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_float(
                &self_p->base,
                length,
                &self_p->my_float));
}

int field_names_repeated_message_pascal_case_my_double_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_double(
                &self_p->base,
                length,
                &self_p->my_double));
}

int field_names_repeated_message_pascal_case_my_bool_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_bool(
                &self_p->base,
                length,
                &self_p->my_bool));
}

int field_names_repeated_message_pascal_case_my_string_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_string(
                &self_p->base,
                length,
                &self_p->my_string));
}

int field_names_repeated_message_pascal_case_my_bytes_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_bytes(
                &self_p->base,
                length,
                &self_p->my_bytes));
}

int field_names_repeated_message_pascal_case_my_enum_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated_int32(
                &self_p->base,
                length,
                &self_p->my_enum));
}

int field_names_repeated_message_pascal_case_my_message_alloc(
    struct field_names_repeated_message_pascal_case_t *self_p,
    int length)
{
    return (pbtools_alloc_repeated(
                (struct pbtools_repeated_message_t *)&self_p->my_message,
                length,
                self_p->base.heap_p,
                sizeof(struct field_names_message_t),
                (pbtools_message_init_t)field_names_message_init));
}

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)
{
    pbtools_encode_repeated_inner(
        encoder_p,
        field_number,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_repeated_message_pascal_case_t),
        (pbtools_message_encode_inner_t)field_names_repeated_message_pascal_case_encode_inner);
}

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)
{
    pbtools_decode_repeated_inner(
        decoder_p,
        repeated_info_p,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_repeated_message_pascal_case_t),
        (pbtools_message_init_t)field_names_repeated_message_pascal_case_init,
        (pbtools_message_decode_inner_t)field_names_repeated_message_pascal_case_decode_inner);
}

struct field_names_repeated_message_pascal_case_t *
field_names_repeated_message_pascal_case_new(
    void *workspace_p,
    size_t size)
{
    return (pbtools_message_new(
                workspace_p,
                size,
                sizeof(struct field_names_repeated_message_pascal_case_t),
                (pbtools_message_init_t)field_names_repeated_message_pascal_case_init));
}

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)
{
    return (pbtools_message_encode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_encode_inner_t)field_names_repeated_message_pascal_case_encode_inner));
}

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)
{
    return (pbtools_message_decode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_decode_inner_t)field_names_repeated_message_pascal_case_decode_inner));
}

void field_names_message_one_of_one_of_camel_case_message_init(
    struct field_names_message_one_of_t *self_p)
{
    self_p->one_of.choice = field_names_message_one_of_one_of_choice_camel_case_message_e;
    field_names_message_camel_case_init(
        &self_p->one_of.value.camel_case_message,
        self_p->base.heap_p);
}

void field_names_message_one_of_one_of_pascal_case_message_init(
    struct field_names_message_one_of_t *self_p)
{
    self_p->one_of.choice = field_names_message_one_of_one_of_choice_pascal_case_message_e;
    field_names_message_pascal_case_init(
        &self_p->one_of.value.pascal_case_message,
        self_p->base.heap_p);
}

void field_names_message_one_of_one_of_camel_case_message_repeated_init(
    struct field_names_message_one_of_t *self_p)
{
    self_p->one_of.choice = field_names_message_one_of_one_of_choice_camel_case_message_repeated_e;
    field_names_repeated_message_camel_case_init(
        &self_p->one_of.value.camel_case_message_repeated,
        self_p->base.heap_p);
}

void field_names_message_one_of_one_of_pascal_case_message_repeated_init(
    struct field_names_message_one_of_t *self_p)
{
    self_p->one_of.choice = field_names_message_one_of_one_of_choice_pascal_case_message_repeated_e;
    field_names_repeated_message_pascal_case_init(
        &self_p->one_of.value.pascal_case_message_repeated,
        self_p->base.heap_p);
}

void field_names_message_one_of_one_of_my_int32_init(
    struct field_names_message_one_of_t *self_p)
{
    self_p->one_of.choice = field_names_message_one_of_one_of_choice_my_int32_e;
    self_p->one_of.value.my_int32 = 0;
}

void field_names_message_one_of_one_of_my_string_init(
    struct field_names_message_one_of_t *self_p)
{
    self_p->one_of.choice = field_names_message_one_of_one_of_choice_my_string_e;
    self_p->one_of.value.my_string_p = "";
}

void field_names_message_one_of_one_of_my_bytes_init(
    struct field_names_message_one_of_t *self_p)
{
    self_p->one_of.choice = field_names_message_one_of_one_of_choice_my_bytes_e;
    pbtools_bytes_init(&self_p->one_of.value.my_bytes);
}

void field_names_message_one_of_one_of_encode(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_message_one_of_one_of_oneof_t *self_p)
{
    switch (self_p->choice) {

    case field_names_message_one_of_one_of_choice_camel_case_message_e:
        pbtools_encoder_sub_message_encode_always(
            encoder_p,
            1,
            &self_p->value.camel_case_message.base,
            (pbtools_message_encode_inner_t)field_names_message_camel_case_encode_inner);
        break;

    case field_names_message_one_of_one_of_choice_pascal_case_message_e:
        pbtools_encoder_sub_message_encode_always(
            encoder_p,
            2,
            &self_p->value.pascal_case_message.base,
            (pbtools_message_encode_inner_t)field_names_message_pascal_case_encode_inner);
        break;

    case field_names_message_one_of_one_of_choice_camel_case_message_repeated_e:
        pbtools_encoder_sub_message_encode_always(
            encoder_p,
            3,
            &self_p->value.camel_case_message_repeated.base,
            (pbtools_message_encode_inner_t)field_names_repeated_message_camel_case_encode_inner);
        break;

    case field_names_message_one_of_one_of_choice_pascal_case_message_repeated_e:
        pbtools_encoder_sub_message_encode_always(
            encoder_p,
            4,
            &self_p->value.pascal_case_message_repeated.base,
            (pbtools_message_encode_inner_t)field_names_repeated_message_pascal_case_encode_inner);
        break;

    case field_names_message_one_of_one_of_choice_my_int32_e:
        pbtools_encoder_write_int32_always(
            encoder_p,
            5,
            self_p->value.my_int32);
        break;

    case field_names_message_one_of_one_of_choice_my_string_e:
        pbtools_encoder_write_string_always(
            encoder_p,
            6,
            self_p->value.my_string_p);
        break;

    case field_names_message_one_of_one_of_choice_my_bytes_e:
        pbtools_encoder_write_bytes_always(
            encoder_p,
            7,
            &self_p->value.my_bytes);
        break;

    default:
        break;
    }
}

static void field_names_message_one_of_one_of_camel_case_message_decode(
    struct pbtools_decoder_t *decoder_p,
    int wire_type,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_camel_case_message_init(self_p);
    pbtools_decoder_sub_message_decode(
        decoder_p,
        wire_type,
        &self_p->one_of.value.camel_case_message.base,
        (pbtools_message_decode_inner_t)field_names_message_camel_case_decode_inner);
}

static void field_names_message_one_of_one_of_pascal_case_message_decode(
    struct pbtools_decoder_t *decoder_p,
    int wire_type,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_pascal_case_message_init(self_p);
    pbtools_decoder_sub_message_decode(
        decoder_p,
        wire_type,
        &self_p->one_of.value.pascal_case_message.base,
        (pbtools_message_decode_inner_t)field_names_message_pascal_case_decode_inner);
}

static void field_names_message_one_of_one_of_camel_case_message_repeated_decode(
    struct pbtools_decoder_t *decoder_p,
    int wire_type,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_camel_case_message_repeated_init(self_p);
    pbtools_decoder_sub_message_decode(
        decoder_p,
        wire_type,
        &self_p->one_of.value.camel_case_message_repeated.base,
        (pbtools_message_decode_inner_t)field_names_repeated_message_camel_case_decode_inner);
}

static void field_names_message_one_of_one_of_pascal_case_message_repeated_decode(
    struct pbtools_decoder_t *decoder_p,
    int wire_type,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_pascal_case_message_repeated_init(self_p);
    pbtools_decoder_sub_message_decode(
        decoder_p,
        wire_type,
        &self_p->one_of.value.pascal_case_message_repeated.base,
        (pbtools_message_decode_inner_t)field_names_repeated_message_pascal_case_decode_inner);
}

static void field_names_message_one_of_one_of_my_int32_decode(
    struct pbtools_decoder_t *decoder_p,
    int wire_type,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_my_int32_init(self_p);
    self_p->one_of.value.my_int32 = pbtools_decoder_read_int32(
        decoder_p,
        wire_type);
}

static void field_names_message_one_of_one_of_my_string_decode(
    struct pbtools_decoder_t *decoder_p,
    int wire_type,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_my_string_init(self_p);
    pbtools_decoder_read_string(decoder_p,
                                wire_type,
                                &self_p->one_of.value.my_string_p);
}

static void field_names_message_one_of_one_of_my_bytes_decode(
    struct pbtools_decoder_t *decoder_p,
    int wire_type,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_my_bytes_init(self_p);
    pbtools_decoder_read_bytes(decoder_p,
                               wire_type,
                               &self_p->one_of.value.my_bytes);
}

void field_names_message_one_of_init(
    struct field_names_message_one_of_t *self_p,
    struct pbtools_heap_t *heap_p)
{
    self_p->base.heap_p = heap_p;
    self_p->one_of.choice = 0;
}

void field_names_message_one_of_encode_inner(
    struct pbtools_encoder_t *encoder_p,
    struct field_names_message_one_of_t *self_p)
{
    field_names_message_one_of_one_of_encode(encoder_p, &self_p->one_of);
}

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

    while (pbtools_decoder_available(decoder_p)) {
        switch (pbtools_decoder_read_tag(decoder_p, &wire_type)) {

        case 1:
            field_names_message_one_of_one_of_camel_case_message_decode(
                decoder_p,
                wire_type,
                self_p);
            break;

        case 2:
            field_names_message_one_of_one_of_pascal_case_message_decode(
                decoder_p,
                wire_type,
                self_p);
            break;

        case 3:
            field_names_message_one_of_one_of_camel_case_message_repeated_decode(
                decoder_p,
                wire_type,
                self_p);
            break;

        case 4:
            field_names_message_one_of_one_of_pascal_case_message_repeated_decode(
                decoder_p,
                wire_type,
                self_p);
            break;

        case 5:
            field_names_message_one_of_one_of_my_int32_decode(
                decoder_p,
                wire_type,
                self_p);
            break;

        case 6:
            field_names_message_one_of_one_of_my_string_decode(
                decoder_p,
                wire_type,
                self_p);
            break;

        case 7:
            field_names_message_one_of_one_of_my_bytes_decode(
                decoder_p,
                wire_type,
                self_p);
            break;

        default:
            pbtools_decoder_skip_field(decoder_p, wire_type);
            break;
        }
    }
}

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)
{
    pbtools_encode_repeated_inner(
        encoder_p,
        field_number,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_one_of_t),
        (pbtools_message_encode_inner_t)field_names_message_one_of_encode_inner);
}

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)
{
    pbtools_decode_repeated_inner(
        decoder_p,
        repeated_info_p,
        (struct pbtools_repeated_message_t *)repeated_p,
        sizeof(struct field_names_message_one_of_t),
        (pbtools_message_init_t)field_names_message_one_of_init,
        (pbtools_message_decode_inner_t)field_names_message_one_of_decode_inner);
}

struct field_names_message_one_of_t *
field_names_message_one_of_new(
    void *workspace_p,
    size_t size)
{
    return (pbtools_message_new(
                workspace_p,
                size,
                sizeof(struct field_names_message_one_of_t),
                (pbtools_message_init_t)field_names_message_one_of_init));
}

int field_names_message_one_of_encode(
    struct field_names_message_one_of_t *self_p,
    uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_encode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_encode_inner_t)field_names_message_one_of_encode_inner));
}

int field_names_message_one_of_decode(
    struct field_names_message_one_of_t *self_p,
    const uint8_t *encoded_p,
    size_t size)
{
    return (pbtools_message_decode(
                &self_p->base,
                encoded_p,
                size,
                (pbtools_message_decode_inner_t)field_names_message_one_of_decode_inner));
}
