aws-sdk-eventbridgev2 1.2.0

AWS SDK for Amazon EventBridgeV2
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 PutEventsInput {
    /// The Amazon Resource Name (ARN) that uniquely identifies an event bus.
    pub event_bus_arn: ::std::option::Option<::std::string::String>,
    /// List of event entries to publish. Must contain at least one entry.
    pub entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>>,
    /// Request-level deduplication settings, applied to every entry in the batch.
    pub deduplication_configuration: ::std::option::Option<crate::types::DeduplicationConfiguration>,
}
impl PutEventsInput {
    /// The Amazon Resource Name (ARN) that uniquely identifies an event bus.
    pub fn event_bus_arn(&self) -> ::std::option::Option<&str> {
        self.event_bus_arn.as_deref()
    }
    /// List of event entries to publish. Must contain at least one entry.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entries.is_none()`.
    pub fn entries(&self) -> &[crate::types::PutEventsRequestEntry] {
        self.entries.as_deref().unwrap_or_default()
    }
    /// Request-level deduplication settings, applied to every entry in the batch.
    pub fn deduplication_configuration(&self) -> ::std::option::Option<&crate::types::DeduplicationConfiguration> {
        self.deduplication_configuration.as_ref()
    }
}
impl PutEventsInput {
    /// Creates a new builder-style object to manufacture [`PutEventsInput`](crate::operation::put_events::PutEventsInput).
    pub fn builder() -> crate::operation::put_events::builders::PutEventsInputBuilder {
        crate::operation::put_events::builders::PutEventsInputBuilder::default()
    }
}

/// A builder for [`PutEventsInput`](crate::operation::put_events::PutEventsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutEventsInputBuilder {
    pub(crate) event_bus_arn: ::std::option::Option<::std::string::String>,
    pub(crate) entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>>,
    pub(crate) deduplication_configuration: ::std::option::Option<crate::types::DeduplicationConfiguration>,
}
impl PutEventsInputBuilder {
    /// The Amazon Resource Name (ARN) that uniquely identifies an event bus.
    /// This field is required.
    pub fn event_bus_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.event_bus_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) that uniquely identifies an event bus.
    pub fn set_event_bus_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.event_bus_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) that uniquely identifies an event bus.
    pub fn get_event_bus_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.event_bus_arn
    }
    /// Appends an item to `entries`.
    ///
    /// To override the contents of this collection use [`set_entries`](Self::set_entries).
    ///
    /// List of event entries to publish. Must contain at least one entry.
    pub fn entries(mut self, input: crate::types::PutEventsRequestEntry) -> Self {
        let mut v = self.entries.unwrap_or_default();
        v.push(input);
        self.entries = ::std::option::Option::Some(v);
        self
    }
    /// List of event entries to publish. Must contain at least one entry.
    pub fn set_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>>) -> Self {
        self.entries = input;
        self
    }
    /// List of event entries to publish. Must contain at least one entry.
    pub fn get_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>> {
        &self.entries
    }
    /// Request-level deduplication settings, applied to every entry in the batch.
    pub fn deduplication_configuration(mut self, input: crate::types::DeduplicationConfiguration) -> Self {
        self.deduplication_configuration = ::std::option::Option::Some(input);
        self
    }
    /// Request-level deduplication settings, applied to every entry in the batch.
    pub fn set_deduplication_configuration(mut self, input: ::std::option::Option<crate::types::DeduplicationConfiguration>) -> Self {
        self.deduplication_configuration = input;
        self
    }
    /// Request-level deduplication settings, applied to every entry in the batch.
    pub fn get_deduplication_configuration(&self) -> &::std::option::Option<crate::types::DeduplicationConfiguration> {
        &self.deduplication_configuration
    }
    /// Consumes the builder and constructs a [`PutEventsInput`](crate::operation::put_events::PutEventsInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::put_events::PutEventsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_events::PutEventsInput {
            event_bus_arn: self.event_bus_arn,
            entries: self.entries,
            deduplication_configuration: self.deduplication_configuration,
        })
    }
}