You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: external_dns_chart.rs
    path of file: ./repos/engine/src/cloud_provider/helm_charts
    
    the code of the file until where you have to start completion: use crate::cloud_provider::helm::{
    ChartInfo, ChartInstallationChecker, ChartSetValue, CommonChart, CommonChartVpa, HelmChartError,
    HelmChartNamespaces, UpdateStrategy, VpaConfig, VpaContainerPolicy, VpaTargetRef, VpaTargetRefApiVersion,
    VpaTargetRefKind,
};
use crate::cloud_provider::helm_charts::{
    HelmChartDirectoryLocation, HelmChartPath, HelmChartValuesFilePath, ToCommonHelmChart,
};
use crate::cloud_provider::models::{KubernetesCpuResourceUnit, KubernetesMemoryResourceUnit};
use crate::dns_provider::DnsProviderConfiguration;
use crate::errors::CommandError;
use kube::Client;

pub struct ExternalDNSChart {
    chart_prefix_path: Option<String>,
    chart_path: HelmChartPath,
    chart_values_path: HelmChartValuesFilePath,
    dns_provider_configuration: DnsProviderConfiguration,
    managed_dns_domains_root_helm_format: String,
    cluster_id: String,
    update_strategy: UpdateStrategy,
    enable_vpa: bool,
    namespace: HelmChartNamespaces,
}

impl ExternalDNSChart {
    pub fn new(
        chart_prefix_path: Option<&str>,
        dns_provider_configuration: DnsProviderConfiguration,
        managed_dns_domains_root_helm_format: String,
        clu
    
    fn to_common_helm_chart(&self) -> Result<CommonChart, HelmChartError> {
        Ok(CommonChart {
            chart_info: ChartInfo {
                name: "externaldns".to_string(),
                namespace: self.namespace,
                path: self.chart_path.to_string(),
                values_files: vec![self.chart_values_path.to_string()],
                values: vec![
                    ChartSetValue {
                        key: "image.registry".to_string(),
                        value: "public.ecr.aws".to_string(),
                    },
                    ChartSetValue {
                        key: "image.repository".to_string(),
                        value: "r3m4q3r9/pub-mirror-externaldns".to_string(),
                    },
                    ChartSetValue {
                        key: "updateStrategy.type".to_string(),
                        value: self.update_strategy.to_string(),
                    },
                    ChartSetValue {
                        key: "provider".to_string(),
                        value: self.dns_provider_configuration.get_cert_manager_config_name(),
                    },
                    ChartSetValue {
                        key: "domainFilters".to_string(),
                        value: self
                            .managed_dns_domains_root_helm_format
                            .to_string()
                            .replace('.', r"\."), // escape . from domains
                    },
                    ChartSetValue {
                        key: "txtOwnerId".to_string(),
                        value: self.cluster_id.to_string(),
                    },
                    ChartSetValue {
                        key: "txtPrefix".to_string(),
                        value: format!("qvy-{}-", self.cluster_id),
                    },
                    // Providers configuration
                    // Cloudflare
                    ChartSetValue {
                        key: "cloudflare.apiToken".to_string(),
                        value: match &self.dns_provider_configuration {
                            DnsProviderConfiguration::Cloudflare(config) => config.cloudflare_api_token.to_string(),
                            _ => "".to_string(),
                        },
                    },
                    ChartSetValue {
                        key: "cloudflare.email".to_string(),
                        value: match &self.dns_provider_configuration {
                            DnsProviderConfiguration::Cloudflare(config) => config.cloudflare_email.to_string(),
                            _ => "".to_string(),
                        },
                    },
                    ChartSetValue {
                        key: "cloudflare.proxied".to_string(),
                        value: match &self.dns_provider_configuration {
                            DnsProviderConfiguration::Cloudflare(config) => config.cloudflare_proxied.to_string(),
                            _ => "".to_string(),
                        },
                    },
                    // PDNS
                    ChartSetValue {
                        key: "pdns.apiUrl".to_string(),
                        value: match &self.dns_provider_configuration {
                            DnsProviderConfiguration::QoveryDns(config) => config.api_url_scheme_and_domain.to_string(),
                            _ => "".to_string(),
                        },
                    },
                    ChartSetValue {
                        key: "pdns.apiPort".to_string(),
                        value: match &self.dns_provider_configuration {
                            DnsProviderConfiguration::QoveryDns(config) => config.api_url_port.to_string(),
                            _ => "".to_string(),
                        },
                    },
                    ChartSetValue {
                        key: "pdns.apiKey".to_string(),
                        value: match &self.dns_provider_configuration {
                            DnsProviderConfiguration::QoveryDns(config) => config.api_key.to_string(),
                            _ => "".to_string(),
                        },
                    },
                ],
                ..Default::default()
            },
            chart_installation_checker: Some(Box::new(ExternalDNSChartInstallationChecker::new())),
            vertical_pod_autoscaler: match self.enable_vpa {
                true => Some(CommonChartVpa::new(
                    self.chart_prefix_path.clone().unwrap_or(".".to_string()),
                    vec![VpaConfig {
                        target_ref: VpaTargetRef::new(
                            VpaTargetRefApiVersion::AppsV1,
                            VpaTargetRefKind::Deployment,
                            "externaldns-external-dns".to_string(),
                        ),
                        container_policy: VpaContainerPolicy::new(
                            "*".to_string(),
                            Some(KubernetesCpuResourceUnit::MilliCpu(50)),
                            Some(KubernetesCpuResourceUnit::MilliCpu(200)),
                            Some(KubernetesMemoryResourceUnit::MebiByte(50)),
                            Some(KubernetesMemoryResourceUnit::MebiByte(200)),
                        ),
                    }],
                )),
                false => None,
            },
        })
    }