aws_sdk_networkfirewall/operation/update_rule_group/
_update_rule_group_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateRuleGroupOutput {
6    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
7    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
8    pub update_token: ::std::string::String,
9    /// <p>The high-level properties of a rule group. This, along with the <code>RuleGroup</code>, define the rule group. You can retrieve all objects for a rule group by calling <code>DescribeRuleGroup</code>.</p>
10    pub rule_group_response: ::std::option::Option<crate::types::RuleGroupResponse>,
11    _request_id: Option<String>,
12}
13impl UpdateRuleGroupOutput {
14    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
15    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
16    pub fn update_token(&self) -> &str {
17        use std::ops::Deref;
18        self.update_token.deref()
19    }
20    /// <p>The high-level properties of a rule group. This, along with the <code>RuleGroup</code>, define the rule group. You can retrieve all objects for a rule group by calling <code>DescribeRuleGroup</code>.</p>
21    pub fn rule_group_response(&self) -> ::std::option::Option<&crate::types::RuleGroupResponse> {
22        self.rule_group_response.as_ref()
23    }
24}
25impl ::aws_types::request_id::RequestId for UpdateRuleGroupOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl UpdateRuleGroupOutput {
31    /// Creates a new builder-style object to manufacture [`UpdateRuleGroupOutput`](crate::operation::update_rule_group::UpdateRuleGroupOutput).
32    pub fn builder() -> crate::operation::update_rule_group::builders::UpdateRuleGroupOutputBuilder {
33        crate::operation::update_rule_group::builders::UpdateRuleGroupOutputBuilder::default()
34    }
35}
36
37/// A builder for [`UpdateRuleGroupOutput`](crate::operation::update_rule_group::UpdateRuleGroupOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct UpdateRuleGroupOutputBuilder {
41    pub(crate) update_token: ::std::option::Option<::std::string::String>,
42    pub(crate) rule_group_response: ::std::option::Option<crate::types::RuleGroupResponse>,
43    _request_id: Option<String>,
44}
45impl UpdateRuleGroupOutputBuilder {
46    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
47    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
48    /// This field is required.
49    pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.update_token = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
54    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
55    pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
56        self.update_token = input;
57        self
58    }
59    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
60    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
61    pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
62        &self.update_token
63    }
64    /// <p>The high-level properties of a rule group. This, along with the <code>RuleGroup</code>, define the rule group. You can retrieve all objects for a rule group by calling <code>DescribeRuleGroup</code>.</p>
65    /// This field is required.
66    pub fn rule_group_response(mut self, input: crate::types::RuleGroupResponse) -> Self {
67        self.rule_group_response = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The high-level properties of a rule group. This, along with the <code>RuleGroup</code>, define the rule group. You can retrieve all objects for a rule group by calling <code>DescribeRuleGroup</code>.</p>
71    pub fn set_rule_group_response(mut self, input: ::std::option::Option<crate::types::RuleGroupResponse>) -> Self {
72        self.rule_group_response = input;
73        self
74    }
75    /// <p>The high-level properties of a rule group. This, along with the <code>RuleGroup</code>, define the rule group. You can retrieve all objects for a rule group by calling <code>DescribeRuleGroup</code>.</p>
76    pub fn get_rule_group_response(&self) -> &::std::option::Option<crate::types::RuleGroupResponse> {
77        &self.rule_group_response
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`UpdateRuleGroupOutput`](crate::operation::update_rule_group::UpdateRuleGroupOutput).
89    /// This method will fail if any of the following fields are not set:
90    /// - [`update_token`](crate::operation::update_rule_group::builders::UpdateRuleGroupOutputBuilder::update_token)
91    pub fn build(
92        self,
93    ) -> ::std::result::Result<crate::operation::update_rule_group::UpdateRuleGroupOutput, ::aws_smithy_types::error::operation::BuildError> {
94        ::std::result::Result::Ok(crate::operation::update_rule_group::UpdateRuleGroupOutput {
95            update_token: self.update_token.ok_or_else(|| {
96                ::aws_smithy_types::error::operation::BuildError::missing_field(
97                    "update_token",
98                    "update_token was not specified but it is required when building UpdateRuleGroupOutput",
99                )
100            })?,
101            rule_group_response: self.rule_group_response,
102            _request_id: self._request_id,
103        })
104    }
105}