aws-sdk-evs 1.29.0

AWS SDK for Amazon Elastic VMware Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetVersionsOutput {
    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
    pub vcf_versions: ::std::vec::Vec<crate::types::VcfVersionInfo>,
    /// <p>A list of EC2 instance types and their available ESX versions.</p>
    pub instance_type_esx_versions: ::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>,
    _request_id: Option<String>,
}
impl GetVersionsOutput {
    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
    pub fn vcf_versions(&self) -> &[crate::types::VcfVersionInfo] {
        use std::ops::Deref;
        self.vcf_versions.deref()
    }
    /// <p>A list of EC2 instance types and their available ESX versions.</p>
    pub fn instance_type_esx_versions(&self) -> &[crate::types::InstanceTypeEsxVersionsInfo] {
        use std::ops::Deref;
        self.instance_type_esx_versions.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetVersionsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetVersionsOutput {
    /// Creates a new builder-style object to manufacture [`GetVersionsOutput`](crate::operation::get_versions::GetVersionsOutput).
    pub fn builder() -> crate::operation::get_versions::builders::GetVersionsOutputBuilder {
        crate::operation::get_versions::builders::GetVersionsOutputBuilder::default()
    }
}

/// A builder for [`GetVersionsOutput`](crate::operation::get_versions::GetVersionsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetVersionsOutputBuilder {
    pub(crate) vcf_versions: ::std::option::Option<::std::vec::Vec<crate::types::VcfVersionInfo>>,
    pub(crate) instance_type_esx_versions: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>>,
    _request_id: Option<String>,
}
impl GetVersionsOutputBuilder {
    /// Appends an item to `vcf_versions`.
    ///
    /// To override the contents of this collection use [`set_vcf_versions`](Self::set_vcf_versions).
    ///
    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
    pub fn vcf_versions(mut self, input: crate::types::VcfVersionInfo) -> Self {
        let mut v = self.vcf_versions.unwrap_or_default();
        v.push(input);
        self.vcf_versions = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
    pub fn set_vcf_versions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VcfVersionInfo>>) -> Self {
        self.vcf_versions = input;
        self
    }
    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
    pub fn get_vcf_versions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VcfVersionInfo>> {
        &self.vcf_versions
    }
    /// Appends an item to `instance_type_esx_versions`.
    ///
    /// To override the contents of this collection use [`set_instance_type_esx_versions`](Self::set_instance_type_esx_versions).
    ///
    /// <p>A list of EC2 instance types and their available ESX versions.</p>
    pub fn instance_type_esx_versions(mut self, input: crate::types::InstanceTypeEsxVersionsInfo) -> Self {
        let mut v = self.instance_type_esx_versions.unwrap_or_default();
        v.push(input);
        self.instance_type_esx_versions = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of EC2 instance types and their available ESX versions.</p>
    pub fn set_instance_type_esx_versions(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>>,
    ) -> Self {
        self.instance_type_esx_versions = input;
        self
    }
    /// <p>A list of EC2 instance types and their available ESX versions.</p>
    pub fn get_instance_type_esx_versions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>> {
        &self.instance_type_esx_versions
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetVersionsOutput`](crate::operation::get_versions::GetVersionsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`vcf_versions`](crate::operation::get_versions::builders::GetVersionsOutputBuilder::vcf_versions)
    /// - [`instance_type_esx_versions`](crate::operation::get_versions::builders::GetVersionsOutputBuilder::instance_type_esx_versions)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_versions::GetVersionsOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_versions::GetVersionsOutput {
            vcf_versions: self.vcf_versions.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "vcf_versions",
                    "vcf_versions was not specified but it is required when building GetVersionsOutput",
                )
            })?,
            instance_type_esx_versions: self.instance_type_esx_versions.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "instance_type_esx_versions",
                    "instance_type_esx_versions was not specified but it is required when building GetVersionsOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}