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 PutRawEventsInput {
    /// 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::PutRawEventsRequestEntry>>,
    /// Schema-registry settings for encoding open-format (Avro/Protobuf) events. Required for open-format entries; ignored for JSON entries. The registry is read with the caller's credentials, so the caller needs read access to the registry it references.
    pub schema_registry_configuration: ::std::option::Option<crate::types::SchemaRegistryConfiguration>,
    /// Request-level deduplication settings, applied to every entry in the batch.
    pub deduplication_configuration: ::std::option::Option<crate::types::DeduplicationConfiguration>,
}
impl PutRawEventsInput {
    /// 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::PutRawEventsRequestEntry] {
        self.entries.as_deref().unwrap_or_default()
    }
    /// Schema-registry settings for encoding open-format (Avro/Protobuf) events. Required for open-format entries; ignored for JSON entries. The registry is read with the caller's credentials, so the caller needs read access to the registry it references.
    pub fn schema_registry_configuration(&self) -> ::std::option::Option<&crate::types::SchemaRegistryConfiguration> {
        self.schema_registry_configuration.as_ref()
    }
    /// 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 PutRawEventsInput {
    /// Creates a new builder-style object to manufacture [`PutRawEventsInput`](crate::operation::put_raw_events::PutRawEventsInput).
    pub fn builder() -> crate::operation::put_raw_events::builders::PutRawEventsInputBuilder {
        crate::operation::put_raw_events::builders::PutRawEventsInputBuilder::default()
    }
}

/// A builder for [`PutRawEventsInput`](crate::operation::put_raw_events::PutRawEventsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutRawEventsInputBuilder {
    pub(crate) event_bus_arn: ::std::option::Option<::std::string::String>,
    pub(crate) entries: ::std::option::Option<::std::vec::Vec<crate::types::PutRawEventsRequestEntry>>,
    pub(crate) schema_registry_configuration: ::std::option::Option<crate::types::SchemaRegistryConfiguration>,
    pub(crate) deduplication_configuration: ::std::option::Option<crate::types::DeduplicationConfiguration>,
}
impl PutRawEventsInputBuilder {
    /// 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::PutRawEventsRequestEntry) -> 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::PutRawEventsRequestEntry>>) -> 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::PutRawEventsRequestEntry>> {
        &self.entries
    }
    /// Schema-registry settings for encoding open-format (Avro/Protobuf) events. Required for open-format entries; ignored for JSON entries. The registry is read with the caller's credentials, so the caller needs read access to the registry it references.
    pub fn schema_registry_configuration(mut self, input: crate::types::SchemaRegistryConfiguration) -> Self {
        self.schema_registry_configuration = ::std::option::Option::Some(input);
        self
    }
    /// Schema-registry settings for encoding open-format (Avro/Protobuf) events. Required for open-format entries; ignored for JSON entries. The registry is read with the caller's credentials, so the caller needs read access to the registry it references.
    pub fn set_schema_registry_configuration(mut self, input: ::std::option::Option<crate::types::SchemaRegistryConfiguration>) -> Self {
        self.schema_registry_configuration = input;
        self
    }
    /// Schema-registry settings for encoding open-format (Avro/Protobuf) events. Required for open-format entries; ignored for JSON entries. The registry is read with the caller's credentials, so the caller needs read access to the registry it references.
    pub fn get_schema_registry_configuration(&self) -> &::std::option::Option<crate::types::SchemaRegistryConfiguration> {
        &self.schema_registry_configuration
    }
    /// 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 [`PutRawEventsInput`](crate::operation::put_raw_events::PutRawEventsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_raw_events::PutRawEventsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_raw_events::PutRawEventsInput {
            event_bus_arn: self.event_bus_arn,
            entries: self.entries,
            schema_registry_configuration: self.schema_registry_configuration,
            deduplication_configuration: self.deduplication_configuration,
        })
    }
}