aws_sdk_codestarnotifications/operation/unsubscribe/
_unsubscribe_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 UnsubscribeOutput {
6    /// <p>The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.</p>
7    pub arn: ::std::string::String,
8    _request_id: Option<String>,
9}
10impl UnsubscribeOutput {
11    /// <p>The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.</p>
12    pub fn arn(&self) -> &str {
13        use std::ops::Deref;
14        self.arn.deref()
15    }
16}
17impl ::aws_types::request_id::RequestId for UnsubscribeOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl UnsubscribeOutput {
23    /// Creates a new builder-style object to manufacture [`UnsubscribeOutput`](crate::operation::unsubscribe::UnsubscribeOutput).
24    pub fn builder() -> crate::operation::unsubscribe::builders::UnsubscribeOutputBuilder {
25        crate::operation::unsubscribe::builders::UnsubscribeOutputBuilder::default()
26    }
27}
28
29/// A builder for [`UnsubscribeOutput`](crate::operation::unsubscribe::UnsubscribeOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct UnsubscribeOutputBuilder {
33    pub(crate) arn: ::std::option::Option<::std::string::String>,
34    _request_id: Option<String>,
35}
36impl UnsubscribeOutputBuilder {
37    /// <p>The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.</p>
38    /// This field is required.
39    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.arn = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.</p>
44    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.arn = input;
46        self
47    }
48    /// <p>The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.</p>
49    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
50        &self.arn
51    }
52    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
53        self._request_id = Some(request_id.into());
54        self
55    }
56
57    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
58        self._request_id = request_id;
59        self
60    }
61    /// Consumes the builder and constructs a [`UnsubscribeOutput`](crate::operation::unsubscribe::UnsubscribeOutput).
62    /// This method will fail if any of the following fields are not set:
63    /// - [`arn`](crate::operation::unsubscribe::builders::UnsubscribeOutputBuilder::arn)
64    pub fn build(self) -> ::std::result::Result<crate::operation::unsubscribe::UnsubscribeOutput, ::aws_smithy_types::error::operation::BuildError> {
65        ::std::result::Result::Ok(crate::operation::unsubscribe::UnsubscribeOutput {
66            arn: self.arn.ok_or_else(|| {
67                ::aws_smithy_types::error::operation::BuildError::missing_field(
68                    "arn",
69                    "arn was not specified but it is required when building UnsubscribeOutput",
70                )
71            })?,
72            _request_id: self._request_id,
73        })
74    }
75}