aws-sdk-applicationsignals 1.90.0

AWS SDK for Amazon CloudWatch Application Signals
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateInstrumentationConfigurationInput {
    /// Type of instrumentation: BREAKPOINT (temporary) or PROBE (permanent)
    pub instrumentation_type: ::std::option::Option<crate::types::InstrumentationType>,
    /// <p>The name of the service to instrument. This should match the <code>service.name</code> resource attribute reported by the application.</p>
    pub service: ::std::option::Option<::std::string::String>,
    /// <p>The environment that the service is running in, such as <code>eks:cluster-prod/namespace</code> or <code>ec2:production</code>.</p>
    pub environment: ::std::option::Option<::std::string::String>,
    /// <p>The telemetry signal type to emit for this instrumentation. The supported value is <code>SNAPSHOT</code>.</p>
    pub signal_type: ::std::option::Option<crate::types::DynamicInstrumentationSignalType>,
    /// <p>The location where instrumentation should be applied. Specify a <code>CodeLocation</code> for code-level instrumentation.</p>
    pub location: ::std::option::Option<crate::types::Location>,
    /// <p>An optional short description (up to 50 characters) that explains the purpose of this instrumentation.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// For BREAKPOINT: optional, defaults to 24 hours, must be between 5 min and 24 hours. For PROBE: not supported. PROBE configurations are permanent and persist until explicitly deleted.
    pub expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Client-side filters that target specific instances. Each object in the array is AND-matched on its keys, and multiple objects are OR-matched to decide where to apply the instrumentation.</p>
    pub attribute_filters: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    /// <p>Specifies what to capture when the instrumentation point is hit. Specify <code>CodeCapture</code> for code-level capture settings.</p>
    pub capture_configuration: ::std::option::Option<crate::types::CaptureConfiguration>,
    /// <p>An optional list of key-value pairs to associate with the instrumentation configuration. Tags can help you organize and categorize your resources.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateInstrumentationConfigurationInput {
    /// Type of instrumentation: BREAKPOINT (temporary) or PROBE (permanent)
    pub fn instrumentation_type(&self) -> ::std::option::Option<&crate::types::InstrumentationType> {
        self.instrumentation_type.as_ref()
    }
    /// <p>The name of the service to instrument. This should match the <code>service.name</code> resource attribute reported by the application.</p>
    pub fn service(&self) -> ::std::option::Option<&str> {
        self.service.as_deref()
    }
    /// <p>The environment that the service is running in, such as <code>eks:cluster-prod/namespace</code> or <code>ec2:production</code>.</p>
    pub fn environment(&self) -> ::std::option::Option<&str> {
        self.environment.as_deref()
    }
    /// <p>The telemetry signal type to emit for this instrumentation. The supported value is <code>SNAPSHOT</code>.</p>
    pub fn signal_type(&self) -> ::std::option::Option<&crate::types::DynamicInstrumentationSignalType> {
        self.signal_type.as_ref()
    }
    /// <p>The location where instrumentation should be applied. Specify a <code>CodeLocation</code> for code-level instrumentation.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::Location> {
        self.location.as_ref()
    }
    /// <p>An optional short description (up to 50 characters) that explains the purpose of this instrumentation.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// For BREAKPOINT: optional, defaults to 24 hours, must be between 5 min and 24 hours. For PROBE: not supported. PROBE configurations are permanent and persist until explicitly deleted.
    pub fn expires_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.expires_at.as_ref()
    }
    /// <p>Client-side filters that target specific instances. Each object in the array is AND-matched on its keys, and multiple objects are OR-matched to decide where to apply the instrumentation.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attribute_filters.is_none()`.
    pub fn attribute_filters(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::string::String>] {
        self.attribute_filters.as_deref().unwrap_or_default()
    }
    /// <p>Specifies what to capture when the instrumentation point is hit. Specify <code>CodeCapture</code> for code-level capture settings.</p>
    pub fn capture_configuration(&self) -> ::std::option::Option<&crate::types::CaptureConfiguration> {
        self.capture_configuration.as_ref()
    }
    /// <p>An optional list of key-value pairs to associate with the instrumentation configuration. Tags can help you organize and categorize your resources.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl CreateInstrumentationConfigurationInput {
    /// Creates a new builder-style object to manufacture [`CreateInstrumentationConfigurationInput`](crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationInput).
    pub fn builder() -> crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationInputBuilder {
        crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationInputBuilder::default()
    }
}

