content: //
  // AUTO-GENERATED FILE, DO NOT MODIFY!
  //
  // @dart=2.18
  
  // 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/plugins/flux/io_fluxcd_toolkit_source_v1beta1_bucket_spec_access_from.dart';
  import 'package:kubenav/models/plugins/flux/io_fluxcd_toolkit_source_v1beta1_helm_repository_spec_secret_ref.dart';
  
  class IoFluxcdToolkitSourceV1beta1HelmRepositorySpec {
    /// Returns a new [IoFluxcdToolkitSourceV1beta1HelmRepositorySpec] instance.
    IoFluxcdToolkitSourceV1beta1HelmRepositorySpec({
      this.accessFrom,
      required this.interval,
      this.passCredentials,
      this.secretRef,
      this.suspend,
      this.timeout,
      required this.url,
    });
  
    ///
    /// 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.
    ///
    IoFluxcdToolkitSourceV1beta1BucketSpecAccessFrom? accessFrom;
  
    /// The interval at which to check the upstream for updates.
    String interval;
  
    /// PassCredentials allows the credentials from the SecretRef to be passed on to a host that does not match the host as defined in URL. This may be required if the host of the advertised chart URLs in the index differ from the defined URL. Enabling this should be done with caution, as it can potentially result in credentials getting stolen in a MITM-attack.
    ///
    /// 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.
    ///
    bool? passCredentials;
  
    ///
    /// 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.
    ///
    IoFluxcdToolkitSourceV1beta1HelmRepositorySpecSecretRef? secretRef;
  
    /// This flag tells the controller to suspend the reconciliation of this source.
    ///
    /// 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.
    ///
    bool? suspend;
  
    /// The timeout of index downloading, defaults to 60s.
    ///
    /// 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? timeout;
  
    /// The Helm repository URL, a valid URL contains at least a protocol and host.
    String url;
  
    @override
    bool operator ==(Object other) =>
        identical(this, other) ||
        other is IoFluxcdToolkitSourceV1beta1HelmRepositorySpec &&
            other.accessFrom == accessFrom &&
            other.interval == interval &&
            other.passCredentials == passCredentials &&
            other.secretRef == secretRef &&
            other.suspend == suspend &&
            other.timeout == timeout &&
            other.url == url;
  
    @override
    int get hashCode =>
        // ignore: unnecessary_parenthesis
        (accessFrom == null ? 0 : accessFrom!.hashCode) +
        (interval.hashCode) +
        (passCredentials == null ? 0 : passCredentials!.hashCode) +
        (secretRef == null ? 0 : secretRef!.hashCode) +
        (suspend == null ? 0 : suspend!.hashCode) +
        (timeout == null ? 0 : timeout!.hashCode) +
        (url.hashCode);
  
    @override
    String toString() =>
        'IoFluxcdToolkitSourceV1beta1HelmRepositorySpec[accessFrom=$accessFrom, interval=$interval, passCredentials=$passCredentials, secretRef=$secretRef, suspend=$suspend, timeout=$timeout, url=$url]';
  
    Map<String, dynamic> toJson() {
      final json = <String, dynamic>{};
      if (this.accessFrom != null) {
        json[r'accessFrom'] = this.accessFrom;
      } else {
        json[r'accessFrom'] = null;
      }
      json[r'interval'] = this.interval;
      if (this.passCredentials != null) {
        json[r'passCredentials'] = this.passCredentials;
      } else {
        json[r'passCredentials'] = null;
      }
      if (this.secretRef != null) {
        json[r'secretRef'] = this.secretRef;
      } else {
        json[r'secretRef'] = null;
      }
      if (this.suspend != null) {
        json[r'suspend'] = this.suspend;
      } else {
        json[r'suspend'] = null;
      }
      if (this.timeout != null) {
        json[r'timeout'] = this.timeout;
      } else {
        json[r'timeout'] = null;
      }
      json[r'url'] = this.url;
      return json;
    }
  
    /// Returns a new [IoFluxcdToolkitSourceV1beta1HelmRepositorySpec] instance and imports its values from
    /// [value] if it's a [Map], null otherwise.
    // ignore: prefer_constructors_over_static_methods
    static IoFluxcdToolkitSourceV1beta1HelmRepositorySpec? 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 "IoFluxcdToolkitSourceV1beta1HelmRepositorySpec[$key]" is missing from JSON.');
            assert(json[key] != null,
                'Required key "IoFluxcdToolkitSourceV1beta1HelmRepositorySpec[$key]" has a null value in JSON.');
          });
          return true;
        }());
  
        return IoFluxcdToolkitSourceV1beta1HelmRepositorySpec(
          accessFrom: IoFluxcdToolkitSourceV1beta1BucketSpecAccessFrom.fromJson(
              json[r'accessFrom']),
          interval: mapValueOfType<String>(json, r'interval')!,
          passCredentials: mapValueOfType<bool>(json, r'passCredentials'),
          secretRef:
              IoFluxcdToolkitSourceV1beta1HelmRepositorySpecSecretRef.fromJson(
                  json[r'secretRef']),
          suspend: mapValueOfType<bool>(json, r'suspend'),
          timeout: mapValueOfType<String>(json, r'timeout'),
          url: mapValueOfType<String>(json, r'url')!,
        );
      }
      return null;
    }
  
    static List<IoFluxcdToolkitSourceV1beta1HelmRepositorySpec> listFromJson(
      dynamic json, {
      bool growable = false,
    }) {
      final result = <IoFluxcdToolkitSourceV1beta1HelmRepositorySpec>[];
      if (json is List && json.isNotEmpty) {
        for (final row in json) {
          final value =
              IoFluxcdToolkitSourceV1beta1HelmRepositorySpec.fromJson(row);
          if (value != null) {
            result.add(value);
          }
        }
      }
      return result.toList(growable: growable);
    }
  
    static Map<String, IoFluxcdToolkitSourceV1beta1HelmRepositorySpec>
        mapFromJson(dynamic json) {
      final map = <String, IoFluxcdToolkitSourceV1beta1HelmRepositorySpec>{};
      if (json is Map && json.isNotEmpty) {
        json = json.cast<String, dynamic>(); // ignore: parameter_assignments
        for (final entry in json.entries) {
          final value = IoFluxcdToolkitSourceV1beta1HelmRepositorySpec.fromJson(
              entry.value);
          if (value != null) {
            map[entry.key] = value;
          }
        }
      }
      return map;
    }
  
    // maps a json object with a list of IoFluxcdToolkitSourceV1beta1HelmRepositorySpec-objects as value to a dart map
    static Map<String, List<IoFluxcdToolkitSourceV1beta1HelmRepositorySpec>>
        mapListFromJson(
      dynamic json, {
      bool growable = false,
    }) {
      final map =
          <String, List<IoFluxcdToolkitSourceV1beta1HelmRepositorySpec>>{};
      if (json is Map && json.isNotEmpty) {
        // ignore: parameter_assignments
        json = json.cast<String, dynamic>();
        for (final entry in json.entries) {
          map[entry.key] =
              IoFluxcdToolkitSourceV1beta1HelmRepositorySpec.listFromJson(
            entry.value,
            growable: growable,
          );
        }
      }
      return map;
    }
  
    /// The list of required keys that must be present in a JSON.
    static const requiredKeys = <String>{
      'interval',
      'url',
    };
  }
  