func (EndDeviceOptionNamespace) WithCreatedAt(v time.Time) EndDeviceOption {
	return func(x ttnpb.EndDevice) ttnpb.EndDevice {
		x.CreatedAt = v
		return x
	}
}
WithCreatedAt returns a EndDeviceOption, which returns a copy of ttnpb.EndDevice with CreatedAt set to v.
package test
import (
	"time"
	pbtypes "github.com/gogo/protobuf/types"
	"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
	"go.thethings.network/lorawan-stack/v3/pkg/types"
)
type (
	RootKeysOption func(ttnpb.RootKeys) ttnpb.RootKeys
	RootKeysOptionNamespace struct{}
)
func (RootKeysOptionNamespace) WithRootKeyID(v string) RootKeysOption {
	return func(x ttnpb.RootKeys) ttnpb.RootKeys {
		x.RootKeyId = v
		return x
	}
}
func (RootKeysOptionNamespace) WithAppKey(v *ttnpb.KeyEnvelope) RootKeysOption {
	return func(x ttnpb.RootKeys) ttnpb.RootKeys {
		x.AppKey = v
		return x
	}
}
func (RootKeysOptionNamespace) WithNwkKey(v *ttnpb.KeyEnvelope) RootKeysOption {
	return func(x ttnpb.RootKeys) ttnpb.RootKeys {
		x.NwkKey = v
		return x
	}
}
func (RootKeysOptionNamespace) Compose(opts ...RootKeysOption) RootKeysOption {
	return func(x ttnpb.RootKeys) ttnpb.RootKeys {
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
func (f RootKeysOption) Compose(opts ...RootKeysOption) RootKeysOption {
	return func(x ttnpb.RootKeys) ttnpb.RootKeys {
		x = f(x)
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
var RootKeysOptions RootKeysOptionNamespace
func MakeRootKeys(opts ...RootKeysOption) *ttnpb.RootKeys {
	v := RootKeysOptions.Compose(opts...)(baseRootKeys)
	return &v
}
type (
	SessionKeysOption func(ttnpb.SessionKeys) ttnpb.SessionKeys
	SessionKeysOptionNamespace struct{}
)
func (SessionKeysOptionNamespace) WithSessionKeyID(v []byte) SessionKeysOption {
	return func(x ttnpb.SessionKeys) ttnpb.SessionKeys {
		x.SessionKeyId = v
		return x
	}
}
func (SessionKeysOptionNamespace) WithFNwkSIntKey(v *ttnpb.KeyEnvelope) SessionKeysOption {
	return func(x ttnpb.SessionKeys) ttnpb.SessionKeys {
		x.FNwkSIntKey = v
		return x
	}
}
func (SessionKeysOptionNamespace) WithSNwkSIntKey(v *ttnpb.KeyEnvelope) SessionKeysOption {
	return func(x ttnpb.SessionKeys) ttnpb.SessionKeys {
		x.SNwkSIntKey = v
		return x
	}
}
func (SessionKeysOptionNamespace) WithNwkSEncKey(v *ttnpb.KeyEnvelope) SessionKeysOption {
	return func(x ttnpb.SessionKeys) ttnpb.SessionKeys {
		x.NwkSEncKey = v
		return x
	}
}
func (SessionKeysOptionNamespace) WithAppSKey(v *ttnpb.KeyEnvelope) SessionKeysOption {
	return func(x ttnpb.SessionKeys) ttnpb.SessionKeys {
		x.AppSKey = v
		return x
	}
}
func (SessionKeysOptionNamespace) Compose(opts ...SessionKeysOption) SessionKeysOption {
	return func(x ttnpb.SessionKeys) ttnpb.SessionKeys {
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
func (f SessionKeysOption) Compose(opts ...SessionKeysOption) SessionKeysOption {
	return func(x ttnpb.SessionKeys) ttnpb.SessionKeys {
		x = f(x)
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
var SessionKeysOptions SessionKeysOptionNamespace
func MakeSessionKeys(opts ...SessionKeysOption) *ttnpb.SessionKeys {
	v := SessionKeysOptions.Compose(opts...)(baseSessionKeys)
	return &v
}
type (
	SessionOption func(ttnpb.Session) ttnpb.Session
	SessionOptionNamespace struct{}
)
func (SessionOptionNamespace) WithDevAddr(v types.DevAddr) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.DevAddr = v
		return x
	}
}
func (SessionOptionNamespace) WithSessionKeys(v ttnpb.SessionKeys) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.SessionKeys = v
		return x
	}
}
func (SessionOptionNamespace) WithLastFCntUp(v uint32) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.LastFCntUp = v
		return x
	}
}
func (SessionOptionNamespace) WithLastNFCntDown(v uint32) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.LastNFCntDown = v
		return x
	}
}
func (SessionOptionNamespace) WithLastAFCntDown(v uint32) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.LastAFCntDown = v
		return x
	}
}
func (SessionOptionNamespace) WithLastConfFCntDown(v uint32) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.LastConfFCntDown = v
		return x
	}
}
func (SessionOptionNamespace) WithStartedAt(v time.Time) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.StartedAt = v
		return x
	}
}
func (SessionOptionNamespace) WithQueuedApplicationDownlinks(vs ...*ttnpb.ApplicationDownlink) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x.QueuedApplicationDownlinks = vs
		return x
	}
}
func (SessionOptionNamespace) Compose(opts ...SessionOption) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
func (f SessionOption) Compose(opts ...SessionOption) SessionOption {
	return func(x ttnpb.Session) ttnpb.Session {
		x = f(x)
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
var SessionOptions SessionOptionNamespace
func MakeSession(opts ...SessionOption) *ttnpb.Session {
	v := SessionOptions.Compose(opts...)(baseSession)
	return &v
}
type (
	MACStateOption func(ttnpb.MACState) ttnpb.MACState
	MACStateOptionNamespace struct{}
)
func (MACStateOptionNamespace) WithCurrentParameters(v ttnpb.MACParameters) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.CurrentParameters = v
		return x
	}
}
func (MACStateOptionNamespace) WithDesiredParameters(v ttnpb.MACParameters) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.DesiredParameters = v
		return x
	}
}
func (MACStateOptionNamespace) WithDeviceClass(v ttnpb.Class) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.DeviceClass = v
		return x
	}
}
func (MACStateOptionNamespace) WithLoRaWANVersion(v ttnpb.MACVersion) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.LorawanVersion = v
		return x
	}
}
func (MACStateOptionNamespace) WithLastConfirmedDownlinkAt(v *time.Time) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.LastConfirmedDownlinkAt = v
		return x
	}
}
func (MACStateOptionNamespace) WithLastDevStatusFCntUp(v uint32) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.LastDevStatusFCntUp = v
		return x
	}
}
func (MACStateOptionNamespace) WithPingSlotPeriodicity(v *ttnpb.PingSlotPeriodValue) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.PingSlotPeriodicity = v
		return x
	}
}
func (MACStateOptionNamespace) WithPendingApplicationDownlink(v *ttnpb.ApplicationDownlink) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.PendingApplicationDownlink = v
		return x
	}
}
func (MACStateOptionNamespace) WithQueuedResponses(vs ...*ttnpb.MACCommand) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.QueuedResponses = vs
		return x
	}
}
func (MACStateOptionNamespace) WithPendingRequests(vs ...*ttnpb.MACCommand) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.PendingRequests = vs
		return x
	}
}
func (MACStateOptionNamespace) WithQueuedJoinAccept(v *ttnpb.MACState_JoinAccept) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.QueuedJoinAccept = v
		return x
	}
}
func (MACStateOptionNamespace) WithPendingJoinRequest(v *ttnpb.MACState_JoinRequest) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.PendingJoinRequest = v
		return x
	}
}
func (MACStateOptionNamespace) WithRxWindowsAvailable(v bool) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.RxWindowsAvailable = v
		return x
	}
}
func (MACStateOptionNamespace) WithRecentUplinks(vs ...*ttnpb.UplinkMessage) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.RecentUplinks = vs
		return x
	}
}
func (MACStateOptionNamespace) WithRecentDownlinks(vs ...*ttnpb.DownlinkMessage) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.RecentDownlinks = vs
		return x
	}
}
func (MACStateOptionNamespace) WithLastNetworkInitiatedDownlinkAt(v *time.Time) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.LastNetworkInitiatedDownlinkAt = v
		return x
	}
}
func (MACStateOptionNamespace) WithRejectedADRDataRateIndexes(vs ...ttnpb.DataRateIndex) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.RejectedAdrDataRateIndexes = vs
		return x
	}
}
func (MACStateOptionNamespace) WithRejectedADRTxPowerIndexes(vs ...uint32) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.RejectedAdrTxPowerIndexes = vs
		return x
	}
}
func (MACStateOptionNamespace) WithRejectedFrequencies(vs ...uint64) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.RejectedFrequencies = vs
		return x
	}
}
func (MACStateOptionNamespace) WithLastDownlinkAt(v *time.Time) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.LastDownlinkAt = v
		return x
	}
}
func (MACStateOptionNamespace) WithRejectedDataRateRanges(v map[uint64]*ttnpb.MACState_DataRateRanges) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.RejectedDataRateRanges = v
		return x
	}
}
func (MACStateOptionNamespace) WithLastADRChangeFCntUp(v uint32) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x.LastAdrChangeFCntUp = v
		return x
	}
}
func (MACStateOptionNamespace) Compose(opts ...MACStateOption) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
func (f MACStateOption) Compose(opts ...MACStateOption) MACStateOption {
	return func(x ttnpb.MACState) ttnpb.MACState {
		x = f(x)
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
var MACStateOptions MACStateOptionNamespace
func MakeMACState(opts ...MACStateOption) *ttnpb.MACState {
	v := MACStateOptions.Compose(opts...)(baseMACState)
	return &v
}
type (
	EndDeviceIdentifiersOption func(ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers
	EndDeviceIdentifiersOptionNamespace struct{}
)
func (EndDeviceIdentifiersOptionNamespace) WithDeviceID(v string) EndDeviceIdentifiersOption {
	return func(x ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers {
		x.DeviceId = v
		return x
	}
}
func (EndDeviceIdentifiersOptionNamespace) WithApplicationIdentifiers(v ttnpb.ApplicationIdentifiers) EndDeviceIdentifiersOption {
	return func(x ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers {
		x.ApplicationIdentifiers = v
		return x
	}
}
func (EndDeviceIdentifiersOptionNamespace) WithDevEUI(v *types.EUI64) EndDeviceIdentifiersOption {
	return func(x ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers {
		x.DevEui = v
		return x
	}
}
func (EndDeviceIdentifiersOptionNamespace) WithJoinEUI(v *types.EUI64) EndDeviceIdentifiersOption {
	return func(x ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers {
		x.JoinEui = v
		return x
	}
}
func (EndDeviceIdentifiersOptionNamespace) WithDevAddr(v *types.DevAddr) EndDeviceIdentifiersOption {
	return func(x ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers {
		x.DevAddr = v
		return x
	}
}
func (EndDeviceIdentifiersOptionNamespace) Compose(opts ...EndDeviceIdentifiersOption) EndDeviceIdentifiersOption {
	return func(x ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers {
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
func (f EndDeviceIdentifiersOption) Compose(opts ...EndDeviceIdentifiersOption) EndDeviceIdentifiersOption {
	return func(x ttnpb.EndDeviceIdentifiers) ttnpb.EndDeviceIdentifiers {
		x = f(x)
		for _, opt := range opts {
			x = opt(x)
		}
		return x
	}
}
var EndDeviceIdentifiersOptions EndDeviceIdentifiersOptionNamespace
func MakeEndDeviceIdentifiers(opts ...EndDeviceIdentifiersOption) *ttnpb.EndDeviceIdentifiers {
	v := EndDeviceIdentifiersOptions.Compose(opts...)(baseEndDeviceIdentifiers)
	return &v
}
type (
	EndDeviceOption func(ttnpb.EndDevice) ttnpb.EndDevice
	EndDeviceOptionNamespace struct{}
)
func (EndDeviceOptionNamespace) WithEndDeviceIdentifiers(v ttnpb.EndDeviceIdentifiers) EndDeviceOption {
	return func(x ttnpb.EndDevice) ttnpb.EndDevice {
		x.EndDeviceIdentifiers = v
		return x
	}
}