NullableParameter

public enum NullableParameter<T>
extension NullableParameter: Encodable where T: Encodable
extension NullableParameter: Equatable where T: Equatable

Type for updating optional parameters - parameters that can either have value of some type, or be nil. Should be used mainly with optinal method parameters to differentiate between ignored parameter and parameter with a nil value.

  • Specifies value that should be set to a parameter

    Declaration

    Swift

    case value(T)
  • Empty value representing null

    Declaration

    Swift

    case null

Available where T: Encodable

  • Encode the nullable parameter to either null or its encoded value

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws