aws-sdk-eks 1.128.0

AWS SDK for Amazon Elastic Kubernetes Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Compatibility information.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Compatibility {
    /// <p>The supported Kubernetes version of the cluster.</p>
    pub cluster_version: ::std::option::Option<::std::string::String>,
    /// <p>The supported compute platform.</p>
    pub platform_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The supported default version.</p>
    pub default_version: bool,
}
impl Compatibility {
    /// <p>The supported Kubernetes version of the cluster.</p>
    pub fn cluster_version(&self) -> ::std::option::Option<&str> {
        self.cluster_version.as_deref()
    }
    /// <p>The supported compute platform.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.platform_versions.is_none()`.
    pub fn platform_versions(&self) -> &[::std::string::String] {
        self.platform_versions.as_deref().unwrap_or_default()
    }
    /// <p>The supported default version.</p>
    pub fn default_version(&self) -> bool {
        self.default_version
    }
}
impl Compatibility {
    /// Creates a new builder-style object to manufacture [`Compatibility`](crate::types::Compatibility).
    pub fn builder() -> crate::types::builders::CompatibilityBuilder {
        crate::types::builders::CompatibilityBuilder::default()
    }
}

/// A builder for [`Compatibility`](crate::types::Compatibility).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CompatibilityBuilder {
    pub(crate) cluster_version: ::std::option::Option<::std::string::String>,
    pub(crate) platform_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) default_version: ::std::option::Option<bool>,
}
impl CompatibilityBuilder {
    /// <p>The supported Kubernetes version of the cluster.</p>
    pub fn cluster_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The supported Kubernetes version of the cluster.</p>
    pub fn set_cluster_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_version = input;
        self
    }
    /// <p>The supported Kubernetes version of the cluster.</p>
    pub fn get_cluster_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_version
    }
    /// Appends an item to `platform_versions`.
    ///
    /// To override the contents of this collection use [`set_platform_versions`](Self::set_platform_versions).
    ///
    /// <p>The supported compute platform.</p>
    pub fn platform_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.platform_versions.unwrap_or_default();
        v.push(input.into());
        self.platform_versions = ::std::option::Option::Some(v);
        self
    }
    /// <p>The supported compute platform.</p>
    pub fn set_platform_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.platform_versions = input;
        self
    }
    /// <p>The supported compute platform.</p>
    pub fn get_platform_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.platform_versions
    }
    /// <p>The supported default version.</p>
    pub fn default_version(mut self, input: bool) -> Self {
        self.default_version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The supported default version.</p>
    pub fn set_default_version(mut self, input: ::std::option::Option<bool>) -> Self {
        self.default_version = input;
        self
    }
    /// <p>The supported default version.</p>
    pub fn get_default_version(&self) -> &::std::option::Option<bool> {
        &self.default_version
    }
    /// Consumes the builder and constructs a [`Compatibility`](crate::types::Compatibility).
    pub fn build(self) -> crate::types::Compatibility {
        crate::types::Compatibility {
            cluster_version: self.cluster_version,
            platform_versions: self.platform_versions,
            default_version: self.default_version.unwrap_or_default(),
        }
    }
}