1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents a request for a purchase offering.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PurchaseOfferingInput {
    /// <p>The ID of the offering.</p>
    #[doc(hidden)]
    pub offering_id: std::option::Option<std::string::String>,
    /// <p>The number of device slots to purchase in an offering request.</p>
    #[doc(hidden)]
    pub quantity: std::option::Option<i32>,
    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
    #[doc(hidden)]
    pub offering_promotion_id: std::option::Option<std::string::String>,
}
impl PurchaseOfferingInput {
    /// <p>The ID of the offering.</p>
    pub fn offering_id(&self) -> std::option::Option<&str> {
        self.offering_id.as_deref()
    }
    /// <p>The number of device slots to purchase in an offering request.</p>
    pub fn quantity(&self) -> std::option::Option<i32> {
        self.quantity
    }
    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
    pub fn offering_promotion_id(&self) -> std::option::Option<&str> {
        self.offering_promotion_id.as_deref()
    }
}
impl PurchaseOfferingInput {
    /// Creates a new builder-style object to manufacture [`PurchaseOfferingInput`](crate::operation::purchase_offering::PurchaseOfferingInput).
    pub fn builder() -> crate::operation::purchase_offering::builders::PurchaseOfferingInputBuilder
    {
        crate::operation::purchase_offering::builders::PurchaseOfferingInputBuilder::default()
    }
}

/// A builder for [`PurchaseOfferingInput`](crate::operation::purchase_offering::PurchaseOfferingInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct PurchaseOfferingInputBuilder {
    pub(crate) offering_id: std::option::Option<std::string::String>,
    pub(crate) quantity: std::option::Option<i32>,
    pub(crate) offering_promotion_id: std::option::Option<std::string::String>,
}
impl PurchaseOfferingInputBuilder {
    /// <p>The ID of the offering.</p>
    pub fn offering_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.offering_id = Some(input.into());
        self
    }
    /// <p>The ID of the offering.</p>
    pub fn set_offering_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.offering_id = input;
        self
    }
    /// <p>The number of device slots to purchase in an offering request.</p>
    pub fn quantity(mut self, input: i32) -> Self {
        self.quantity = Some(input);
        self
    }
    /// <p>The number of device slots to purchase in an offering request.</p>
    pub fn set_quantity(mut self, input: std::option::Option<i32>) -> Self {
        self.quantity = input;
        self
    }
    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
    pub fn offering_promotion_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.offering_promotion_id = Some(input.into());
        self
    }
    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
    pub fn set_offering_promotion_id(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.offering_promotion_id = input;
        self
    }
    /// Consumes the builder and constructs a [`PurchaseOfferingInput`](crate::operation::purchase_offering::PurchaseOfferingInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::purchase_offering::PurchaseOfferingInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::purchase_offering::PurchaseOfferingInput {
            offering_id: self.offering_id,
            quantity: self.quantity,
            offering_promotion_id: self.offering_promotion_id,
        })
    }
}