Action
public protocol Action
An Action to be sent to the server. The action is sent by calling the
call method.
The set method returns the Action instance to allow
the fields of the action to be set in fluent style.
See VirtualDevice.createAction
-
Set the value of an argument in the
Action. The arguments are determined by the action in the device model. The arguments can be set in any order. The value is validated according to the constraints in the device model. If the value is not valid, or the named arguement does not exist in the device model, aClientError.argumentError is raised.If the action has an
argumentsarray in the device model, theargNamemust match one of the argument names in the array. To support device models which have only a single, un-named argument,argNamemay be passed as “” (an empty String) ornil. For an action that takes no arguments, theset, the code only needs to invoke the icallmethod. An attempt to set an argument value for an action that does not take arguments will result in aClientError.argumentError.All arguments defined in the action that do not have default values must be set before calling
call.return: this Action instance
Throws
ClientError.argumentif the value is not valid, orfieldisnilSee
VirtualDevice.createActionDeclaration
Swift
func set(argumentName: String, value: Any?) throws -> ActionParameters
argNamethe name of an argument from the action
valuethe value to set
-
Send the action.
The onError handler of the parent virtual device will be called if there is error sending the action.
All fields defined in the action that do not have default values must be set before invoking
callotherwise, aClientError.stateError is thrown.Throws
ClientError.stateifcallis invoked before setting all arguments that do not have default valuesDeclaration
Swift
func call()
Action Protocol Reference