aws_sdk_rtbfabric/operation/delete_link/
_delete_link_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 DeleteLinkOutput {
6    /// <p>The unique identifier of the link.</p>
7    pub link_id: ::std::string::String,
8    /// <p>The status of the link.</p>
9    pub status: crate::types::LinkStatus,
10    _request_id: Option<String>,
11}
12impl DeleteLinkOutput {
13    /// <p>The unique identifier of the link.</p>
14    pub fn link_id(&self) -> &str {
15        use std::ops::Deref;
16        self.link_id.deref()
17    }
18    /// <p>The status of the link.</p>
19    pub fn status(&self) -> &crate::types::LinkStatus {
20        &self.status
21    }
22}
23impl ::aws_types::request_id::RequestId for DeleteLinkOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl DeleteLinkOutput {
29    /// Creates a new builder-style object to manufacture [`DeleteLinkOutput`](crate::operation::delete_link::DeleteLinkOutput).
30    pub fn builder() -> crate::operation::delete_link::builders::DeleteLinkOutputBuilder {
31        crate::operation::delete_link::builders::DeleteLinkOutputBuilder::default()
32    }
33}
34
35/// A builder for [`DeleteLinkOutput`](crate::operation::delete_link::DeleteLinkOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct DeleteLinkOutputBuilder {
39    pub(crate) link_id: ::std::option::Option<::std::string::String>,
40    pub(crate) status: ::std::option::Option<crate::types::LinkStatus>,
41    _request_id: Option<String>,
42}
43impl DeleteLinkOutputBuilder {
44    /// <p>The unique identifier of the link.</p>
45    /// This field is required.
46    pub fn link_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.link_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The unique identifier of the link.</p>
51    pub fn set_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.link_id = input;
53        self
54    }
55    /// <p>The unique identifier of the link.</p>
56    pub fn get_link_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.link_id
58    }
59    /// <p>The status of the link.</p>
60    /// This field is required.
61    pub fn status(mut self, input: crate::types::LinkStatus) -> Self {
62        self.status = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The status of the link.</p>
66    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LinkStatus>) -> Self {
67        self.status = input;
68        self
69    }
70    /// <p>The status of the link.</p>
71    pub fn get_status(&self) -> &::std::option::Option<crate::types::LinkStatus> {
72        &self.status
73    }
74    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
75        self._request_id = Some(request_id.into());
76        self
77    }
78
79    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
80        self._request_id = request_id;
81        self
82    }
83    /// Consumes the builder and constructs a [`DeleteLinkOutput`](crate::operation::delete_link::DeleteLinkOutput).
84    /// This method will fail if any of the following fields are not set:
85    /// - [`link_id`](crate::operation::delete_link::builders::DeleteLinkOutputBuilder::link_id)
86    /// - [`status`](crate::operation::delete_link::builders::DeleteLinkOutputBuilder::status)
87    pub fn build(self) -> ::std::result::Result<crate::operation::delete_link::DeleteLinkOutput, ::aws_smithy_types::error::operation::BuildError> {
88        ::std::result::Result::Ok(crate::operation::delete_link::DeleteLinkOutput {
89            link_id: self.link_id.ok_or_else(|| {
90                ::aws_smithy_types::error::operation::BuildError::missing_field(
91                    "link_id",
92                    "link_id was not specified but it is required when building DeleteLinkOutput",
93                )
94            })?,
95            status: self.status.ok_or_else(|| {
96                ::aws_smithy_types::error::operation::BuildError::missing_field(
97                    "status",
98                    "status was not specified but it is required when building DeleteLinkOutput",
99                )
100            })?,
101            _request_id: self._request_id,
102        })
103    }
104}