aws_sdk_amp/operation/update_scraper/
_update_scraper_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 UpdateScraperOutput {
6    /// <p>The ID of the updated scraper.</p>
7    pub scraper_id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
9    pub arn: ::std::string::String,
10    /// <p>A structure that displays the current status of the scraper.</p>
11    pub status: ::std::option::Option<crate::types::ScraperStatus>,
12    /// <p>The list of tag keys and values that are associated with the scraper.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14    _request_id: Option<String>,
15}
16impl UpdateScraperOutput {
17    /// <p>The ID of the updated scraper.</p>
18    pub fn scraper_id(&self) -> &str {
19        use std::ops::Deref;
20        self.scraper_id.deref()
21    }
22    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
23    pub fn arn(&self) -> &str {
24        use std::ops::Deref;
25        self.arn.deref()
26    }
27    /// <p>A structure that displays the current status of the scraper.</p>
28    pub fn status(&self) -> ::std::option::Option<&crate::types::ScraperStatus> {
29        self.status.as_ref()
30    }
31    /// <p>The list of tag keys and values that are associated with the scraper.</p>
32    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
33        self.tags.as_ref()
34    }
35}
36impl ::aws_types::request_id::RequestId for UpdateScraperOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl UpdateScraperOutput {
42    /// Creates a new builder-style object to manufacture [`UpdateScraperOutput`](crate::operation::update_scraper::UpdateScraperOutput).
43    pub fn builder() -> crate::operation::update_scraper::builders::UpdateScraperOutputBuilder {
44        crate::operation::update_scraper::builders::UpdateScraperOutputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateScraperOutput`](crate::operation::update_scraper::UpdateScraperOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateScraperOutputBuilder {
52    pub(crate) scraper_id: ::std::option::Option<::std::string::String>,
53    pub(crate) arn: ::std::option::Option<::std::string::String>,
54    pub(crate) status: ::std::option::Option<crate::types::ScraperStatus>,
55    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
56    _request_id: Option<String>,
57}
58impl UpdateScraperOutputBuilder {
59    /// <p>The ID of the updated scraper.</p>
60    /// This field is required.
61    pub fn scraper_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.scraper_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The ID of the updated scraper.</p>
66    pub fn set_scraper_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.scraper_id = input;
68        self
69    }
70    /// <p>The ID of the updated scraper.</p>
71    pub fn get_scraper_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.scraper_id
73    }
74    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
75    /// This field is required.
76    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.arn = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
81    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.arn = input;
83        self
84    }
85    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
86    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
87        &self.arn
88    }
89    /// <p>A structure that displays the current status of the scraper.</p>
90    /// This field is required.
91    pub fn status(mut self, input: crate::types::ScraperStatus) -> Self {
92        self.status = ::std::option::Option::Some(input);
93        self
94    }
95    /// <p>A structure that displays the current status of the scraper.</p>
96    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ScraperStatus>) -> Self {
97        self.status = input;
98        self
99    }
100    /// <p>A structure that displays the current status of the scraper.</p>
101    pub fn get_status(&self) -> &::std::option::Option<crate::types::ScraperStatus> {
102        &self.status
103    }
104    /// Adds a key-value pair to `tags`.
105    ///
106    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
107    ///
108    /// <p>The list of tag keys and values that are associated with the scraper.</p>
109    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
110        let mut hash_map = self.tags.unwrap_or_default();
111        hash_map.insert(k.into(), v.into());
112        self.tags = ::std::option::Option::Some(hash_map);
113        self
114    }
115    /// <p>The list of tag keys and values that are associated with the scraper.</p>
116    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
117        self.tags = input;
118        self
119    }
120    /// <p>The list of tag keys and values that are associated with the scraper.</p>
121    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
122        &self.tags
123    }
124    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
125        self._request_id = Some(request_id.into());
126        self
127    }
128
129    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
130        self._request_id = request_id;
131        self
132    }
133    /// Consumes the builder and constructs a [`UpdateScraperOutput`](crate::operation::update_scraper::UpdateScraperOutput).
134    /// This method will fail if any of the following fields are not set:
135    /// - [`scraper_id`](crate::operation::update_scraper::builders::UpdateScraperOutputBuilder::scraper_id)
136    /// - [`arn`](crate::operation::update_scraper::builders::UpdateScraperOutputBuilder::arn)
137    pub fn build(
138        self,
139    ) -> ::std::result::Result<crate::operation::update_scraper::UpdateScraperOutput, ::aws_smithy_types::error::operation::BuildError> {
140        ::std::result::Result::Ok(crate::operation::update_scraper::UpdateScraperOutput {
141            scraper_id: self.scraper_id.ok_or_else(|| {
142                ::aws_smithy_types::error::operation::BuildError::missing_field(
143                    "scraper_id",
144                    "scraper_id was not specified but it is required when building UpdateScraperOutput",
145                )
146            })?,
147            arn: self.arn.ok_or_else(|| {
148                ::aws_smithy_types::error::operation::BuildError::missing_field(
149                    "arn",
150                    "arn was not specified but it is required when building UpdateScraperOutput",
151                )
152            })?,
153            status: self.status,
154            tags: self.tags,
155            _request_id: self._request_id,
156        })
157    }
158}