Skip to main content

aws_sdk_batch/types/
_node_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that represents the details of a multi-node parallel job node.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct NodeDetails {
7    /// <p>The node index for the node. Node index numbering starts at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p>
8    pub node_index: ::std::option::Option<i32>,
9    /// <p>Specifies whether the current node is the main node for a multi-node parallel job.</p>
10    pub is_main_node: ::std::option::Option<bool>,
11}
12impl NodeDetails {
13    /// <p>The node index for the node. Node index numbering starts at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p>
14    pub fn node_index(&self) -> ::std::option::Option<i32> {
15        self.node_index
16    }
17    /// <p>Specifies whether the current node is the main node for a multi-node parallel job.</p>
18    pub fn is_main_node(&self) -> ::std::option::Option<bool> {
19        self.is_main_node
20    }
21}
22impl NodeDetails {
23    /// Creates a new builder-style object to manufacture [`NodeDetails`](crate::types::NodeDetails).
24    pub fn builder() -> crate::types::builders::NodeDetailsBuilder {
25        crate::types::builders::NodeDetailsBuilder::default()
26    }
27}
28
29/// A builder for [`NodeDetails`](crate::types::NodeDetails).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct NodeDetailsBuilder {
33    pub(crate) node_index: ::std::option::Option<i32>,
34    pub(crate) is_main_node: ::std::option::Option<bool>,
35}
36impl NodeDetailsBuilder {
37    /// <p>The node index for the node. Node index numbering starts at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p>
38    pub fn node_index(mut self, input: i32) -> Self {
39        self.node_index = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The node index for the node. Node index numbering starts at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p>
43    pub fn set_node_index(mut self, input: ::std::option::Option<i32>) -> Self {
44        self.node_index = input;
45        self
46    }
47    /// <p>The node index for the node. Node index numbering starts at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p>
48    pub fn get_node_index(&self) -> &::std::option::Option<i32> {
49        &self.node_index
50    }
51    /// <p>Specifies whether the current node is the main node for a multi-node parallel job.</p>
52    pub fn is_main_node(mut self, input: bool) -> Self {
53        self.is_main_node = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>Specifies whether the current node is the main node for a multi-node parallel job.</p>
57    pub fn set_is_main_node(mut self, input: ::std::option::Option<bool>) -> Self {
58        self.is_main_node = input;
59        self
60    }
61    /// <p>Specifies whether the current node is the main node for a multi-node parallel job.</p>
62    pub fn get_is_main_node(&self) -> &::std::option::Option<bool> {
63        &self.is_main_node
64    }
65    /// Consumes the builder and constructs a [`NodeDetails`](crate::types::NodeDetails).
66    pub fn build(self) -> crate::types::NodeDetails {
67        crate::types::NodeDetails {
68            node_index: self.node_index,
69            is_main_node: self.is_main_node,
70        }
71    }
72}