Operation

public protocol Operation : Decodable, Encodable

An identifier for an operation object.

  • Creates an Operation from a string value

    Declaration

    Swift

    init(string: String) throws
  • Returns the string representation of the parameters for an Operation to be used in the URL.

     let range = InclusiveRange(start: 5, end: 10)
    

    would be represented as "5,10", which in the URL would translate to: ?range=5,10 This URL format is not an API but an implementation detail that could change in the future. The URL doesn’t encode the operator itself instead it is inferred at decoding time by the type information associated with that key. The type information used to decode this URL format is defined by the QueryParams structure associated with a route. The key name in the url maps to the field name in the QueryParams structure.

    Declaration

    Swift

    func getStringValue() -> String
  • Returns the Operator associated with the Operation.

    InclusiveRange(start: 5, end: 10) will have the operator Operator.inclusiveRange

    Declaration

    Swift

    func getOperator() -> Operator