fromJson static method

IamInvitationsInput? fromJson(
  1. dynamic value
)

Returns a new IamInvitationsInput instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static IamInvitationsInput? fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();

    // Ensure that the map contains the required keys.
    // Note 1: the values aren't checked for validity beyond being non-null.
    // Note 2: this code is stripped in release mode!
    assert(() {
      requiredKeys.forEach((key) {
        assert(json.containsKey(key), 'Required key "IamInvitationsInput[$key]" is missing from JSON.');
        assert(json[key] != null, 'Required key "IamInvitationsInput[$key]" has a null value in JSON.');
      });
      return true;
    }());

    return IamInvitationsInput(
      application: mapValueOfType<String>(json, r'application'),
      code: mapValueOfType<String>(json, r'code'),
      createdTime: mapValueOfType<String>(json, r'createdTime'),
      defaultCode: mapValueOfType<String>(json, r'defaultCode'),
      displayName: mapValueOfType<String>(json, r'displayName'),
      email: mapValueOfType<String>(json, r'email'),
      isRegexp: mapValueOfType<bool>(json, r'isRegexp'),
      name: mapValueOfType<String>(json, r'name'),
      owner: mapValueOfType<String>(json, r'owner'),
      phone: mapValueOfType<String>(json, r'phone'),
      quota: mapValueOfType<int>(json, r'quota'),
      signupGroup: mapValueOfType<String>(json, r'signupGroup'),
      state: mapValueOfType<String>(json, r'state'),
      updatedTime: mapValueOfType<String>(json, r'updatedTime'),
      usedCount: mapValueOfType<int>(json, r'usedCount'),
      username: mapValueOfType<String>(json, r'username'),
    );
  }
  return null;
}