aws_sdk_sagemaker/operation/create_space/
_create_space_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 CreateSpaceInput {
6    /// <p>The ID of the associated domain.</p>
7    pub domain_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the space.</p>
9    pub space_name: ::std::option::Option<::std::string::String>,
10    /// <p>Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the <code>Search</code> API.</p>
11    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
12    /// <p>A collection of space settings.</p>
13    pub space_settings: ::std::option::Option<crate::types::SpaceSettings>,
14    /// <p>A collection of ownership settings.</p>
15    pub ownership_settings: ::std::option::Option<crate::types::OwnershipSettings>,
16    /// <p>A collection of space sharing settings.</p>
17    pub space_sharing_settings: ::std::option::Option<crate::types::SpaceSharingSettings>,
18    /// <p>The name of the space that appears in the SageMaker Studio UI.</p>
19    pub space_display_name: ::std::option::Option<::std::string::String>,
20}
21impl CreateSpaceInput {
22    /// <p>The ID of the associated domain.</p>
23    pub fn domain_id(&self) -> ::std::option::Option<&str> {
24        self.domain_id.as_deref()
25    }
26    /// <p>The name of the space.</p>
27    pub fn space_name(&self) -> ::std::option::Option<&str> {
28        self.space_name.as_deref()
29    }
30    /// <p>Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the <code>Search</code> API.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
33    pub fn tags(&self) -> &[crate::types::Tag] {
34        self.tags.as_deref().unwrap_or_default()
35    }
36    /// <p>A collection of space settings.</p>
37    pub fn space_settings(&self) -> ::std::option::Option<&crate::types::SpaceSettings> {
38        self.space_settings.as_ref()
39    }
40    /// <p>A collection of ownership settings.</p>
41    pub fn ownership_settings(&self) -> ::std::option::Option<&crate::types::OwnershipSettings> {
42        self.ownership_settings.as_ref()
43    }
44    /// <p>A collection of space sharing settings.</p>
45    pub fn space_sharing_settings(&self) -> ::std::option::Option<&crate::types::SpaceSharingSettings> {
46        self.space_sharing_settings.as_ref()
47    }
48    /// <p>The name of the space that appears in the SageMaker Studio UI.</p>
49    pub fn space_display_name(&self) -> ::std::option::Option<&str> {
50        self.space_display_name.as_deref()
51    }
52}
53impl CreateSpaceInput {
54    /// Creates a new builder-style object to manufacture [`CreateSpaceInput`](crate::operation::create_space::CreateSpaceInput).
55    pub fn builder() -> crate::operation::create_space::builders::CreateSpaceInputBuilder {
56        crate::operation::create_space::builders::CreateSpaceInputBuilder::default()
57    }
58}
59
60/// A builder for [`CreateSpaceInput`](crate::operation::create_space::CreateSpaceInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateSpaceInputBuilder {
64    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
65    pub(crate) space_name: ::std::option::Option<::std::string::String>,
66    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
67    pub(crate) space_settings: ::std::option::Option<crate::types::SpaceSettings>,
68    pub(crate) ownership_settings: ::std::option::Option<crate::types::OwnershipSettings>,
69    pub(crate) space_sharing_settings: ::std::option::Option<crate::types::SpaceSharingSettings>,
70    pub(crate) space_display_name: ::std::option::Option<::std::string::String>,
71}
72impl CreateSpaceInputBuilder {
73    /// <p>The ID of the associated domain.</p>
74    /// This field is required.
75    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.domain_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The ID of the associated domain.</p>
80    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.domain_id = input;
82        self
83    }
84    /// <p>The ID of the associated domain.</p>
85    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.domain_id
87    }
88    /// <p>The name of the space.</p>
89    /// This field is required.
90    pub fn space_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.space_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the space.</p>
95    pub fn set_space_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.space_name = input;
97        self
98    }
99    /// <p>The name of the space.</p>
100    pub fn get_space_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.space_name
102    }
103    /// Appends an item to `tags`.
104    ///
105    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
106    ///
107    /// <p>Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the <code>Search</code> API.</p>
108    pub fn tags(mut self, input: crate::types::Tag) -> Self {
109        let mut v = self.tags.unwrap_or_default();
110        v.push(input);
111        self.tags = ::std::option::Option::Some(v);
112        self
113    }
114    /// <p>Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the <code>Search</code> API.</p>
115    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
116        self.tags = input;
117        self
118    }
119    /// <p>Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the <code>Search</code> API.</p>
120    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
121        &self.tags
122    }
123    /// <p>A collection of space settings.</p>
124    pub fn space_settings(mut self, input: crate::types::SpaceSettings) -> Self {
125        self.space_settings = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>A collection of space settings.</p>
129    pub fn set_space_settings(mut self, input: ::std::option::Option<crate::types::SpaceSettings>) -> Self {
130        self.space_settings = input;
131        self
132    }
133    /// <p>A collection of space settings.</p>
134    pub fn get_space_settings(&self) -> &::std::option::Option<crate::types::SpaceSettings> {
135        &self.space_settings
136    }
137    /// <p>A collection of ownership settings.</p>
138    pub fn ownership_settings(mut self, input: crate::types::OwnershipSettings) -> Self {
139        self.ownership_settings = ::std::option::Option::Some(input);
140        self
141    }
142    /// <p>A collection of ownership settings.</p>
143    pub fn set_ownership_settings(mut self, input: ::std::option::Option<crate::types::OwnershipSettings>) -> Self {
144        self.ownership_settings = input;
145        self
146    }
147    /// <p>A collection of ownership settings.</p>
148    pub fn get_ownership_settings(&self) -> &::std::option::Option<crate::types::OwnershipSettings> {
149        &self.ownership_settings
150    }
151    /// <p>A collection of space sharing settings.</p>
152    pub fn space_sharing_settings(mut self, input: crate::types::SpaceSharingSettings) -> Self {
153        self.space_sharing_settings = ::std::option::Option::Some(input);
154        self
155    }
156    /// <p>A collection of space sharing settings.</p>
157    pub fn set_space_sharing_settings(mut self, input: ::std::option::Option<crate::types::SpaceSharingSettings>) -> Self {
158        self.space_sharing_settings = input;
159        self
160    }
161    /// <p>A collection of space sharing settings.</p>
162    pub fn get_space_sharing_settings(&self) -> &::std::option::Option<crate::types::SpaceSharingSettings> {
163        &self.space_sharing_settings
164    }
165    /// <p>The name of the space that appears in the SageMaker Studio UI.</p>
166    pub fn space_display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.space_display_name = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <p>The name of the space that appears in the SageMaker Studio UI.</p>
171    pub fn set_space_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.space_display_name = input;
173        self
174    }
175    /// <p>The name of the space that appears in the SageMaker Studio UI.</p>
176    pub fn get_space_display_name(&self) -> &::std::option::Option<::std::string::String> {
177        &self.space_display_name
178    }
179    /// Consumes the builder and constructs a [`CreateSpaceInput`](crate::operation::create_space::CreateSpaceInput).
180    pub fn build(self) -> ::std::result::Result<crate::operation::create_space::CreateSpaceInput, ::aws_smithy_types::error::operation::BuildError> {
181        ::std::result::Result::Ok(crate::operation::create_space::CreateSpaceInput {
182            domain_id: self.domain_id,
183            space_name: self.space_name,
184            tags: self.tags,
185            space_settings: self.space_settings,
186            ownership_settings: self.ownership_settings,
187            space_sharing_settings: self.space_sharing_settings,
188            space_display_name: self.space_display_name,
189        })
190    }
191}