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 CreateInstrumentationConfigurationOutput {
    /// <p>The type of instrumentation that was created, echoed from the request.</p>
    pub instrumentation_type: crate::types::InstrumentationType,
    /// <p>The service name for the instrumentation configuration, echoed from the request.</p>
    pub service: ::std::string::String,
    /// <p>The environment for the instrumentation configuration, echoed from the request.</p>
    pub environment: ::std::string::String,
    /// <p>The telemetry signal type for the instrumentation configuration, echoed from the request.</p>
    pub signal_type: crate::types::DynamicInstrumentationSignalType,
    /// <p>The location where instrumentation is applied, echoed from the request.</p>
    pub location: ::std::option::Option<crate::types::Location>,
    /// <p>A stable hash computed from the location that uniquely identifies this instrumentation point within the service, environment, and signal type.</p>
    pub location_hash: ::std::string::String,
    /// <p>The optional description that was stored with the instrumentation configuration.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The timestamp after which this configuration is no longer served to clients. Present only for <code>BREAKPOINT</code> configurations; <code>PROBE</code> configurations do not expire.</p>
    pub expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The attribute filters returned with the configuration so SDKs can perform client-side targeting.</p>
    pub attribute_filters: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    /// <p>The capture settings that were stored for this instrumentation configuration.</p>
    pub capture_configuration: ::std::option::Option<crate::types::CaptureConfiguration>,
    /// <p>The server-generated creation timestamp for this instrumentation configuration.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// ARN for the created instrumentation configuration
    pub arn: ::std::string::String,
    _request_id: Option<String>,
}
impl CreateInstrumentationConfigurationOutput {
    /// <p>The type of instrumentation that was created, echoed from the request.</p>
    pub fn instrumentation_type(&self) -> &crate::types::InstrumentationType {
        &self.instrumentation_type
    }
    /// <p>The service name for the instrumentation configuration, echoed from the request.</p>
    pub fn service(&self) -> &str {
        use std::ops::Deref;
        self.service.deref()
    }
    /// <p>The environment for the instrumentation configuration, echoed from the request.</p>
    pub fn environment(&self) -> &str {
        use std::ops::Deref;
        self.environment.deref()
    }
    /// <p>The telemetry signal type for the instrumentation configuration, echoed from the request.</p>
    pub fn signal_type(&self) -> &crate::types::DynamicInstrumentationSignalType {
        &self.signal_type
    }
    /// <p>The location where instrumentation is applied, echoed from the request.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::Location> {
        self.location.as_ref()
    }
    /// <p>A stable hash computed from the location that uniquely identifies this instrumentation point within the service, environment, and signal type.</p>
    pub fn location_hash(&self) -> &str {
        use std::ops::Deref;
        self.location_hash.deref()
    }
    /// <p>The optional description that was stored with the instrumentation configuration.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The timestamp after which this configuration is no longer served to clients. Present only for <code>BREAKPOINT</code> configurations; <code>PROBE</code> configurations do not expire.</p>
    pub fn expires_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.expires_at.as_ref()
    }
    /// <p>The attribute filters returned with the configuration so SDKs can perform client-side targeting.</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>The capture settings that were stored for this instrumentation configuration.</p>
    pub fn capture_configuration(&self) -> ::std::option::Option<&crate::types::CaptureConfiguration> {
        self.capture_configuration.as_ref()
    }
    /// <p>The server-generated creation timestamp for this instrumentation configuration.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// ARN for the created instrumentation configuration
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateInstrumentationConfigurationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateInstrumentationConfigurationOutput {
    /// Creates a new builder-style object to manufacture [`CreateInstrumentationConfigurationOutput`](crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationOutput).
    pub fn builder() -> crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder {
        crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::default()
    }
}

