aws_sdk_wafv2/operation/get_ip_set/_get_ip_set_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 GetIpSetOutput {
6 /// <p></p>
7 pub ip_set: ::std::option::Option<crate::types::IpSet>,
8 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
9 pub lock_token: ::std::option::Option<::std::string::String>,
10 _request_id: Option<String>,
11}
12impl GetIpSetOutput {
13 /// <p></p>
14 pub fn ip_set(&self) -> ::std::option::Option<&crate::types::IpSet> {
15 self.ip_set.as_ref()
16 }
17 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
18 pub fn lock_token(&self) -> ::std::option::Option<&str> {
19 self.lock_token.as_deref()
20 }
21}
22impl ::aws_types::request_id::RequestId for GetIpSetOutput {
23 fn request_id(&self) -> Option<&str> {
24 self._request_id.as_deref()
25 }
26}
27impl GetIpSetOutput {
28 /// Creates a new builder-style object to manufacture [`GetIpSetOutput`](crate::operation::get_ip_set::GetIpSetOutput).
29 pub fn builder() -> crate::operation::get_ip_set::builders::GetIpSetOutputBuilder {
30 crate::operation::get_ip_set::builders::GetIpSetOutputBuilder::default()
31 }
32}
33
34/// A builder for [`GetIpSetOutput`](crate::operation::get_ip_set::GetIpSetOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GetIpSetOutputBuilder {
38 pub(crate) ip_set: ::std::option::Option<crate::types::IpSet>,
39 pub(crate) lock_token: ::std::option::Option<::std::string::String>,
40 _request_id: Option<String>,
41}
42impl GetIpSetOutputBuilder {
43 /// <p></p>
44 pub fn ip_set(mut self, input: crate::types::IpSet) -> Self {
45 self.ip_set = ::std::option::Option::Some(input);
46 self
47 }
48 /// <p></p>
49 pub fn set_ip_set(mut self, input: ::std::option::Option<crate::types::IpSet>) -> Self {
50 self.ip_set = input;
51 self
52 }
53 /// <p></p>
54 pub fn get_ip_set(&self) -> &::std::option::Option<crate::types::IpSet> {
55 &self.ip_set
56 }
57 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
58 pub fn lock_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59 self.lock_token = ::std::option::Option::Some(input.into());
60 self
61 }
62 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
63 pub fn set_lock_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64 self.lock_token = input;
65 self
66 }
67 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
68 pub fn get_lock_token(&self) -> &::std::option::Option<::std::string::String> {
69 &self.lock_token
70 }
71 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
72 self._request_id = Some(request_id.into());
73 self
74 }
75
76 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
77 self._request_id = request_id;
78 self
79 }
80 /// Consumes the builder and constructs a [`GetIpSetOutput`](crate::operation::get_ip_set::GetIpSetOutput).
81 pub fn build(self) -> crate::operation::get_ip_set::GetIpSetOutput {
82 crate::operation::get_ip_set::GetIpSetOutput {
83 ip_set: self.ip_set,
84 lock_token: self.lock_token,
85 _request_id: self._request_id,
86 }
87 }
88}