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