// Code generated by protoc-gen-gopherjs. DO NOT EDIT. // source: grpc.proto /* Package P4wnP1_grpc is a generated protocol buffer package. It is generated from these files: grpc.proto It has these top-level messages: TriggerActionSet TriggerAction TriggerServiceStarted TriggerUSBGadgetConnected TriggerUSBGadgetDisconnected TriggerWifiAPStarted TriggerWifiConnectedAsSta TriggerSSHLogin TriggerDHCPLeaseGranted TriggerGroupReceive TriggerGroupReceiveSequence TriggerGPIOIn ActionStartBashScript ActionStartHIDScript ActionDeploySettingsTemplate ActionLog ActionGPIOOut ActionGroupSend WifiRequestSettingsStorage WiFiSettings WiFiState WiFiBSSCfg StringMessage StringMessageArray EventRequest EventValue Event TempDirOrFileRequest TempDirOrFileResponse ReadFileRequest ReadFileResponse WriteFileRequest FileInfoRequest FileInfoResponse HIDScriptRequest HIDScriptJob HIDScriptJobList HIDRunningJobStateResult HIDScriptResult LEDSettings GadgetSettings GadgetSettingsEthernet GadgetSettingsUMS DeployedEthernetInterfaceSettings EthernetInterfaceSettings DHCPServerSettings DHCPServerRange DHCPServerStaticHost Empty */ package P4wnP1_grpc import jspb "github.com/johanbrandhorst/protobuf/jspb" import ( context "context" grpcweb "github.com/johanbrandhorst/protobuf/grpcweb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the jspb package it is being compiled against. const _ = jspb.JspbPackageIsVersion2 type GPIOInPullUpDown int const ( GPIOInPullUpDown_UP GPIOInPullUpDown = 0 GPIOInPullUpDown_DOWN GPIOInPullUpDown = 1 GPIOInPullUpDown_OFF GPIOInPullUpDown = 2 ) var GPIOInPullUpDown_name = map[int]string{ 0: "UP", 1: "DOWN", 2: "OFF", } var GPIOInPullUpDown_value = map[string]int{ "UP": 0, "DOWN": 1, "OFF": 2, } func (x GPIOInPullUpDown) String() string { return GPIOInPullUpDown_name[int(x)] } type GPIOInEdge int const ( GPIOInEdge_RISING GPIOInEdge = 0 GPIOInEdge_FALLING GPIOInEdge = 1 GPIOInEdge_BOTH GPIOInEdge = 2 ) var GPIOInEdge_name = map[int]string{ 0: "RISING", 1: "FALLING", 2: "BOTH", } var GPIOInEdge_value = map[string]int{ "RISING": 0, "FALLING": 1, "BOTH": 2, } func (x GPIOInEdge) String() string { return GPIOInEdge_name[int(x)] } type GPIONum int const ( GPIONum_NUM_1 GPIONum = 0 GPIONum_NUM_2 GPIONum = 1 GPIONum_NUM_3 GPIONum = 2 GPIONum_NUM_4 GPIONum = 3 GPIONum_NUM_5 GPIONum = 4 GPIONum_NUM_6 GPIONum = 5 GPIONum_NUM_7 GPIONum = 6 GPIONum_NUM_8 GPIONum = 7 GPIONum_NUM_9 GPIONum = 8 GPIONum_NUM_10 GPIONum = 9 GPIONum_NUM_11 GPIONum = 10 GPIONum_NUM_12 GPIONum = 11 GPIONum_NUM_13 GPIONum = 12 GPIONum_NUM_14 GPIONum = 13 GPIONum_NUM_15 GPIONum = 14 GPIONum_NUM_16 GPIONum = 15 GPIONum_NUM_17 GPIONum = 16 GPIONum_NUM_18 GPIONum = 17 GPIONum_NUM_19 GPIONum = 18 GPIONum_NUM_20 GPIONum = 19 ) var GPIONum_name = map[int]string{ 0: "NUM_1", 1: "NUM_2", 2: "NUM_3", 3: "NUM_4", 4: "NUM_5", 5: "NUM_6", 6: "NUM_7", 7: "NUM_8", 8: "NUM_9", 9: "NUM_10", 10: "NUM_11", 11: "NUM_12", 12: "NUM_13", 13: "NUM_14", 14: "NUM_15", 15: "NUM_16", 16: "NUM_17", 17: "NUM_18", 18: "NUM_19", 19: "NUM_20", } var GPIONum_value = map[string]int{ "NUM_1": 0, "NUM_2": 1, "NUM_3": 2, "NUM_4": 3, "NUM_5": 4, "NUM_6": 5, "NUM_7": 6, "NUM_8": 7, "NUM_9": 8, "NUM_10": 9, "NUM_11": 10, "NUM_12": 11, "NUM_13": 12, "NUM_14": 13, "NUM_15": 14, "NUM_16": 15, "NUM_17": 16, "NUM_18": 17, "NUM_19": 18, "NUM_20": 19, } func (x GPIONum) String() string { return GPIONum_name[int(x)] } type GPIOOutValue int const ( GPIOOutValue_LOW GPIOOutValue = 0 GPIOOutValue_HIGH GPIOOutValue = 1 GPIOOutValue_TOGGLE GPIOOutValue = 2 ) var GPIOOutValue_name = map[int]string{ 0: "LOW", 1: "HIGH", 2: "TOGGLE", } var GPIOOutValue_value = map[string]int{ "LOW": 0, "HIGH": 1, "TOGGLE": 2, } func (x GPIOOutValue) String() string { return GPIOOutValue_name[int(x)] } // WiFi2 (distinguish state and settings) type WiFiWorkingMode int const ( WiFiWorkingMode_UNKNOWN WiFiWorkingMode = 0 WiFiWorkingMode_AP WiFiWorkingMode = 1 WiFiWorkingMode_STA WiFiWorkingMode = 2 WiFiWorkingMode_STA_FAILOVER_AP WiFiWorkingMode = 3 ) var WiFiWorkingMode_name = map[int]string{ 0: "UNKNOWN", 1: "AP", 2: "STA", 3: "STA_FAILOVER_AP", } var WiFiWorkingMode_value = map[string]int{ "UNKNOWN": 0, "AP": 1, "STA": 2, "STA_FAILOVER_AP": 3, } func (x WiFiWorkingMode) String() string { return WiFiWorkingMode_name[int(x)] } type WiFiStateMode int const ( WiFiStateMode_STA_NOT_CONNECTED WiFiStateMode = 0 WiFiStateMode_AP_UP WiFiStateMode = 1 WiFiStateMode_STA_CONNECTED WiFiStateMode = 2 ) var WiFiStateMode_name = map[int]string{ 0: "STA_NOT_CONNECTED", 1: "AP_UP", 2: "STA_CONNECTED", } var WiFiStateMode_value = map[string]int{ "STA_NOT_CONNECTED": 0, "AP_UP": 1, "STA_CONNECTED": 2, } func (x WiFiStateMode) String() string { return WiFiStateMode_name[int(x)] } type WiFiAuthMode int const ( WiFiAuthMode_WPA2_PSK WiFiAuthMode = 0 WiFiAuthMode_OPEN WiFiAuthMode = 1 ) var WiFiAuthMode_name = map[int]string{ 0: "WPA2_PSK", 1: "OPEN", } var WiFiAuthMode_value = map[string]int{ "WPA2_PSK": 0, "OPEN": 1, } func (x WiFiAuthMode) String() string { return WiFiAuthMode_name[int(x)] } type ActionDeploySettingsTemplate_TemplateType int const ( ActionDeploySettingsTemplate_FULL_SETTINGS ActionDeploySettingsTemplate_TemplateType = 0 ActionDeploySettingsTemplate_NETWORK ActionDeploySettingsTemplate_TemplateType = 1 ActionDeploySettingsTemplate_WIFI ActionDeploySettingsTemplate_TemplateType = 2 ActionDeploySettingsTemplate_USB ActionDeploySettingsTemplate_TemplateType = 3 ActionDeploySettingsTemplate_BLUETOOTH ActionDeploySettingsTemplate_TemplateType = 4 ActionDeploySettingsTemplate_TRIGGER_ACTIONS ActionDeploySettingsTemplate_TemplateType = 5 ) var ActionDeploySettingsTemplate_TemplateType_name = map[int]string{ 0: "FULL_SETTINGS", 1: "NETWORK", 2: "WIFI", 3: "USB", 4: "BLUETOOTH", 5: "TRIGGER_ACTIONS", } var ActionDeploySettingsTemplate_TemplateType_value = map[string]int{ "FULL_SETTINGS": 0, "NETWORK": 1, "WIFI": 2, "USB": 3, "BLUETOOTH": 4, "TRIGGER_ACTIONS": 5, } func (x ActionDeploySettingsTemplate_TemplateType) String() string { return ActionDeploySettingsTemplate_TemplateType_name[int(x)] } type EthernetInterfaceSettings_Mode int const ( EthernetInterfaceSettings_MANUAL EthernetInterfaceSettings_Mode = 0 EthernetInterfaceSettings_DHCP_CLIENT EthernetInterfaceSettings_Mode = 1 EthernetInterfaceSettings_DHCP_SERVER EthernetInterfaceSettings_Mode = 2 EthernetInterfaceSettings_UNMANAGED EthernetInterfaceSettings_Mode = 3 ) var EthernetInterfaceSettings_Mode_name = map[int]string{ 0: "MANUAL", 1: "DHCP_CLIENT", 2: "DHCP_SERVER", 3: "UNMANAGED", } var EthernetInterfaceSettings_Mode_value = map[string]int{ "MANUAL": 0, "DHCP_CLIENT": 1, "DHCP_SERVER": 2, "UNMANAGED": 3, } func (x EthernetInterfaceSettings_Mode) String() string { return EthernetInterfaceSettings_Mode_name[int(x)] } // Triggers, Actions and resulting TriggerActions type TriggerActionSet struct { TriggerActions []*TriggerAction Name string } // GetTriggerActions gets the TriggerActions of the TriggerActionSet. func (m *TriggerActionSet) GetTriggerActions() (x []*TriggerAction) { if m == nil { return x } return m.TriggerActions } // GetName gets the Name of the TriggerActionSet. func (m *TriggerActionSet) GetName() (x string) { if m == nil { return x } return m.Name } // MarshalToWriter marshals TriggerActionSet to the provided writer. func (m *TriggerActionSet) MarshalToWriter(writer jspb.Writer) { if m == nil { return } for _, msg := range m.TriggerActions { writer.WriteMessage(1, func() { msg.MarshalToWriter(writer) }) } if len(m.Name) > 0 { writer.WriteString(2, m.Name) } return } // Marshal marshals TriggerActionSet to a slice of bytes. func (m *TriggerActionSet) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerActionSet from the provided reader. func (m *TriggerActionSet) UnmarshalFromReader(reader jspb.Reader) *TriggerActionSet { for reader.Next() { if m == nil { m = &TriggerActionSet{} } switch reader.GetFieldNumber() { case 1: reader.ReadMessage(func() { m.TriggerActions = append(m.TriggerActions, new(TriggerAction).UnmarshalFromReader(reader)) }) case 2: m.Name = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerActionSet from a slice of bytes. func (m *TriggerActionSet) Unmarshal(rawBytes []byte) (*TriggerActionSet, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerAction struct { Id uint32 OneShot bool IsActive bool Immutable bool // Types that are valid to be assigned to Trigger: // *TriggerAction_ServiceStarted // *TriggerAction_UsbGadgetConnected // *TriggerAction_UsbGadgetDisconnected // *TriggerAction_WifiAPStarted // *TriggerAction_WifiConnectedAsSta // *TriggerAction_SshLogin // *TriggerAction_DhcpLeaseGranted // *TriggerAction_GroupReceive // *TriggerAction_GroupReceiveSequence // *TriggerAction_GpioIn Trigger isTriggerAction_Trigger // Types that are valid to be assigned to Action: // *TriggerAction_BashScript // *TriggerAction_HidScript // *TriggerAction_DeploySettingsTemplate // *TriggerAction_Log // *TriggerAction_GpioOut // *TriggerAction_GroupSend Action isTriggerAction_Action } // isTriggerAction_Trigger is used to distinguish types assignable to Trigger type isTriggerAction_Trigger interface{ isTriggerAction_Trigger() } // isTriggerAction_Action is used to distinguish types assignable to Action type isTriggerAction_Action interface{ isTriggerAction_Action() } // TriggerAction_ServiceStarted is assignable to Trigger type TriggerAction_ServiceStarted struct { ServiceStarted *TriggerServiceStarted } // TriggerAction_UsbGadgetConnected is assignable to Trigger type TriggerAction_UsbGadgetConnected struct { UsbGadgetConnected *TriggerUSBGadgetConnected } // TriggerAction_UsbGadgetDisconnected is assignable to Trigger type TriggerAction_UsbGadgetDisconnected struct { UsbGadgetDisconnected *TriggerUSBGadgetDisconnected } // TriggerAction_WifiAPStarted is assignable to Trigger type TriggerAction_WifiAPStarted struct { WifiAPStarted *TriggerWifiAPStarted } // TriggerAction_WifiConnectedAsSta is assignable to Trigger type TriggerAction_WifiConnectedAsSta struct { WifiConnectedAsSta *TriggerWifiConnectedAsSta } // TriggerAction_SshLogin is assignable to Trigger type TriggerAction_SshLogin struct { SshLogin *TriggerSSHLogin } // TriggerAction_DhcpLeaseGranted is assignable to Trigger type TriggerAction_DhcpLeaseGranted struct { DhcpLeaseGranted *TriggerDHCPLeaseGranted } // TriggerAction_GroupReceive is assignable to Trigger type TriggerAction_GroupReceive struct { GroupReceive *TriggerGroupReceive } // TriggerAction_GroupReceiveSequence is assignable to Trigger type TriggerAction_GroupReceiveSequence struct { GroupReceiveSequence *TriggerGroupReceiveSequence } // TriggerAction_GpioIn is assignable to Trigger type TriggerAction_GpioIn struct { GpioIn *TriggerGPIOIn } // TriggerAction_BashScript is assignable to Action type TriggerAction_BashScript struct { BashScript *ActionStartBashScript } // TriggerAction_HidScript is assignable to Action type TriggerAction_HidScript struct { HidScript *ActionStartHIDScript } // TriggerAction_DeploySettingsTemplate is assignable to Action type TriggerAction_DeploySettingsTemplate struct { DeploySettingsTemplate *ActionDeploySettingsTemplate } // TriggerAction_Log is assignable to Action type TriggerAction_Log struct { Log *ActionLog } // TriggerAction_GpioOut is assignable to Action type TriggerAction_GpioOut struct { GpioOut *ActionGPIOOut } // TriggerAction_GroupSend is assignable to Action type TriggerAction_GroupSend struct { GroupSend *ActionGroupSend } func (*TriggerAction_ServiceStarted) isTriggerAction_Trigger() {} func (*TriggerAction_UsbGadgetConnected) isTriggerAction_Trigger() {} func (*TriggerAction_UsbGadgetDisconnected) isTriggerAction_Trigger() {} func (*TriggerAction_WifiAPStarted) isTriggerAction_Trigger() {} func (*TriggerAction_WifiConnectedAsSta) isTriggerAction_Trigger() {} func (*TriggerAction_SshLogin) isTriggerAction_Trigger() {} func (*TriggerAction_DhcpLeaseGranted) isTriggerAction_Trigger() {} func (*TriggerAction_GroupReceive) isTriggerAction_Trigger() {} func (*TriggerAction_GroupReceiveSequence) isTriggerAction_Trigger() {} func (*TriggerAction_GpioIn) isTriggerAction_Trigger() {} func (*TriggerAction_BashScript) isTriggerAction_Action() {} func (*TriggerAction_HidScript) isTriggerAction_Action() {} func (*TriggerAction_DeploySettingsTemplate) isTriggerAction_Action() {} func (*TriggerAction_Log) isTriggerAction_Action() {} func (*TriggerAction_GpioOut) isTriggerAction_Action() {} func (*TriggerAction_GroupSend) isTriggerAction_Action() {} // GetTrigger gets the Trigger of the TriggerAction. func (m *TriggerAction) GetTrigger() (x isTriggerAction_Trigger) { if m == nil { return x } return m.Trigger } // GetAction gets the Action of the TriggerAction. func (m *TriggerAction) GetAction() (x isTriggerAction_Action) { if m == nil { return x } return m.Action } // GetId gets the Id of the TriggerAction. func (m *TriggerAction) GetId() (x uint32) { if m == nil { return x } return m.Id } // GetOneShot gets the OneShot of the TriggerAction. func (m *TriggerAction) GetOneShot() (x bool) { if m == nil { return x } return m.OneShot } // GetIsActive gets the IsActive of the TriggerAction. func (m *TriggerAction) GetIsActive() (x bool) { if m == nil { return x } return m.IsActive } // GetImmutable gets the Immutable of the TriggerAction. func (m *TriggerAction) GetImmutable() (x bool) { if m == nil { return x } return m.Immutable } // GetServiceStarted gets the ServiceStarted of the TriggerAction. func (m *TriggerAction) GetServiceStarted() (x *TriggerServiceStarted) { if v, ok := m.GetTrigger().(*TriggerAction_ServiceStarted); ok { return v.ServiceStarted } return x } // GetUsbGadgetConnected gets the UsbGadgetConnected of the TriggerAction. func (m *TriggerAction) GetUsbGadgetConnected() (x *TriggerUSBGadgetConnected) { if v, ok := m.GetTrigger().(*TriggerAction_UsbGadgetConnected); ok { return v.UsbGadgetConnected } return x } // GetUsbGadgetDisconnected gets the UsbGadgetDisconnected of the TriggerAction. func (m *TriggerAction) GetUsbGadgetDisconnected() (x *TriggerUSBGadgetDisconnected) { if v, ok := m.GetTrigger().(*TriggerAction_UsbGadgetDisconnected); ok { return v.UsbGadgetDisconnected } return x } // GetWifiAPStarted gets the WifiAPStarted of the TriggerAction. func (m *TriggerAction) GetWifiAPStarted() (x *TriggerWifiAPStarted) { if v, ok := m.GetTrigger().(*TriggerAction_WifiAPStarted); ok { return v.WifiAPStarted } return x } // GetWifiConnectedAsSta gets the WifiConnectedAsSta of the TriggerAction. func (m *TriggerAction) GetWifiConnectedAsSta() (x *TriggerWifiConnectedAsSta) { if v, ok := m.GetTrigger().(*TriggerAction_WifiConnectedAsSta); ok { return v.WifiConnectedAsSta } return x } // GetSshLogin gets the SshLogin of the TriggerAction. func (m *TriggerAction) GetSshLogin() (x *TriggerSSHLogin) { if v, ok := m.GetTrigger().(*TriggerAction_SshLogin); ok { return v.SshLogin } return x } // GetDhcpLeaseGranted gets the DhcpLeaseGranted of the TriggerAction. func (m *TriggerAction) GetDhcpLeaseGranted() (x *TriggerDHCPLeaseGranted) { if v, ok := m.GetTrigger().(*TriggerAction_DhcpLeaseGranted); ok { return v.DhcpLeaseGranted } return x } // GetGroupReceive gets the GroupReceive of the TriggerAction. func (m *TriggerAction) GetGroupReceive() (x *TriggerGroupReceive) { if v, ok := m.GetTrigger().(*TriggerAction_GroupReceive); ok { return v.GroupReceive } return x } // GetGroupReceiveSequence gets the GroupReceiveSequence of the TriggerAction. func (m *TriggerAction) GetGroupReceiveSequence() (x *TriggerGroupReceiveSequence) { if v, ok := m.GetTrigger().(*TriggerAction_GroupReceiveSequence); ok { return v.GroupReceiveSequence } return x } // GetGpioIn gets the GpioIn of the TriggerAction. func (m *TriggerAction) GetGpioIn() (x *TriggerGPIOIn) { if v, ok := m.GetTrigger().(*TriggerAction_GpioIn); ok { return v.GpioIn } return x } // GetBashScript gets the BashScript of the TriggerAction. func (m *TriggerAction) GetBashScript() (x *ActionStartBashScript) { if v, ok := m.GetAction().(*TriggerAction_BashScript); ok { return v.BashScript } return x } // GetHidScript gets the HidScript of the TriggerAction. func (m *TriggerAction) GetHidScript() (x *ActionStartHIDScript) { if v, ok := m.GetAction().(*TriggerAction_HidScript); ok { return v.HidScript } return x } // GetDeploySettingsTemplate gets the DeploySettingsTemplate of the TriggerAction. func (m *TriggerAction) GetDeploySettingsTemplate() (x *ActionDeploySettingsTemplate) { if v, ok := m.GetAction().(*TriggerAction_DeploySettingsTemplate); ok { return v.DeploySettingsTemplate } return x } // GetLog gets the Log of the TriggerAction. func (m *TriggerAction) GetLog() (x *ActionLog) { if v, ok := m.GetAction().(*TriggerAction_Log); ok { return v.Log } return x } // GetGpioOut gets the GpioOut of the TriggerAction. func (m *TriggerAction) GetGpioOut() (x *ActionGPIOOut) { if v, ok := m.GetAction().(*TriggerAction_GpioOut); ok { return v.GpioOut } return x } // GetGroupSend gets the GroupSend of the TriggerAction. func (m *TriggerAction) GetGroupSend() (x *ActionGroupSend) { if v, ok := m.GetAction().(*TriggerAction_GroupSend); ok { return v.GroupSend } return x } // MarshalToWriter marshals TriggerAction to the provided writer. func (m *TriggerAction) MarshalToWriter(writer jspb.Writer) { if m == nil { return } switch t := m.Trigger.(type) { case *TriggerAction_ServiceStarted: if t.ServiceStarted != nil { writer.WriteMessage(5, func() { t.ServiceStarted.MarshalToWriter(writer) }) } case *TriggerAction_UsbGadgetConnected: if t.UsbGadgetConnected != nil { writer.WriteMessage(6, func() { t.UsbGadgetConnected.MarshalToWriter(writer) }) } case *TriggerAction_UsbGadgetDisconnected: if t.UsbGadgetDisconnected != nil { writer.WriteMessage(7, func() { t.UsbGadgetDisconnected.MarshalToWriter(writer) }) } case *TriggerAction_WifiAPStarted: if t.WifiAPStarted != nil { writer.WriteMessage(8, func() { t.WifiAPStarted.MarshalToWriter(writer) }) } case *TriggerAction_WifiConnectedAsSta: if t.WifiConnectedAsSta != nil { writer.WriteMessage(9, func() { t.WifiConnectedAsSta.MarshalToWriter(writer) }) } case *TriggerAction_SshLogin: if t.SshLogin != nil { writer.WriteMessage(10, func() { t.SshLogin.MarshalToWriter(writer) }) } case *TriggerAction_DhcpLeaseGranted: if t.DhcpLeaseGranted != nil { writer.WriteMessage(11, func() { t.DhcpLeaseGranted.MarshalToWriter(writer) }) } case *TriggerAction_GroupReceive: if t.GroupReceive != nil { writer.WriteMessage(12, func() { t.GroupReceive.MarshalToWriter(writer) }) } case *TriggerAction_GroupReceiveSequence: if t.GroupReceiveSequence != nil { writer.WriteMessage(13, func() { t.GroupReceiveSequence.MarshalToWriter(writer) }) } case *TriggerAction_GpioIn: if t.GpioIn != nil { writer.WriteMessage(14, func() { t.GpioIn.MarshalToWriter(writer) }) } } switch t := m.Action.(type) { case *TriggerAction_BashScript: if t.BashScript != nil { writer.WriteMessage(15, func() { t.BashScript.MarshalToWriter(writer) }) } case *TriggerAction_HidScript: if t.HidScript != nil { writer.WriteMessage(16, func() { t.HidScript.MarshalToWriter(writer) }) } case *TriggerAction_DeploySettingsTemplate: if t.DeploySettingsTemplate != nil { writer.WriteMessage(17, func() { t.DeploySettingsTemplate.MarshalToWriter(writer) }) } case *TriggerAction_Log: if t.Log != nil { writer.WriteMessage(18, func() { t.Log.MarshalToWriter(writer) }) } case *TriggerAction_GpioOut: if t.GpioOut != nil { writer.WriteMessage(19, func() { t.GpioOut.MarshalToWriter(writer) }) } case *TriggerAction_GroupSend: if t.GroupSend != nil { writer.WriteMessage(20, func() { t.GroupSend.MarshalToWriter(writer) }) } } if m.Id != 0 { writer.WriteUint32(1, m.Id) } if m.OneShot { writer.WriteBool(2, m.OneShot) } if m.IsActive { writer.WriteBool(3, m.IsActive) } if m.Immutable { writer.WriteBool(4, m.Immutable) } return } // Marshal marshals TriggerAction to a slice of bytes. func (m *TriggerAction) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerAction from the provided reader. func (m *TriggerAction) UnmarshalFromReader(reader jspb.Reader) *TriggerAction { for reader.Next() { if m == nil { m = &TriggerAction{} } switch reader.GetFieldNumber() { case 1: m.Id = reader.ReadUint32() case 2: m.OneShot = reader.ReadBool() case 3: m.IsActive = reader.ReadBool() case 4: m.Immutable = reader.ReadBool() case 5: reader.ReadMessage(func() { m.Trigger = &TriggerAction_ServiceStarted{ ServiceStarted: new(TriggerServiceStarted).UnmarshalFromReader(reader), } }) case 6: reader.ReadMessage(func() { m.Trigger = &TriggerAction_UsbGadgetConnected{ UsbGadgetConnected: new(TriggerUSBGadgetConnected).UnmarshalFromReader(reader), } }) case 7: reader.ReadMessage(func() { m.Trigger = &TriggerAction_UsbGadgetDisconnected{ UsbGadgetDisconnected: new(TriggerUSBGadgetDisconnected).UnmarshalFromReader(reader), } }) case 8: reader.ReadMessage(func() { m.Trigger = &TriggerAction_WifiAPStarted{ WifiAPStarted: new(TriggerWifiAPStarted).UnmarshalFromReader(reader), } }) case 9: reader.ReadMessage(func() { m.Trigger = &TriggerAction_WifiConnectedAsSta{ WifiConnectedAsSta: new(TriggerWifiConnectedAsSta).UnmarshalFromReader(reader), } }) case 10: reader.ReadMessage(func() { m.Trigger = &TriggerAction_SshLogin{ SshLogin: new(TriggerSSHLogin).UnmarshalFromReader(reader), } }) case 11: reader.ReadMessage(func() { m.Trigger = &TriggerAction_DhcpLeaseGranted{ DhcpLeaseGranted: new(TriggerDHCPLeaseGranted).UnmarshalFromReader(reader), } }) case 12: reader.ReadMessage(func() { m.Trigger = &TriggerAction_GroupReceive{ GroupReceive: new(TriggerGroupReceive).UnmarshalFromReader(reader), } }) case 13: reader.ReadMessage(func() { m.Trigger = &TriggerAction_GroupReceiveSequence{ GroupReceiveSequence: new(TriggerGroupReceiveSequence).UnmarshalFromReader(reader), } }) case 14: reader.ReadMessage(func() { m.Trigger = &TriggerAction_GpioIn{ GpioIn: new(TriggerGPIOIn).UnmarshalFromReader(reader), } }) case 15: reader.ReadMessage(func() { m.Action = &TriggerAction_BashScript{ BashScript: new(ActionStartBashScript).UnmarshalFromReader(reader), } }) case 16: reader.ReadMessage(func() { m.Action = &TriggerAction_HidScript{ HidScript: new(ActionStartHIDScript).UnmarshalFromReader(reader), } }) case 17: reader.ReadMessage(func() { m.Action = &TriggerAction_DeploySettingsTemplate{ DeploySettingsTemplate: new(ActionDeploySettingsTemplate).UnmarshalFromReader(reader), } }) case 18: reader.ReadMessage(func() { m.Action = &TriggerAction_Log{ Log: new(ActionLog).UnmarshalFromReader(reader), } }) case 19: reader.ReadMessage(func() { m.Action = &TriggerAction_GpioOut{ GpioOut: new(ActionGPIOOut).UnmarshalFromReader(reader), } }) case 20: reader.ReadMessage(func() { m.Action = &TriggerAction_GroupSend{ GroupSend: new(ActionGroupSend).UnmarshalFromReader(reader), } }) default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerAction from a slice of bytes. func (m *TriggerAction) Unmarshal(rawBytes []byte) (*TriggerAction, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerServiceStarted struct { } // MarshalToWriter marshals TriggerServiceStarted to the provided writer. func (m *TriggerServiceStarted) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals TriggerServiceStarted to a slice of bytes. func (m *TriggerServiceStarted) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerServiceStarted from the provided reader. func (m *TriggerServiceStarted) UnmarshalFromReader(reader jspb.Reader) *TriggerServiceStarted { for reader.Next() { if m == nil { m = &TriggerServiceStarted{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerServiceStarted from a slice of bytes. func (m *TriggerServiceStarted) Unmarshal(rawBytes []byte) (*TriggerServiceStarted, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerUSBGadgetConnected struct { } // MarshalToWriter marshals TriggerUSBGadgetConnected to the provided writer. func (m *TriggerUSBGadgetConnected) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals TriggerUSBGadgetConnected to a slice of bytes. func (m *TriggerUSBGadgetConnected) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerUSBGadgetConnected from the provided reader. func (m *TriggerUSBGadgetConnected) UnmarshalFromReader(reader jspb.Reader) *TriggerUSBGadgetConnected { for reader.Next() { if m == nil { m = &TriggerUSBGadgetConnected{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerUSBGadgetConnected from a slice of bytes. func (m *TriggerUSBGadgetConnected) Unmarshal(rawBytes []byte) (*TriggerUSBGadgetConnected, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerUSBGadgetDisconnected struct { } // MarshalToWriter marshals TriggerUSBGadgetDisconnected to the provided writer. func (m *TriggerUSBGadgetDisconnected) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals TriggerUSBGadgetDisconnected to a slice of bytes. func (m *TriggerUSBGadgetDisconnected) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerUSBGadgetDisconnected from the provided reader. func (m *TriggerUSBGadgetDisconnected) UnmarshalFromReader(reader jspb.Reader) *TriggerUSBGadgetDisconnected { for reader.Next() { if m == nil { m = &TriggerUSBGadgetDisconnected{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerUSBGadgetDisconnected from a slice of bytes. func (m *TriggerUSBGadgetDisconnected) Unmarshal(rawBytes []byte) (*TriggerUSBGadgetDisconnected, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerWifiAPStarted struct { } // MarshalToWriter marshals TriggerWifiAPStarted to the provided writer. func (m *TriggerWifiAPStarted) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals TriggerWifiAPStarted to a slice of bytes. func (m *TriggerWifiAPStarted) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerWifiAPStarted from the provided reader. func (m *TriggerWifiAPStarted) UnmarshalFromReader(reader jspb.Reader) *TriggerWifiAPStarted { for reader.Next() { if m == nil { m = &TriggerWifiAPStarted{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerWifiAPStarted from a slice of bytes. func (m *TriggerWifiAPStarted) Unmarshal(rawBytes []byte) (*TriggerWifiAPStarted, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerWifiConnectedAsSta struct { } // MarshalToWriter marshals TriggerWifiConnectedAsSta to the provided writer. func (m *TriggerWifiConnectedAsSta) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals TriggerWifiConnectedAsSta to a slice of bytes. func (m *TriggerWifiConnectedAsSta) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerWifiConnectedAsSta from the provided reader. func (m *TriggerWifiConnectedAsSta) UnmarshalFromReader(reader jspb.Reader) *TriggerWifiConnectedAsSta { for reader.Next() { if m == nil { m = &TriggerWifiConnectedAsSta{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerWifiConnectedAsSta from a slice of bytes. func (m *TriggerWifiConnectedAsSta) Unmarshal(rawBytes []byte) (*TriggerWifiConnectedAsSta, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerSSHLogin struct { LoginUser string } // GetLoginUser gets the LoginUser of the TriggerSSHLogin. func (m *TriggerSSHLogin) GetLoginUser() (x string) { if m == nil { return x } return m.LoginUser } // MarshalToWriter marshals TriggerSSHLogin to the provided writer. func (m *TriggerSSHLogin) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.LoginUser) > 0 { writer.WriteString(1, m.LoginUser) } return } // Marshal marshals TriggerSSHLogin to a slice of bytes. func (m *TriggerSSHLogin) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerSSHLogin from the provided reader. func (m *TriggerSSHLogin) UnmarshalFromReader(reader jspb.Reader) *TriggerSSHLogin { for reader.Next() { if m == nil { m = &TriggerSSHLogin{} } switch reader.GetFieldNumber() { case 1: m.LoginUser = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerSSHLogin from a slice of bytes. func (m *TriggerSSHLogin) Unmarshal(rawBytes []byte) (*TriggerSSHLogin, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerDHCPLeaseGranted struct { } // MarshalToWriter marshals TriggerDHCPLeaseGranted to the provided writer. func (m *TriggerDHCPLeaseGranted) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals TriggerDHCPLeaseGranted to a slice of bytes. func (m *TriggerDHCPLeaseGranted) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerDHCPLeaseGranted from the provided reader. func (m *TriggerDHCPLeaseGranted) UnmarshalFromReader(reader jspb.Reader) *TriggerDHCPLeaseGranted { for reader.Next() { if m == nil { m = &TriggerDHCPLeaseGranted{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerDHCPLeaseGranted from a slice of bytes. func (m *TriggerDHCPLeaseGranted) Unmarshal(rawBytes []byte) (*TriggerDHCPLeaseGranted, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerGroupReceive struct { GroupName string Value int32 } // GetGroupName gets the GroupName of the TriggerGroupReceive. func (m *TriggerGroupReceive) GetGroupName() (x string) { if m == nil { return x } return m.GroupName } // GetValue gets the Value of the TriggerGroupReceive. func (m *TriggerGroupReceive) GetValue() (x int32) { if m == nil { return x } return m.Value } // MarshalToWriter marshals TriggerGroupReceive to the provided writer. func (m *TriggerGroupReceive) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.GroupName) > 0 { writer.WriteString(1, m.GroupName) } if m.Value != 0 { writer.WriteInt32(2, m.Value) } return } // Marshal marshals TriggerGroupReceive to a slice of bytes. func (m *TriggerGroupReceive) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerGroupReceive from the provided reader. func (m *TriggerGroupReceive) UnmarshalFromReader(reader jspb.Reader) *TriggerGroupReceive { for reader.Next() { if m == nil { m = &TriggerGroupReceive{} } switch reader.GetFieldNumber() { case 1: m.GroupName = reader.ReadString() case 2: m.Value = reader.ReadInt32() default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerGroupReceive from a slice of bytes. func (m *TriggerGroupReceive) Unmarshal(rawBytes []byte) (*TriggerGroupReceive, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerGroupReceiveSequence struct { GroupName string IgnoreOutOfOrder bool Values []int32 } // GetGroupName gets the GroupName of the TriggerGroupReceiveSequence. func (m *TriggerGroupReceiveSequence) GetGroupName() (x string) { if m == nil { return x } return m.GroupName } // GetIgnoreOutOfOrder gets the IgnoreOutOfOrder of the TriggerGroupReceiveSequence. func (m *TriggerGroupReceiveSequence) GetIgnoreOutOfOrder() (x bool) { if m == nil { return x } return m.IgnoreOutOfOrder } // GetValues gets the Values of the TriggerGroupReceiveSequence. func (m *TriggerGroupReceiveSequence) GetValues() (x []int32) { if m == nil { return x } return m.Values } // MarshalToWriter marshals TriggerGroupReceiveSequence to the provided writer. func (m *TriggerGroupReceiveSequence) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.GroupName) > 0 { writer.WriteString(1, m.GroupName) } if m.IgnoreOutOfOrder { writer.WriteBool(2, m.IgnoreOutOfOrder) } if len(m.Values) > 0 { writer.WriteInt32Slice(3, m.Values) } return } // Marshal marshals TriggerGroupReceiveSequence to a slice of bytes. func (m *TriggerGroupReceiveSequence) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerGroupReceiveSequence from the provided reader. func (m *TriggerGroupReceiveSequence) UnmarshalFromReader(reader jspb.Reader) *TriggerGroupReceiveSequence { for reader.Next() { if m == nil { m = &TriggerGroupReceiveSequence{} } switch reader.GetFieldNumber() { case 1: m.GroupName = reader.ReadString() case 2: m.IgnoreOutOfOrder = reader.ReadBool() case 3: m.Values = reader.ReadInt32Slice() default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerGroupReceiveSequence from a slice of bytes. func (m *TriggerGroupReceiveSequence) Unmarshal(rawBytes []byte) (*TriggerGroupReceiveSequence, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TriggerGPIOIn struct { GpioNum GPIONum PullUpDown GPIOInPullUpDown GpioInEdge GPIOInEdge } // GetGpioNum gets the GpioNum of the TriggerGPIOIn. func (m *TriggerGPIOIn) GetGpioNum() (x GPIONum) { if m == nil { return x } return m.GpioNum } // GetPullUpDown gets the PullUpDown of the TriggerGPIOIn. func (m *TriggerGPIOIn) GetPullUpDown() (x GPIOInPullUpDown) { if m == nil { return x } return m.PullUpDown } // GetGpioInEdge gets the GpioInEdge of the TriggerGPIOIn. func (m *TriggerGPIOIn) GetGpioInEdge() (x GPIOInEdge) { if m == nil { return x } return m.GpioInEdge } // MarshalToWriter marshals TriggerGPIOIn to the provided writer. func (m *TriggerGPIOIn) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if int(m.GpioNum) != 0 { writer.WriteEnum(1, int(m.GpioNum)) } if int(m.PullUpDown) != 0 { writer.WriteEnum(2, int(m.PullUpDown)) } if int(m.GpioInEdge) != 0 { writer.WriteEnum(3, int(m.GpioInEdge)) } return } // Marshal marshals TriggerGPIOIn to a slice of bytes. func (m *TriggerGPIOIn) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TriggerGPIOIn from the provided reader. func (m *TriggerGPIOIn) UnmarshalFromReader(reader jspb.Reader) *TriggerGPIOIn { for reader.Next() { if m == nil { m = &TriggerGPIOIn{} } switch reader.GetFieldNumber() { case 1: m.GpioNum = GPIONum(reader.ReadEnum()) case 2: m.PullUpDown = GPIOInPullUpDown(reader.ReadEnum()) case 3: m.GpioInEdge = GPIOInEdge(reader.ReadEnum()) default: reader.SkipField() } } return m } // Unmarshal unmarshals a TriggerGPIOIn from a slice of bytes. func (m *TriggerGPIOIn) Unmarshal(rawBytes []byte) (*TriggerGPIOIn, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ActionStartBashScript struct { ScriptName string } // GetScriptName gets the ScriptName of the ActionStartBashScript. func (m *ActionStartBashScript) GetScriptName() (x string) { if m == nil { return x } return m.ScriptName } // MarshalToWriter marshals ActionStartBashScript to the provided writer. func (m *ActionStartBashScript) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.ScriptName) > 0 { writer.WriteString(1, m.ScriptName) } return } // Marshal marshals ActionStartBashScript to a slice of bytes. func (m *ActionStartBashScript) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ActionStartBashScript from the provided reader. func (m *ActionStartBashScript) UnmarshalFromReader(reader jspb.Reader) *ActionStartBashScript { for reader.Next() { if m == nil { m = &ActionStartBashScript{} } switch reader.GetFieldNumber() { case 1: m.ScriptName = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a ActionStartBashScript from a slice of bytes. func (m *ActionStartBashScript) Unmarshal(rawBytes []byte) (*ActionStartBashScript, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ActionStartHIDScript struct { ScriptName string } // GetScriptName gets the ScriptName of the ActionStartHIDScript. func (m *ActionStartHIDScript) GetScriptName() (x string) { if m == nil { return x } return m.ScriptName } // MarshalToWriter marshals ActionStartHIDScript to the provided writer. func (m *ActionStartHIDScript) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.ScriptName) > 0 { writer.WriteString(1, m.ScriptName) } return } // Marshal marshals ActionStartHIDScript to a slice of bytes. func (m *ActionStartHIDScript) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ActionStartHIDScript from the provided reader. func (m *ActionStartHIDScript) UnmarshalFromReader(reader jspb.Reader) *ActionStartHIDScript { for reader.Next() { if m == nil { m = &ActionStartHIDScript{} } switch reader.GetFieldNumber() { case 1: m.ScriptName = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a ActionStartHIDScript from a slice of bytes. func (m *ActionStartHIDScript) Unmarshal(rawBytes []byte) (*ActionStartHIDScript, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ActionDeploySettingsTemplate struct { TemplateName string Type ActionDeploySettingsTemplate_TemplateType } // GetTemplateName gets the TemplateName of the ActionDeploySettingsTemplate. func (m *ActionDeploySettingsTemplate) GetTemplateName() (x string) { if m == nil { return x } return m.TemplateName } // GetType gets the Type of the ActionDeploySettingsTemplate. func (m *ActionDeploySettingsTemplate) GetType() (x ActionDeploySettingsTemplate_TemplateType) { if m == nil { return x } return m.Type } // MarshalToWriter marshals ActionDeploySettingsTemplate to the provided writer. func (m *ActionDeploySettingsTemplate) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.TemplateName) > 0 { writer.WriteString(1, m.TemplateName) } if int(m.Type) != 0 { writer.WriteEnum(2, int(m.Type)) } return } // Marshal marshals ActionDeploySettingsTemplate to a slice of bytes. func (m *ActionDeploySettingsTemplate) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ActionDeploySettingsTemplate from the provided reader. func (m *ActionDeploySettingsTemplate) UnmarshalFromReader(reader jspb.Reader) *ActionDeploySettingsTemplate { for reader.Next() { if m == nil { m = &ActionDeploySettingsTemplate{} } switch reader.GetFieldNumber() { case 1: m.TemplateName = reader.ReadString() case 2: m.Type = ActionDeploySettingsTemplate_TemplateType(reader.ReadEnum()) default: reader.SkipField() } } return m } // Unmarshal unmarshals a ActionDeploySettingsTemplate from a slice of bytes. func (m *ActionDeploySettingsTemplate) Unmarshal(rawBytes []byte) (*ActionDeploySettingsTemplate, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ActionLog struct { } // MarshalToWriter marshals ActionLog to the provided writer. func (m *ActionLog) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals ActionLog to a slice of bytes. func (m *ActionLog) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ActionLog from the provided reader. func (m *ActionLog) UnmarshalFromReader(reader jspb.Reader) *ActionLog { for reader.Next() { if m == nil { m = &ActionLog{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a ActionLog from a slice of bytes. func (m *ActionLog) Unmarshal(rawBytes []byte) (*ActionLog, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ActionGPIOOut struct { GpioNum GPIONum Value GPIOOutValue } // GetGpioNum gets the GpioNum of the ActionGPIOOut. func (m *ActionGPIOOut) GetGpioNum() (x GPIONum) { if m == nil { return x } return m.GpioNum } // GetValue gets the Value of the ActionGPIOOut. func (m *ActionGPIOOut) GetValue() (x GPIOOutValue) { if m == nil { return x } return m.Value } // MarshalToWriter marshals ActionGPIOOut to the provided writer. func (m *ActionGPIOOut) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if int(m.GpioNum) != 0 { writer.WriteEnum(1, int(m.GpioNum)) } if int(m.Value) != 0 { writer.WriteEnum(2, int(m.Value)) } return } // Marshal marshals ActionGPIOOut to a slice of bytes. func (m *ActionGPIOOut) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ActionGPIOOut from the provided reader. func (m *ActionGPIOOut) UnmarshalFromReader(reader jspb.Reader) *ActionGPIOOut { for reader.Next() { if m == nil { m = &ActionGPIOOut{} } switch reader.GetFieldNumber() { case 1: m.GpioNum = GPIONum(reader.ReadEnum()) case 2: m.Value = GPIOOutValue(reader.ReadEnum()) default: reader.SkipField() } } return m } // Unmarshal unmarshals a ActionGPIOOut from a slice of bytes. func (m *ActionGPIOOut) Unmarshal(rawBytes []byte) (*ActionGPIOOut, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ActionGroupSend struct { GroupName string Value int32 } // GetGroupName gets the GroupName of the ActionGroupSend. func (m *ActionGroupSend) GetGroupName() (x string) { if m == nil { return x } return m.GroupName } // GetValue gets the Value of the ActionGroupSend. func (m *ActionGroupSend) GetValue() (x int32) { if m == nil { return x } return m.Value } // MarshalToWriter marshals ActionGroupSend to the provided writer. func (m *ActionGroupSend) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.GroupName) > 0 { writer.WriteString(1, m.GroupName) } if m.Value != 0 { writer.WriteInt32(2, m.Value) } return } // Marshal marshals ActionGroupSend to a slice of bytes. func (m *ActionGroupSend) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ActionGroupSend from the provided reader. func (m *ActionGroupSend) UnmarshalFromReader(reader jspb.Reader) *ActionGroupSend { for reader.Next() { if m == nil { m = &ActionGroupSend{} } switch reader.GetFieldNumber() { case 1: m.GroupName = reader.ReadString() case 2: m.Value = reader.ReadInt32() default: reader.SkipField() } } return m } // Unmarshal unmarshals a ActionGroupSend from a slice of bytes. func (m *ActionGroupSend) Unmarshal(rawBytes []byte) (*ActionGroupSend, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type WifiRequestSettingsStorage struct { TemplateName string Settings *WiFiSettings } // GetTemplateName gets the TemplateName of the WifiRequestSettingsStorage. func (m *WifiRequestSettingsStorage) GetTemplateName() (x string) { if m == nil { return x } return m.TemplateName } // GetSettings gets the Settings of the WifiRequestSettingsStorage. func (m *WifiRequestSettingsStorage) GetSettings() (x *WiFiSettings) { if m == nil { return x } return m.Settings } // MarshalToWriter marshals WifiRequestSettingsStorage to the provided writer. func (m *WifiRequestSettingsStorage) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.TemplateName) > 0 { writer.WriteString(1, m.TemplateName) } if m.Settings != nil { writer.WriteMessage(2, func() { m.Settings.MarshalToWriter(writer) }) } return } // Marshal marshals WifiRequestSettingsStorage to a slice of bytes. func (m *WifiRequestSettingsStorage) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a WifiRequestSettingsStorage from the provided reader. func (m *WifiRequestSettingsStorage) UnmarshalFromReader(reader jspb.Reader) *WifiRequestSettingsStorage { for reader.Next() { if m == nil { m = &WifiRequestSettingsStorage{} } switch reader.GetFieldNumber() { case 1: m.TemplateName = reader.ReadString() case 2: reader.ReadMessage(func() { m.Settings = m.Settings.UnmarshalFromReader(reader) }) default: reader.SkipField() } } return m } // Unmarshal unmarshals a WifiRequestSettingsStorage from a slice of bytes. func (m *WifiRequestSettingsStorage) Unmarshal(rawBytes []byte) (*WifiRequestSettingsStorage, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type WiFiSettings struct { // Generic Name string Disabled bool Regulatory string WorkingMode WiFiWorkingMode AuthMode WiFiAuthMode Channel uint32 Ap_BSS *WiFiBSSCfg Client_BSSList []*WiFiBSSCfg HideSsid bool Nexmon bool } // GetName gets the Name of the WiFiSettings. func (m *WiFiSettings) GetName() (x string) { if m == nil { return x } return m.Name } // GetDisabled gets the Disabled of the WiFiSettings. func (m *WiFiSettings) GetDisabled() (x bool) { if m == nil { return x } return m.Disabled } // GetRegulatory gets the Regulatory of the WiFiSettings. func (m *WiFiSettings) GetRegulatory() (x string) { if m == nil { return x } return m.Regulatory } // GetWorkingMode gets the WorkingMode of the WiFiSettings. func (m *WiFiSettings) GetWorkingMode() (x WiFiWorkingMode) { if m == nil { return x } return m.WorkingMode } // GetAuthMode gets the AuthMode of the WiFiSettings. func (m *WiFiSettings) GetAuthMode() (x WiFiAuthMode) { if m == nil { return x } return m.AuthMode } // GetChannel gets the Channel of the WiFiSettings. func (m *WiFiSettings) GetChannel() (x uint32) { if m == nil { return x } return m.Channel } // GetAp_BSS gets the Ap_BSS of the WiFiSettings. func (m *WiFiSettings) GetAp_BSS() (x *WiFiBSSCfg) { if m == nil { return x } return m.Ap_BSS } // GetClient_BSSList gets the Client_BSSList of the WiFiSettings. func (m *WiFiSettings) GetClient_BSSList() (x []*WiFiBSSCfg) { if m == nil { return x } return m.Client_BSSList } // GetHideSsid gets the HideSsid of the WiFiSettings. func (m *WiFiSettings) GetHideSsid() (x bool) { if m == nil { return x } return m.HideSsid } // GetNexmon gets the Nexmon of the WiFiSettings. func (m *WiFiSettings) GetNexmon() (x bool) { if m == nil { return x } return m.Nexmon } // MarshalToWriter marshals WiFiSettings to the provided writer. func (m *WiFiSettings) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Name) > 0 { writer.WriteString(1, m.Name) } if m.Disabled { writer.WriteBool(2, m.Disabled) } if len(m.Regulatory) > 0 { writer.WriteString(3, m.Regulatory) } if int(m.WorkingMode) != 0 { writer.WriteEnum(4, int(m.WorkingMode)) } if int(m.AuthMode) != 0 { writer.WriteEnum(5, int(m.AuthMode)) } if m.Channel != 0 { writer.WriteUint32(6, m.Channel) } if m.Ap_BSS != nil { writer.WriteMessage(7, func() { m.Ap_BSS.MarshalToWriter(writer) }) } for _, msg := range m.Client_BSSList { writer.WriteMessage(8, func() { msg.MarshalToWriter(writer) }) } if m.HideSsid { writer.WriteBool(9, m.HideSsid) } if m.Nexmon { writer.WriteBool(13, m.Nexmon) } return } // Marshal marshals WiFiSettings to a slice of bytes. func (m *WiFiSettings) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a WiFiSettings from the provided reader. func (m *WiFiSettings) UnmarshalFromReader(reader jspb.Reader) *WiFiSettings { for reader.Next() { if m == nil { m = &WiFiSettings{} } switch reader.GetFieldNumber() { case 1: m.Name = reader.ReadString() case 2: m.Disabled = reader.ReadBool() case 3: m.Regulatory = reader.ReadString() case 4: m.WorkingMode = WiFiWorkingMode(reader.ReadEnum()) case 5: m.AuthMode = WiFiAuthMode(reader.ReadEnum()) case 6: m.Channel = reader.ReadUint32() case 7: reader.ReadMessage(func() { m.Ap_BSS = m.Ap_BSS.UnmarshalFromReader(reader) }) case 8: reader.ReadMessage(func() { m.Client_BSSList = append(m.Client_BSSList, new(WiFiBSSCfg).UnmarshalFromReader(reader)) }) case 9: m.HideSsid = reader.ReadBool() case 13: m.Nexmon = reader.ReadBool() default: reader.SkipField() } } return m } // Unmarshal unmarshals a WiFiSettings from a slice of bytes. func (m *WiFiSettings) Unmarshal(rawBytes []byte) (*WiFiSettings, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type WiFiState struct { Mode WiFiStateMode Channel uint32 Ssid string CurrentSettings *WiFiSettings } // GetMode gets the Mode of the WiFiState. func (m *WiFiState) GetMode() (x WiFiStateMode) { if m == nil { return x } return m.Mode } // GetChannel gets the Channel of the WiFiState. func (m *WiFiState) GetChannel() (x uint32) { if m == nil { return x } return m.Channel } // GetSsid gets the Ssid of the WiFiState. func (m *WiFiState) GetSsid() (x string) { if m == nil { return x } return m.Ssid } // GetCurrentSettings gets the CurrentSettings of the WiFiState. func (m *WiFiState) GetCurrentSettings() (x *WiFiSettings) { if m == nil { return x } return m.CurrentSettings } // MarshalToWriter marshals WiFiState to the provided writer. func (m *WiFiState) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if int(m.Mode) != 0 { writer.WriteEnum(1, int(m.Mode)) } if m.Channel != 0 { writer.WriteUint32(2, m.Channel) } if len(m.Ssid) > 0 { writer.WriteString(3, m.Ssid) } if m.CurrentSettings != nil { writer.WriteMessage(4, func() { m.CurrentSettings.MarshalToWriter(writer) }) } return } // Marshal marshals WiFiState to a slice of bytes. func (m *WiFiState) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a WiFiState from the provided reader. func (m *WiFiState) UnmarshalFromReader(reader jspb.Reader) *WiFiState { for reader.Next() { if m == nil { m = &WiFiState{} } switch reader.GetFieldNumber() { case 1: m.Mode = WiFiStateMode(reader.ReadEnum()) case 2: m.Channel = reader.ReadUint32() case 3: m.Ssid = reader.ReadString() case 4: reader.ReadMessage(func() { m.CurrentSettings = m.CurrentSettings.UnmarshalFromReader(reader) }) default: reader.SkipField() } } return m } // Unmarshal unmarshals a WiFiState from a slice of bytes. func (m *WiFiState) Unmarshal(rawBytes []byte) (*WiFiState, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type WiFiBSSCfg struct { SSID string PSK string } // GetSSID gets the SSID of the WiFiBSSCfg. func (m *WiFiBSSCfg) GetSSID() (x string) { if m == nil { return x } return m.SSID } // GetPSK gets the PSK of the WiFiBSSCfg. func (m *WiFiBSSCfg) GetPSK() (x string) { if m == nil { return x } return m.PSK } // MarshalToWriter marshals WiFiBSSCfg to the provided writer. func (m *WiFiBSSCfg) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.SSID) > 0 { writer.WriteString(1, m.SSID) } if len(m.PSK) > 0 { writer.WriteString(2, m.PSK) } return } // Marshal marshals WiFiBSSCfg to a slice of bytes. func (m *WiFiBSSCfg) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a WiFiBSSCfg from the provided reader. func (m *WiFiBSSCfg) UnmarshalFromReader(reader jspb.Reader) *WiFiBSSCfg { for reader.Next() { if m == nil { m = &WiFiBSSCfg{} } switch reader.GetFieldNumber() { case 1: m.SSID = reader.ReadString() case 2: m.PSK = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a WiFiBSSCfg from a slice of bytes. func (m *WiFiBSSCfg) Unmarshal(rawBytes []byte) (*WiFiBSSCfg, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // Alive check type StringMessage struct { Msg string } // GetMsg gets the Msg of the StringMessage. func (m *StringMessage) GetMsg() (x string) { if m == nil { return x } return m.Msg } // MarshalToWriter marshals StringMessage to the provided writer. func (m *StringMessage) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Msg) > 0 { writer.WriteString(1, m.Msg) } return } // Marshal marshals StringMessage to a slice of bytes. func (m *StringMessage) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a StringMessage from the provided reader. func (m *StringMessage) UnmarshalFromReader(reader jspb.Reader) *StringMessage { for reader.Next() { if m == nil { m = &StringMessage{} } switch reader.GetFieldNumber() { case 1: m.Msg = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a StringMessage from a slice of bytes. func (m *StringMessage) Unmarshal(rawBytes []byte) (*StringMessage, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type StringMessageArray struct { MsgArray []string } // GetMsgArray gets the MsgArray of the StringMessageArray. func (m *StringMessageArray) GetMsgArray() (x []string) { if m == nil { return x } return m.MsgArray } // MarshalToWriter marshals StringMessageArray to the provided writer. func (m *StringMessageArray) MarshalToWriter(writer jspb.Writer) { if m == nil { return } for _, val := range m.MsgArray { writer.WriteString(1, val) } return } // Marshal marshals StringMessageArray to a slice of bytes. func (m *StringMessageArray) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a StringMessageArray from the provided reader. func (m *StringMessageArray) UnmarshalFromReader(reader jspb.Reader) *StringMessageArray { for reader.Next() { if m == nil { m = &StringMessageArray{} } switch reader.GetFieldNumber() { case 1: m.MsgArray = append(m.MsgArray, reader.ReadString()) default: reader.SkipField() } } return m } // Unmarshal unmarshals a StringMessageArray from a slice of bytes. func (m *StringMessageArray) Unmarshal(rawBytes []byte) (*StringMessageArray, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // Events type EventRequest struct { ListenType int64 } // GetListenType gets the ListenType of the EventRequest. func (m *EventRequest) GetListenType() (x int64) { if m == nil { return x } return m.ListenType } // MarshalToWriter marshals EventRequest to the provided writer. func (m *EventRequest) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.ListenType != 0 { writer.WriteInt64(1, m.ListenType) } return } // Marshal marshals EventRequest to a slice of bytes. func (m *EventRequest) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a EventRequest from the provided reader. func (m *EventRequest) UnmarshalFromReader(reader jspb.Reader) *EventRequest { for reader.Next() { if m == nil { m = &EventRequest{} } switch reader.GetFieldNumber() { case 1: m.ListenType = reader.ReadInt64() default: reader.SkipField() } } return m } // Unmarshal unmarshals a EventRequest from a slice of bytes. func (m *EventRequest) Unmarshal(rawBytes []byte) (*EventRequest, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type EventValue struct { // Types that are valid to be assigned to Val: // *EventValue_Tstring // *EventValue_Tbool // *EventValue_Tint64 Val isEventValue_Val } // isEventValue_Val is used to distinguish types assignable to Val type isEventValue_Val interface{ isEventValue_Val() } // EventValue_Tstring is assignable to Val type EventValue_Tstring struct { Tstring string } // EventValue_Tbool is assignable to Val type EventValue_Tbool struct { Tbool bool } // EventValue_Tint64 is assignable to Val type EventValue_Tint64 struct { Tint64 int64 } func (*EventValue_Tstring) isEventValue_Val() {} func (*EventValue_Tbool) isEventValue_Val() {} func (*EventValue_Tint64) isEventValue_Val() {} // GetVal gets the Val of the EventValue. func (m *EventValue) GetVal() (x isEventValue_Val) { if m == nil { return x } return m.Val } // GetTstring gets the Tstring of the EventValue. func (m *EventValue) GetTstring() (x string) { if v, ok := m.GetVal().(*EventValue_Tstring); ok { return v.Tstring } return x } // GetTbool gets the Tbool of the EventValue. func (m *EventValue) GetTbool() (x bool) { if v, ok := m.GetVal().(*EventValue_Tbool); ok { return v.Tbool } return x } // GetTint64 gets the Tint64 of the EventValue. func (m *EventValue) GetTint64() (x int64) { if v, ok := m.GetVal().(*EventValue_Tint64); ok { return v.Tint64 } return x } // MarshalToWriter marshals EventValue to the provided writer. func (m *EventValue) MarshalToWriter(writer jspb.Writer) { if m == nil { return } switch t := m.Val.(type) { case *EventValue_Tstring: if len(t.Tstring) > 0 { writer.WriteString(1, t.Tstring) } case *EventValue_Tbool: if t.Tbool { writer.WriteBool(2, t.Tbool) } case *EventValue_Tint64: if t.Tint64 != 0 { writer.WriteInt64(3, t.Tint64) } } return } // Marshal marshals EventValue to a slice of bytes. func (m *EventValue) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a EventValue from the provided reader. func (m *EventValue) UnmarshalFromReader(reader jspb.Reader) *EventValue { for reader.Next() { if m == nil { m = &EventValue{} } switch reader.GetFieldNumber() { case 1: m.Val = &EventValue_Tstring{ Tstring: reader.ReadString(), } case 2: m.Val = &EventValue_Tbool{ Tbool: reader.ReadBool(), } case 3: m.Val = &EventValue_Tint64{ Tint64: reader.ReadInt64(), } default: reader.SkipField() } } return m } // Unmarshal unmarshals a EventValue from a slice of bytes. func (m *EventValue) Unmarshal(rawBytes []byte) (*EventValue, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type Event struct { Type int64 Values []*EventValue } // GetType gets the Type of the Event. func (m *Event) GetType() (x int64) { if m == nil { return x } return m.Type } // GetValues gets the Values of the Event. func (m *Event) GetValues() (x []*EventValue) { if m == nil { return x } return m.Values } // MarshalToWriter marshals Event to the provided writer. func (m *Event) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.Type != 0 { writer.WriteInt64(1, m.Type) } for _, msg := range m.Values { writer.WriteMessage(2, func() { msg.MarshalToWriter(writer) }) } return } // Marshal marshals Event to a slice of bytes. func (m *Event) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a Event from the provided reader. func (m *Event) UnmarshalFromReader(reader jspb.Reader) *Event { for reader.Next() { if m == nil { m = &Event{} } switch reader.GetFieldNumber() { case 1: m.Type = reader.ReadInt64() case 2: reader.ReadMessage(func() { m.Values = append(m.Values, new(EventValue).UnmarshalFromReader(reader)) }) default: reader.SkipField() } } return m } // Unmarshal unmarshals a Event from a slice of bytes. func (m *Event) Unmarshal(rawBytes []byte) (*Event, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // File System type TempDirOrFileRequest struct { Dir string Prefix string OnlyFolder bool } // GetDir gets the Dir of the TempDirOrFileRequest. func (m *TempDirOrFileRequest) GetDir() (x string) { if m == nil { return x } return m.Dir } // GetPrefix gets the Prefix of the TempDirOrFileRequest. func (m *TempDirOrFileRequest) GetPrefix() (x string) { if m == nil { return x } return m.Prefix } // GetOnlyFolder gets the OnlyFolder of the TempDirOrFileRequest. func (m *TempDirOrFileRequest) GetOnlyFolder() (x bool) { if m == nil { return x } return m.OnlyFolder } // MarshalToWriter marshals TempDirOrFileRequest to the provided writer. func (m *TempDirOrFileRequest) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Dir) > 0 { writer.WriteString(1, m.Dir) } if len(m.Prefix) > 0 { writer.WriteString(2, m.Prefix) } if m.OnlyFolder { writer.WriteBool(3, m.OnlyFolder) } return } // Marshal marshals TempDirOrFileRequest to a slice of bytes. func (m *TempDirOrFileRequest) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TempDirOrFileRequest from the provided reader. func (m *TempDirOrFileRequest) UnmarshalFromReader(reader jspb.Reader) *TempDirOrFileRequest { for reader.Next() { if m == nil { m = &TempDirOrFileRequest{} } switch reader.GetFieldNumber() { case 1: m.Dir = reader.ReadString() case 2: m.Prefix = reader.ReadString() case 3: m.OnlyFolder = reader.ReadBool() default: reader.SkipField() } } return m } // Unmarshal unmarshals a TempDirOrFileRequest from a slice of bytes. func (m *TempDirOrFileRequest) Unmarshal(rawBytes []byte) (*TempDirOrFileRequest, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type TempDirOrFileResponse struct { ResultPath string } // GetResultPath gets the ResultPath of the TempDirOrFileResponse. func (m *TempDirOrFileResponse) GetResultPath() (x string) { if m == nil { return x } return m.ResultPath } // MarshalToWriter marshals TempDirOrFileResponse to the provided writer. func (m *TempDirOrFileResponse) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.ResultPath) > 0 { writer.WriteString(1, m.ResultPath) } return } // Marshal marshals TempDirOrFileResponse to a slice of bytes. func (m *TempDirOrFileResponse) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a TempDirOrFileResponse from the provided reader. func (m *TempDirOrFileResponse) UnmarshalFromReader(reader jspb.Reader) *TempDirOrFileResponse { for reader.Next() { if m == nil { m = &TempDirOrFileResponse{} } switch reader.GetFieldNumber() { case 1: m.ResultPath = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a TempDirOrFileResponse from a slice of bytes. func (m *TempDirOrFileResponse) Unmarshal(rawBytes []byte) (*TempDirOrFileResponse, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ReadFileRequest struct { Path string Start int64 Data []byte } // GetPath gets the Path of the ReadFileRequest. func (m *ReadFileRequest) GetPath() (x string) { if m == nil { return x } return m.Path } // GetStart gets the Start of the ReadFileRequest. func (m *ReadFileRequest) GetStart() (x int64) { if m == nil { return x } return m.Start } // GetData gets the Data of the ReadFileRequest. func (m *ReadFileRequest) GetData() (x []byte) { if m == nil { return x } return m.Data } // MarshalToWriter marshals ReadFileRequest to the provided writer. func (m *ReadFileRequest) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Path) > 0 { writer.WriteString(1, m.Path) } if m.Start != 0 { writer.WriteInt64(2, m.Start) } if len(m.Data) > 0 { writer.WriteBytes(3, m.Data) } return } // Marshal marshals ReadFileRequest to a slice of bytes. func (m *ReadFileRequest) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ReadFileRequest from the provided reader. func (m *ReadFileRequest) UnmarshalFromReader(reader jspb.Reader) *ReadFileRequest { for reader.Next() { if m == nil { m = &ReadFileRequest{} } switch reader.GetFieldNumber() { case 1: m.Path = reader.ReadString() case 2: m.Start = reader.ReadInt64() case 3: m.Data = reader.ReadBytes() default: reader.SkipField() } } return m } // Unmarshal unmarshals a ReadFileRequest from a slice of bytes. func (m *ReadFileRequest) Unmarshal(rawBytes []byte) (*ReadFileRequest, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type ReadFileResponse struct { ReadCount int64 } // GetReadCount gets the ReadCount of the ReadFileResponse. func (m *ReadFileResponse) GetReadCount() (x int64) { if m == nil { return x } return m.ReadCount } // MarshalToWriter marshals ReadFileResponse to the provided writer. func (m *ReadFileResponse) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.ReadCount != 0 { writer.WriteInt64(1, m.ReadCount) } return } // Marshal marshals ReadFileResponse to a slice of bytes. func (m *ReadFileResponse) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a ReadFileResponse from the provided reader. func (m *ReadFileResponse) UnmarshalFromReader(reader jspb.Reader) *ReadFileResponse { for reader.Next() { if m == nil { m = &ReadFileResponse{} } switch reader.GetFieldNumber() { case 1: m.ReadCount = reader.ReadInt64() default: reader.SkipField() } } return m } // Unmarshal unmarshals a ReadFileResponse from a slice of bytes. func (m *ReadFileResponse) Unmarshal(rawBytes []byte) (*ReadFileResponse, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type WriteFileRequest struct { Path string Append bool MustNotExist bool Data []byte } // GetPath gets the Path of the WriteFileRequest. func (m *WriteFileRequest) GetPath() (x string) { if m == nil { return x } return m.Path } // GetAppend gets the Append of the WriteFileRequest. func (m *WriteFileRequest) GetAppend() (x bool) { if m == nil { return x } return m.Append } // GetMustNotExist gets the MustNotExist of the WriteFileRequest. func (m *WriteFileRequest) GetMustNotExist() (x bool) { if m == nil { return x } return m.MustNotExist } // GetData gets the Data of the WriteFileRequest. func (m *WriteFileRequest) GetData() (x []byte) { if m == nil { return x } return m.Data } // MarshalToWriter marshals WriteFileRequest to the provided writer. func (m *WriteFileRequest) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Path) > 0 { writer.WriteString(1, m.Path) } if m.Append { writer.WriteBool(2, m.Append) } if m.MustNotExist { writer.WriteBool(3, m.MustNotExist) } if len(m.Data) > 0 { writer.WriteBytes(4, m.Data) } return } // Marshal marshals WriteFileRequest to a slice of bytes. func (m *WriteFileRequest) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a WriteFileRequest from the provided reader. func (m *WriteFileRequest) UnmarshalFromReader(reader jspb.Reader) *WriteFileRequest { for reader.Next() { if m == nil { m = &WriteFileRequest{} } switch reader.GetFieldNumber() { case 1: m.Path = reader.ReadString() case 2: m.Append = reader.ReadBool() case 3: m.MustNotExist = reader.ReadBool() case 4: m.Data = reader.ReadBytes() default: reader.SkipField() } } return m } // Unmarshal unmarshals a WriteFileRequest from a slice of bytes. func (m *WriteFileRequest) Unmarshal(rawBytes []byte) (*WriteFileRequest, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type FileInfoRequest struct { Path string } // GetPath gets the Path of the FileInfoRequest. func (m *FileInfoRequest) GetPath() (x string) { if m == nil { return x } return m.Path } // MarshalToWriter marshals FileInfoRequest to the provided writer. func (m *FileInfoRequest) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Path) > 0 { writer.WriteString(1, m.Path) } return } // Marshal marshals FileInfoRequest to a slice of bytes. func (m *FileInfoRequest) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a FileInfoRequest from the provided reader. func (m *FileInfoRequest) UnmarshalFromReader(reader jspb.Reader) *FileInfoRequest { for reader.Next() { if m == nil { m = &FileInfoRequest{} } switch reader.GetFieldNumber() { case 1: m.Path = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a FileInfoRequest from a slice of bytes. func (m *FileInfoRequest) Unmarshal(rawBytes []byte) (*FileInfoRequest, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type FileInfoResponse struct { Name string Size int64 Mode uint32 ModTime int64 IsDir bool } // GetName gets the Name of the FileInfoResponse. func (m *FileInfoResponse) GetName() (x string) { if m == nil { return x } return m.Name } // GetSize gets the Size of the FileInfoResponse. func (m *FileInfoResponse) GetSize() (x int64) { if m == nil { return x } return m.Size } // GetMode gets the Mode of the FileInfoResponse. func (m *FileInfoResponse) GetMode() (x uint32) { if m == nil { return x } return m.Mode } // GetModTime gets the ModTime of the FileInfoResponse. func (m *FileInfoResponse) GetModTime() (x int64) { if m == nil { return x } return m.ModTime } // GetIsDir gets the IsDir of the FileInfoResponse. func (m *FileInfoResponse) GetIsDir() (x bool) { if m == nil { return x } return m.IsDir } // MarshalToWriter marshals FileInfoResponse to the provided writer. func (m *FileInfoResponse) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Name) > 0 { writer.WriteString(1, m.Name) } if m.Size != 0 { writer.WriteInt64(2, m.Size) } if m.Mode != 0 { writer.WriteUint32(3, m.Mode) } if m.ModTime != 0 { writer.WriteInt64(4, m.ModTime) } if m.IsDir { writer.WriteBool(5, m.IsDir) } return } // Marshal marshals FileInfoResponse to a slice of bytes. func (m *FileInfoResponse) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a FileInfoResponse from the provided reader. func (m *FileInfoResponse) UnmarshalFromReader(reader jspb.Reader) *FileInfoResponse { for reader.Next() { if m == nil { m = &FileInfoResponse{} } switch reader.GetFieldNumber() { case 1: m.Name = reader.ReadString() case 2: m.Size = reader.ReadInt64() case 3: m.Mode = reader.ReadUint32() case 4: m.ModTime = reader.ReadInt64() case 5: m.IsDir = reader.ReadBool() default: reader.SkipField() } } return m } // Unmarshal unmarshals a FileInfoResponse from a slice of bytes. func (m *FileInfoResponse) Unmarshal(rawBytes []byte) (*FileInfoResponse, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // HID type HIDScriptRequest struct { ScriptPath string TimeoutSeconds uint32 } // GetScriptPath gets the ScriptPath of the HIDScriptRequest. func (m *HIDScriptRequest) GetScriptPath() (x string) { if m == nil { return x } return m.ScriptPath } // GetTimeoutSeconds gets the TimeoutSeconds of the HIDScriptRequest. func (m *HIDScriptRequest) GetTimeoutSeconds() (x uint32) { if m == nil { return x } return m.TimeoutSeconds } // MarshalToWriter marshals HIDScriptRequest to the provided writer. func (m *HIDScriptRequest) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.ScriptPath) > 0 { writer.WriteString(1, m.ScriptPath) } if m.TimeoutSeconds != 0 { writer.WriteUint32(2, m.TimeoutSeconds) } return } // Marshal marshals HIDScriptRequest to a slice of bytes. func (m *HIDScriptRequest) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a HIDScriptRequest from the provided reader. func (m *HIDScriptRequest) UnmarshalFromReader(reader jspb.Reader) *HIDScriptRequest { for reader.Next() { if m == nil { m = &HIDScriptRequest{} } switch reader.GetFieldNumber() { case 1: m.ScriptPath = reader.ReadString() case 2: m.TimeoutSeconds = reader.ReadUint32() default: reader.SkipField() } } return m } // Unmarshal unmarshals a HIDScriptRequest from a slice of bytes. func (m *HIDScriptRequest) Unmarshal(rawBytes []byte) (*HIDScriptRequest, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type HIDScriptJob struct { Id uint32 } // GetId gets the Id of the HIDScriptJob. func (m *HIDScriptJob) GetId() (x uint32) { if m == nil { return x } return m.Id } // MarshalToWriter marshals HIDScriptJob to the provided writer. func (m *HIDScriptJob) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.Id != 0 { writer.WriteUint32(1, m.Id) } return } // Marshal marshals HIDScriptJob to a slice of bytes. func (m *HIDScriptJob) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a HIDScriptJob from the provided reader. func (m *HIDScriptJob) UnmarshalFromReader(reader jspb.Reader) *HIDScriptJob { for reader.Next() { if m == nil { m = &HIDScriptJob{} } switch reader.GetFieldNumber() { case 1: m.Id = reader.ReadUint32() default: reader.SkipField() } } return m } // Unmarshal unmarshals a HIDScriptJob from a slice of bytes. func (m *HIDScriptJob) Unmarshal(rawBytes []byte) (*HIDScriptJob, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type HIDScriptJobList struct { Ids []uint32 } // GetIds gets the Ids of the HIDScriptJobList. func (m *HIDScriptJobList) GetIds() (x []uint32) { if m == nil { return x } return m.Ids } // MarshalToWriter marshals HIDScriptJobList to the provided writer. func (m *HIDScriptJobList) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Ids) > 0 { writer.WriteUint32Slice(1, m.Ids) } return } // Marshal marshals HIDScriptJobList to a slice of bytes. func (m *HIDScriptJobList) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a HIDScriptJobList from the provided reader. func (m *HIDScriptJobList) UnmarshalFromReader(reader jspb.Reader) *HIDScriptJobList { for reader.Next() { if m == nil { m = &HIDScriptJobList{} } switch reader.GetFieldNumber() { case 1: m.Ids = reader.ReadUint32Slice() default: reader.SkipField() } } return m } // Unmarshal unmarshals a HIDScriptJobList from a slice of bytes. func (m *HIDScriptJobList) Unmarshal(rawBytes []byte) (*HIDScriptJobList, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type HIDRunningJobStateResult struct { Id int64 VmId int64 Source string } // GetId gets the Id of the HIDRunningJobStateResult. func (m *HIDRunningJobStateResult) GetId() (x int64) { if m == nil { return x } return m.Id } // GetVmId gets the VmId of the HIDRunningJobStateResult. func (m *HIDRunningJobStateResult) GetVmId() (x int64) { if m == nil { return x } return m.VmId } // GetSource gets the Source of the HIDRunningJobStateResult. func (m *HIDRunningJobStateResult) GetSource() (x string) { if m == nil { return x } return m.Source } // MarshalToWriter marshals HIDRunningJobStateResult to the provided writer. func (m *HIDRunningJobStateResult) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.Id != 0 { writer.WriteInt64(1, m.Id) } if m.VmId != 0 { writer.WriteInt64(2, m.VmId) } if len(m.Source) > 0 { writer.WriteString(3, m.Source) } return } // Marshal marshals HIDRunningJobStateResult to a slice of bytes. func (m *HIDRunningJobStateResult) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a HIDRunningJobStateResult from the provided reader. func (m *HIDRunningJobStateResult) UnmarshalFromReader(reader jspb.Reader) *HIDRunningJobStateResult { for reader.Next() { if m == nil { m = &HIDRunningJobStateResult{} } switch reader.GetFieldNumber() { case 1: m.Id = reader.ReadInt64() case 2: m.VmId = reader.ReadInt64() case 3: m.Source = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a HIDRunningJobStateResult from a slice of bytes. func (m *HIDRunningJobStateResult) Unmarshal(rawBytes []byte) (*HIDRunningJobStateResult, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type HIDScriptResult struct { Job *HIDScriptJob IsFinished bool ResultJson string } // GetJob gets the Job of the HIDScriptResult. func (m *HIDScriptResult) GetJob() (x *HIDScriptJob) { if m == nil { return x } return m.Job } // GetIsFinished gets the IsFinished of the HIDScriptResult. func (m *HIDScriptResult) GetIsFinished() (x bool) { if m == nil { return x } return m.IsFinished } // GetResultJson gets the ResultJson of the HIDScriptResult. func (m *HIDScriptResult) GetResultJson() (x string) { if m == nil { return x } return m.ResultJson } // MarshalToWriter marshals HIDScriptResult to the provided writer. func (m *HIDScriptResult) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.Job != nil { writer.WriteMessage(1, func() { m.Job.MarshalToWriter(writer) }) } if m.IsFinished { writer.WriteBool(2, m.IsFinished) } if len(m.ResultJson) > 0 { writer.WriteString(3, m.ResultJson) } return } // Marshal marshals HIDScriptResult to a slice of bytes. func (m *HIDScriptResult) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a HIDScriptResult from the provided reader. func (m *HIDScriptResult) UnmarshalFromReader(reader jspb.Reader) *HIDScriptResult { for reader.Next() { if m == nil { m = &HIDScriptResult{} } switch reader.GetFieldNumber() { case 1: reader.ReadMessage(func() { m.Job = m.Job.UnmarshalFromReader(reader) }) case 2: m.IsFinished = reader.ReadBool() case 3: m.ResultJson = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a HIDScriptResult from a slice of bytes. func (m *HIDScriptResult) Unmarshal(rawBytes []byte) (*HIDScriptResult, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // LED type LEDSettings struct { BlinkCount uint32 } // GetBlinkCount gets the BlinkCount of the LEDSettings. func (m *LEDSettings) GetBlinkCount() (x uint32) { if m == nil { return x } return m.BlinkCount } // MarshalToWriter marshals LEDSettings to the provided writer. func (m *LEDSettings) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.BlinkCount != 0 { writer.WriteUint32(1, m.BlinkCount) } return } // Marshal marshals LEDSettings to a slice of bytes. func (m *LEDSettings) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a LEDSettings from the provided reader. func (m *LEDSettings) UnmarshalFromReader(reader jspb.Reader) *LEDSettings { for reader.Next() { if m == nil { m = &LEDSettings{} } switch reader.GetFieldNumber() { case 1: m.BlinkCount = reader.ReadUint32() default: reader.SkipField() } } return m } // Unmarshal unmarshals a LEDSettings from a slice of bytes. func (m *LEDSettings) Unmarshal(rawBytes []byte) (*LEDSettings, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // USB Gadget type GadgetSettings struct { Enabled bool Vid string Pid string Manufacturer string Product string Serial string Use_CDC_ECM bool Use_RNDIS bool Use_HID_KEYBOARD bool Use_HID_MOUSE bool Use_HID_RAW bool Use_UMS bool Use_SERIAL bool RndisSettings *GadgetSettingsEthernet CdcEcmSettings *GadgetSettingsEthernet UmsSettings *GadgetSettingsUMS } // GetEnabled gets the Enabled of the GadgetSettings. func (m *GadgetSettings) GetEnabled() (x bool) { if m == nil { return x } return m.Enabled } // GetVid gets the Vid of the GadgetSettings. func (m *GadgetSettings) GetVid() (x string) { if m == nil { return x } return m.Vid } // GetPid gets the Pid of the GadgetSettings. func (m *GadgetSettings) GetPid() (x string) { if m == nil { return x } return m.Pid } // GetManufacturer gets the Manufacturer of the GadgetSettings. func (m *GadgetSettings) GetManufacturer() (x string) { if m == nil { return x } return m.Manufacturer } // GetProduct gets the Product of the GadgetSettings. func (m *GadgetSettings) GetProduct() (x string) { if m == nil { return x } return m.Product } // GetSerial gets the Serial of the GadgetSettings. func (m *GadgetSettings) GetSerial() (x string) { if m == nil { return x } return m.Serial } // GetUse_CDC_ECM gets the Use_CDC_ECM of the GadgetSettings. func (m *GadgetSettings) GetUse_CDC_ECM() (x bool) { if m == nil { return x } return m.Use_CDC_ECM } // GetUse_RNDIS gets the Use_RNDIS of the GadgetSettings. func (m *GadgetSettings) GetUse_RNDIS() (x bool) { if m == nil { return x } return m.Use_RNDIS } // GetUse_HID_KEYBOARD gets the Use_HID_KEYBOARD of the GadgetSettings. func (m *GadgetSettings) GetUse_HID_KEYBOARD() (x bool) { if m == nil { return x } return m.Use_HID_KEYBOARD } // GetUse_HID_MOUSE gets the Use_HID_MOUSE of the GadgetSettings. func (m *GadgetSettings) GetUse_HID_MOUSE() (x bool) { if m == nil { return x } return m.Use_HID_MOUSE } // GetUse_HID_RAW gets the Use_HID_RAW of the GadgetSettings. func (m *GadgetSettings) GetUse_HID_RAW() (x bool) { if m == nil { return x } return m.Use_HID_RAW } // GetUse_UMS gets the Use_UMS of the GadgetSettings. func (m *GadgetSettings) GetUse_UMS() (x bool) { if m == nil { return x } return m.Use_UMS } // GetUse_SERIAL gets the Use_SERIAL of the GadgetSettings. func (m *GadgetSettings) GetUse_SERIAL() (x bool) { if m == nil { return x } return m.Use_SERIAL } // GetRndisSettings gets the RndisSettings of the GadgetSettings. func (m *GadgetSettings) GetRndisSettings() (x *GadgetSettingsEthernet) { if m == nil { return x } return m.RndisSettings } // GetCdcEcmSettings gets the CdcEcmSettings of the GadgetSettings. func (m *GadgetSettings) GetCdcEcmSettings() (x *GadgetSettingsEthernet) { if m == nil { return x } return m.CdcEcmSettings } // GetUmsSettings gets the UmsSettings of the GadgetSettings. func (m *GadgetSettings) GetUmsSettings() (x *GadgetSettingsUMS) { if m == nil { return x } return m.UmsSettings } // MarshalToWriter marshals GadgetSettings to the provided writer. func (m *GadgetSettings) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.Enabled { writer.WriteBool(1, m.Enabled) } if len(m.Vid) > 0 { writer.WriteString(2, m.Vid) } if len(m.Pid) > 0 { writer.WriteString(3, m.Pid) } if len(m.Manufacturer) > 0 { writer.WriteString(4, m.Manufacturer) } if len(m.Product) > 0 { writer.WriteString(5, m.Product) } if len(m.Serial) > 0 { writer.WriteString(6, m.Serial) } if m.Use_CDC_ECM { writer.WriteBool(7, m.Use_CDC_ECM) } if m.Use_RNDIS { writer.WriteBool(8, m.Use_RNDIS) } if m.Use_HID_KEYBOARD { writer.WriteBool(9, m.Use_HID_KEYBOARD) } if m.Use_HID_MOUSE { writer.WriteBool(10, m.Use_HID_MOUSE) } if m.Use_HID_RAW { writer.WriteBool(11, m.Use_HID_RAW) } if m.Use_UMS { writer.WriteBool(12, m.Use_UMS) } if m.Use_SERIAL { writer.WriteBool(13, m.Use_SERIAL) } if m.RndisSettings != nil { writer.WriteMessage(14, func() { m.RndisSettings.MarshalToWriter(writer) }) } if m.CdcEcmSettings != nil { writer.WriteMessage(15, func() { m.CdcEcmSettings.MarshalToWriter(writer) }) } if m.UmsSettings != nil { writer.WriteMessage(16, func() { m.UmsSettings.MarshalToWriter(writer) }) } return } // Marshal marshals GadgetSettings to a slice of bytes. func (m *GadgetSettings) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a GadgetSettings from the provided reader. func (m *GadgetSettings) UnmarshalFromReader(reader jspb.Reader) *GadgetSettings { for reader.Next() { if m == nil { m = &GadgetSettings{} } switch reader.GetFieldNumber() { case 1: m.Enabled = reader.ReadBool() case 2: m.Vid = reader.ReadString() case 3: m.Pid = reader.ReadString() case 4: m.Manufacturer = reader.ReadString() case 5: m.Product = reader.ReadString() case 6: m.Serial = reader.ReadString() case 7: m.Use_CDC_ECM = reader.ReadBool() case 8: m.Use_RNDIS = reader.ReadBool() case 9: m.Use_HID_KEYBOARD = reader.ReadBool() case 10: m.Use_HID_MOUSE = reader.ReadBool() case 11: m.Use_HID_RAW = reader.ReadBool() case 12: m.Use_UMS = reader.ReadBool() case 13: m.Use_SERIAL = reader.ReadBool() case 14: reader.ReadMessage(func() { m.RndisSettings = m.RndisSettings.UnmarshalFromReader(reader) }) case 15: reader.ReadMessage(func() { m.CdcEcmSettings = m.CdcEcmSettings.UnmarshalFromReader(reader) }) case 16: reader.ReadMessage(func() { m.UmsSettings = m.UmsSettings.UnmarshalFromReader(reader) }) default: reader.SkipField() } } return m } // Unmarshal unmarshals a GadgetSettings from a slice of bytes. func (m *GadgetSettings) Unmarshal(rawBytes []byte) (*GadgetSettings, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type GadgetSettingsEthernet struct { HostAddr string DevAddr string } // GetHostAddr gets the HostAddr of the GadgetSettingsEthernet. func (m *GadgetSettingsEthernet) GetHostAddr() (x string) { if m == nil { return x } return m.HostAddr } // GetDevAddr gets the DevAddr of the GadgetSettingsEthernet. func (m *GadgetSettingsEthernet) GetDevAddr() (x string) { if m == nil { return x } return m.DevAddr } // MarshalToWriter marshals GadgetSettingsEthernet to the provided writer. func (m *GadgetSettingsEthernet) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.HostAddr) > 0 { writer.WriteString(1, m.HostAddr) } if len(m.DevAddr) > 0 { writer.WriteString(2, m.DevAddr) } return } // Marshal marshals GadgetSettingsEthernet to a slice of bytes. func (m *GadgetSettingsEthernet) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a GadgetSettingsEthernet from the provided reader. func (m *GadgetSettingsEthernet) UnmarshalFromReader(reader jspb.Reader) *GadgetSettingsEthernet { for reader.Next() { if m == nil { m = &GadgetSettingsEthernet{} } switch reader.GetFieldNumber() { case 1: m.HostAddr = reader.ReadString() case 2: m.DevAddr = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a GadgetSettingsEthernet from a slice of bytes. func (m *GadgetSettingsEthernet) Unmarshal(rawBytes []byte) (*GadgetSettingsEthernet, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type GadgetSettingsUMS struct { Cdrom bool File string } // GetCdrom gets the Cdrom of the GadgetSettingsUMS. func (m *GadgetSettingsUMS) GetCdrom() (x bool) { if m == nil { return x } return m.Cdrom } // GetFile gets the File of the GadgetSettingsUMS. func (m *GadgetSettingsUMS) GetFile() (x string) { if m == nil { return x } return m.File } // MarshalToWriter marshals GadgetSettingsUMS to the provided writer. func (m *GadgetSettingsUMS) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.Cdrom { writer.WriteBool(1, m.Cdrom) } if len(m.File) > 0 { writer.WriteString(2, m.File) } return } // Marshal marshals GadgetSettingsUMS to a slice of bytes. func (m *GadgetSettingsUMS) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a GadgetSettingsUMS from the provided reader. func (m *GadgetSettingsUMS) UnmarshalFromReader(reader jspb.Reader) *GadgetSettingsUMS { for reader.Next() { if m == nil { m = &GadgetSettingsUMS{} } switch reader.GetFieldNumber() { case 1: m.Cdrom = reader.ReadBool() case 2: m.File = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a GadgetSettingsUMS from a slice of bytes. func (m *GadgetSettingsUMS) Unmarshal(rawBytes []byte) (*GadgetSettingsUMS, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // Ethernet Interface Settings type DeployedEthernetInterfaceSettings struct { List []*EthernetInterfaceSettings } // GetList gets the List of the DeployedEthernetInterfaceSettings. func (m *DeployedEthernetInterfaceSettings) GetList() (x []*EthernetInterfaceSettings) { if m == nil { return x } return m.List } // MarshalToWriter marshals DeployedEthernetInterfaceSettings to the provided writer. func (m *DeployedEthernetInterfaceSettings) MarshalToWriter(writer jspb.Writer) { if m == nil { return } for _, msg := range m.List { writer.WriteMessage(1, func() { msg.MarshalToWriter(writer) }) } return } // Marshal marshals DeployedEthernetInterfaceSettings to a slice of bytes. func (m *DeployedEthernetInterfaceSettings) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a DeployedEthernetInterfaceSettings from the provided reader. func (m *DeployedEthernetInterfaceSettings) UnmarshalFromReader(reader jspb.Reader) *DeployedEthernetInterfaceSettings { for reader.Next() { if m == nil { m = &DeployedEthernetInterfaceSettings{} } switch reader.GetFieldNumber() { case 1: reader.ReadMessage(func() { m.List = append(m.List, new(EthernetInterfaceSettings).UnmarshalFromReader(reader)) }) default: reader.SkipField() } } return m } // Unmarshal unmarshals a DeployedEthernetInterfaceSettings from a slice of bytes. func (m *DeployedEthernetInterfaceSettings) Unmarshal(rawBytes []byte) (*DeployedEthernetInterfaceSettings, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type EthernetInterfaceSettings struct { Name string Mode EthernetInterfaceSettings_Mode IpAddress4 string Netmask4 string Enabled bool DhcpServerSettings *DHCPServerSettings SettingsInUse bool } // GetName gets the Name of the EthernetInterfaceSettings. func (m *EthernetInterfaceSettings) GetName() (x string) { if m == nil { return x } return m.Name } // GetMode gets the Mode of the EthernetInterfaceSettings. func (m *EthernetInterfaceSettings) GetMode() (x EthernetInterfaceSettings_Mode) { if m == nil { return x } return m.Mode } // GetIpAddress4 gets the IpAddress4 of the EthernetInterfaceSettings. func (m *EthernetInterfaceSettings) GetIpAddress4() (x string) { if m == nil { return x } return m.IpAddress4 } // GetNetmask4 gets the Netmask4 of the EthernetInterfaceSettings. func (m *EthernetInterfaceSettings) GetNetmask4() (x string) { if m == nil { return x } return m.Netmask4 } // GetEnabled gets the Enabled of the EthernetInterfaceSettings. func (m *EthernetInterfaceSettings) GetEnabled() (x bool) { if m == nil { return x } return m.Enabled } // GetDhcpServerSettings gets the DhcpServerSettings of the EthernetInterfaceSettings. func (m *EthernetInterfaceSettings) GetDhcpServerSettings() (x *DHCPServerSettings) { if m == nil { return x } return m.DhcpServerSettings } // GetSettingsInUse gets the SettingsInUse of the EthernetInterfaceSettings. func (m *EthernetInterfaceSettings) GetSettingsInUse() (x bool) { if m == nil { return x } return m.SettingsInUse } // MarshalToWriter marshals EthernetInterfaceSettings to the provided writer. func (m *EthernetInterfaceSettings) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Name) > 0 { writer.WriteString(1, m.Name) } if int(m.Mode) != 0 { writer.WriteEnum(2, int(m.Mode)) } if len(m.IpAddress4) > 0 { writer.WriteString(3, m.IpAddress4) } if len(m.Netmask4) > 0 { writer.WriteString(4, m.Netmask4) } if m.Enabled { writer.WriteBool(5, m.Enabled) } if m.DhcpServerSettings != nil { writer.WriteMessage(6, func() { m.DhcpServerSettings.MarshalToWriter(writer) }) } if m.SettingsInUse { writer.WriteBool(7, m.SettingsInUse) } return } // Marshal marshals EthernetInterfaceSettings to a slice of bytes. func (m *EthernetInterfaceSettings) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a EthernetInterfaceSettings from the provided reader. func (m *EthernetInterfaceSettings) UnmarshalFromReader(reader jspb.Reader) *EthernetInterfaceSettings { for reader.Next() { if m == nil { m = &EthernetInterfaceSettings{} } switch reader.GetFieldNumber() { case 1: m.Name = reader.ReadString() case 2: m.Mode = EthernetInterfaceSettings_Mode(reader.ReadEnum()) case 3: m.IpAddress4 = reader.ReadString() case 4: m.Netmask4 = reader.ReadString() case 5: m.Enabled = reader.ReadBool() case 6: reader.ReadMessage(func() { m.DhcpServerSettings = m.DhcpServerSettings.UnmarshalFromReader(reader) }) case 7: m.SettingsInUse = reader.ReadBool() default: reader.SkipField() } } return m } // Unmarshal unmarshals a EthernetInterfaceSettings from a slice of bytes. func (m *EthernetInterfaceSettings) Unmarshal(rawBytes []byte) (*EthernetInterfaceSettings, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // DHCP type DHCPServerSettings struct { ListenPort uint32 ListenInterface string LeaseFile string NotAuthoritative bool DoNotBindInterface bool CallbackScript string Ranges []*DHCPServerRange // repeated DHCPServerOption options = 8; Options map[uint32]string StaticHosts []*DHCPServerStaticHost } // GetListenPort gets the ListenPort of the DHCPServerSettings. func (m *DHCPServerSettings) GetListenPort() (x uint32) { if m == nil { return x } return m.ListenPort } // GetListenInterface gets the ListenInterface of the DHCPServerSettings. func (m *DHCPServerSettings) GetListenInterface() (x string) { if m == nil { return x } return m.ListenInterface } // GetLeaseFile gets the LeaseFile of the DHCPServerSettings. func (m *DHCPServerSettings) GetLeaseFile() (x string) { if m == nil { return x } return m.LeaseFile } // GetNotAuthoritative gets the NotAuthoritative of the DHCPServerSettings. func (m *DHCPServerSettings) GetNotAuthoritative() (x bool) { if m == nil { return x } return m.NotAuthoritative } // GetDoNotBindInterface gets the DoNotBindInterface of the DHCPServerSettings. func (m *DHCPServerSettings) GetDoNotBindInterface() (x bool) { if m == nil { return x } return m.DoNotBindInterface } // GetCallbackScript gets the CallbackScript of the DHCPServerSettings. func (m *DHCPServerSettings) GetCallbackScript() (x string) { if m == nil { return x } return m.CallbackScript } // GetRanges gets the Ranges of the DHCPServerSettings. func (m *DHCPServerSettings) GetRanges() (x []*DHCPServerRange) { if m == nil { return x } return m.Ranges } // GetOptions gets the Options of the DHCPServerSettings. func (m *DHCPServerSettings) GetOptions() (x map[uint32]string) { if m == nil { return x } return m.Options } // GetStaticHosts gets the StaticHosts of the DHCPServerSettings. func (m *DHCPServerSettings) GetStaticHosts() (x []*DHCPServerStaticHost) { if m == nil { return x } return m.StaticHosts } // MarshalToWriter marshals DHCPServerSettings to the provided writer. func (m *DHCPServerSettings) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if m.ListenPort != 0 { writer.WriteUint32(1, m.ListenPort) } if len(m.ListenInterface) > 0 { writer.WriteString(2, m.ListenInterface) } if len(m.LeaseFile) > 0 { writer.WriteString(3, m.LeaseFile) } if m.NotAuthoritative { writer.WriteBool(4, m.NotAuthoritative) } if m.DoNotBindInterface { writer.WriteBool(5, m.DoNotBindInterface) } if len(m.CallbackScript) > 0 { writer.WriteString(6, m.CallbackScript) } for _, msg := range m.Ranges { writer.WriteMessage(7, func() { msg.MarshalToWriter(writer) }) } if len(m.Options) > 0 { for key, value := range m.Options { writer.WriteMessage(8, func() { writer.WriteUint32(1, key) writer.WriteString(2, value) }) } } for _, msg := range m.StaticHosts { writer.WriteMessage(9, func() { msg.MarshalToWriter(writer) }) } return } // Marshal marshals DHCPServerSettings to a slice of bytes. func (m *DHCPServerSettings) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a DHCPServerSettings from the provided reader. func (m *DHCPServerSettings) UnmarshalFromReader(reader jspb.Reader) *DHCPServerSettings { for reader.Next() { if m == nil { m = &DHCPServerSettings{} } switch reader.GetFieldNumber() { case 1: m.ListenPort = reader.ReadUint32() case 2: m.ListenInterface = reader.ReadString() case 3: m.LeaseFile = reader.ReadString() case 4: m.NotAuthoritative = reader.ReadBool() case 5: m.DoNotBindInterface = reader.ReadBool() case 6: m.CallbackScript = reader.ReadString() case 7: reader.ReadMessage(func() { m.Ranges = append(m.Ranges, new(DHCPServerRange).UnmarshalFromReader(reader)) }) case 8: if m.Options == nil { m.Options = map[uint32]string{} } reader.ReadMessage(func() { var key uint32 var value string for reader.Next() { switch reader.GetFieldNumber() { case 1: key = reader.ReadUint32() case 2: value = reader.ReadString() } m.Options[key] = value } }) case 9: reader.ReadMessage(func() { m.StaticHosts = append(m.StaticHosts, new(DHCPServerStaticHost).UnmarshalFromReader(reader)) }) default: reader.SkipField() } } return m } // Unmarshal unmarshals a DHCPServerSettings from a slice of bytes. func (m *DHCPServerSettings) Unmarshal(rawBytes []byte) (*DHCPServerSettings, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // Could be used for IPv4 or IPv6 (refer dnsmasq docs), nor field for prefix length (default is 64) type DHCPServerRange struct { RangeLower string RangeUpper string LeaseTime string } // GetRangeLower gets the RangeLower of the DHCPServerRange. func (m *DHCPServerRange) GetRangeLower() (x string) { if m == nil { return x } return m.RangeLower } // GetRangeUpper gets the RangeUpper of the DHCPServerRange. func (m *DHCPServerRange) GetRangeUpper() (x string) { if m == nil { return x } return m.RangeUpper } // GetLeaseTime gets the LeaseTime of the DHCPServerRange. func (m *DHCPServerRange) GetLeaseTime() (x string) { if m == nil { return x } return m.LeaseTime } // MarshalToWriter marshals DHCPServerRange to the provided writer. func (m *DHCPServerRange) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.RangeLower) > 0 { writer.WriteString(1, m.RangeLower) } if len(m.RangeUpper) > 0 { writer.WriteString(2, m.RangeUpper) } if len(m.LeaseTime) > 0 { writer.WriteString(3, m.LeaseTime) } return } // Marshal marshals DHCPServerRange to a slice of bytes. func (m *DHCPServerRange) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a DHCPServerRange from the provided reader. func (m *DHCPServerRange) UnmarshalFromReader(reader jspb.Reader) *DHCPServerRange { for reader.Next() { if m == nil { m = &DHCPServerRange{} } switch reader.GetFieldNumber() { case 1: m.RangeLower = reader.ReadString() case 2: m.RangeUpper = reader.ReadString() case 3: m.LeaseTime = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a DHCPServerRange from a slice of bytes. func (m *DHCPServerRange) Unmarshal(rawBytes []byte) (*DHCPServerRange, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // Used for static leases type DHCPServerStaticHost struct { Mac string Ip string } // GetMac gets the Mac of the DHCPServerStaticHost. func (m *DHCPServerStaticHost) GetMac() (x string) { if m == nil { return x } return m.Mac } // GetIp gets the Ip of the DHCPServerStaticHost. func (m *DHCPServerStaticHost) GetIp() (x string) { if m == nil { return x } return m.Ip } // MarshalToWriter marshals DHCPServerStaticHost to the provided writer. func (m *DHCPServerStaticHost) MarshalToWriter(writer jspb.Writer) { if m == nil { return } if len(m.Mac) > 0 { writer.WriteString(1, m.Mac) } if len(m.Ip) > 0 { writer.WriteString(2, m.Ip) } return } // Marshal marshals DHCPServerStaticHost to a slice of bytes. func (m *DHCPServerStaticHost) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a DHCPServerStaticHost from the provided reader. func (m *DHCPServerStaticHost) UnmarshalFromReader(reader jspb.Reader) *DHCPServerStaticHost { for reader.Next() { if m == nil { m = &DHCPServerStaticHost{} } switch reader.GetFieldNumber() { case 1: m.Mac = reader.ReadString() case 2: m.Ip = reader.ReadString() default: reader.SkipField() } } return m } // Unmarshal unmarshals a DHCPServerStaticHost from a slice of bytes. func (m *DHCPServerStaticHost) Unmarshal(rawBytes []byte) (*DHCPServerStaticHost, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } type Empty struct { } // MarshalToWriter marshals Empty to the provided writer. func (m *Empty) MarshalToWriter(writer jspb.Writer) { if m == nil { return } return } // Marshal marshals Empty to a slice of bytes. func (m *Empty) Marshal() []byte { writer := jspb.NewWriter() m.MarshalToWriter(writer) return writer.GetResult() } // UnmarshalFromReader unmarshals a Empty from the provided reader. func (m *Empty) UnmarshalFromReader(reader jspb.Reader) *Empty { for reader.Next() { if m == nil { m = &Empty{} } switch reader.GetFieldNumber() { default: reader.SkipField() } } return m } // Unmarshal unmarshals a Empty from a slice of bytes. func (m *Empty) Unmarshal(rawBytes []byte) (*Empty, error) { reader := jspb.NewReader(rawBytes) m = m.UnmarshalFromReader(reader) if err := reader.Err(); err != nil { return nil, err } return m, nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpcweb.Client // This is a compile-time assertion to ensure that this generated file // is compatible with the grpcweb package it is being compiled against. const _ = grpcweb.GrpcWebPackageIsVersion3 // Client API for P4WNP1 service type P4WNP1Client interface { // USB gadget GetDeployedGadgetSetting(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*GadgetSettings, error) DeployGadgetSetting(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*GadgetSettings, error) GetGadgetSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*GadgetSettings, error) SetGadgetSettings(ctx context.Context, in *GadgetSettings, opts ...grpcweb.CallOption) (*GadgetSettings, error) GetLEDSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*LEDSettings, error) SetLEDSettings(ctx context.Context, in *LEDSettings, opts ...grpcweb.CallOption) (*Empty, error) MountUMSFile(ctx context.Context, in *GadgetSettingsUMS, opts ...grpcweb.CallOption) (*Empty, error) // Ethernet DeployEthernetInterfaceSettings(ctx context.Context, in *EthernetInterfaceSettings, opts ...grpcweb.CallOption) (*Empty, error) GetAllDeployedEthernetInterfaceSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*DeployedEthernetInterfaceSettings, error) GetDeployedEthernetInterfaceSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*EthernetInterfaceSettings, error) // HIDScript / job management HIDRunScript(ctx context.Context, in *HIDScriptRequest, opts ...grpcweb.CallOption) (*HIDScriptResult, error) HIDRunScriptJob(ctx context.Context, in *HIDScriptRequest, opts ...grpcweb.CallOption) (*HIDScriptJob, error) HIDGetScriptJobResult(ctx context.Context, in *HIDScriptJob, opts ...grpcweb.CallOption) (*HIDScriptResult, error) HIDCancelScriptJob(ctx context.Context, in *HIDScriptJob, opts ...grpcweb.CallOption) (*Empty, error) HIDGetRunningScriptJobs(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*HIDScriptJobList, error) HIDCancelAllScriptJobs(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*Empty, error) HIDGetRunningJobState(ctx context.Context, in *HIDScriptJob, opts ...grpcweb.CallOption) (*HIDRunningJobStateResult, error) // FileSystem FSWriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpcweb.CallOption) (*Empty, error) FSReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpcweb.CallOption) (*ReadFileResponse, error) FSGetFileInfo(ctx context.Context, in *FileInfoRequest, opts ...grpcweb.CallOption) (*FileInfoResponse, error) FSCreateTempDirOrFile(ctx context.Context, in *TempDirOrFileRequest, opts ...grpcweb.CallOption) (*TempDirOrFileResponse, error) // Events EventListen(ctx context.Context, in *EventRequest, opts ...grpcweb.CallOption) (P4WNP1_EventListenClient, error) // Alive check EchoRequest(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*StringMessage, error) // WiFi DeployWiFiSettings(ctx context.Context, in *WiFiSettings, opts ...grpcweb.CallOption) (*WiFiState, error) GetWiFiState(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*WiFiState, error) ListenWiFiStateChanges(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*WiFiState, error) // ToDo: Template requests (store, load, listStored) StoreWifiSettings(ctx context.Context, in *WifiRequestSettingsStorage, opts ...grpcweb.CallOption) (*Empty, error) GetStoredWifiSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*WiFiSettings, error) DeployStoredWifiSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*WiFiState, error) StoreDeployedWifiSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*Empty, error) ListStoredWifiSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) // TriggerActions GetDeployedTriggerActionSet(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*TriggerActionSet, error) DeployTriggerActionSetReplace(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*TriggerActionSet, error) DeployTriggerActionSetAdd(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*TriggerActionSet, error) DeployTriggerActionSetRemove(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*TriggerActionSet, error) ListStoredTriggerActionSets(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) StoreTriggerActionSet(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*Empty, error) DeployStoredTriggerActionSetReplace(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*TriggerActionSet, error) DeployStoredTriggerActionSetAdd(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*TriggerActionSet, error) ListStoredHIDScripts(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) ListStoredBashScripts(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) } type p4WNP1Client struct { client *grpcweb.Client } // NewP4WNP1Client creates a new gRPC-Web client. func NewP4WNP1Client(hostname string, opts ...grpcweb.DialOption) P4WNP1Client { return &p4WNP1Client{ client: grpcweb.NewClient(hostname, "P4wnP1_grpc.P4WNP1", opts...), } } func (c *p4WNP1Client) GetDeployedGadgetSetting(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*GadgetSettings, error) { resp, err := c.client.RPCCall(ctx, "GetDeployedGadgetSetting", in.Marshal(), opts...) if err != nil { return nil, err } return new(GadgetSettings).Unmarshal(resp) } func (c *p4WNP1Client) DeployGadgetSetting(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*GadgetSettings, error) { resp, err := c.client.RPCCall(ctx, "DeployGadgetSetting", in.Marshal(), opts...) if err != nil { return nil, err } return new(GadgetSettings).Unmarshal(resp) } func (c *p4WNP1Client) GetGadgetSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*GadgetSettings, error) { resp, err := c.client.RPCCall(ctx, "GetGadgetSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(GadgetSettings).Unmarshal(resp) } func (c *p4WNP1Client) SetGadgetSettings(ctx context.Context, in *GadgetSettings, opts ...grpcweb.CallOption) (*GadgetSettings, error) { resp, err := c.client.RPCCall(ctx, "SetGadgetSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(GadgetSettings).Unmarshal(resp) } func (c *p4WNP1Client) GetLEDSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*LEDSettings, error) { resp, err := c.client.RPCCall(ctx, "GetLEDSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(LEDSettings).Unmarshal(resp) } func (c *p4WNP1Client) SetLEDSettings(ctx context.Context, in *LEDSettings, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "SetLEDSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) MountUMSFile(ctx context.Context, in *GadgetSettingsUMS, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "MountUMSFile", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) DeployEthernetInterfaceSettings(ctx context.Context, in *EthernetInterfaceSettings, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "DeployEthernetInterfaceSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) GetAllDeployedEthernetInterfaceSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*DeployedEthernetInterfaceSettings, error) { resp, err := c.client.RPCCall(ctx, "GetAllDeployedEthernetInterfaceSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(DeployedEthernetInterfaceSettings).Unmarshal(resp) } func (c *p4WNP1Client) GetDeployedEthernetInterfaceSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*EthernetInterfaceSettings, error) { resp, err := c.client.RPCCall(ctx, "GetDeployedEthernetInterfaceSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(EthernetInterfaceSettings).Unmarshal(resp) } func (c *p4WNP1Client) HIDRunScript(ctx context.Context, in *HIDScriptRequest, opts ...grpcweb.CallOption) (*HIDScriptResult, error) { resp, err := c.client.RPCCall(ctx, "HIDRunScript", in.Marshal(), opts...) if err != nil { return nil, err } return new(HIDScriptResult).Unmarshal(resp) } func (c *p4WNP1Client) HIDRunScriptJob(ctx context.Context, in *HIDScriptRequest, opts ...grpcweb.CallOption) (*HIDScriptJob, error) { resp, err := c.client.RPCCall(ctx, "HIDRunScriptJob", in.Marshal(), opts...) if err != nil { return nil, err } return new(HIDScriptJob).Unmarshal(resp) } func (c *p4WNP1Client) HIDGetScriptJobResult(ctx context.Context, in *HIDScriptJob, opts ...grpcweb.CallOption) (*HIDScriptResult, error) { resp, err := c.client.RPCCall(ctx, "HIDGetScriptJobResult", in.Marshal(), opts...) if err != nil { return nil, err } return new(HIDScriptResult).Unmarshal(resp) } func (c *p4WNP1Client) HIDCancelScriptJob(ctx context.Context, in *HIDScriptJob, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "HIDCancelScriptJob", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) HIDGetRunningScriptJobs(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*HIDScriptJobList, error) { resp, err := c.client.RPCCall(ctx, "HIDGetRunningScriptJobs", in.Marshal(), opts...) if err != nil { return nil, err } return new(HIDScriptJobList).Unmarshal(resp) } func (c *p4WNP1Client) HIDCancelAllScriptJobs(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "HIDCancelAllScriptJobs", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) HIDGetRunningJobState(ctx context.Context, in *HIDScriptJob, opts ...grpcweb.CallOption) (*HIDRunningJobStateResult, error) { resp, err := c.client.RPCCall(ctx, "HIDGetRunningJobState", in.Marshal(), opts...) if err != nil { return nil, err } return new(HIDRunningJobStateResult).Unmarshal(resp) } func (c *p4WNP1Client) FSWriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "FSWriteFile", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) FSReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpcweb.CallOption) (*ReadFileResponse, error) { resp, err := c.client.RPCCall(ctx, "FSReadFile", in.Marshal(), opts...) if err != nil { return nil, err } return new(ReadFileResponse).Unmarshal(resp) } func (c *p4WNP1Client) FSGetFileInfo(ctx context.Context, in *FileInfoRequest, opts ...grpcweb.CallOption) (*FileInfoResponse, error) { resp, err := c.client.RPCCall(ctx, "FSGetFileInfo", in.Marshal(), opts...) if err != nil { return nil, err } return new(FileInfoResponse).Unmarshal(resp) } func (c *p4WNP1Client) FSCreateTempDirOrFile(ctx context.Context, in *TempDirOrFileRequest, opts ...grpcweb.CallOption) (*TempDirOrFileResponse, error) { resp, err := c.client.RPCCall(ctx, "FSCreateTempDirOrFile", in.Marshal(), opts...) if err != nil { return nil, err } return new(TempDirOrFileResponse).Unmarshal(resp) } func (c *p4WNP1Client) EventListen(ctx context.Context, in *EventRequest, opts ...grpcweb.CallOption) (P4WNP1_EventListenClient, error) { srv, err := c.client.NewClientStream(ctx, false, true, "EventListen", opts...) if err != nil { return nil, err } err = srv.SendMsg(in.Marshal()) if err != nil { return nil, err } return &p4WNP1EventListenClient{srv}, nil } type P4WNP1_EventListenClient interface { Recv() (*Event, error) grpcweb.ClientStream } type p4WNP1EventListenClient struct { grpcweb.ClientStream } func (x *p4WNP1EventListenClient) Recv() (*Event, error) { resp, err := x.RecvMsg() if err != nil { return nil, err } return new(Event).Unmarshal(resp) } func (c *p4WNP1Client) EchoRequest(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*StringMessage, error) { resp, err := c.client.RPCCall(ctx, "EchoRequest", in.Marshal(), opts...) if err != nil { return nil, err } return new(StringMessage).Unmarshal(resp) } func (c *p4WNP1Client) DeployWiFiSettings(ctx context.Context, in *WiFiSettings, opts ...grpcweb.CallOption) (*WiFiState, error) { resp, err := c.client.RPCCall(ctx, "DeployWiFiSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(WiFiState).Unmarshal(resp) } func (c *p4WNP1Client) GetWiFiState(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*WiFiState, error) { resp, err := c.client.RPCCall(ctx, "GetWiFiState", in.Marshal(), opts...) if err != nil { return nil, err } return new(WiFiState).Unmarshal(resp) } func (c *p4WNP1Client) ListenWiFiStateChanges(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*WiFiState, error) { resp, err := c.client.RPCCall(ctx, "ListenWiFiStateChanges", in.Marshal(), opts...) if err != nil { return nil, err } return new(WiFiState).Unmarshal(resp) } func (c *p4WNP1Client) StoreWifiSettings(ctx context.Context, in *WifiRequestSettingsStorage, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "StoreWifiSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) GetStoredWifiSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*WiFiSettings, error) { resp, err := c.client.RPCCall(ctx, "GetStoredWifiSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(WiFiSettings).Unmarshal(resp) } func (c *p4WNP1Client) DeployStoredWifiSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*WiFiState, error) { resp, err := c.client.RPCCall(ctx, "DeployStoredWifiSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(WiFiState).Unmarshal(resp) } func (c *p4WNP1Client) StoreDeployedWifiSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "StoreDeployedWifiSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) ListStoredWifiSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) { resp, err := c.client.RPCCall(ctx, "ListStoredWifiSettings", in.Marshal(), opts...) if err != nil { return nil, err } return new(StringMessageArray).Unmarshal(resp) } func (c *p4WNP1Client) GetDeployedTriggerActionSet(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*TriggerActionSet, error) { resp, err := c.client.RPCCall(ctx, "GetDeployedTriggerActionSet", in.Marshal(), opts...) if err != nil { return nil, err } return new(TriggerActionSet).Unmarshal(resp) } func (c *p4WNP1Client) DeployTriggerActionSetReplace(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*TriggerActionSet, error) { resp, err := c.client.RPCCall(ctx, "DeployTriggerActionSetReplace", in.Marshal(), opts...) if err != nil { return nil, err } return new(TriggerActionSet).Unmarshal(resp) } func (c *p4WNP1Client) DeployTriggerActionSetAdd(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*TriggerActionSet, error) { resp, err := c.client.RPCCall(ctx, "DeployTriggerActionSetAdd", in.Marshal(), opts...) if err != nil { return nil, err } return new(TriggerActionSet).Unmarshal(resp) } func (c *p4WNP1Client) DeployTriggerActionSetRemove(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*TriggerActionSet, error) { resp, err := c.client.RPCCall(ctx, "DeployTriggerActionSetRemove", in.Marshal(), opts...) if err != nil { return nil, err } return new(TriggerActionSet).Unmarshal(resp) } func (c *p4WNP1Client) ListStoredTriggerActionSets(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) { resp, err := c.client.RPCCall(ctx, "ListStoredTriggerActionSets", in.Marshal(), opts...) if err != nil { return nil, err } return new(StringMessageArray).Unmarshal(resp) } func (c *p4WNP1Client) StoreTriggerActionSet(ctx context.Context, in *TriggerActionSet, opts ...grpcweb.CallOption) (*Empty, error) { resp, err := c.client.RPCCall(ctx, "StoreTriggerActionSet", in.Marshal(), opts...) if err != nil { return nil, err } return new(Empty).Unmarshal(resp) } func (c *p4WNP1Client) DeployStoredTriggerActionSetReplace(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*TriggerActionSet, error) { resp, err := c.client.RPCCall(ctx, "DeployStoredTriggerActionSetReplace", in.Marshal(), opts...) if err != nil { return nil, err } return new(TriggerActionSet).Unmarshal(resp) } func (c *p4WNP1Client) DeployStoredTriggerActionSetAdd(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*TriggerActionSet, error) { resp, err := c.client.RPCCall(ctx, "DeployStoredTriggerActionSetAdd", in.Marshal(), opts...) if err != nil { return nil, err } return new(TriggerActionSet).Unmarshal(resp) } func (c *p4WNP1Client) ListStoredHIDScripts(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) { resp, err := c.client.RPCCall(ctx, "ListStoredHIDScripts", in.Marshal(), opts...) if err != nil { return nil, err } return new(StringMessageArray).Unmarshal(resp) } func (c *p4WNP1Client) ListStoredBashScripts(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*StringMessageArray, error) { resp, err := c.client.RPCCall(ctx, "ListStoredBashScripts", in.Marshal(), opts...) if err != nil { return nil, err } return new(StringMessageArray).Unmarshal(resp) }