aws-sdk-ecs 1.124.0

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

/// <p>Information about the service deployment rollback.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Rollback {
    /// <p>The reason the rollback happened. For example, the circuit breaker initiated the rollback operation.</p>
    pub reason: ::std::option::Option<::std::string::String>,
    /// <p>Time time that the rollback started. The format is yyyy-MM-dd HH:mm:ss.SSSSSS.</p>
    pub started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The ARN of the service revision deployed as part of the rollback.</p>
    pub service_revision_arn: ::std::option::Option<::std::string::String>,
}
impl Rollback {
    /// <p>The reason the rollback happened. For example, the circuit breaker initiated the rollback operation.</p>
    pub fn reason(&self) -> ::std::option::Option<&str> {
        self.reason.as_deref()
    }
    /// <p>Time time that the rollback started. The format is yyyy-MM-dd HH:mm:ss.SSSSSS.</p>
    pub fn started_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.started_at.as_ref()
    }
    /// <p>The ARN of the service revision deployed as part of the rollback.</p>
    pub fn service_revision_arn(&self) -> ::std::option::Option<&str> {
        self.service_revision_arn.as_deref()
    }
}
impl Rollback {
    /// Creates a new builder-style object to manufacture [`Rollback`](crate::types::Rollback).
    pub fn builder() -> crate::types::builders::RollbackBuilder {
        crate::types::builders::RollbackBuilder::default()
    }
}

/// A builder for [`Rollback`](crate::types::Rollback).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RollbackBuilder {
    pub(crate) reason: ::std::option::Option<::std::string::String>,
    pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) service_revision_arn: ::std::option::Option<::std::string::String>,
}
impl RollbackBuilder {
    /// <p>The reason the rollback happened. For example, the circuit breaker initiated the rollback operation.</p>
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reason the rollback happened. For example, the circuit breaker initiated the rollback operation.</p>
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reason = input;
        self
    }
    /// <p>The reason the rollback happened. For example, the circuit breaker initiated the rollback operation.</p>
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.reason
    }
    /// <p>Time time that the rollback started. The format is yyyy-MM-dd HH:mm:ss.SSSSSS.</p>
    pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.started_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>Time time that the rollback started. The format is yyyy-MM-dd HH:mm:ss.SSSSSS.</p>
    pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.started_at = input;
        self
    }
    /// <p>Time time that the rollback started. The format is yyyy-MM-dd HH:mm:ss.SSSSSS.</p>
    pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.started_at
    }
    /// <p>The ARN of the service revision deployed as part of the rollback.</p>
    pub fn service_revision_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_revision_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the service revision deployed as part of the rollback.</p>
    pub fn set_service_revision_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_revision_arn = input;
        self
    }
    /// <p>The ARN of the service revision deployed as part of the rollback.</p>
    pub fn get_service_revision_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_revision_arn
    }
    /// Consumes the builder and constructs a [`Rollback`](crate::types::Rollback).
    pub fn build(self) -> crate::types::Rollback {
        crate::types::Rollback {
            reason: self.reason,
            started_at: self.started_at,
            service_revision_arn: self.service_revision_arn,
        }
    }
}