aws-sdk-robomaker 1.81.0

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

/// <p>Information about a tool. Tools are used in a simulation job.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Tool {
    /// <p>Boolean indicating whether a streaming session will be configured for the tool. If <code>True</code>, AWS RoboMaker will configure a connection so you can interact with the tool as it is running in the simulation. It must have a graphical user interface. The default is <code>False</code>.</p>
    pub stream_ui: ::std::option::Option<bool>,
    /// <p>The name of the tool.</p>
    pub name: ::std::string::String,
    /// <p>Command-line arguments for the tool. It must include the tool executable name.</p>
    pub command: ::std::string::String,
    /// <p>Boolean indicating whether logs will be recorded in CloudWatch for the tool. The default is <code>False</code>.</p>
    pub stream_output_to_cloud_watch: ::std::option::Option<bool>,
    /// <p>Exit behavior determines what happens when your tool quits running. <code>RESTART</code> will cause your tool to be restarted. <code>FAIL</code> will cause your job to exit. The default is <code>RESTART</code>.</p>
    pub exit_behavior: ::std::option::Option<crate::types::ExitBehavior>,
}
impl Tool {
    /// <p>Boolean indicating whether a streaming session will be configured for the tool. If <code>True</code>, AWS RoboMaker will configure a connection so you can interact with the tool as it is running in the simulation. It must have a graphical user interface. The default is <code>False</code>.</p>
    pub fn stream_ui(&self) -> ::std::option::Option<bool> {
        self.stream_ui
    }
    /// <p>The name of the tool.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>Command-line arguments for the tool. It must include the tool executable name.</p>
    pub fn command(&self) -> &str {
        use std::ops::Deref;
        self.command.deref()
    }
    /// <p>Boolean indicating whether logs will be recorded in CloudWatch for the tool. The default is <code>False</code>.</p>
    pub fn stream_output_to_cloud_watch(&self) -> ::std::option::Option<bool> {
        self.stream_output_to_cloud_watch
    }
    /// <p>Exit behavior determines what happens when your tool quits running. <code>RESTART</code> will cause your tool to be restarted. <code>FAIL</code> will cause your job to exit. The default is <code>RESTART</code>.</p>
    pub fn exit_behavior(&self) -> ::std::option::Option<&crate::types::ExitBehavior> {
        self.exit_behavior.as_ref()
    }
}
impl Tool {
    /// Creates a new builder-style object to manufacture [`Tool`](crate::types::Tool).
    pub fn builder() -> crate::types::builders::ToolBuilder {
        crate::types::builders::ToolBuilder::default()
    }
}

/// A builder for [`Tool`](crate::types::Tool).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ToolBuilder {
    pub(crate) stream_ui: ::std::option::Option<bool>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) command: ::std::option::Option<::std::string::String>,
    pub(crate) stream_output_to_cloud_watch: ::std::option::Option<bool>,
    pub(crate) exit_behavior: ::std::option::Option<crate::types::ExitBehavior>,
}
impl ToolBuilder {
    /// <p>Boolean indicating whether a streaming session will be configured for the tool. If <code>True</code>, AWS RoboMaker will configure a connection so you can interact with the tool as it is running in the simulation. It must have a graphical user interface. The default is <code>False</code>.</p>
    pub fn stream_ui(mut self, input: bool) -> Self {
        self.stream_ui = ::std::option::Option::Some(input);
        self
    }
    /// <p>Boolean indicating whether a streaming session will be configured for the tool. If <code>True</code>, AWS RoboMaker will configure a connection so you can interact with the tool as it is running in the simulation. It must have a graphical user interface. The default is <code>False</code>.</p>
    pub fn set_stream_ui(mut self, input: ::std::option::Option<bool>) -> Self {
        self.stream_ui = input;
        self
    }
    /// <p>Boolean indicating whether a streaming session will be configured for the tool. If <code>True</code>, AWS RoboMaker will configure a connection so you can interact with the tool as it is running in the simulation. It must have a graphical user interface. The default is <code>False</code>.</p>
    pub fn get_stream_ui(&self) -> &::std::option::Option<bool> {
        &self.stream_ui
    }
    /// <p>The name of the tool.</p>
    /// This field is required.
    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 tool.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the tool.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>Command-line arguments for the tool. It must include the tool executable name.</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>Command-line arguments for the tool. It must include the tool executable name.</p>
    pub fn set_command(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.command = input;
        self
    }
    /// <p>Command-line arguments for the tool. It must include the tool executable name.</p>
    pub fn get_command(&self) -> &::std::option::Option<::std::string::String> {
        &self.command
    }
    /// <p>Boolean indicating whether logs will be recorded in CloudWatch for the tool. The default is <code>False</code>.</p>
    pub fn stream_output_to_cloud_watch(mut self, input: bool) -> Self {
        self.stream_output_to_cloud_watch = ::std::option::Option::Some(input);
        self
    }
    /// <p>Boolean indicating whether logs will be recorded in CloudWatch for the tool. The default is <code>False</code>.</p>
    pub fn set_stream_output_to_cloud_watch(mut self, input: ::std::option::Option<bool>) -> Self {
        self.stream_output_to_cloud_watch = input;
        self
    }
    /// <p>Boolean indicating whether logs will be recorded in CloudWatch for the tool. The default is <code>False</code>.</p>
    pub fn get_stream_output_to_cloud_watch(&self) -> &::std::option::Option<bool> {
        &self.stream_output_to_cloud_watch
    }
    /// <p>Exit behavior determines what happens when your tool quits running. <code>RESTART</code> will cause your tool to be restarted. <code>FAIL</code> will cause your job to exit. The default is <code>RESTART</code>.</p>
    pub fn exit_behavior(mut self, input: crate::types::ExitBehavior) -> Self {
        self.exit_behavior = ::std::option::Option::Some(input);
        self
    }
    /// <p>Exit behavior determines what happens when your tool quits running. <code>RESTART</code> will cause your tool to be restarted. <code>FAIL</code> will cause your job to exit. The default is <code>RESTART</code>.</p>
    pub fn set_exit_behavior(mut self, input: ::std::option::Option<crate::types::ExitBehavior>) -> Self {
        self.exit_behavior = input;
        self
    }
    /// <p>Exit behavior determines what happens when your tool quits running. <code>RESTART</code> will cause your tool to be restarted. <code>FAIL</code> will cause your job to exit. The default is <code>RESTART</code>.</p>
    pub fn get_exit_behavior(&self) -> &::std::option::Option<crate::types::ExitBehavior> {
        &self.exit_behavior
    }
    /// Consumes the builder and constructs a [`Tool`](crate::types::Tool).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::ToolBuilder::name)
    /// - [`command`](crate::types::builders::ToolBuilder::command)
    pub fn build(self) -> ::std::result::Result<crate::types::Tool, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Tool {
            stream_ui: self.stream_ui,
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building Tool",
                )
            })?,
            command: self.command.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "command",
                    "command was not specified but it is required when building Tool",
                )
            })?,
            stream_output_to_cloud_watch: self.stream_output_to_cloud_watch,
            exit_behavior: self.exit_behavior,
        })
    }
}