aws-sdk-novaact 1.8.0

AWS SDK for Nova Act Service
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 CreateActOutput {
    /// <p>The unique identifier for the created act.</p>
    pub act_id: ::std::string::String,
    /// <p>The initial status of the act after creation.</p>
    pub status: crate::types::ActStatus,
    _request_id: Option<String>,
}
impl CreateActOutput {
    /// <p>The unique identifier for the created act.</p>
    pub fn act_id(&self) -> &str {
        use std::ops::Deref;
        self.act_id.deref()
    }
    /// <p>The initial status of the act after creation.</p>
    pub fn status(&self) -> &crate::types::ActStatus {
        &self.status
    }
}
impl ::aws_types::request_id::RequestId for CreateActOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateActOutput {
    /// Creates a new builder-style object to manufacture [`CreateActOutput`](crate::operation::create_act::CreateActOutput).
    pub fn builder() -> crate::operation::create_act::builders::CreateActOutputBuilder {
        crate::operation::create_act::builders::CreateActOutputBuilder::default()
    }
}

/// A builder for [`CreateActOutput`](crate::operation::create_act::CreateActOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateActOutputBuilder {
    pub(crate) act_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ActStatus>,
    _request_id: Option<String>,
}
impl CreateActOutputBuilder {
    /// <p>The unique identifier for the created act.</p>
    /// This field is required.
    pub fn act_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.act_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the created act.</p>
    pub fn set_act_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.act_id = input;
        self
    }
    /// <p>The unique identifier for the created act.</p>
    pub fn get_act_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.act_id
    }
    /// <p>The initial status of the act after creation.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ActStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The initial status of the act after creation.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ActStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The initial status of the act after creation.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ActStatus> {
        &self.status
    }
    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 [`CreateActOutput`](crate::operation::create_act::CreateActOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`act_id`](crate::operation::create_act::builders::CreateActOutputBuilder::act_id)
    /// - [`status`](crate::operation::create_act::builders::CreateActOutputBuilder::status)
    pub fn build(self) -> ::std::result::Result<crate::operation::create_act::CreateActOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_act::CreateActOutput {
            act_id: self.act_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "act_id",
                    "act_id was not specified but it is required when building CreateActOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building CreateActOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}