aws_sdk_amp/operation/delete_scraper/
_delete_scraper_output.rs

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