aws-sdk-pipes 1.104.0

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

/// <p>An object that represents a pipe. Amazon EventBridgePipes connect event sources to targets and reduces the need for specialized knowledge and integration code.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Pipe {
    /// <p>The name of the pipe.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the pipe.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The state the pipe should be in.</p>
    pub desired_state: ::std::option::Option<crate::types::RequestedPipeState>,
    /// <p>The state the pipe is in.</p>
    pub current_state: ::std::option::Option<crate::types::PipeState>,
    /// <p>The reason the pipe is in its current state.</p>
    pub state_reason: ::std::option::Option<::std::string::String>,
    /// <p>The time the pipe was created.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>When the pipe was last updated, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The ARN of the source resource.</p>
    pub source: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the target resource.</p>
    pub target: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the enrichment resource.</p>
    pub enrichment: ::std::option::Option<::std::string::String>,
}
impl Pipe {
    /// <p>The name of the pipe.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The ARN of the pipe.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The state the pipe should be in.</p>
    pub fn desired_state(&self) -> ::std::option::Option<&crate::types::RequestedPipeState> {
        self.desired_state.as_ref()
    }
    /// <p>The state the pipe is in.</p>
    pub fn current_state(&self) -> ::std::option::Option<&crate::types::PipeState> {
        self.current_state.as_ref()
    }
    /// <p>The reason the pipe is in its current state.</p>
    pub fn state_reason(&self) -> ::std::option::Option<&str> {
        self.state_reason.as_deref()
    }
    /// <p>The time the pipe was created.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>When the pipe was last updated, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_time.as_ref()
    }
    /// <p>The ARN of the source resource.</p>
    pub fn source(&self) -> ::std::option::Option<&str> {
        self.source.as_deref()
    }
    /// <p>The ARN of the target resource.</p>
    pub fn target(&self) -> ::std::option::Option<&str> {
        self.target.as_deref()
    }
    /// <p>The ARN of the enrichment resource.</p>
    pub fn enrichment(&self) -> ::std::option::Option<&str> {
        self.enrichment.as_deref()
    }
}
impl Pipe {
    /// Creates a new builder-style object to manufacture [`Pipe`](crate::types::Pipe).
    pub fn builder() -> crate::types::builders::PipeBuilder {
        crate::types::builders::PipeBuilder::default()
    }
}

/// A builder for [`Pipe`](crate::types::Pipe).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PipeBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) desired_state: ::std::option::Option<crate::types::RequestedPipeState>,
    pub(crate) current_state: ::std::option::Option<crate::types::PipeState>,
    pub(crate) state_reason: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) source: ::std::option::Option<::std::string::String>,
    pub(crate) target: ::std::option::Option<::std::string::String>,
    pub(crate) enrichment: ::std::option::Option<::std::string::String>,
}
impl PipeBuilder {
    /// <p>The name of the pipe.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the pipe.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the pipe.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The ARN of the pipe.</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 ARN of the pipe.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the pipe.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The state the pipe should be in.</p>
    pub fn desired_state(mut self, input: crate::types::RequestedPipeState) -> Self {
        self.desired_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state the pipe should be in.</p>
    pub fn set_desired_state(mut self, input: ::std::option::Option<crate::types::RequestedPipeState>) -> Self {
        self.desired_state = input;
        self
    }
    /// <p>The state the pipe should be in.</p>
    pub fn get_desired_state(&self) -> &::std::option::Option<crate::types::RequestedPipeState> {
        &self.desired_state
    }
    /// <p>The state the pipe is in.</p>
    pub fn current_state(mut self, input: crate::types::PipeState) -> Self {
        self.current_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state the pipe is in.</p>
    pub fn set_current_state(mut self, input: ::std::option::Option<crate::types::PipeState>) -> Self {
        self.current_state = input;
        self
    }
    /// <p>The state the pipe is in.</p>
    pub fn get_current_state(&self) -> &::std::option::Option<crate::types::PipeState> {
        &self.current_state
    }
    /// <p>The reason the pipe is in its current state.</p>
    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
    }
    /// <p>The reason the pipe is in its current state.</p>
    pub fn set_state_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.state_reason = input;
        self
    }
    /// <p>The reason the pipe is in its current state.</p>
    pub fn get_state_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.state_reason
    }
    /// <p>The time the pipe was created.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time the pipe was created.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The time the pipe was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>When the pipe was last updated, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>When the pipe was last updated, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_time = input;
        self
    }
    /// <p>When the pipe was last updated, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_time
    }
    /// <p>The ARN of the source resource.</p>
    pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the source resource.</p>
    pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source = input;
        self
    }
    /// <p>The ARN of the source resource.</p>
    pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
        &self.source
    }
    /// <p>The ARN of the target resource.</p>
    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the target resource.</p>
    pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target = input;
        self
    }
    /// <p>The ARN of the target resource.</p>
    pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
        &self.target
    }
    /// <p>The ARN of the enrichment resource.</p>
    pub fn enrichment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.enrichment = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the enrichment resource.</p>
    pub fn set_enrichment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.enrichment = input;
        self
    }
    /// <p>The ARN of the enrichment resource.</p>
    pub fn get_enrichment(&self) -> &::std::option::Option<::std::string::String> {
        &self.enrichment
    }
    /// Consumes the builder and constructs a [`Pipe`](crate::types::Pipe).
    pub fn build(self) -> crate::types::Pipe {
        crate::types::Pipe {
            name: self.name,
            arn: self.arn,
            desired_state: self.desired_state,
            current_state: self.current_state,
            state_reason: self.state_reason,
            creation_time: self.creation_time,
            last_modified_time: self.last_modified_time,
            source: self.source,
            target: self.target,
            enrichment: self.enrichment,
        }
    }
}