aws_sdk_m2/types/
_engine_versions_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A subset of information about the engine version for a specific application.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EngineVersionsSummary {
7    /// <p>The type of target platform for the application.</p>
8    pub engine_type: ::std::string::String,
9    /// <p>The version of the engine type used by the application.</p>
10    pub engine_version: ::std::string::String,
11}
12impl EngineVersionsSummary {
13    /// <p>The type of target platform for the application.</p>
14    pub fn engine_type(&self) -> &str {
15        use std::ops::Deref;
16        self.engine_type.deref()
17    }
18    /// <p>The version of the engine type used by the application.</p>
19    pub fn engine_version(&self) -> &str {
20        use std::ops::Deref;
21        self.engine_version.deref()
22    }
23}
24impl EngineVersionsSummary {
25    /// Creates a new builder-style object to manufacture [`EngineVersionsSummary`](crate::types::EngineVersionsSummary).
26    pub fn builder() -> crate::types::builders::EngineVersionsSummaryBuilder {
27        crate::types::builders::EngineVersionsSummaryBuilder::default()
28    }
29}
30
31/// A builder for [`EngineVersionsSummary`](crate::types::EngineVersionsSummary).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct EngineVersionsSummaryBuilder {
35    pub(crate) engine_type: ::std::option::Option<::std::string::String>,
36    pub(crate) engine_version: ::std::option::Option<::std::string::String>,
37}
38impl EngineVersionsSummaryBuilder {
39    /// <p>The type of target platform for the application.</p>
40    /// This field is required.
41    pub fn engine_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.engine_type = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>The type of target platform for the application.</p>
46    pub fn set_engine_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47        self.engine_type = input;
48        self
49    }
50    /// <p>The type of target platform for the application.</p>
51    pub fn get_engine_type(&self) -> &::std::option::Option<::std::string::String> {
52        &self.engine_type
53    }
54    /// <p>The version of the engine type used by the application.</p>
55    /// This field is required.
56    pub fn engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.engine_version = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The version of the engine type used by the application.</p>
61    pub fn set_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.engine_version = input;
63        self
64    }
65    /// <p>The version of the engine type used by the application.</p>
66    pub fn get_engine_version(&self) -> &::std::option::Option<::std::string::String> {
67        &self.engine_version
68    }
69    /// Consumes the builder and constructs a [`EngineVersionsSummary`](crate::types::EngineVersionsSummary).
70    /// This method will fail if any of the following fields are not set:
71    /// - [`engine_type`](crate::types::builders::EngineVersionsSummaryBuilder::engine_type)
72    /// - [`engine_version`](crate::types::builders::EngineVersionsSummaryBuilder::engine_version)
73    pub fn build(self) -> ::std::result::Result<crate::types::EngineVersionsSummary, ::aws_smithy_types::error::operation::BuildError> {
74        ::std::result::Result::Ok(crate::types::EngineVersionsSummary {
75            engine_type: self.engine_type.ok_or_else(|| {
76                ::aws_smithy_types::error::operation::BuildError::missing_field(
77                    "engine_type",
78                    "engine_type was not specified but it is required when building EngineVersionsSummary",
79                )
80            })?,
81            engine_version: self.engine_version.ok_or_else(|| {
82                ::aws_smithy_types::error::operation::BuildError::missing_field(
83                    "engine_version",
84                    "engine_version was not specified but it is required when building EngineVersionsSummary",
85                )
86            })?,
87        })
88    }
89}