aws_sdk_eventbridge/operation/cancel_replay/
_cancel_replay_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 CancelReplayOutput {
6    /// <p>The ARN of the replay to cancel.</p>
7    pub replay_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The current state of the replay.</p>
9    pub state: ::std::option::Option<crate::types::ReplayState>,
10    /// <p>The reason that the replay is in the current state.</p>
11    pub state_reason: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl CancelReplayOutput {
15    /// <p>The ARN of the replay to cancel.</p>
16    pub fn replay_arn(&self) -> ::std::option::Option<&str> {
17        self.replay_arn.as_deref()
18    }
19    /// <p>The current state of the replay.</p>
20    pub fn state(&self) -> ::std::option::Option<&crate::types::ReplayState> {
21        self.state.as_ref()
22    }
23    /// <p>The reason that the replay is in the current state.</p>
24    pub fn state_reason(&self) -> ::std::option::Option<&str> {
25        self.state_reason.as_deref()
26    }
27}
28impl ::aws_types::request_id::RequestId for CancelReplayOutput {
29    fn request_id(&self) -> Option<&str> {
30        self._request_id.as_deref()
31    }
32}
33impl CancelReplayOutput {
34    /// Creates a new builder-style object to manufacture [`CancelReplayOutput`](crate::operation::cancel_replay::CancelReplayOutput).
35    pub fn builder() -> crate::operation::cancel_replay::builders::CancelReplayOutputBuilder {
36        crate::operation::cancel_replay::builders::CancelReplayOutputBuilder::default()
37    }
38}
39
40/// A builder for [`CancelReplayOutput`](crate::operation::cancel_replay::CancelReplayOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CancelReplayOutputBuilder {
44    pub(crate) replay_arn: ::std::option::Option<::std::string::String>,
45    pub(crate) state: ::std::option::Option<crate::types::ReplayState>,
46    pub(crate) state_reason: ::std::option::Option<::std::string::String>,
47    _request_id: Option<String>,
48}
49impl CancelReplayOutputBuilder {
50    /// <p>The ARN of the replay to cancel.</p>
51    pub fn replay_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.replay_arn = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// <p>The ARN of the replay to cancel.</p>
56    pub fn set_replay_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.replay_arn = input;
58        self
59    }
60    /// <p>The ARN of the replay to cancel.</p>
61    pub fn get_replay_arn(&self) -> &::std::option::Option<::std::string::String> {
62        &self.replay_arn
63    }
64    /// <p>The current state of the replay.</p>
65    pub fn state(mut self, input: crate::types::ReplayState) -> Self {
66        self.state = ::std::option::Option::Some(input);
67        self
68    }
69    /// <p>The current state of the replay.</p>
70    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ReplayState>) -> Self {
71        self.state = input;
72        self
73    }
74    /// <p>The current state of the replay.</p>
75    pub fn get_state(&self) -> &::std::option::Option<crate::types::ReplayState> {
76        &self.state
77    }
78    /// <p>The reason that the replay is in the current state.</p>
79    pub fn state_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.state_reason = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <p>The reason that the replay is in the current state.</p>
84    pub fn set_state_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.state_reason = input;
86        self
87    }
88    /// <p>The reason that the replay is in the current state.</p>
89    pub fn get_state_reason(&self) -> &::std::option::Option<::std::string::String> {
90        &self.state_reason
91    }
92    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93        self._request_id = Some(request_id.into());
94        self
95    }
96
97    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98        self._request_id = request_id;
99        self
100    }
101    /// Consumes the builder and constructs a [`CancelReplayOutput`](crate::operation::cancel_replay::CancelReplayOutput).
102    pub fn build(self) -> crate::operation::cancel_replay::CancelReplayOutput {
103        crate::operation::cancel_replay::CancelReplayOutput {
104            replay_arn: self.replay_arn,
105            state: self.state,
106            state_reason: self.state_reason,
107            _request_id: self._request_id,
108        }
109    }
110}