aws_sdk_athena/types/
_capacity_assignment.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A mapping between one or more workgroups and a capacity reservation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CapacityAssignment {
7    /// <p>The list of workgroup names for the capacity assignment.</p>
8    pub work_group_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9}
10impl CapacityAssignment {
11    /// <p>The list of workgroup names for the capacity assignment.</p>
12    ///
13    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.work_group_names.is_none()`.
14    pub fn work_group_names(&self) -> &[::std::string::String] {
15        self.work_group_names.as_deref().unwrap_or_default()
16    }
17}
18impl CapacityAssignment {
19    /// Creates a new builder-style object to manufacture [`CapacityAssignment`](crate::types::CapacityAssignment).
20    pub fn builder() -> crate::types::builders::CapacityAssignmentBuilder {
21        crate::types::builders::CapacityAssignmentBuilder::default()
22    }
23}
24
25/// A builder for [`CapacityAssignment`](crate::types::CapacityAssignment).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct CapacityAssignmentBuilder {
29    pub(crate) work_group_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
30}
31impl CapacityAssignmentBuilder {
32    /// Appends an item to `work_group_names`.
33    ///
34    /// To override the contents of this collection use [`set_work_group_names`](Self::set_work_group_names).
35    ///
36    /// <p>The list of workgroup names for the capacity assignment.</p>
37    pub fn work_group_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
38        let mut v = self.work_group_names.unwrap_or_default();
39        v.push(input.into());
40        self.work_group_names = ::std::option::Option::Some(v);
41        self
42    }
43    /// <p>The list of workgroup names for the capacity assignment.</p>
44    pub fn set_work_group_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
45        self.work_group_names = input;
46        self
47    }
48    /// <p>The list of workgroup names for the capacity assignment.</p>
49    pub fn get_work_group_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
50        &self.work_group_names
51    }
52    /// Consumes the builder and constructs a [`CapacityAssignment`](crate::types::CapacityAssignment).
53    pub fn build(self) -> crate::types::CapacityAssignment {
54        crate::types::CapacityAssignment {
55            work_group_names: self.work_group_names,
56        }
57    }
58}