func (j *TarOptions) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error {
	var err error
	currentKey := ffjtTarOptionsbase
	_ = currentKey
	tok := fflib.FFTok_init
	wantedTok := fflib.FFTok_init
mainparse:
	for {
		tok = fs.Scan()
		if tok == fflib.FFTok_error {
			goto tokerror
		}
		switch state {
		case fflib.FFParse_map_start:
			if tok != fflib.FFTok_left_bracket {
				wantedTok = fflib.FFTok_left_bracket
				goto wrongtokenerror
			}
			state = fflib.FFParse_want_key
			continue
		case fflib.FFParse_after_value:
			if tok == fflib.FFTok_comma {
				state = fflib.FFParse_want_key
			} else if tok == fflib.FFTok_right_bracket {
				goto done
			} else {
				wantedTok = fflib.FFTok_comma
				goto wrongtokenerror
			}
		case fflib.FFParse_want_key:
			if tok == fflib.FFTok_right_bracket {
				goto done
			}
			if tok != fflib.FFTok_string {
				wantedTok = fflib.FFTok_string
				goto wrongtokenerror
			}
			kn := fs.Output.Bytes()
			if len(kn) <= 0 {
				currentKey = ffjtTarOptionsnosuchkey
				state = fflib.FFParse_want_colon
				goto mainparse
			} else {
				switch kn[0] {
				case 'C':
					if bytes.Equal(ffjKeyTarOptionsCompression, kn) {
						currentKey = ffjtTarOptionsCompression
						state = fflib.FFParse_want_colon
						goto mainparse
					} else if bytes.Equal(ffjKeyTarOptionsChownOpts, kn) {
						currentKey = ffjtTarOptionsChownOpts
						state = fflib.FFParse_want_colon
						goto mainparse
					} else if bytes.Equal(ffjKeyTarOptionsCopyPass, kn) {
						currentKey = ffjtTarOptionsCopyPass
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'E':
					if bytes.Equal(ffjKeyTarOptionsExcludePatterns, kn) {
						currentKey = ffjtTarOptionsExcludePatterns
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'G':
					if bytes.Equal(ffjKeyTarOptionsGIDMaps, kn) {
						currentKey = ffjtTarOptionsGIDMaps
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'I':
					if bytes.Equal(ffjKeyTarOptionsIncludeFiles, kn) {
						currentKey = ffjtTarOptionsIncludeFiles
						state = fflib.FFParse_want_colon
						goto mainparse
					} else if bytes.Equal(ffjKeyTarOptionsIncludeSourceDir, kn) {
						currentKey = ffjtTarOptionsIncludeSourceDir
						state = fflib.FFParse_want_colon
						goto mainparse
					} else if bytes.Equal(ffjKeyTarOptionsInUserNS, kn) {
						currentKey = ffjtTarOptionsInUserNS
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'N':
					if bytes.Equal(ffjKeyTarOptionsNoLchown, kn) {
						currentKey = ffjtTarOptionsNoLchown
						state = fflib.FFParse_want_colon
						goto mainparse
					} else if bytes.Equal(ffjKeyTarOptionsNoOverwriteDirNonDir, kn) {
						currentKey = ffjtTarOptionsNoOverwriteDirNonDir
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'R':
					if bytes.Equal(ffjKeyTarOptionsRebaseNames, kn) {
						currentKey = ffjtTarOptionsRebaseNames
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'U':
					if bytes.Equal(ffjKeyTarOptionsUIDMaps, kn) {
						currentKey = ffjtTarOptionsUIDMaps
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'W':
					if bytes.Equal(ffjKeyTarOptionsWhiteoutFormat, kn) {
						currentKey = ffjtTarOptionsWhiteoutFormat
						state = fflib.FFParse_want_colon
						goto mainparse
					} else if bytes.Equal(ffjKeyTarOptionsWhiteoutData, kn) {
						currentKey = ffjtTarOptionsWhiteoutData
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsCopyPass, kn) {
					currentKey = ffjtTarOptionsCopyPass
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsInUserNS, kn) {
					currentKey = ffjtTarOptionsInUserNS
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsRebaseNames, kn) {
					currentKey = ffjtTarOptionsRebaseNames
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.SimpleLetterEqualFold(ffjKeyTarOptionsNoOverwriteDirNonDir, kn) {
					currentKey = ffjtTarOptionsNoOverwriteDirNonDir
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.SimpleLetterEqualFold(ffjKeyTarOptionsWhiteoutData, kn) {
					currentKey = ffjtTarOptionsWhiteoutData
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.SimpleLetterEqualFold(ffjKeyTarOptionsWhiteoutFormat, kn) {
					currentKey = ffjtTarOptionsWhiteoutFormat
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsIncludeSourceDir, kn) {
					currentKey = ffjtTarOptionsIncludeSourceDir
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsChownOpts, kn) {
					currentKey = ffjtTarOptionsChownOpts
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsGIDMaps, kn) {
					currentKey = ffjtTarOptionsGIDMaps
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsUIDMaps, kn) {
					currentKey = ffjtTarOptionsUIDMaps
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.SimpleLetterEqualFold(ffjKeyTarOptionsNoLchown, kn) {
					currentKey = ffjtTarOptionsNoLchown
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsCompression, kn) {
					currentKey = ffjtTarOptionsCompression
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsExcludePatterns, kn) {
					currentKey = ffjtTarOptionsExcludePatterns
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyTarOptionsIncludeFiles, kn) {
					currentKey = ffjtTarOptionsIncludeFiles
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				currentKey = ffjtTarOptionsnosuchkey
				state = fflib.FFParse_want_colon
				goto mainparse
			}
		case fflib.FFParse_want_colon:
			if tok != fflib.FFTok_colon {
				wantedTok = fflib.FFTok_colon
				goto wrongtokenerror
			}
			state = fflib.FFParse_want_value
			continue
		case fflib.FFParse_want_value:
			if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null {
				switch currentKey {
				case ffjtTarOptionsIncludeFiles:
					goto handle_IncludeFiles
				case ffjtTarOptionsExcludePatterns:
					goto handle_ExcludePatterns
				case ffjtTarOptionsCompression:
					goto handle_Compression
				case ffjtTarOptionsNoLchown:
					goto handle_NoLchown
				case ffjtTarOptionsUIDMaps:
					goto handle_UIDMaps
				case ffjtTarOptionsGIDMaps:
					goto handle_GIDMaps
				case ffjtTarOptionsChownOpts:
					goto handle_ChownOpts
				case ffjtTarOptionsIncludeSourceDir:
					goto handle_IncludeSourceDir
				case ffjtTarOptionsWhiteoutFormat:
					goto handle_WhiteoutFormat
				case ffjtTarOptionsWhiteoutData:
					goto handle_WhiteoutData
				case ffjtTarOptionsNoOverwriteDirNonDir:
					goto handle_NoOverwriteDirNonDir
				case ffjtTarOptionsRebaseNames:
					goto handle_RebaseNames
				case ffjtTarOptionsInUserNS:
					goto handle_InUserNS
				case ffjtTarOptionsCopyPass:
					goto handle_CopyPass
				case ffjtTarOptionsnosuchkey:
					err = fs.SkipField(tok)
					if err != nil {
						return fs.WrapErr(err)
					}
					state = fflib.FFParse_after_value
					goto mainparse
				}
			} else {
				goto wantedvalue
			}
		}
	}
handle_IncludeFiles:
	{
		{
			if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null {
				return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok))
			}
		}
		if tok == fflib.FFTok_null {
			j.IncludeFiles = nil
		} else {
			j.IncludeFiles = []string{}
			wantVal := true
			for {
				var tmpJIncludeFiles string
				tok = fs.Scan()
				if tok == fflib.FFTok_error {
					goto tokerror
				}
				if tok == fflib.FFTok_right_brace {
					break
				}
				if tok == fflib.FFTok_comma {
					if wantVal == true {
						return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
					}
					continue
				} else {
					wantVal = true
				}
				{
					{
						if tok != fflib.FFTok_string && tok != fflib.FFTok_null {
							return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok))
						}
					}
					if tok == fflib.FFTok_null {
					} else {
						outBuf := fs.Output.Bytes()
						tmpJIncludeFiles = string(string(outBuf))
					}
				}
				j.IncludeFiles = append(j.IncludeFiles, tmpJIncludeFiles)
				wantVal = false
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_ExcludePatterns:
	{
		{
			if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null {
				return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok))
			}
		}
		if tok == fflib.FFTok_null {
			j.ExcludePatterns = nil
		} else {
			j.ExcludePatterns = []string{}
			wantVal := true
			for {
				var tmpJExcludePatterns string
				tok = fs.Scan()
				if tok == fflib.FFTok_error {
					goto tokerror
				}
				if tok == fflib.FFTok_right_brace {
					break
				}
				if tok == fflib.FFTok_comma {
					if wantVal == true {
						return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
					}
					continue
				} else {
					wantVal = true
				}
				{
					{
						if tok != fflib.FFTok_string && tok != fflib.FFTok_null {
							return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok))
						}
					}
					if tok == fflib.FFTok_null {
					} else {
						outBuf := fs.Output.Bytes()
						tmpJExcludePatterns = string(string(outBuf))
					}
				}
				j.ExcludePatterns = append(j.ExcludePatterns, tmpJExcludePatterns)
				wantVal = false
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_Compression:
	{
		if tok != fflib.FFTok_integer && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for Compression", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64)
			if err != nil {
				return fs.WrapErr(err)
			}
			j.Compression = Compression(tval)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_NoLchown:
	{
		if tok != fflib.FFTok_bool && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tmpb := fs.Output.Bytes()
			if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 {
				j.NoLchown = true
			} else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 {
				j.NoLchown = false
			} else {
				err = errors.New("unexpected bytes for true/false value")
				return fs.WrapErr(err)
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_UIDMaps:
	{
		{
			if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null {
				return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok))
			}
		}
		if tok == fflib.FFTok_null {
			j.UIDMaps = nil
		} else {
			j.UIDMaps = []idtools.IDMap{}
			wantVal := true
			for {
				var tmpJUIDMaps idtools.IDMap
				tok = fs.Scan()
				if tok == fflib.FFTok_error {
					goto tokerror
				}
				if tok == fflib.FFTok_right_brace {
					break
				}
				if tok == fflib.FFTok_comma {
					if wantVal == true {
						return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
					}
					continue
				} else {
					wantVal = true
				}
				{
					tbuf, err := fs.CaptureField(tok)
					if err != nil {
						return fs.WrapErr(err)
					}
					err = json.Unmarshal(tbuf, &tmpJUIDMaps)
					if err != nil {
						return fs.WrapErr(err)
					}
				}
				j.UIDMaps = append(j.UIDMaps, tmpJUIDMaps)
				wantVal = false
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_GIDMaps:
	{
		{
			if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null {
				return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok))
			}
		}
		if tok == fflib.FFTok_null {
			j.GIDMaps = nil
		} else {
			j.GIDMaps = []idtools.IDMap{}
			wantVal := true
			for {
				var tmpJGIDMaps idtools.IDMap
				tok = fs.Scan()
				if tok == fflib.FFTok_error {
					goto tokerror
				}
				if tok == fflib.FFTok_right_brace {
					break
				}
				if tok == fflib.FFTok_comma {
					if wantVal == true {
						return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
					}
					continue
				} else {
					wantVal = true
				}
				{
					tbuf, err := fs.CaptureField(tok)
					if err != nil {
						return fs.WrapErr(err)
					}
					err = json.Unmarshal(tbuf, &tmpJGIDMaps)
					if err != nil {
						return fs.WrapErr(err)
					}
				}
				j.GIDMaps = append(j.GIDMaps, tmpJGIDMaps)
				wantVal = false
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_ChownOpts:
	{
		tbuf, err := fs.CaptureField(tok)
		if err != nil {
			return fs.WrapErr(err)
		}
		err = json.Unmarshal(tbuf, &j.ChownOpts)
		if err != nil {
			return fs.WrapErr(err)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_IncludeSourceDir:
	{
		if tok != fflib.FFTok_bool && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tmpb := fs.Output.Bytes()
			if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 {
				j.IncludeSourceDir = true
			} else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 {
				j.IncludeSourceDir = false
			} else {
				err = errors.New("unexpected bytes for true/false value")
				return fs.WrapErr(err)
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_WhiteoutFormat:
	{
		if tok != fflib.FFTok_integer && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for WhiteoutFormat", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64)
			if err != nil {
				return fs.WrapErr(err)
			}
			j.WhiteoutFormat = WhiteoutFormat(tval)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_WhiteoutData:
	{
		tbuf, err := fs.CaptureField(tok)
		if err != nil {
			return fs.WrapErr(err)
		}
		err = json.Unmarshal(tbuf, &j.WhiteoutData)
		if err != nil {
			return fs.WrapErr(err)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_NoOverwriteDirNonDir:
	{
		if tok != fflib.FFTok_bool && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tmpb := fs.Output.Bytes()
			if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 {
				j.NoOverwriteDirNonDir = true
			} else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 {
				j.NoOverwriteDirNonDir = false
			} else {
				err = errors.New("unexpected bytes for true/false value")
				return fs.WrapErr(err)
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_RebaseNames:
	{
		{
			if tok != fflib.FFTok_left_bracket && tok != fflib.FFTok_null {
				return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok))
			}
		}
		if tok == fflib.FFTok_null {
			j.RebaseNames = nil
		} else {
			j.RebaseNames = make(map[string]string, 0)
			wantVal := true
			for {
				var k string
				var tmpJRebaseNames string
				tok = fs.Scan()
				if tok == fflib.FFTok_error {
					goto tokerror
				}
				if tok == fflib.FFTok_right_bracket {
					break
				}
				if tok == fflib.FFTok_comma {
					if wantVal == true {
						return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
					}
					continue
				} else {
					wantVal = true
				}
				{
					{
						if tok != fflib.FFTok_string && tok != fflib.FFTok_null {
							return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok))
						}
					}
					if tok == fflib.FFTok_null {
					} else {
						outBuf := fs.Output.Bytes()
						k = string(string(outBuf))
					}
				}
				tok = fs.Scan()
				if tok != fflib.FFTok_colon {
					return fs.WrapErr(fmt.Errorf("wanted colon token, but got token: %v", tok))
				}
				tok = fs.Scan()
				{
					{
						if tok != fflib.FFTok_string && tok != fflib.FFTok_null {
							return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok))
						}
					}
					if tok == fflib.FFTok_null {
					} else {
						outBuf := fs.Output.Bytes()
						tmpJRebaseNames = string(string(outBuf))
					}
				}
				j.RebaseNames[k] = tmpJRebaseNames
				wantVal = false
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_InUserNS:
	{
		if tok != fflib.FFTok_bool && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tmpb := fs.Output.Bytes()
			if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 {
				j.InUserNS = true
			} else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 {
				j.InUserNS = false
			} else {
				err = errors.New("unexpected bytes for true/false value")
				return fs.WrapErr(err)
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_CopyPass:
	{
		if tok != fflib.FFTok_bool && tok != fflib.FFTok_null {
			return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok))
		}
	}
	{
		if tok == fflib.FFTok_null {
		} else {
			tmpb := fs.Output.Bytes()
			if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 {
				j.CopyPass = true
			} else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 {
				j.CopyPass = false
			} else {
				err = errors.New("unexpected bytes for true/false value")
				return fs.WrapErr(err)
			}
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
wantedvalue:
	return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
wrongtokenerror:
	return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String()))
tokerror:
	if fs.BigError != nil {
		return fs.WrapErr(fs.BigError)
	}
	err = fs.Error.ToError()
	if err != nil {
		return fs.WrapErr(err)
	}
	panic("ffjson-generated: unreachable, please report bug.")
done:
	return nil
}
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
package archive
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"github.com/containers/storage/pkg/idtools"
	fflib "github.com/pquerna/ffjson/fflib/v1"
)
func (j *Archiver) MarshalJSON() ([]byte, error) {
	var buf fflib.Buffer
	if j == nil {
		buf.WriteString("null")
		return buf.Bytes(), nil
	}
	err := j.MarshalJSONBuf(&buf)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
func (j *Archiver) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if j == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"Untar":`)
	err = buf.Encode(j.Untar)
	if err != nil {
		return err
	}
	if j.TarIDMappings != nil {
		buf.WriteString(`,"TarIDMappings":`)
		err = buf.Encode(j.TarIDMappings)
		if err != nil {
			return err
		}
	} else {
		buf.WriteString(`,"TarIDMappings":null`)
	}
	if j.ChownOpts != nil {
		buf.WriteString(`,"ChownOpts":`)
		err = buf.Encode(j.ChownOpts)
		if err != nil {
			return err
		}
	} else {
		buf.WriteString(`,"ChownOpts":null`)
	}
	if j.UntarIDMappings != nil {
		buf.WriteString(`,"UntarIDMappings":`)
		err = buf.Encode(j.UntarIDMappings)
		if err != nil {
			return err
		}
	} else {
		buf.WriteString(`,"UntarIDMappings":null`)
	}
	buf.WriteByte('}')
	return nil
}
const (
	ffjtArchiverbase = iota
	ffjtArchivernosuchkey
	ffjtArchiverUntar
	ffjtArchiverTarIDMappings
	ffjtArchiverChownOpts
	ffjtArchiverUntarIDMappings
)
var ffjKeyArchiverUntar = []byte("Untar")
var ffjKeyArchiverTarIDMappings = []byte("TarIDMappings")
var ffjKeyArchiverChownOpts = []byte("ChownOpts")
var ffjKeyArchiverUntarIDMappings = []byte("UntarIDMappings")
func (j *Archiver) UnmarshalJSON(input []byte) error {
	fs := fflib.NewFFLexer(input)
	return j.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start)
}
func (j *Archiver) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error {
	var err error
	currentKey := ffjtArchiverbase
	_ = currentKey
	tok := fflib.FFTok_init
	wantedTok := fflib.FFTok_init
mainparse:
	for {
		tok = fs.Scan()
		if tok == fflib.FFTok_error {
			goto tokerror
		}
		switch state {
		case fflib.FFParse_map_start:
			if tok != fflib.FFTok_left_bracket {
				wantedTok = fflib.FFTok_left_bracket
				goto wrongtokenerror
			}
			state = fflib.FFParse_want_key
			continue
		case fflib.FFParse_after_value:
			if tok == fflib.FFTok_comma {
				state = fflib.FFParse_want_key
			} else if tok == fflib.FFTok_right_bracket {
				goto done
			} else {
				wantedTok = fflib.FFTok_comma
				goto wrongtokenerror
			}
		case fflib.FFParse_want_key:
			if tok == fflib.FFTok_right_bracket {
				goto done
			}
			if tok != fflib.FFTok_string {
				wantedTok = fflib.FFTok_string
				goto wrongtokenerror
			}
			kn := fs.Output.Bytes()
			if len(kn) <= 0 {
				currentKey = ffjtArchivernosuchkey
				state = fflib.FFParse_want_colon
				goto mainparse
			} else {
				switch kn[0] {
				case 'C':
					if bytes.Equal(ffjKeyArchiverChownOpts, kn) {
						currentKey = ffjtArchiverChownOpts
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'T':
					if bytes.Equal(ffjKeyArchiverTarIDMappings, kn) {
						currentKey = ffjtArchiverTarIDMappings
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				case 'U':
					if bytes.Equal(ffjKeyArchiverUntar, kn) {
						currentKey = ffjtArchiverUntar
						state = fflib.FFParse_want_colon
						goto mainparse
					} else if bytes.Equal(ffjKeyArchiverUntarIDMappings, kn) {
						currentKey = ffjtArchiverUntarIDMappings
						state = fflib.FFParse_want_colon
						goto mainparse
					}
				}
				if fflib.EqualFoldRight(ffjKeyArchiverUntarIDMappings, kn) {
					currentKey = ffjtArchiverUntarIDMappings
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyArchiverChownOpts, kn) {
					currentKey = ffjtArchiverChownOpts
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.EqualFoldRight(ffjKeyArchiverTarIDMappings, kn) {
					currentKey = ffjtArchiverTarIDMappings
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				if fflib.SimpleLetterEqualFold(ffjKeyArchiverUntar, kn) {
					currentKey = ffjtArchiverUntar
					state = fflib.FFParse_want_colon
					goto mainparse
				}
				currentKey = ffjtArchivernosuchkey
				state = fflib.FFParse_want_colon
				goto mainparse
			}
		case fflib.FFParse_want_colon:
			if tok != fflib.FFTok_colon {
				wantedTok = fflib.FFTok_colon
				goto wrongtokenerror
			}
			state = fflib.FFParse_want_value
			continue
		case fflib.FFParse_want_value:
			if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null {
				switch currentKey {
				case ffjtArchiverUntar:
					goto handle_Untar
				case ffjtArchiverTarIDMappings:
					goto handle_TarIDMappings
				case ffjtArchiverChownOpts:
					goto handle_ChownOpts
				case ffjtArchiverUntarIDMappings:
					goto handle_UntarIDMappings
				case ffjtArchivernosuchkey:
					err = fs.SkipField(tok)
					if err != nil {
						return fs.WrapErr(err)
					}
					state = fflib.FFParse_after_value
					goto mainparse
				}
			} else {
				goto wantedvalue
			}
		}
	}
handle_Untar:
	{
		tbuf, err := fs.CaptureField(tok)
		if err != nil {
			return fs.WrapErr(err)
		}
		err = json.Unmarshal(tbuf, &j.Untar)
		if err != nil {
			return fs.WrapErr(err)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_TarIDMappings:
	{
		tbuf, err := fs.CaptureField(tok)
		if err != nil {
			return fs.WrapErr(err)
		}
		err = json.Unmarshal(tbuf, &j.TarIDMappings)
		if err != nil {
			return fs.WrapErr(err)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_ChownOpts:
	{
		tbuf, err := fs.CaptureField(tok)
		if err != nil {
			return fs.WrapErr(err)
		}
		err = json.Unmarshal(tbuf, &j.ChownOpts)
		if err != nil {
			return fs.WrapErr(err)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
handle_UntarIDMappings:
	{
		tbuf, err := fs.CaptureField(tok)
		if err != nil {
			return fs.WrapErr(err)
		}
		err = json.Unmarshal(tbuf, &j.UntarIDMappings)
		if err != nil {
			return fs.WrapErr(err)
		}
	}
	state = fflib.FFParse_after_value
	goto mainparse
wantedvalue:
	return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok))
wrongtokenerror:
	return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String()))
tokerror:
	if fs.BigError != nil {
		return fs.WrapErr(fs.BigError)
	}
	err = fs.Error.ToError()
	if err != nil {
		return fs.WrapErr(err)
	}
	panic("ffjson-generated: unreachable, please report bug.")
done:
	return nil
}
func (j *TarOptions) MarshalJSON() ([]byte, error) {
	var buf fflib.Buffer
	if j == nil {
		buf.WriteString("null")
		return buf.Bytes(), nil
	}
	err := j.MarshalJSONBuf(&buf)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
func (j *TarOptions) MarshalJSONBuf(buf fflib.EncodingBuffer) error {
	if j == nil {
		buf.WriteString("null")
		return nil
	}
	var err error
	var obj []byte
	_ = obj
	_ = err
	buf.WriteString(`{"IncludeFiles":`)
	if j.IncludeFiles != nil {
		buf.WriteString(`[`)
		for i, v := range j.IncludeFiles {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.WriteJsonString(buf, string(v))
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"ExcludePatterns":`)
	if j.ExcludePatterns != nil {
		buf.WriteString(`[`)
		for i, v := range j.ExcludePatterns {
			if i != 0 {
				buf.WriteString(`,`)
			}
			fflib.WriteJsonString(buf, string(v))
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"Compression":`)
	fflib.FormatBits2(buf, uint64(j.Compression), 10, j.Compression < 0)
	if j.NoLchown {
		buf.WriteString(`,"NoLchown":true`)
	} else {
		buf.WriteString(`,"NoLchown":false`)
	}
	buf.WriteString(`,"UIDMaps":`)
	if j.UIDMaps != nil {
		buf.WriteString(`[`)
		for i, v := range j.UIDMaps {
			if i != 0 {
				buf.WriteString(`,`)
			}
			err = buf.Encode(&v)
			if err != nil {
				return err
			}
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	buf.WriteString(`,"GIDMaps":`)
	if j.GIDMaps != nil {
		buf.WriteString(`[`)
		for i, v := range j.GIDMaps {
			if i != 0 {
				buf.WriteString(`,`)
			}
			err = buf.Encode(&v)
			if err != nil {
				return err
			}
		}
		buf.WriteString(`]`)
	} else {
		buf.WriteString(`null`)
	}
	if j.ChownOpts != nil {
		buf.WriteString(`,"ChownOpts":`)
		err = buf.Encode(j.ChownOpts)
		if err != nil {
			return err
		}
	} else {
		buf.WriteString(`,"ChownOpts":null`)
	}
	if j.IncludeSourceDir {
		buf.WriteString(`,"IncludeSourceDir":true`)
	} else {
		buf.WriteString(`,"IncludeSourceDir":false`)
	}
	buf.WriteString(`,"WhiteoutFormat":`)
	fflib.FormatBits2(buf, uint64(j.WhiteoutFormat), 10, j.WhiteoutFormat < 0)
	buf.WriteString(`,"WhiteoutData":`)
	err = buf.Encode(j.WhiteoutData)
	if err != nil {
		return err
	}
	if j.NoOverwriteDirNonDir {
		buf.WriteString(`,"NoOverwriteDirNonDir":true`)
	} else {
		buf.WriteString(`,"NoOverwriteDirNonDir":false`)
	}
	if j.RebaseNames == nil {
		buf.WriteString(`,"RebaseNames":null`)
	} else {
		buf.WriteString(`,"RebaseNames":{ `)
		for key, value := range j.RebaseNames {
			fflib.WriteJsonString(buf, key)
			buf.WriteString(`:`)
			fflib.WriteJsonString(buf, string(value))
			buf.WriteByte(',')
		}
		buf.Rewind(1)
		buf.WriteByte('}')
	}
	if j.InUserNS {
		buf.WriteString(`,"InUserNS":true`)
	} else {
		buf.WriteString(`,"InUserNS":false`)
	}
	if j.CopyPass {
		buf.WriteString(`,"CopyPass":true`)
	} else {
		buf.WriteString(`,"CopyPass":false`)
	}
	buf.WriteByte('}')
	return nil
}
const (
	ffjtTarOptionsbase = iota
	ffjtTarOptionsnosuchkey
	ffjtTarOptionsIncludeFiles
	ffjtTarOptionsExcludePatterns
	ffjtTarOptionsCompression
	ffjtTarOptionsNoLchown
	ffjtTarOptionsUIDMaps
	ffjtTarOptionsGIDMaps
	ffjtTarOptionsChownOpts
	ffjtTarOptionsIncludeSourceDir
	ffjtTarOptionsWhiteoutFormat
	ffjtTarOptionsWhiteoutData
	ffjtTarOptionsNoOverwriteDirNonDir
	ffjtTarOptionsRebaseNames
	ffjtTarOptionsInUserNS
	ffjtTarOptionsCopyPass
)
var ffjKeyTarOptionsIncludeFiles = []byte("IncludeFiles")
var ffjKeyTarOptionsExcludePatterns = []byte("ExcludePatterns")
var ffjKeyTarOptionsCompression = []byte("Compression")
var ffjKeyTarOptionsNoLchown = []byte("NoLchown")
var ffjKeyTarOptionsUIDMaps = []byte("UIDMaps")
var ffjKeyTarOptionsGIDMaps = []byte("GIDMaps")
var ffjKeyTarOptionsChownOpts = []byte("ChownOpts")
var ffjKeyTarOptionsIncludeSourceDir = []byte("IncludeSourceDir")
var ffjKeyTarOptionsWhiteoutFormat = []byte("WhiteoutFormat")
var ffjKeyTarOptionsWhiteoutData = []byte("WhiteoutData")
var ffjKeyTarOptionsNoOverwriteDirNonDir = []byte("NoOverwriteDirNonDir")
var ffjKeyTarOptionsRebaseNames = []byte("RebaseNames")
var ffjKeyTarOptionsInUserNS = []byte("InUserNS")
var ffjKeyTarOptionsCopyPass = []byte("CopyPass")
func (j *TarOptions) UnmarshalJSON(input []byte) error {
	fs := fflib.NewFFLexer(input)
	return j.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start)
}