/// A builder for [`CreateInstrumentationConfigurationOutput`](crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateInstrumentationConfigurationOutputBuilder {
    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) location_hash: ::std::option::Option<::std::string::String>,
    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) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateInstrumentationConfigurationOutputBuilder {
    /// <p>The type of instrumentation that was created, echoed from the request.</p>
    /// This field is required.
    pub fn instrumentation_type(mut self, input: crate::types::InstrumentationType) -> Self {
        self.instrumentation_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of instrumentation that was created, echoed from the request.</p>
    pub fn set_instrumentation_type(mut self, input: ::std::option::Option<crate::types::InstrumentationType>) -> Self {
        self.instrumentation_type = input;
        self
    }
    /// <p>The type of instrumentation that was created, echoed from the request.</p>
    pub fn get_instrumentation_type(&self) -> &::std::option::Option<crate::types::InstrumentationType> {
        &self.instrumentation_type
    }
    /// <p>The service name for the instrumentation configuration, echoed from the request.</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 service name for the instrumentation configuration, echoed from the request.</p>
    pub fn set_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service = input;
        self
    }
    /// <p>The service name for the instrumentation configuration, echoed from the request.</p>
    pub fn get_service(&self) -> &::std::option::Option<::std::string::String> {
        &self.service
    }
    /// <p>The environment for the instrumentation configuration, echoed from the request.</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 for the instrumentation configuration, echoed from the request.</p>
    pub fn set_environment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment = input;
        self
    }
    /// <p>The environment for the instrumentation configuration, echoed from the request.</p>
    pub fn get_environment(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment
    }
    /// <p>The telemetry signal type for the instrumentation configuration, echoed from the request.</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 for the instrumentation configuration, echoed from the request.</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 for the instrumentation configuration, echoed from the request.</p>
    pub fn get_signal_type(&self) -> &::std::option::Option<crate::types::DynamicInstrumentationSignalType> {
        &self.signal_type
    }
    /// <p>The location where instrumentation is applied, echoed from the request.</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 is applied, echoed from the request.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::Location>) -> Self {
        self.location = input;
        self
    }
    /// <p>The location where instrumentation is applied, echoed from the request.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::Location> {
        &self.location
    }
    /// <p>A stable hash computed from the location that uniquely identifies this instrumentation point within the service, environment, and signal type.</p>
    /// This field is required.
    pub fn location_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.location_hash = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A stable hash computed from the location that uniquely identifies this instrumentation point within the service, environment, and signal type.</p>
    pub fn set_location_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.location_hash = input;
        self
    }
    /// <p>A stable hash computed from the location that uniquely identifies this instrumentation point within the service, environment, and signal type.</p>
    pub fn get_location_hash(&self) -> &::std::option::Option<::std::string::String> {
        &self.location_hash
    }
    /// <p>The optional description that was stored with the instrumentation configuration.</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>The optional description that was stored with the instrumentation configuration.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The optional description that was stored with the instrumentation configuration.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The timestamp after which this configuration is no longer served to clients. Present only for <code>BREAKPOINT</code> configurations; <code>PROBE</code> configurations do not expire.</p>
    pub fn expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.expires_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp after which this configuration is no longer served to clients. Present only for <code>BREAKPOINT</code> configurations; <code>PROBE</code> configurations do not expire.</p>
    pub fn set_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.expires_at = input;
        self
    }
    /// <p>The timestamp after which this configuration is no longer served to clients. Present only for <code>BREAKPOINT</code> configurations; <code>PROBE</code> configurations do not expire.</p>
    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>The attribute filters returned with the configuration so SDKs can perform client-side targeting.</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>The attribute filters returned with the configuration so SDKs can perform client-side targeting.</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>The attribute filters returned with the configuration so SDKs can perform client-side targeting.</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>The capture settings that were stored for this instrumentation configuration.</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>The capture settings that were stored for this instrumentation configuration.</p>
    pub fn set_capture_configuration(mut self, input: ::std::option::Option<crate::types::CaptureConfiguration>) -> Self {
        self.capture_configuration = input;
        self
    }
    /// <p>The capture settings that were stored for this instrumentation configuration.</p>
    pub fn get_capture_configuration(&self) -> &::std::option::Option<crate::types::CaptureConfiguration> {
        &self.capture_configuration
    }
    /// <p>The server-generated creation timestamp for this instrumentation configuration.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The server-generated creation timestamp for this instrumentation configuration.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The server-generated creation timestamp for this instrumentation configuration.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// ARN for the created instrumentation configuration
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// ARN for the created instrumentation configuration
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// ARN for the created instrumentation configuration
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateInstrumentationConfigurationOutput`](crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`instrumentation_type`](crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::instrumentation_type)
    /// - [`service`](crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::service)
    /// - [`environment`](crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::environment)
    /// - [`signal_type`](crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::signal_type)
    /// - [`location_hash`](crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::location_hash)
    /// - [`created_at`](crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::created_at)
    /// - [`arn`](crate::operation::create_instrumentation_configuration::builders::CreateInstrumentationConfigurationOutputBuilder::arn)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(
            crate::operation::create_instrumentation_configuration::CreateInstrumentationConfigurationOutput {
                instrumentation_type: self.instrumentation_type.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "instrumentation_type",
                        "instrumentation_type was not specified but it is required when building CreateInstrumentationConfigurationOutput",
                    )
                })?,
                service: self.service.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "service",
                        "service was not specified but it is required when building CreateInstrumentationConfigurationOutput",
                    )
                })?,
                environment: self.environment.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "environment",
                        "environment was not specified but it is required when building CreateInstrumentationConfigurationOutput",
                    )
                })?,
                signal_type: self.signal_type.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "signal_type",
                        "signal_type was not specified but it is required when building CreateInstrumentationConfigurationOutput",
                    )
                })?,
                location: self.location,
                location_hash: self.location_hash.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "location_hash",
                        "location_hash was not specified but it is required when building CreateInstrumentationConfigurationOutput",
                    )
                })?,
                description: self.description,
                expires_at: self.expires_at,
                attribute_filters: self.attribute_filters,
                capture_configuration: self.capture_configuration,
                created_at: self.created_at.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "created_at",
                        "created_at was not specified but it is required when building CreateInstrumentationConfigurationOutput",
                    )
                })?,
                arn: self.arn.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "arn",
                        "arn was not specified but it is required when building CreateInstrumentationConfigurationOutput",
                    )
                })?,
                _request_id: self._request_id,
            },
        )
    }
}