aws-sdk-cloudwatchlogs 1.6.0

AWS SDK for Amazon CloudWatch Logs
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>This structure contains information about one <i>delivery</i> in your account. </p>
/// <p>A delivery is a connection between a logical <i>delivery source</i> and a logical <i>delivery destination</i>.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html">CreateDelivery</a>.</p>
/// <p>You can't update an existing delivery. You can only create and delete deliveries.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Delivery {
    /// <p>The unique ID that identifies this delivery in your account.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies this delivery.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the delivery source that is associated with this delivery.</p>
    pub delivery_source_name: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the delivery destination that is associated with this delivery.</p>
    pub delivery_destination_arn: ::std::option::Option<::std::string::String>,
    /// <p>Displays whether the delivery destination associated with this delivery is CloudWatch Logs, Amazon S3, or Kinesis Data Firehose.</p>
    pub delivery_destination_type: ::std::option::Option<crate::types::DeliveryDestinationType>,
    /// <p>The tags that have been assigned to this delivery.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Delivery {
    /// <p>The unique ID that identifies this delivery in your account.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies this delivery.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The name of the delivery source that is associated with this delivery.</p>
    pub fn delivery_source_name(&self) -> ::std::option::Option<&str> {
        self.delivery_source_name.as_deref()
    }
    /// <p>The ARN of the delivery destination that is associated with this delivery.</p>
    pub fn delivery_destination_arn(&self) -> ::std::option::Option<&str> {
        self.delivery_destination_arn.as_deref()
    }
    /// <p>Displays whether the delivery destination associated with this delivery is CloudWatch Logs, Amazon S3, or Kinesis Data Firehose.</p>
    pub fn delivery_destination_type(&self) -> ::std::option::Option<&crate::types::DeliveryDestinationType> {
        self.delivery_destination_type.as_ref()
    }
    /// <p>The tags that have been assigned to this delivery.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl Delivery {
    /// Creates a new builder-style object to manufacture [`Delivery`](crate::types::Delivery).
    pub fn builder() -> crate::types::builders::DeliveryBuilder {
        crate::types::builders::DeliveryBuilder::default()
    }
}

/// A builder for [`Delivery`](crate::types::Delivery).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DeliveryBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) delivery_source_name: ::std::option::Option<::std::string::String>,
    pub(crate) delivery_destination_arn: ::std::option::Option<::std::string::String>,
    pub(crate) delivery_destination_type: ::std::option::Option<crate::types::DeliveryDestinationType>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl DeliveryBuilder {
    /// <p>The unique ID that identifies this delivery in your account.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID that identifies this delivery in your account.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The unique ID that identifies this delivery in your account.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies this delivery.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies this delivery.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies this delivery.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The name of the delivery source that is associated with this delivery.</p>
    pub fn delivery_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.delivery_source_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the delivery source that is associated with this delivery.</p>
    pub fn set_delivery_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.delivery_source_name = input;
        self
    }
    /// <p>The name of the delivery source that is associated with this delivery.</p>
    pub fn get_delivery_source_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.delivery_source_name
    }
    /// <p>The ARN of the delivery destination that is associated with this delivery.</p>
    pub fn delivery_destination_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.delivery_destination_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the delivery destination that is associated with this delivery.</p>
    pub fn set_delivery_destination_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.delivery_destination_arn = input;
        self
    }
    /// <p>The ARN of the delivery destination that is associated with this delivery.</p>
    pub fn get_delivery_destination_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.delivery_destination_arn
    }
    /// <p>Displays whether the delivery destination associated with this delivery is CloudWatch Logs, Amazon S3, or Kinesis Data Firehose.</p>
    pub fn delivery_destination_type(mut self, input: crate::types::DeliveryDestinationType) -> Self {
        self.delivery_destination_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Displays whether the delivery destination associated with this delivery is CloudWatch Logs, Amazon S3, or Kinesis Data Firehose.</p>
    pub fn set_delivery_destination_type(mut self, input: ::std::option::Option<crate::types::DeliveryDestinationType>) -> Self {
        self.delivery_destination_type = input;
        self
    }
    /// <p>Displays whether the delivery destination associated with this delivery is CloudWatch Logs, Amazon S3, or Kinesis Data Firehose.</p>
    pub fn get_delivery_destination_type(&self) -> &::std::option::Option<crate::types::DeliveryDestinationType> {
        &self.delivery_destination_type
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags that have been assigned to this delivery.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags that have been assigned to this delivery.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags that have been assigned to this delivery.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`Delivery`](crate::types::Delivery).
    pub fn build(self) -> crate::types::Delivery {
        crate::types::Delivery {
            id: self.id,
            arn: self.arn,
            delivery_source_name: self.delivery_source_name,
            delivery_destination_arn: self.delivery_destination_arn,
            delivery_destination_type: self.delivery_destination_type,
            tags: self.tags,
        }
    }
}