/// A builder for [`CreateInstrumentationConfigurationInput`](crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateInstrumentationConfigurationInputBuilder {
    pub(crate) instrumentation_type: ::std::option::Option<crate::types::InstrumentationType>,
    pub(crate) service: ::std::option::Option<::std::string::String>,
    pub(crate) environment: ::std::option::Option<::std::string::String>,
    pub(crate) signal_type: ::std::option::Option<crate::types::DynamicInstrumentationSignalType>,
    pub(crate) location: ::std::option::Option<crate::types::Location>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) attribute_filters: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    pub(crate) capture_configuration: ::std::option::Option<crate::types::CaptureConfiguration>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateInstrumentationConfigurationInputBuilder {
    /// Type of instrumentation: BREAKPOINT (temporary) or PROBE (permanent)
    /// This field is required.
    pub fn instrumentation_type(mut self, input: crate::types::InstrumentationType) -> Self {
        self.instrumentation_type = ::std::option::Option::Some(input);
        self
    }
    /// Type of instrumentation: BREAKPOINT (temporary) or PROBE (permanent)
    pub fn set_instrumentation_type(mut self, input: ::std::option::Option<crate::types::InstrumentationType>) -> Self {
        self.instrumentation_type = input;
        self
    }
    /// Type of instrumentation: BREAKPOINT (temporary) or PROBE (permanent)
    pub fn get_instrumentation_type(&self) -> &::std::option::Option<crate::types::InstrumentationType> {
        &self.instrumentation_type
    }
    /// <p>The name of the service to instrument. This should match the <code>service.name</code> resource attribute reported by the application.</p>
    /// This field is required.
    pub fn service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the service to instrument. This should match the <code>service.name</code> resource attribute reported by the application.</p>
    pub fn set_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service = input;
        self
    }
    /// <p>The name of the service to instrument. This should match the <code>service.name</code> resource attribute reported by the application.</p>
    pub fn get_service(&self) -> &::std::option::Option<::std::string::String> {
        &self.service
    }
    /// <p>The environment that the service is running in, such as <code>eks:cluster-prod/namespace</code> or <code>ec2:production</code>.</p>
    /// This field is required.
    pub fn environment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The environment that the service is running in, such as <code>eks:cluster-prod/namespace</code> or <code>ec2:production</code>.</p>
    pub fn set_environment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment = input;
        self
    }
    /// <p>The environment that the service is running in, such as <code>eks:cluster-prod/namespace</code> or <code>ec2:production</code>.</p>
    pub fn get_environment(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment
    }
    /// <p>The telemetry signal type to emit for this instrumentation. The supported value is <code>SNAPSHOT</code>.</p>
    /// This field is required.
    pub fn signal_type(mut self, input: crate::types::DynamicInstrumentationSignalType) -> Self {
        self.signal_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The telemetry signal type to emit for this instrumentation. The supported value is <code>SNAPSHOT</code>.</p>
    pub fn set_signal_type(mut self, input: ::std::option::Option<crate::types::DynamicInstrumentationSignalType>) -> Self {
        self.signal_type = input;
        self
    }
    /// <p>The telemetry signal type to emit for this instrumentation. The supported value is <code>SNAPSHOT</code>.</p>
    pub fn get_signal_type(&self) -> &::std::option::Option<crate::types::DynamicInstrumentationSignalType> {
        &self.signal_type
    }
    /// <p>The location where instrumentation should be applied. Specify a <code>CodeLocation</code> for code-level instrumentation.</p>
    /// This field is required.
    pub fn location(mut self, input: crate::types::Location) -> Self {
        self.location = ::std::option::Option::Some(input);
        self
    }
    /// <p>The location where instrumentation should be applied. Specify a <code>CodeLocation</code> for code-level instrumentation.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::Location>) -> Self {
        self.location = input;
        self
    }
    /// <p>The location where instrumentation should be applied. Specify a <code>CodeLocation</code> for code-level instrumentation.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::Location> {
        &self.location
    }
    /// <p>An optional short description (up to 50 characters) that explains the purpose of this instrumentation.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional short description (up to 50 characters) that explains the purpose of this instrumentation.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>An optional short description (up to 50 characters) that explains the purpose of this instrumentation.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// For BREAKPOINT: optional, defaults to 24 hours, must be between 5 min and 24 hours. For PROBE: not supported. PROBE configurations are permanent and persist until explicitly deleted.
    pub fn expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.expires_at = ::std::option::Option::Some(input);
        self
    }
    /// For BREAKPOINT: optional, defaults to 24 hours, must be between 5 min and 24 hours. For PROBE: not supported. PROBE configurations are permanent and persist until explicitly deleted.
    pub fn set_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.expires_at = input;
        self
    }
    /// For BREAKPOINT: optional, defaults to 24 hours, must be between 5 min and 24 hours. For PROBE: not supported. PROBE configurations are permanent and persist until explicitly deleted.
    pub fn get_expires_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.expires_at
    }
    /// Appends an item to `attribute_filters`.
    ///
    /// To override the contents of this collection use [`set_attribute_filters`](Self::set_attribute_filters).
    ///
    /// <p>Client-side filters that target specific instances. Each object in the array is AND-matched on its keys, and multiple objects are OR-matched to decide where to apply the instrumentation.</p>
    pub fn attribute_filters(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::string::String>) -> Self {
        let mut v = self.attribute_filters.unwrap_or_default();
        v.push(input);
        self.attribute_filters = ::std::option::Option::Some(v);
        self
    }
    /// <p>Client-side filters that target specific instances. Each object in the array is AND-matched on its keys, and multiple objects are OR-matched to decide where to apply the instrumentation.</p>
    pub fn set_attribute_filters(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    ) -> Self {
        self.attribute_filters = input;
        self
    }
    /// <p>Client-side filters that target specific instances. Each object in the array is AND-matched on its keys, and multiple objects are OR-matched to decide where to apply the instrumentation.</p>
    pub fn get_attribute_filters(
        &self,
    ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>> {
        &self.attribute_filters
    }
    /// <p>Specifies what to capture when the instrumentation point is hit. Specify <code>CodeCapture</code> for code-level capture settings.</p>
    /// This field is required.
    pub fn capture_configuration(mut self, input: crate::types::CaptureConfiguration) -> Self {
        self.capture_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies what to capture when the instrumentation point is hit. Specify <code>CodeCapture</code> for code-level capture settings.</p>
    pub fn set_capture_configuration(mut self, input: ::std::option::Option<crate::types::CaptureConfiguration>) -> Self {
        self.capture_configuration = input;
        self
    }
    /// <p>Specifies what to capture when the instrumentation point is hit. Specify <code>CodeCapture</code> for code-level capture settings.</p>
    pub fn get_capture_configuration(&self) -> &::std::option::Option<crate::types::CaptureConfiguration> {
        &self.capture_configuration
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>An optional list of key-value pairs to associate with the instrumentation configuration. Tags can help you organize and categorize your resources.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>An optional list of key-value pairs to associate with the instrumentation configuration. Tags can help you organize and categorize your resources.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>An optional list of key-value pairs to associate with the instrumentation configuration. Tags can help you organize and categorize your resources.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateInstrumentationConfigurationInput`](crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(
            crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationInput {
                instrumentation_type: self.instrumentation_type,
                service: self.service,
                environment: self.environment,
                signal_type: self.signal_type,
                location: self.location,
                description: self.description,
                expires_at: self.expires_at,
                attribute_filters: self.attribute_filters,
                capture_configuration: self.capture_configuration,
                tags: self.tags,
            },
        )
    }
}