aws_sdk_budgets/operation/create_subscriber/
_create_subscriber_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request of CreateSubscriber</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateSubscriberInput {
7    /// <p>The <code>accountId</code> that is associated with the budget that you want to create a subscriber for.</p>
8    pub account_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the budget that you want to subscribe to. Budget names must be unique within an account.</p>
10    pub budget_name: ::std::option::Option<::std::string::String>,
11    /// <p>The notification that you want to create a subscriber for.</p>
12    pub notification: ::std::option::Option<crate::types::Notification>,
13    /// <p>The subscriber that you want to associate with a budget notification.</p>
14    pub subscriber: ::std::option::Option<crate::types::Subscriber>,
15}
16impl CreateSubscriberInput {
17    /// <p>The <code>accountId</code> that is associated with the budget that you want to create a subscriber for.</p>
18    pub fn account_id(&self) -> ::std::option::Option<&str> {
19        self.account_id.as_deref()
20    }
21    /// <p>The name of the budget that you want to subscribe to. Budget names must be unique within an account.</p>
22    pub fn budget_name(&self) -> ::std::option::Option<&str> {
23        self.budget_name.as_deref()
24    }
25    /// <p>The notification that you want to create a subscriber for.</p>
26    pub fn notification(&self) -> ::std::option::Option<&crate::types::Notification> {
27        self.notification.as_ref()
28    }
29    /// <p>The subscriber that you want to associate with a budget notification.</p>
30    pub fn subscriber(&self) -> ::std::option::Option<&crate::types::Subscriber> {
31        self.subscriber.as_ref()
32    }
33}
34impl CreateSubscriberInput {
35    /// Creates a new builder-style object to manufacture [`CreateSubscriberInput`](crate::operation::create_subscriber::CreateSubscriberInput).
36    pub fn builder() -> crate::operation::create_subscriber::builders::CreateSubscriberInputBuilder {
37        crate::operation::create_subscriber::builders::CreateSubscriberInputBuilder::default()
38    }
39}
40
41/// A builder for [`CreateSubscriberInput`](crate::operation::create_subscriber::CreateSubscriberInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct CreateSubscriberInputBuilder {
45    pub(crate) account_id: ::std::option::Option<::std::string::String>,
46    pub(crate) budget_name: ::std::option::Option<::std::string::String>,
47    pub(crate) notification: ::std::option::Option<crate::types::Notification>,
48    pub(crate) subscriber: ::std::option::Option<crate::types::Subscriber>,
49}
50impl CreateSubscriberInputBuilder {
51    /// <p>The <code>accountId</code> that is associated with the budget that you want to create a subscriber for.</p>
52    /// This field is required.
53    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.account_id = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The <code>accountId</code> that is associated with the budget that you want to create a subscriber for.</p>
58    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.account_id = input;
60        self
61    }
62    /// <p>The <code>accountId</code> that is associated with the budget that you want to create a subscriber for.</p>
63    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
64        &self.account_id
65    }
66    /// <p>The name of the budget that you want to subscribe to. Budget names must be unique within an account.</p>
67    /// This field is required.
68    pub fn budget_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.budget_name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The name of the budget that you want to subscribe to. Budget names must be unique within an account.</p>
73    pub fn set_budget_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.budget_name = input;
75        self
76    }
77    /// <p>The name of the budget that you want to subscribe to. Budget names must be unique within an account.</p>
78    pub fn get_budget_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.budget_name
80    }
81    /// <p>The notification that you want to create a subscriber for.</p>
82    /// This field is required.
83    pub fn notification(mut self, input: crate::types::Notification) -> Self {
84        self.notification = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>The notification that you want to create a subscriber for.</p>
88    pub fn set_notification(mut self, input: ::std::option::Option<crate::types::Notification>) -> Self {
89        self.notification = input;
90        self
91    }
92    /// <p>The notification that you want to create a subscriber for.</p>
93    pub fn get_notification(&self) -> &::std::option::Option<crate::types::Notification> {
94        &self.notification
95    }
96    /// <p>The subscriber that you want to associate with a budget notification.</p>
97    /// This field is required.
98    pub fn subscriber(mut self, input: crate::types::Subscriber) -> Self {
99        self.subscriber = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The subscriber that you want to associate with a budget notification.</p>
103    pub fn set_subscriber(mut self, input: ::std::option::Option<crate::types::Subscriber>) -> Self {
104        self.subscriber = input;
105        self
106    }
107    /// <p>The subscriber that you want to associate with a budget notification.</p>
108    pub fn get_subscriber(&self) -> &::std::option::Option<crate::types::Subscriber> {
109        &self.subscriber
110    }
111    /// Consumes the builder and constructs a [`CreateSubscriberInput`](crate::operation::create_subscriber::CreateSubscriberInput).
112    pub fn build(
113        self,
114    ) -> ::std::result::Result<crate::operation::create_subscriber::CreateSubscriberInput, ::aws_smithy_types::error::operation::BuildError> {
115        ::std::result::Result::Ok(crate::operation::create_subscriber::CreateSubscriberInput {
116            account_id: self.account_id,
117            budget_name: self.budget_name,
118            notification: self.notification,
119            subscriber: self.subscriber,
120        })
121    }
122}