aws_sdk_connect/operation/create_rule/
_create_rule_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateRuleOutput {
6 pub rule_arn: ::std::string::String,
8 pub rule_id: ::std::string::String,
10 _request_id: Option<String>,
11}
12impl CreateRuleOutput {
13 pub fn rule_arn(&self) -> &str {
15 use std::ops::Deref;
16 self.rule_arn.deref()
17 }
18 pub fn rule_id(&self) -> &str {
20 use std::ops::Deref;
21 self.rule_id.deref()
22 }
23}
24impl ::aws_types::request_id::RequestId for CreateRuleOutput {
25 fn request_id(&self) -> Option<&str> {
26 self._request_id.as_deref()
27 }
28}
29impl CreateRuleOutput {
30 pub fn builder() -> crate::operation::create_rule::builders::CreateRuleOutputBuilder {
32 crate::operation::create_rule::builders::CreateRuleOutputBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateRuleOutputBuilder {
40 pub(crate) rule_arn: ::std::option::Option<::std::string::String>,
41 pub(crate) rule_id: ::std::option::Option<::std::string::String>,
42 _request_id: Option<String>,
43}
44impl CreateRuleOutputBuilder {
45 pub fn rule_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.rule_arn = ::std::option::Option::Some(input.into());
49 self
50 }
51 pub fn set_rule_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.rule_arn = input;
54 self
55 }
56 pub fn get_rule_arn(&self) -> &::std::option::Option<::std::string::String> {
58 &self.rule_arn
59 }
60 pub fn rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63 self.rule_id = ::std::option::Option::Some(input.into());
64 self
65 }
66 pub fn set_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68 self.rule_id = input;
69 self
70 }
71 pub fn get_rule_id(&self) -> &::std::option::Option<::std::string::String> {
73 &self.rule_id
74 }
75 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
76 self._request_id = Some(request_id.into());
77 self
78 }
79
80 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
81 self._request_id = request_id;
82 self
83 }
84 pub fn build(self) -> ::std::result::Result<crate::operation::create_rule::CreateRuleOutput, ::aws_smithy_types::error::operation::BuildError> {
89 ::std::result::Result::Ok(crate::operation::create_rule::CreateRuleOutput {
90 rule_arn: self.rule_arn.ok_or_else(|| {
91 ::aws_smithy_types::error::operation::BuildError::missing_field(
92 "rule_arn",
93 "rule_arn was not specified but it is required when building CreateRuleOutput",
94 )
95 })?,
96 rule_id: self.rule_id.ok_or_else(|| {
97 ::aws_smithy_types::error::operation::BuildError::missing_field(
98 "rule_id",
99 "rule_id was not specified but it is required when building CreateRuleOutput",
100 )
101 })?,
102 _request_id: self._request_id,
103 })
104 }
105}