aws_sdk_amp/types/_scrape_configuration.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A scrape configuration for a scraper, base 64 encoded. For more information, see <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration">Scraper configuration</a> in the <i>Amazon Managed Service for Prometheus User Guide</i>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub enum ScrapeConfiguration {
7 /// <p>The base 64 encoded scrape configuration file.</p>
8 ConfigurationBlob(::aws_smithy_types::Blob),
9 /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
10 /// An unknown enum variant
11 ///
12 /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
13 /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
14 /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
15 /// To investigate this, consider turning on debug logging to print the raw HTTP response.
16 #[non_exhaustive]
17 Unknown,
18}
19impl ScrapeConfiguration {
20 #[allow(irrefutable_let_patterns)]
21 /// Tries to convert the enum instance into [`ConfigurationBlob`](crate::types::ScrapeConfiguration::ConfigurationBlob), extracting the inner [`Blob`](::aws_smithy_types::Blob).
22 /// Returns `Err(&Self)` if it can't be converted.
23 pub fn as_configuration_blob(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
24 if let ScrapeConfiguration::ConfigurationBlob(val) = &self {
25 ::std::result::Result::Ok(val)
26 } else {
27 ::std::result::Result::Err(self)
28 }
29 }
30 /// Returns true if this is a [`ConfigurationBlob`](crate::types::ScrapeConfiguration::ConfigurationBlob).
31 pub fn is_configuration_blob(&self) -> bool {
32 self.as_configuration_blob().is_ok()
33 }
34 /// Returns true if the enum instance is the `Unknown` variant.
35 pub fn is_unknown(&self) -> bool {
36 matches!(self, Self::Unknown)
37 }
38}