aws_sdk_pcs/operation/create_queue/_create_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 CreateQueueInput {
6 /// <p>The name or ID of the cluster for which to create a queue.</p>
7 pub cluster_identifier: ::std::option::Option<::std::string::String>,
8 /// <p>A name to identify the queue.</p>
9 pub queue_name: ::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::QueueSlurmConfigurationRequest>,
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 /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
17 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18}
19impl CreateQueueInput {
20 /// <p>The name or ID of the cluster for which to create a queue.</p>
21 pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
22 self.cluster_identifier.as_deref()
23 }
24 /// <p>A name to identify the queue.</p>
25 pub fn queue_name(&self) -> ::std::option::Option<&str> {
26 self.queue_name.as_deref()
27 }
28 /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
29 ///
30 /// 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()`.
31 pub fn compute_node_group_configurations(&self) -> &[crate::types::ComputeNodeGroupConfiguration] {
32 self.compute_node_group_configurations.as_deref().unwrap_or_default()
33 }
34 /// <p>Additional options related to the Slurm scheduler.</p>
35 pub fn slurm_configuration(&self) -> ::std::option::Option<&crate::types::QueueSlurmConfigurationRequest> {
36 self.slurm_configuration.as_ref()
37 }
38 /// <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>
39 pub fn client_token(&self) -> ::std::option::Option<&str> {
40 self.client_token.as_deref()
41 }
42 /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
43 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
44 self.tags.as_ref()
45 }
46}
47impl CreateQueueInput {
48 /// Creates a new builder-style object to manufacture [`CreateQueueInput`](crate::operation::create_queue::CreateQueueInput).
49 pub fn builder() -> crate::operation::create_queue::builders::CreateQueueInputBuilder {
50 crate::operation::create_queue::builders::CreateQueueInputBuilder::default()
51 }
52}
53
54/// A builder for [`CreateQueueInput`](crate::operation::create_queue::CreateQueueInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateQueueInputBuilder {
58 pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
59 pub(crate) queue_name: ::std::option::Option<::std::string::String>,
60 pub(crate) compute_node_group_configurations: ::std::option::Option<::std::vec::Vec<crate::types::ComputeNodeGroupConfiguration>>,
61 pub(crate) slurm_configuration: ::std::option::Option<crate::types::QueueSlurmConfigurationRequest>,
62 pub(crate) client_token: ::std::option::Option<::std::string::String>,
63 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
64}
65impl CreateQueueInputBuilder {
66 /// <p>The name or ID of the cluster for which to create a queue.</p>
67 /// This field is required.
68 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.cluster_identifier = ::std::option::Option::Some(input.into());
70 self
71 }
72 /// <p>The name or ID of the cluster for which to create a queue.</p>
73 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.cluster_identifier = input;
75 self
76 }
77 /// <p>The name or ID of the cluster for which to create a queue.</p>
78 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
79 &self.cluster_identifier
80 }
81 /// <p>A name to identify the queue.</p>
82 /// This field is required.
83 pub fn queue_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.queue_name = ::std::option::Option::Some(input.into());
85 self
86 }
87 /// <p>A name to identify the queue.</p>
88 pub fn set_queue_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.queue_name = input;
90 self
91 }
92 /// <p>A name to identify the queue.</p>
93 pub fn get_queue_name(&self) -> &::std::option::Option<::std::string::String> {
94 &self.queue_name
95 }
96 /// Appends an item to `compute_node_group_configurations`.
97 ///
98 /// To override the contents of this collection use [`set_compute_node_group_configurations`](Self::set_compute_node_group_configurations).
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 compute_node_group_configurations(mut self, input: crate::types::ComputeNodeGroupConfiguration) -> Self {
102 let mut v = self.compute_node_group_configurations.unwrap_or_default();
103 v.push(input);
104 self.compute_node_group_configurations = ::std::option::Option::Some(v);
105 self
106 }
107 /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
108 pub fn set_compute_node_group_configurations(
109 mut self,
110 input: ::std::option::Option<::std::vec::Vec<crate::types::ComputeNodeGroupConfiguration>>,
111 ) -> Self {
112 self.compute_node_group_configurations = input;
113 self
114 }
115 /// <p>The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.</p>
116 pub fn get_compute_node_group_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComputeNodeGroupConfiguration>> {
117 &self.compute_node_group_configurations
118 }
119 /// <p>Additional options related to the Slurm scheduler.</p>
120 pub fn slurm_configuration(mut self, input: crate::types::QueueSlurmConfigurationRequest) -> Self {
121 self.slurm_configuration = ::std::option::Option::Some(input);
122 self
123 }
124 /// <p>Additional options related to the Slurm scheduler.</p>
125 pub fn set_slurm_configuration(mut self, input: ::std::option::Option<crate::types::QueueSlurmConfigurationRequest>) -> Self {
126 self.slurm_configuration = input;
127 self
128 }
129 /// <p>Additional options related to the Slurm scheduler.</p>
130 pub fn get_slurm_configuration(&self) -> &::std::option::Option<crate::types::QueueSlurmConfigurationRequest> {
131 &self.slurm_configuration
132 }
133 /// <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>
134 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.client_token = ::std::option::Option::Some(input.into());
136 self
137 }
138 /// <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>
139 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.client_token = input;
141 self
142 }
143 /// <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>
144 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
145 &self.client_token
146 }
147 /// Adds a key-value pair to `tags`.
148 ///
149 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
150 ///
151 /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
152 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
153 let mut hash_map = self.tags.unwrap_or_default();
154 hash_map.insert(k.into(), v.into());
155 self.tags = ::std::option::Option::Some(hash_map);
156 self
157 }
158 /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
159 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
160 self.tags = input;
161 self
162 }
163 /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
164 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
165 &self.tags
166 }
167 /// Consumes the builder and constructs a [`CreateQueueInput`](crate::operation::create_queue::CreateQueueInput).
168 pub fn build(self) -> ::std::result::Result<crate::operation::create_queue::CreateQueueInput, ::aws_smithy_types::error::operation::BuildError> {
169 ::std::result::Result::Ok(crate::operation::create_queue::CreateQueueInput {
170 cluster_identifier: self.cluster_identifier,
171 queue_name: self.queue_name,
172 compute_node_group_configurations: self.compute_node_group_configurations,
173 slurm_configuration: self.slurm_configuration,
174 client_token: self.client_token,
175 tags: self.tags,
176 })
177 }
178}