---
source: boltffi_bindgen/src/render/csharp/templates.rs
assertion_line: 1034
expression: template.render().unwrap()
---
// <auto-generated>
// This file was generated by BoltFFI. Do not edit.
// </auto-generated>
#nullable enable

using System;

namespace Demo
{
    /// <summary>
    /// Lifecycle status of an item.
    /// </summary>
    public enum Status : int
    {
        /// <summary>
        /// In active use.
        /// </summary>
        Active = 0,
        /// <summary>
        /// Soft-deleted.
        /// </summary>
        Inactive = 1,
        /// <summary>
        /// Awaiting review.
        /// </summary>
        Pending = 2
    }

    internal static class StatusWire
    {
        internal const int WireEncodedSize = 4;

        internal static Status Decode(WireReader reader) =>
            reader.ReadI32() switch
            {
                0 => Status.Active,
                1 => Status.Inactive,
                2 => Status.Pending,
                int tag => throw new InvalidOperationException($"Unknown Status wire tag: {tag}"),
            };

        internal static void WireEncodeTo(this Status value, WireWriter wire) =>
            wire.WriteI32(value switch
            {
                Status.Active => 0,
                Status.Inactive => 1,
                Status.Pending => 2,
                _ => throw new InvalidOperationException($"Unknown Status variant: {value}"),
            });
    }
}
