aws_sdk_devicefarm/operation/purchase_offering/
_purchase_offering_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a request for a purchase offering.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PurchaseOfferingInput {
7    /// <p>The ID of the offering.</p>
8    pub offering_id: ::std::option::Option<::std::string::String>,
9    /// <p>The number of device slots to purchase in an offering request.</p>
10    pub quantity: ::std::option::Option<i32>,
11    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
12    pub offering_promotion_id: ::std::option::Option<::std::string::String>,
13}
14impl PurchaseOfferingInput {
15    /// <p>The ID of the offering.</p>
16    pub fn offering_id(&self) -> ::std::option::Option<&str> {
17        self.offering_id.as_deref()
18    }
19    /// <p>The number of device slots to purchase in an offering request.</p>
20    pub fn quantity(&self) -> ::std::option::Option<i32> {
21        self.quantity
22    }
23    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
24    pub fn offering_promotion_id(&self) -> ::std::option::Option<&str> {
25        self.offering_promotion_id.as_deref()
26    }
27}
28impl PurchaseOfferingInput {
29    /// Creates a new builder-style object to manufacture [`PurchaseOfferingInput`](crate::operation::purchase_offering::PurchaseOfferingInput).
30    pub fn builder() -> crate::operation::purchase_offering::builders::PurchaseOfferingInputBuilder {
31        crate::operation::purchase_offering::builders::PurchaseOfferingInputBuilder::default()
32    }
33}
34
35/// A builder for [`PurchaseOfferingInput`](crate::operation::purchase_offering::PurchaseOfferingInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct PurchaseOfferingInputBuilder {
39    pub(crate) offering_id: ::std::option::Option<::std::string::String>,
40    pub(crate) quantity: ::std::option::Option<i32>,
41    pub(crate) offering_promotion_id: ::std::option::Option<::std::string::String>,
42}
43impl PurchaseOfferingInputBuilder {
44    /// <p>The ID of the offering.</p>
45    /// This field is required.
46    pub fn offering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.offering_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The ID of the offering.</p>
51    pub fn set_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.offering_id = input;
53        self
54    }
55    /// <p>The ID of the offering.</p>
56    pub fn get_offering_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.offering_id
58    }
59    /// <p>The number of device slots to purchase in an offering request.</p>
60    /// This field is required.
61    pub fn quantity(mut self, input: i32) -> Self {
62        self.quantity = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The number of device slots to purchase in an offering request.</p>
66    pub fn set_quantity(mut self, input: ::std::option::Option<i32>) -> Self {
67        self.quantity = input;
68        self
69    }
70    /// <p>The number of device slots to purchase in an offering request.</p>
71    pub fn get_quantity(&self) -> &::std::option::Option<i32> {
72        &self.quantity
73    }
74    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
75    pub fn offering_promotion_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.offering_promotion_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
80    pub fn set_offering_promotion_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.offering_promotion_id = input;
82        self
83    }
84    /// <p>The ID of the offering promotion to be applied to the purchase.</p>
85    pub fn get_offering_promotion_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.offering_promotion_id
87    }
88    /// Consumes the builder and constructs a [`PurchaseOfferingInput`](crate::operation::purchase_offering::PurchaseOfferingInput).
89    pub fn build(
90        self,
91    ) -> ::std::result::Result<crate::operation::purchase_offering::PurchaseOfferingInput, ::aws_smithy_types::error::operation::BuildError> {
92        ::std::result::Result::Ok(crate::operation::purchase_offering::PurchaseOfferingInput {
93            offering_id: self.offering_id,
94            quantity: self.quantity,
95            offering_promotion_id: self.offering_promotion_id,
96        })
97    }
98}