private PB.ReservedThroughput EncodeReservedThroughput(DataModel.CapacityUnit capacityUnit)
        {
            var builder = PB.ReservedThroughput.CreateBuilder();

            builder.SetCapacityUnit(EncodeCapacityUnit(capacityUnit));
            return(builder.Build());
        }
        private PB.CapacityUnit EncodeCapacityUnit(DataModel.CapacityUnit capacityUnit)
        {
            var builder = PB.CapacityUnit.CreateBuilder();

            if (capacityUnit.Read.HasValue)
            {
                builder.SetRead(capacityUnit.Read.Value);
            }

            if (capacityUnit.Write.HasValue)
            {
                builder.SetWrite(capacityUnit.Write.Value);
            }

            return(builder.Build());
        }