decode static method

AccessChange? decode(
  1. Unpacker u
)

Implementation

static AccessChange? decode(Unpacker u) {
  try {
    switch (u.unpackString()) {
      case "Disable": return AccessChangeDisable();
      case null: return null;
      default: throw DecodeError();
    }
  } on FormatException {
    if (u.unpackMapLength() != 1) throw DecodeError();
    switch (u.unpackString()) {
      case "Enable":
        return AccessChangeEnable(
          SetLocalSecret.decode(u),
        );
      case null: return null;
      default: throw DecodeError();
    }
  }
}