aws_sdk_pcs/operation/update_queue/
_update_queue_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateQueueInput {
6    /// <p>The name or ID of the cluster of the queue.</p>
7    pub cluster_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The name or ID of the queue.</p>
9    pub queue_identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
11    pub compute_node_group_configurations: ::std::option::Option<::std::vec::Vec<crate::types::ComputeNodeGroupConfiguration>>,
12    /// <p>Additional options related to the Slurm scheduler.</p>
13    pub slurm_configuration: ::std::option::Option<crate::types::UpdateQueueSlurmConfigurationRequest>,
14    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
15    pub client_token: ::std::option::Option<::std::string::String>,
16}
17impl UpdateQueueInput {
18    /// <p>The name or ID of the cluster of the queue.</p>
19    pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
20        self.cluster_identifier.as_deref()
21    }
22    /// <p>The name or ID of the queue.</p>
23    pub fn queue_identifier(&self) -> ::std::option::Option<&str> {
24        self.queue_identifier.as_deref()
25    }
26    /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
27    ///
28    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.compute_node_group_configurations.is_none()`.
29    pub fn compute_node_group_configurations(&self) -> &[crate::types::ComputeNodeGroupConfiguration] {
30        self.compute_node_group_configurations.as_deref().unwrap_or_default()
31    }
32    /// <p>Additional options related to the Slurm scheduler.</p>
33    pub fn slurm_configuration(&self) -> ::std::option::Option<&crate::types::UpdateQueueSlurmConfigurationRequest> {
34        self.slurm_configuration.as_ref()
35    }
36    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
37    pub fn client_token(&self) -> ::std::option::Option<&str> {
38        self.client_token.as_deref()
39    }
40}
41impl UpdateQueueInput {
42    /// Creates a new builder-style object to manufacture [`UpdateQueueInput`](crate::operation::update_queue::UpdateQueueInput).
43    pub fn builder() -> crate::operation::update_queue::builders::UpdateQueueInputBuilder {
44        crate::operation::update_queue::builders::UpdateQueueInputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateQueueInput`](crate::operation::update_queue::UpdateQueueInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateQueueInputBuilder {
52    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
53    pub(crate) queue_identifier: ::std::option::Option<::std::string::String>,
54    pub(crate) compute_node_group_configurations: ::std::option::Option<::std::vec::Vec<crate::types::ComputeNodeGroupConfiguration>>,
55    pub(crate) slurm_configuration: ::std::option::Option<crate::types::UpdateQueueSlurmConfigurationRequest>,
56    pub(crate) client_token: ::std::option::Option<::std::string::String>,
57}
58impl UpdateQueueInputBuilder {
59    /// <p>The name or ID of the cluster of the queue.</p>
60    /// This field is required.
61    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.cluster_identifier = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name or ID of the cluster of the queue.</p>
66    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.cluster_identifier = input;
68        self
69    }
70    /// <p>The name or ID of the cluster of the queue.</p>
71    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
72        &self.cluster_identifier
73    }
74    /// <p>The name or ID of the queue.</p>
75    /// This field is required.
76    pub fn queue_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.queue_identifier = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The name or ID of the queue.</p>
81    pub fn set_queue_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.queue_identifier = input;
83        self
84    }
85    /// <p>The name or ID of the queue.</p>
86    pub fn get_queue_identifier(&self) -> &::std::option::Option<::std::string::String> {
87        &self.queue_identifier
88    }
89    /// Appends an item to `compute_node_group_configurations`.
90    ///
91    /// To override the contents of this collection use [`set_compute_node_group_configurations`](Self::set_compute_node_group_configurations).
92    ///
93    /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
94    pub fn compute_node_group_configurations(mut self, input: crate::types::ComputeNodeGroupConfiguration) -> Self {
95        let mut v = self.compute_node_group_configurations.unwrap_or_default();
96        v.push(input);
97        self.compute_node_group_configurations = ::std::option::Option::Some(v);
98        self
99    }
100    /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
101    pub fn set_compute_node_group_configurations(
102        mut self,
103        input: ::std::option::Option<::std::vec::Vec<crate::types::ComputeNodeGroupConfiguration>>,
104    ) -> Self {
105        self.compute_node_group_configurations = input;
106        self
107    }
108    /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
109    pub fn get_compute_node_group_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComputeNodeGroupConfiguration>> {
110        &self.compute_node_group_configurations
111    }
112    /// <p>Additional options related to the Slurm scheduler.</p>
113    pub fn slurm_configuration(mut self, input: crate::types::UpdateQueueSlurmConfigurationRequest) -> Self {
114        self.slurm_configuration = ::std::option::Option::Some(input);
115        self
116    }
117    /// <p>Additional options related to the Slurm scheduler.</p>
118    pub fn set_slurm_configuration(mut self, input: ::std::option::Option<crate::types::UpdateQueueSlurmConfigurationRequest>) -> Self {
119        self.slurm_configuration = input;
120        self
121    }
122    /// <p>Additional options related to the Slurm scheduler.</p>
123    pub fn get_slurm_configuration(&self) -> &::std::option::Option<crate::types::UpdateQueueSlurmConfigurationRequest> {
124        &self.slurm_configuration
125    }
126    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
127    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.client_token = ::std::option::Option::Some(input.into());
129        self
130    }
131    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
132    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.client_token = input;
134        self
135    }
136    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
137    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
138        &self.client_token
139    }
140    /// Consumes the builder and constructs a [`UpdateQueueInput`](crate::operation::update_queue::UpdateQueueInput).
141    pub fn build(self) -> ::std::result::Result<crate::operation::update_queue::UpdateQueueInput, ::aws_smithy_types::error::operation::BuildError> {
142        ::std::result::Result::Ok(crate::operation::update_queue::UpdateQueueInput {
143            cluster_identifier: self.cluster_identifier,
144            queue_identifier: self.queue_identifier,
145            compute_node_group_configurations: self.compute_node_group_configurations,
146            slurm_configuration: self.slurm_configuration,
147            client_token: self.client_token,
148        })
149    }
150}