aws_sdk_deadline/types/
_service_managed_ec2_instance_market_options.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The details of the Amazon EC2 instance market options for a service managed fleet.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ServiceManagedEc2InstanceMarketOptions {
7    /// <p>The Amazon EC2 instance type.</p>
8    pub r#type: crate::types::Ec2MarketType,
9}
10impl ServiceManagedEc2InstanceMarketOptions {
11    /// <p>The Amazon EC2 instance type.</p>
12    pub fn r#type(&self) -> &crate::types::Ec2MarketType {
13        &self.r#type
14    }
15}
16impl ServiceManagedEc2InstanceMarketOptions {
17    /// Creates a new builder-style object to manufacture [`ServiceManagedEc2InstanceMarketOptions`](crate::types::ServiceManagedEc2InstanceMarketOptions).
18    pub fn builder() -> crate::types::builders::ServiceManagedEc2InstanceMarketOptionsBuilder {
19        crate::types::builders::ServiceManagedEc2InstanceMarketOptionsBuilder::default()
20    }
21}
22
23/// A builder for [`ServiceManagedEc2InstanceMarketOptions`](crate::types::ServiceManagedEc2InstanceMarketOptions).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct ServiceManagedEc2InstanceMarketOptionsBuilder {
27    pub(crate) r#type: ::std::option::Option<crate::types::Ec2MarketType>,
28}
29impl ServiceManagedEc2InstanceMarketOptionsBuilder {
30    /// <p>The Amazon EC2 instance type.</p>
31    /// This field is required.
32    pub fn r#type(mut self, input: crate::types::Ec2MarketType) -> Self {
33        self.r#type = ::std::option::Option::Some(input);
34        self
35    }
36    /// <p>The Amazon EC2 instance type.</p>
37    pub fn set_type(mut self, input: ::std::option::Option<crate::types::Ec2MarketType>) -> Self {
38        self.r#type = input;
39        self
40    }
41    /// <p>The Amazon EC2 instance type.</p>
42    pub fn get_type(&self) -> &::std::option::Option<crate::types::Ec2MarketType> {
43        &self.r#type
44    }
45    /// Consumes the builder and constructs a [`ServiceManagedEc2InstanceMarketOptions`](crate::types::ServiceManagedEc2InstanceMarketOptions).
46    /// This method will fail if any of the following fields are not set:
47    /// - [`r#type`](crate::types::builders::ServiceManagedEc2InstanceMarketOptionsBuilder::type)
48    pub fn build(
49        self,
50    ) -> ::std::result::Result<crate::types::ServiceManagedEc2InstanceMarketOptions, ::aws_smithy_types::error::operation::BuildError> {
51        ::std::result::Result::Ok(crate::types::ServiceManagedEc2InstanceMarketOptions {
52            r#type: self.r#type.ok_or_else(|| {
53                ::aws_smithy_types::error::operation::BuildError::missing_field(
54                    "r#type",
55                    "r#type was not specified but it is required when building ServiceManagedEc2InstanceMarketOptions",
56                )
57            })?,
58        })
59    }
60}