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 CreateEventBusOutput {
    /// The Amazon Resource Name (ARN) that uniquely identifies an event bus.
    pub event_bus_arn: ::std::option::Option<::std::string::String>,
    /// Name of an event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'. The grammar matches the name segment of EventBusArn (event-busv2/<name>
    /// /
    /// <id>
    /// ), so every valid name can be represented in the bus's ARN. The same type is used everywhere a bus name appears.
    /// </id>
    /// </name>
    pub name: ::std::option::Option<::std::string::String>,
    /// Free-text description. Used by every resource type that has one: event buses, subscribers, and event sources.
    pub description: ::std::option::Option<::std::string::String>,
    /// Encryption configuration for an event bus.
    pub encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
    /// Event storage configuration of an event bus, as returned on reads.
    pub storage_configuration: ::std::option::Option<crate::types::StorageConfigurationOutput>,
    /// Lifecycle state of an event bus. - CREATING: Bus creation is in progress. - CREATE_FAILED: Bus creation failed; see StateReason. The bus cannot be recovered or recreated in place: delete it with DeleteEventBus, then create a new bus. - ACTIVE: Bus is fully operational and can accept events. - UPDATING: Bus update is in progress. - UPDATE_FAILED: Bus update failed; the bus remains operational with its previous configuration. - DELETING: Bus deletion is actively in progress. - DELETE_FAILED: Bus deletion failed; see StateReason. Retry DeleteEventBus after removing subscribers and event sources.
    pub state: ::std::option::Option<crate::types::BusState>,
    /// Human-readable explanation of why an event bus is in its current State. Omitted when the bus is in a normal operational state (ACTIVE). It stands in for the error response an asynchronous failure cannot return, so it applies only to resources with an asynchronous lifecycle: event buses. EventSources and subscribers are provisioned synchronously and report failures directly on the request.
    pub state_reason: ::std::option::Option<::std::string::String>,
    /// The time the event bus was created.
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateEventBusOutput {
    /// 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()
    }
    /// Name of an event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'. The grammar matches the name segment of EventBusArn (event-busv2/<name>
    /// /
    /// <id>
    /// ), so every valid name can be represented in the bus's ARN. The same type is used everywhere a bus name appears.
    /// </id>
    /// </name>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// Free-text description. Used by every resource type that has one: event buses, subscribers, and event sources.
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// Encryption configuration for an event bus.
    pub fn encryption_configuration(&self) -> ::std::option::Option<&crate::types::EncryptionConfiguration> {
        self.encryption_configuration.as_ref()
    }
    /// Event storage configuration of an event bus, as returned on reads.
    pub fn storage_configuration(&self) -> ::std::option::Option<&crate::types::StorageConfigurationOutput> {
        self.storage_configuration.as_ref()
    }
    /// Lifecycle state of an event bus. - CREATING: Bus creation is in progress. - CREATE_FAILED: Bus creation failed; see StateReason. The bus cannot be recovered or recreated in place: delete it with DeleteEventBus, then create a new bus. - ACTIVE: Bus is fully operational and can accept events. - UPDATING: Bus update is in progress. - UPDATE_FAILED: Bus update failed; the bus remains operational with its previous configuration. - DELETING: Bus deletion is actively in progress. - DELETE_FAILED: Bus deletion failed; see StateReason. Retry DeleteEventBus after removing subscribers and event sources.
    pub fn state(&self) -> ::std::option::Option<&crate::types::BusState> {
        self.state.as_ref()
    }
    /// Human-readable explanation of why an event bus is in its current State. Omitted when the bus is in a normal operational state (ACTIVE). It stands in for the error response an asynchronous failure cannot return, so it applies only to resources with an asynchronous lifecycle: event buses. EventSources and subscribers are provisioned synchronously and report failures directly on the request.
    pub fn state_reason(&self) -> ::std::option::Option<&str> {
        self.state_reason.as_deref()
    }
    /// The time the event bus was created.
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for CreateEventBusOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateEventBusOutput {
    /// Creates a new builder-style object to manufacture [`CreateEventBusOutput`](crate::operation::create_event_bus::CreateEventBusOutput).
    pub fn builder() -> crate::operation::create_event_bus::builders::CreateEventBusOutputBuilder {
        crate::operation::create_event_bus::builders::CreateEventBusOutputBuilder::default()
    }
}

/// A builder for [`CreateEventBusOutput`](crate::operation::create_event_bus::CreateEventBusOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateEventBusOutputBuilder {
    pub(crate) event_bus_arn: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
    pub(crate) storage_configuration: ::std::option::Option<crate::types::StorageConfigurationOutput>,
    pub(crate) state: ::std::option::Option<crate::types::BusState>,
    pub(crate) state_reason: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateEventBusOutputBuilder {
    /// The Amazon Resource Name (ARN) that uniquely identifies an event bus.
    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
    }
    /// Name of an event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'. The grammar matches the name segment of EventBusArn (event-busv2/<name>
    /// /
    /// <id>
    /// ), so every valid name can be represented in the bus's ARN. The same type is used everywhere a bus name appears.
    /// </id>
    /// </name>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// Name of an event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'. The grammar matches the name segment of EventBusArn (event-busv2/<name>
    /// /
    /// <id>
    /// ), so every valid name can be represented in the bus's ARN. The same type is used everywhere a bus name appears.
    /// </id>
    /// </name>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// Name of an event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'. The grammar matches the name segment of EventBusArn (event-busv2/<name>
    /// /
    /// <id>
    /// ), so every valid name can be represented in the bus's ARN. The same type is used everywhere a bus name appears.
    /// </id>
    /// </name>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Free-text description. Used by every resource type that has one: event buses, subscribers, and event sources.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// Free-text description. Used by every resource type that has one: event buses, subscribers, and event sources.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// Free-text description. Used by every resource type that has one: event buses, subscribers, and event sources.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Encryption configuration for an event bus.
    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
        self.encryption_configuration = ::std::option::Option::Some(input);
        self
    }
    /// Encryption configuration for an event bus.
    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
        self.encryption_configuration = input;
        self
    }
    /// Encryption configuration for an event bus.
    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
        &self.encryption_configuration
    }
    /// Event storage configuration of an event bus, as returned on reads.
    pub fn storage_configuration(mut self, input: crate::types::StorageConfigurationOutput) -> Self {
        self.storage_configuration = ::std::option::Option::Some(input);
        self
    }
    /// Event storage configuration of an event bus, as returned on reads.
    pub fn set_storage_configuration(mut self, input: ::std::option::Option<crate::types::StorageConfigurationOutput>) -> Self {
        self.storage_configuration = input;
        self
    }
    /// Event storage configuration of an event bus, as returned on reads.
    pub fn get_storage_configuration(&self) -> &::std::option::Option<crate::types::StorageConfigurationOutput> {
        &self.storage_configuration
    }
    /// Lifecycle state of an event bus. - CREATING: Bus creation is in progress. - CREATE_FAILED: Bus creation failed; see StateReason. The bus cannot be recovered or recreated in place: delete it with DeleteEventBus, then create a new bus. - ACTIVE: Bus is fully operational and can accept events. - UPDATING: Bus update is in progress. - UPDATE_FAILED: Bus update failed; the bus remains operational with its previous configuration. - DELETING: Bus deletion is actively in progress. - DELETE_FAILED: Bus deletion failed; see StateReason. Retry DeleteEventBus after removing subscribers and event sources.
    pub fn state(mut self, input: crate::types::BusState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// Lifecycle state of an event bus. - CREATING: Bus creation is in progress. - CREATE_FAILED: Bus creation failed; see StateReason. The bus cannot be recovered or recreated in place: delete it with DeleteEventBus, then create a new bus. - ACTIVE: Bus is fully operational and can accept events. - UPDATING: Bus update is in progress. - UPDATE_FAILED: Bus update failed; the bus remains operational with its previous configuration. - DELETING: Bus deletion is actively in progress. - DELETE_FAILED: Bus deletion failed; see StateReason. Retry DeleteEventBus after removing subscribers and event sources.
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::BusState>) -> Self {
        self.state = input;
        self
    }
    /// Lifecycle state of an event bus. - CREATING: Bus creation is in progress. - CREATE_FAILED: Bus creation failed; see StateReason. The bus cannot be recovered or recreated in place: delete it with DeleteEventBus, then create a new bus. - ACTIVE: Bus is fully operational and can accept events. - UPDATING: Bus update is in progress. - UPDATE_FAILED: Bus update failed; the bus remains operational with its previous configuration. - DELETING: Bus deletion is actively in progress. - DELETE_FAILED: Bus deletion failed; see StateReason. Retry DeleteEventBus after removing subscribers and event sources.
    pub fn get_state(&self) -> &::std::option::Option<crate::types::BusState> {
        &self.state
    }
    /// Human-readable explanation of why an event bus is in its current State. Omitted when the bus is in a normal operational state (ACTIVE). It stands in for the error response an asynchronous failure cannot return, so it applies only to resources with an asynchronous lifecycle: event buses. EventSources and subscribers are provisioned synchronously and report failures directly on the request.
    pub fn state_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.state_reason = ::std::option::Option::Some(input.into());
        self
    }
    /// Human-readable explanation of why an event bus is in its current State. Omitted when the bus is in a normal operational state (ACTIVE). It stands in for the error response an asynchronous failure cannot return, so it applies only to resources with an asynchronous lifecycle: event buses. EventSources and subscribers are provisioned synchronously and report failures directly on the request.
    pub fn set_state_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.state_reason = input;
        self
    }
    /// Human-readable explanation of why an event bus is in its current State. Omitted when the bus is in a normal operational state (ACTIVE). It stands in for the error response an asynchronous failure cannot return, so it applies only to resources with an asynchronous lifecycle: event buses. EventSources and subscribers are provisioned synchronously and report failures directly on the request.
    pub fn get_state_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.state_reason
    }
    /// The time the event bus was created.
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// The time the event bus was created.
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// The time the event bus was created.
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    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 [`CreateEventBusOutput`](crate::operation::create_event_bus::CreateEventBusOutput).
    pub fn build(self) -> crate::operation::create_event_bus::CreateEventBusOutput {
        crate::operation::create_event_bus::CreateEventBusOutput {
            event_bus_arn: self.event_bus_arn,
            name: self.name,
            description: self.description,
            encryption_configuration: self.encryption_configuration,
            storage_configuration: self.storage_configuration,
            state: self.state,
            state_reason: self.state_reason,
            creation_time: self.creation_time,
            _request_id: self._request_id,
        }
    }
}