// Generated by [optioner] command-line tool; DO NOT EDIT
// If you have any questions, please create issues and submit contributions at:
// https://github.com/chenmingyong0423/go-optioner

package example

import "github.com/chenmingyong0423/go-optioner/example/third_party"

type UserOption func(*User)

func NewUser(embedded Embedded, embedded2 *Embedded2, e3 Embedded3, e4 *Embedded4, opts ...UserOption) *User {
	user := &User{
		Embedded:  embedded,
		Embedded2: embedded2,
		E3:        e3,
		E4:        e4,
	}

	for _, opt := range opts {
		opt(user)
	}

	return user
}

func WithEmbedded5(embedded5 Embedded5) UserOption {
	return func(user *User) {
		user.Embedded5 = embedded5
	}
}

func WithEmbedded6(embedded6 *Embedded6) UserOption {
	return func(user *User) {
		user.Embedded6 = embedded6
	}
}

func WithE7(e7 Embedded7) UserOption {
	return func(user *User) {
		user.E7 = e7
	}
}

func WithE8(e8 *Embedded8) UserOption {
	return func(user *User) {
		user.E8 = e8
	}
}

func WithUsername(username string) UserOption {
	return func(user *User) {
		user.Username = username
	}
}

func WithEmail(email string) UserOption {
	return func(user *User) {
		user.Email = email
	}
}

func WithAddress(address Address) UserOption {
	return func(user *User) {
		user.Address = address
	}
}

func WithArrayField(arrayField [4]int) UserOption {
	return func(user *User) {
		user.ArrayField = arrayField
	}
}

func WithSliceField(sliceField []int) UserOption {
	return func(user *User) {
		user.SliceField = sliceField
	}
}

func WithThirdPartyField(thirdPartyField third_party.ThirdParty) UserOption {
	return func(user *User) {
		user.ThirdPartyField = thirdPartyField
	}
}

func WithMapField(mapField map[string]int) UserOption {
	return func(user *User) {
		user.MapField = mapField
	}
}

func WithPtrField(ptrField *int) UserOption {
	return func(user *User) {
		user.PtrField = ptrField
	}
}

func WithEmptyStructFiled(emptyStructFiled struct{}) UserOption {
	return func(user *User) {
		user.EmptyStructFiled = emptyStructFiled
	}
}

func WithSimpleFuncField(simpleFuncField func()) UserOption {
	return func(user *User) {
		user.SimpleFuncField = simpleFuncField
	}
}

func WithComplexFuncField(complexFuncField func(a int)) UserOption {
	return func(user *User) {
		user.ComplexFuncField = complexFuncField
	}
}

func WithComplexFuncFieldV2(complexFuncFieldV2 func() int) UserOption {
	return func(user *User) {
		user.ComplexFuncFieldV2 = complexFuncFieldV2
	}
}

func WithComplexFuncFieldV3(complexFuncFieldV3 func(a int) int) UserOption {
	return func(user *User) {
		user.ComplexFuncFieldV3 = complexFuncFieldV3
	}
}

func WithComplexFuncFieldV4(complexFuncFieldV4 func(a int) (int, error)) UserOption {
	return func(user *User) {
		user.ComplexFuncFieldV4 = complexFuncFieldV4
	}
}

func WithChanField(chanField chan int) UserOption {
	return func(user *User) {
		user.ChanField = chanField
	}
}

func WithError(error error) UserOption {
	return func(user *User) {
		user.error = error
	}
}
