aws_sdk_amp/operation/update_scraper/
_update_scraper_input.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 UpdateScraperInput {
6    /// <p>The ID of the scraper to update.</p>
7    pub scraper_id: ::std::option::Option<::std::string::String>,
8    /// <p>The new alias of the scraper.</p>
9    pub alias: ::std::option::Option<::std::string::String>,
10    /// <p>Contains the base-64 encoded YAML configuration for the scraper.</p><note>
11    /// <p>For more information about configuring a scraper, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html">Using an Amazon Web Services managed collector</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p>
12    /// </note>
13    pub scrape_configuration: ::std::option::Option<crate::types::ScrapeConfiguration>,
14    /// <p>The new Amazon Managed Service for Prometheus workspace to send metrics to.</p>
15    pub destination: ::std::option::Option<crate::types::Destination>,
16    /// <p>Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.</p>
17    pub role_configuration: ::std::option::Option<crate::types::RoleConfiguration>,
18    /// <p>A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.</p>
19    pub client_token: ::std::option::Option<::std::string::String>,
20}
21impl UpdateScraperInput {
22    /// <p>The ID of the scraper to update.</p>
23    pub fn scraper_id(&self) -> ::std::option::Option<&str> {
24        self.scraper_id.as_deref()
25    }
26    /// <p>The new alias of the scraper.</p>
27    pub fn alias(&self) -> ::std::option::Option<&str> {
28        self.alias.as_deref()
29    }
30    /// <p>Contains the base-64 encoded YAML configuration for the scraper.</p><note>
31    /// <p>For more information about configuring a scraper, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html">Using an Amazon Web Services managed collector</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p>
32    /// </note>
33    pub fn scrape_configuration(&self) -> ::std::option::Option<&crate::types::ScrapeConfiguration> {
34        self.scrape_configuration.as_ref()
35    }
36    /// <p>The new Amazon Managed Service for Prometheus workspace to send metrics to.</p>
37    pub fn destination(&self) -> ::std::option::Option<&crate::types::Destination> {
38        self.destination.as_ref()
39    }
40    /// <p>Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.</p>
41    pub fn role_configuration(&self) -> ::std::option::Option<&crate::types::RoleConfiguration> {
42        self.role_configuration.as_ref()
43    }
44    /// <p>A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.</p>
45    pub fn client_token(&self) -> ::std::option::Option<&str> {
46        self.client_token.as_deref()
47    }
48}
49impl UpdateScraperInput {
50    /// Creates a new builder-style object to manufacture [`UpdateScraperInput`](crate::operation::update_scraper::UpdateScraperInput).
51    pub fn builder() -> crate::operation::update_scraper::builders::UpdateScraperInputBuilder {
52        crate::operation::update_scraper::builders::UpdateScraperInputBuilder::default()
53    }
54}
55
56/// A builder for [`UpdateScraperInput`](crate::operation::update_scraper::UpdateScraperInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct UpdateScraperInputBuilder {
60    pub(crate) scraper_id: ::std::option::Option<::std::string::String>,
61    pub(crate) alias: ::std::option::Option<::std::string::String>,
62    pub(crate) scrape_configuration: ::std::option::Option<crate::types::ScrapeConfiguration>,
63    pub(crate) destination: ::std::option::Option<crate::types::Destination>,
64    pub(crate) role_configuration: ::std::option::Option<crate::types::RoleConfiguration>,
65    pub(crate) client_token: ::std::option::Option<::std::string::String>,
66}
67impl UpdateScraperInputBuilder {
68    /// <p>The ID of the scraper to update.</p>
69    /// This field is required.
70    pub fn scraper_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.scraper_id = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The ID of the scraper to update.</p>
75    pub fn set_scraper_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.scraper_id = input;
77        self
78    }
79    /// <p>The ID of the scraper to update.</p>
80    pub fn get_scraper_id(&self) -> &::std::option::Option<::std::string::String> {
81        &self.scraper_id
82    }
83    /// <p>The new alias of the scraper.</p>
84    pub fn alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.alias = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The new alias of the scraper.</p>
89    pub fn set_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.alias = input;
91        self
92    }
93    /// <p>The new alias of the scraper.</p>
94    pub fn get_alias(&self) -> &::std::option::Option<::std::string::String> {
95        &self.alias
96    }
97    /// <p>Contains the base-64 encoded YAML configuration for the scraper.</p><note>
98    /// <p>For more information about configuring a scraper, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html">Using an Amazon Web Services managed collector</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p>
99    /// </note>
100    pub fn scrape_configuration(mut self, input: crate::types::ScrapeConfiguration) -> Self {
101        self.scrape_configuration = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>Contains the base-64 encoded YAML configuration for the scraper.</p><note>
105    /// <p>For more information about configuring a scraper, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html">Using an Amazon Web Services managed collector</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p>
106    /// </note>
107    pub fn set_scrape_configuration(mut self, input: ::std::option::Option<crate::types::ScrapeConfiguration>) -> Self {
108        self.scrape_configuration = input;
109        self
110    }
111    /// <p>Contains the base-64 encoded YAML configuration for the scraper.</p><note>
112    /// <p>For more information about configuring a scraper, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html">Using an Amazon Web Services managed collector</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p>
113    /// </note>
114    pub fn get_scrape_configuration(&self) -> &::std::option::Option<crate::types::ScrapeConfiguration> {
115        &self.scrape_configuration
116    }
117    /// <p>The new Amazon Managed Service for Prometheus workspace to send metrics to.</p>
118    pub fn destination(mut self, input: crate::types::Destination) -> Self {
119        self.destination = ::std::option::Option::Some(input);
120        self
121    }
122    /// <p>The new Amazon Managed Service for Prometheus workspace to send metrics to.</p>
123    pub fn set_destination(mut self, input: ::std::option::Option<crate::types::Destination>) -> Self {
124        self.destination = input;
125        self
126    }
127    /// <p>The new Amazon Managed Service for Prometheus workspace to send metrics to.</p>
128    pub fn get_destination(&self) -> &::std::option::Option<crate::types::Destination> {
129        &self.destination
130    }
131    /// <p>Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.</p>
132    pub fn role_configuration(mut self, input: crate::types::RoleConfiguration) -> Self {
133        self.role_configuration = ::std::option::Option::Some(input);
134        self
135    }
136    /// <p>Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.</p>
137    pub fn set_role_configuration(mut self, input: ::std::option::Option<crate::types::RoleConfiguration>) -> Self {
138        self.role_configuration = input;
139        self
140    }
141    /// <p>Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.</p>
142    pub fn get_role_configuration(&self) -> &::std::option::Option<crate::types::RoleConfiguration> {
143        &self.role_configuration
144    }
145    /// <p>A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.</p>
146    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.client_token = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// <p>A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.</p>
151    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.client_token = input;
153        self
154    }
155    /// <p>A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.</p>
156    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
157        &self.client_token
158    }
159    /// Consumes the builder and constructs a [`UpdateScraperInput`](crate::operation::update_scraper::UpdateScraperInput).
160    pub fn build(
161        self,
162    ) -> ::std::result::Result<crate::operation::update_scraper::UpdateScraperInput, ::aws_smithy_types::error::operation::BuildError> {
163        ::std::result::Result::Ok(crate::operation::update_scraper::UpdateScraperInput {
164            scraper_id: self.scraper_id,
165            alias: self.alias,
166            scrape_configuration: self.scrape_configuration,
167            destination: self.destination,
168            role_configuration: self.role_configuration,
169            client_token: self.client_token,
170        })
171    }
172}