fromJsonString static method

Oauth2SubjectTypes fromJsonString({
  1. required String jsonString,
})

Converts a jsonString to a Oauth2SubjectTypes

Throws a RangeError if the jsonString is not supported

Implementation

static Oauth2SubjectTypes fromJsonString({
  required String jsonString,
}) {
  switch (jsonString) {
    case "public":
      return Oauth2SubjectTypes.public;
    case "private":
      return Oauth2SubjectTypes.private;

    default:
      throw RangeError(
          "There's no subject type corresponding to $jsonString.");
  }
}