fromJson static method

GetDomainConfigsResponseAnyOf1? fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static GetDomainConfigsResponseAnyOf1? 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(() {
      assert(json.containsKey(r'reason'), 'Required key "GetDomainConfigsResponseAnyOf1[reason]" is missing from JSON.');
      assert(json[r'reason'] != null, 'Required key "GetDomainConfigsResponseAnyOf1[reason]" has a null value in JSON.');
      assert(json.containsKey(r'code'), 'Required key "GetDomainConfigsResponseAnyOf1[code]" is missing from JSON.');
      assert(json[r'code'] != null, 'Required key "GetDomainConfigsResponseAnyOf1[code]" has a null value in JSON.');
      assert(json.containsKey(r'status'), 'Required key "GetDomainConfigsResponseAnyOf1[status]" is missing from JSON.');
      return true;
    }());

    return GetDomainConfigsResponseAnyOf1(
      reason: mapValueOfType<String>(json, r'reason')!,
      code: mapValueOfType<String>(json, r'code')!,
      status: mapValueOfType<Object>(json, r'status'),
    );
  }
  return null;
}