// DevLinkSetEswitchMode sets eswitch mode if able to set successfully or
// returns an error code.
// Equivalent to: `devlink dev eswitch set $dev mode switchdev`
// Equivalent to: `devlink dev eswitch set $dev mode legacy`
517350
func DevLinkSetEswitchMode(Dev *DevlinkDevice, NewMode string) error {
	return pkgHandle.DevLinkSetEswitchMode(Dev, NewMode)
}
946699
func (s *CampaignHook) SetMode(v string) *CampaignHook {
	s.Mode = &v
	return s
}
119378
func setMacVlanMode(mode string) (netlink.MacvlanMode, error) {
	switch mode {
	case modePrivate:
		return netlink.MACVLAN_MODE_PRIVATE, nil
	case modeVepa:
		return netlink.MACVLAN_MODE_VEPA, nil
	case modeBridge:
		return netlink.MACVLAN_MODE_BRIDGE, nil
	case modePassthru:
		return netlink.MACVLAN_MODE_PASSTHRU, nil
	default:
		return 0, fmt.Errorf("unknown macvlan mode: %s", mode)
	}
}
536350
func (t *Terminal) SetMode(state sys.Termios) error {
	if err := sys.Setattr(t.fd, sys.TCSANOW, &state); err != nil {
		return os.NewSyscallError("sys.Setattr", err)
	}

	t.lastState = state
	t.mode |= OtherMode
	return nil
}
300372
func (s *ScheduleActionSettings) SetInputSwitchSettings(v *InputSwitchScheduleActionSettings) *ScheduleActionSettings {
	s.InputSwitchSettings = v
	return s
}
1127313
func (s *DeleteGeoMatchSetInput) SetChangeToken(v string) *DeleteGeoMatchSetInput {
	s.ChangeToken = &v
	return s
}
20920
func (s *DeleteIPSetOutput) SetChangeToken(v string) *DeleteIPSetOutput {
	s.ChangeToken = &v
	return s
}
785096
func (_class BondClass) SetMode(sessionID SessionRef, self BondRef, value BondMode) (_err error) {
	_method := "Bond.set_mode"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertBondRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_valueArg, _err := convertEnumBondModeToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg, _valueArg)
	return
}
970647
func (s *DeleteSqlInjectionMatchSetOutput) SetChangeToken(v string) *DeleteSqlInjectionMatchSetOutput {
	s.ChangeToken = &v
	return s
}
750200
func (d *DRV2605LDriver) SetMode(newMode DRV2605Mode) (err error) {
	mode, err := d.connection.ReadByteData(drv2605RegMode)
	if err != nil {
		return err
	}

	// clear mode bits (lower three bits)
	mode &= 0xf8
	// set new mode bits
	mode |= uint8(newMode)

	err = d.connection.WriteByteData(drv2605RegMode, mode)

	return err
}
294590
func (s *DeleteIPSetInput) SetChangeToken(v string) *DeleteIPSetInput {
	s.ChangeToken = &v
	return s
}
1022390
func (s *HlsGroupSettings) SetSegmentationMode(v string) *HlsGroupSettings {
	s.SegmentationMode = &v
	return s
}
58752
func (client *Client) DeleteVSwitch(VSwitchId string) error {
	args := DeleteVSwitchArgs{
		VSwitchId: VSwitchId,
	}
	response := DeleteVSwitchResponse{}
	return client.Invoke("DeleteVSwitch", &args, &response)
}
1275271
func (s *StartAutomationExecutionInput) SetMode(v string) *StartAutomationExecutionInput {
	s.Mode = &v
	return s
}
908667
func (e *DeviceWrap) SwitchConfigAndActiveDevice(m libkb.MetaContext) (err error) {
	defer m.Trace("DeviceWrap#SetActiveDevice", func() error { return err })()

	if err = e.refreshMe(m); err != nil {
		return err
	}

	salt, err := e.args.Me.GetSalt()
	if err != nil {
		return err
	}
	me := e.args.Me
	// Atomically swap to the new config and active device
	if err := m.SwitchUserNewConfigActiveDevice(me.ToUserVersion(), me.GetNormalizedName(), salt,
		e.deviceID, e.signingKey, e.encryptionKey, e.args.DeviceName); err != nil {
		return err
	}

	// Sync down secrets for future offline login attempts to work.
	// This will largely just download what we just uploaded, but it's
	// easy to do this way.
	_, w := m.ActiveDevice().SyncSecrets(m)
	if w != nil {
		m.Warning("Error sync secrets: %s", w.Error())
	}
	return nil
}
457251
func (s *Server) SwitchIDAt(index int) int64 {
	if len(s.Interfaces) <= index {
		return -1
	}

	nic := s.Interfaces[index]
	if nic.Switch == nil || nic.Switch.Scope == ESCopeShared {
		return -1
	}
	return nic.Switch.ID
}
1192310
func (s *TaskDefinition) SetPidMode(v string) *TaskDefinition {
	s.PidMode = &v
	return s
}