Skip to main content

aws_sdk_evs/operation/get_versions/
_get_versions_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetVersionsOutput {
6    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
7    pub vcf_versions: ::std::vec::Vec<crate::types::VcfVersionInfo>,
8    /// <p>A list of EC2 instance types and their available ESX versions.</p>
9    pub instance_type_esx_versions: ::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>,
10    _request_id: Option<String>,
11}
12impl GetVersionsOutput {
13    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
14    pub fn vcf_versions(&self) -> &[crate::types::VcfVersionInfo] {
15        use std::ops::Deref;
16        self.vcf_versions.deref()
17    }
18    /// <p>A list of EC2 instance types and their available ESX versions.</p>
19    pub fn instance_type_esx_versions(&self) -> &[crate::types::InstanceTypeEsxVersionsInfo] {
20        use std::ops::Deref;
21        self.instance_type_esx_versions.deref()
22    }
23}
24impl ::aws_types::request_id::RequestId for GetVersionsOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl GetVersionsOutput {
30    /// Creates a new builder-style object to manufacture [`GetVersionsOutput`](crate::operation::get_versions::GetVersionsOutput).
31    pub fn builder() -> crate::operation::get_versions::builders::GetVersionsOutputBuilder {
32        crate::operation::get_versions::builders::GetVersionsOutputBuilder::default()
33    }
34}
35
36/// A builder for [`GetVersionsOutput`](crate::operation::get_versions::GetVersionsOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct GetVersionsOutputBuilder {
40    pub(crate) vcf_versions: ::std::option::Option<::std::vec::Vec<crate::types::VcfVersionInfo>>,
41    pub(crate) instance_type_esx_versions: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>>,
42    _request_id: Option<String>,
43}
44impl GetVersionsOutputBuilder {
45    /// Appends an item to `vcf_versions`.
46    ///
47    /// To override the contents of this collection use [`set_vcf_versions`](Self::set_vcf_versions).
48    ///
49    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
50    pub fn vcf_versions(mut self, input: crate::types::VcfVersionInfo) -> Self {
51        let mut v = self.vcf_versions.unwrap_or_default();
52        v.push(input);
53        self.vcf_versions = ::std::option::Option::Some(v);
54        self
55    }
56    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
57    pub fn set_vcf_versions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VcfVersionInfo>>) -> Self {
58        self.vcf_versions = input;
59        self
60    }
61    /// <p>A list of VCF versions with their availability status, default ESX version, and instance types.</p>
62    pub fn get_vcf_versions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VcfVersionInfo>> {
63        &self.vcf_versions
64    }
65    /// Appends an item to `instance_type_esx_versions`.
66    ///
67    /// To override the contents of this collection use [`set_instance_type_esx_versions`](Self::set_instance_type_esx_versions).
68    ///
69    /// <p>A list of EC2 instance types and their available ESX versions.</p>
70    pub fn instance_type_esx_versions(mut self, input: crate::types::InstanceTypeEsxVersionsInfo) -> Self {
71        let mut v = self.instance_type_esx_versions.unwrap_or_default();
72        v.push(input);
73        self.instance_type_esx_versions = ::std::option::Option::Some(v);
74        self
75    }
76    /// <p>A list of EC2 instance types and their available ESX versions.</p>
77    pub fn set_instance_type_esx_versions(
78        mut self,
79        input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>>,
80    ) -> Self {
81        self.instance_type_esx_versions = input;
82        self
83    }
84    /// <p>A list of EC2 instance types and their available ESX versions.</p>
85    pub fn get_instance_type_esx_versions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeEsxVersionsInfo>> {
86        &self.instance_type_esx_versions
87    }
88    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
89        self._request_id = Some(request_id.into());
90        self
91    }
92
93    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
94        self._request_id = request_id;
95        self
96    }
97    /// Consumes the builder and constructs a [`GetVersionsOutput`](crate::operation::get_versions::GetVersionsOutput).
98    /// This method will fail if any of the following fields are not set:
99    /// - [`vcf_versions`](crate::operation::get_versions::builders::GetVersionsOutputBuilder::vcf_versions)
100    /// - [`instance_type_esx_versions`](crate::operation::get_versions::builders::GetVersionsOutputBuilder::instance_type_esx_versions)
101    pub fn build(self) -> ::std::result::Result<crate::operation::get_versions::GetVersionsOutput, ::aws_smithy_types::error::operation::BuildError> {
102        ::std::result::Result::Ok(crate::operation::get_versions::GetVersionsOutput {
103            vcf_versions: self.vcf_versions.ok_or_else(|| {
104                ::aws_smithy_types::error::operation::BuildError::missing_field(
105                    "vcf_versions",
106                    "vcf_versions was not specified but it is required when building GetVersionsOutput",
107                )
108            })?,
109            instance_type_esx_versions: self.instance_type_esx_versions.ok_or_else(|| {
110                ::aws_smithy_types::error::operation::BuildError::missing_field(
111                    "instance_type_esx_versions",
112                    "instance_type_esx_versions was not specified but it is required when building GetVersionsOutput",
113                )
114            })?,
115            _request_id: self._request_id,
116        })
117    }
118}