Skip to main content

aws_sdk_ec2/types/
_target_reservation_value.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The total value of the new Convertible Reserved Instances.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TargetReservationValue {
7    /// <p>The total value of the Convertible Reserved Instances that make up the exchange. This is the sum of the list value, remaining upfront price, and additional upfront cost of the exchange.</p>
8    pub reservation_value: ::std::option::Option<crate::types::ReservationValue>,
9    /// <p>The configuration of the Convertible Reserved Instances that make up the exchange.</p>
10    pub target_configuration: ::std::option::Option<crate::types::TargetConfiguration>,
11}
12impl TargetReservationValue {
13    /// <p>The total value of the Convertible Reserved Instances that make up the exchange. This is the sum of the list value, remaining upfront price, and additional upfront cost of the exchange.</p>
14    pub fn reservation_value(&self) -> ::std::option::Option<&crate::types::ReservationValue> {
15        self.reservation_value.as_ref()
16    }
17    /// <p>The configuration of the Convertible Reserved Instances that make up the exchange.</p>
18    pub fn target_configuration(&self) -> ::std::option::Option<&crate::types::TargetConfiguration> {
19        self.target_configuration.as_ref()
20    }
21}
22impl TargetReservationValue {
23    /// Creates a new builder-style object to manufacture [`TargetReservationValue`](crate::types::TargetReservationValue).
24    pub fn builder() -> crate::types::builders::TargetReservationValueBuilder {
25        crate::types::builders::TargetReservationValueBuilder::default()
26    }
27}
28
29/// A builder for [`TargetReservationValue`](crate::types::TargetReservationValue).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct TargetReservationValueBuilder {
33    pub(crate) reservation_value: ::std::option::Option<crate::types::ReservationValue>,
34    pub(crate) target_configuration: ::std::option::Option<crate::types::TargetConfiguration>,
35}
36impl TargetReservationValueBuilder {
37    /// <p>The total value of the Convertible Reserved Instances that make up the exchange. This is the sum of the list value, remaining upfront price, and additional upfront cost of the exchange.</p>
38    pub fn reservation_value(mut self, input: crate::types::ReservationValue) -> Self {
39        self.reservation_value = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The total value of the Convertible Reserved Instances that make up the exchange. This is the sum of the list value, remaining upfront price, and additional upfront cost of the exchange.</p>
43    pub fn set_reservation_value(mut self, input: ::std::option::Option<crate::types::ReservationValue>) -> Self {
44        self.reservation_value = input;
45        self
46    }
47    /// <p>The total value of the Convertible Reserved Instances that make up the exchange. This is the sum of the list value, remaining upfront price, and additional upfront cost of the exchange.</p>
48    pub fn get_reservation_value(&self) -> &::std::option::Option<crate::types::ReservationValue> {
49        &self.reservation_value
50    }
51    /// <p>The configuration of the Convertible Reserved Instances that make up the exchange.</p>
52    pub fn target_configuration(mut self, input: crate::types::TargetConfiguration) -> Self {
53        self.target_configuration = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The configuration of the Convertible Reserved Instances that make up the exchange.</p>
57    pub fn set_target_configuration(mut self, input: ::std::option::Option<crate::types::TargetConfiguration>) -> Self {
58        self.target_configuration = input;
59        self
60    }
61    /// <p>The configuration of the Convertible Reserved Instances that make up the exchange.</p>
62    pub fn get_target_configuration(&self) -> &::std::option::Option<crate::types::TargetConfiguration> {
63        &self.target_configuration
64    }
65    /// Consumes the builder and constructs a [`TargetReservationValue`](crate::types::TargetReservationValue).
66    pub fn build(self) -> crate::types::TargetReservationValue {
67        crate::types::TargetReservationValue {
68            reservation_value: self.reservation_value,
69            target_configuration: self.target_configuration,
70        }
71    }
72}