content: //
  // AUTO-GENERATED FILE, DO NOT MODIFY!
  //
  // @dart=2.12
  
  // ignore_for_file: require_trailing_commas
  // ignore_for_file: unused_element
  // ignore_for_file: unnecessary_this
  // ignore_for_file: always_put_required_named_parameters_first
  // ignore_for_file: constant_identifier_names
  // ignore_for_file: lines_longer_than_80_chars
  // ignore_for_file: avoid_function_literals_in_foreach_calls
  
  import 'package:kubenav/models/kubernetes/helpers.dart';
  import 'package:kubenav/models/kubernetes/io_k8s_api_networking_v1_http_ingress_rule_value.dart';
  
  class IoK8sApiNetworkingV1IngressRule {
    /// Returns a new [IoK8sApiNetworkingV1IngressRule] instance.
    IoK8sApiNetworkingV1IngressRule({
      this.host,
      this.http,
    });
  
    /// Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the \"host\" part of the URI as defined in RFC 3986: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to    the IP in the Spec of the parent Ingress. 2. The `:` delimiter is not respected because ports are not allowed.    Currently the port of an Ingress is implicitly :80 for http and    :443 for https. Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue.  Host can be \"precise\" which is a domain name without the terminating dot of a network host (e.g. \"foo.bar.com\") or \"wildcard\", which is a domain name prefixed with a single wildcard label (e.g. \"*.foo.com\"). The wildcard character '*' must appear by itself as the first DNS label and matches only a single label. You cannot have a wildcard label by itself (e.g. Host == \"*\"). Requests will be matched against the Host field in the following way: 1. If Host is precise, the request matches this rule if the http host header is equal to Host. 2. If Host is a wildcard, then the request matches this rule if the http host header is to equal to the suffix (removing the first label) of the wildcard rule.
    ///
    /// Please note: This property should have been non-nullable! Since the specification file
    /// does not include a default value (using the "default:" property), however, the generated
    /// source code must fall back to having a nullable type.
    /// Consider adding a "default:" property in the specification file to hide this note.
    ///
    String? host;
  
    ///
    /// Please note: This property should have been non-nullable! Since the specification file
    /// does not include a default value (using the "default:" property), however, the generated
    /// source code must fall back to having a nullable type.
    /// Consider adding a "default:" property in the specification file to hide this note.
    ///
    IoK8sApiNetworkingV1HTTPIngressRuleValue? http;
  
    @override
    bool operator ==(Object other) =>
        identical(this, other) ||
        other is IoK8sApiNetworkingV1IngressRule &&
            other.host == host &&
            other.http == http;
  
    @override
    int get hashCode =>
        // ignore: unnecessary_parenthesis
        (host == null ? 0 : host!.hashCode) + (http == null ? 0 : http!.hashCode);
  
    @override
    String toString() =>
        'IoK8sApiNetworkingV1IngressRule[host=$host, http=$http]';
  
    Map<String, dynamic> toJson() {
      final json = <String, dynamic>{};
      if (this.host != null) {
        json[r'host'] = this.host;
      } else {
        json[r'host'] = null;
      }
      if (this.http != null) {
        json[r'http'] = this.http;
      } else {
        json[r'http'] = null;
      }
      return json;
    }
  
    /// Returns a new [IoK8sApiNetworkingV1IngressRule] instance and imports its values from
    /// [value] if it's a [Map], null otherwise.
    // ignore: prefer_constructors_over_static_methods
    static IoK8sApiNetworkingV1IngressRule? 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 "IoK8sApiNetworkingV1IngressRule[$key]" is missing from JSON.');
            assert(json[key] != null,
                'Required key "IoK8sApiNetworkingV1IngressRule[$key]" has a null value in JSON.');
          });
          return true;
        }());
  
        return IoK8sApiNetworkingV1IngressRule(
          host: mapValueOfType<String>(json, r'host'),
          http: IoK8sApiNetworkingV1HTTPIngressRuleValue.fromJson(json[r'http']),
        );
      }
      return null;
    }
  
    static List<IoK8sApiNetworkingV1IngressRule>? listFromJson(
      dynamic json, {
      bool growable = false,
    }) {
      final result = <IoK8sApiNetworkingV1IngressRule>[];
      if (json is List && json.isNotEmpty) {
        for (final row in json) {
          final value = IoK8sApiNetworkingV1IngressRule.fromJson(row);
          if (value != null) {
            result.add(value);
          }
        }
      }
      return result.toList(growable: growable);
    }
  
    static Map<String, IoK8sApiNetworkingV1IngressRule> mapFromJson(
        dynamic json) {
      final map = <String, IoK8sApiNetworkingV1IngressRule>{};
      if (json is Map && json.isNotEmpty) {
        json = json.cast<String, dynamic>(); // ignore: parameter_assignments
        for (final entry in json.entries) {
          final value = IoK8sApiNetworkingV1IngressRule.fromJson(entry.value);
          if (value != null) {
            map[entry.key] = value;
          }
        }
      }
      return map;
    }
  
    // maps a json object with a list of IoK8sApiNetworkingV1IngressRule-objects as value to a dart map
    static Map<String, List<IoK8sApiNetworkingV1IngressRule>> mapListFromJson(
      dynamic json, {
      bool growable = false,
    }) {
      final map = <String, List<IoK8sApiNetworkingV1IngressRule>>{};
      if (json is Map && json.isNotEmpty) {
        json = json.cast<String, dynamic>(); // ignore: parameter_assignments
        for (final entry in json.entries) {
          final value = IoK8sApiNetworkingV1IngressRule.listFromJson(
            entry.value,
            growable: growable,
          );
          if (value != null) {
            map[entry.key] = value;
          }
        }
      }
      return map;
    }
  
    /// The list of required keys that must be present in a JSON.
    static const requiredKeys = <String>{};
  }
  