aws-sdk-codebuild 1.122.0

AWS SDK for AWS CodeBuild
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)]
pub struct StartCommandExecutionInput {
    /// <p>A <code>sandboxId</code> or <code>sandboxArn</code>.</p>
    pub sandbox_id: ::std::option::Option<::std::string::String>,
    /// <p>The command that needs to be executed.</p>
    pub command: ::std::option::Option<::std::string::String>,
    /// <p>The command type.</p>
    pub r#type: ::std::option::Option<crate::types::CommandType>,
}
impl StartCommandExecutionInput {
    /// <p>A <code>sandboxId</code> or <code>sandboxArn</code>.</p>
    pub fn sandbox_id(&self) -> ::std::option::Option<&str> {
        self.sandbox_id.as_deref()
    }
    /// <p>The command that needs to be executed.</p>
    pub fn command(&self) -> ::std::option::Option<&str> {
        self.command.as_deref()
    }
    /// <p>The command type.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::CommandType> {
        self.r#type.as_ref()
    }
}
impl ::std::fmt::Debug for StartCommandExecutionInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartCommandExecutionInput");
        formatter.field("sandbox_id", &self.sandbox_id);
        formatter.field("command", &"*** Sensitive Data Redacted ***");
        formatter.field("r#type", &self.r#type);
        formatter.finish()
    }
}
impl StartCommandExecutionInput {
    /// Creates a new builder-style object to manufacture [`StartCommandExecutionInput`](crate::operation::start_command_execution::StartCommandExecutionInput).
    pub fn builder() -> crate::operation::start_command_execution::builders::StartCommandExecutionInputBuilder {
        crate::operation::start_command_execution::builders::StartCommandExecutionInputBuilder::default()
    }
}

/// A builder for [`StartCommandExecutionInput`](crate::operation::start_command_execution::StartCommandExecutionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct StartCommandExecutionInputBuilder {
    pub(crate) sandbox_id: ::std::option::Option<::std::string::String>,
    pub(crate) command: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::CommandType>,
}
impl StartCommandExecutionInputBuilder {
    /// <p>A <code>sandboxId</code> or <code>sandboxArn</code>.</p>
    /// This field is required.
    pub fn sandbox_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sandbox_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A <code>sandboxId</code> or <code>sandboxArn</code>.</p>
    pub fn set_sandbox_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sandbox_id = input;
        self
    }
    /// <p>A <code>sandboxId</code> or <code>sandboxArn</code>.</p>
    pub fn get_sandbox_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.sandbox_id
    }
    /// <p>The command that needs to be executed.</p>
    /// This field is required.
    pub fn command(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.command = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The command that needs to be executed.</p>
    pub fn set_command(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.command = input;
        self
    }
    /// <p>The command that needs to be executed.</p>
    pub fn get_command(&self) -> &::std::option::Option<::std::string::String> {
        &self.command
    }
    /// <p>The command type.</p>
    pub fn r#type(mut self, input: crate::types::CommandType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The command type.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CommandType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The command type.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::CommandType> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`StartCommandExecutionInput`](crate::operation::start_command_execution::StartCommandExecutionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_command_execution::StartCommandExecutionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_command_execution::StartCommandExecutionInput {
            sandbox_id: self.sandbox_id,
            command: self.command,
            r#type: self.r#type,
        })
    }
}
impl ::std::fmt::Debug for StartCommandExecutionInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartCommandExecutionInputBuilder");
        formatter.field("sandbox_id", &self.sandbox_id);
        formatter.field("command", &"*** Sensitive Data Redacted ***");
        formatter.field("r#type", &self.r#type);
        formatter.finish()
    }
}