aws_sdk_sagemaker/operation/create_hub/
_create_hub_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 CreateHubInput {
6    /// <p>The name of the hub to create.</p>
7    pub hub_name: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the hub.</p>
9    pub hub_description: ::std::option::Option<::std::string::String>,
10    /// <p>The display name of the hub.</p>
11    pub hub_display_name: ::std::option::Option<::std::string::String>,
12    /// <p>The searchable keywords for the hub.</p>
13    pub hub_search_keywords: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    /// <p>The Amazon S3 storage configuration for the hub.</p>
15    pub s3_storage_config: ::std::option::Option<crate::types::HubS3StorageConfig>,
16    /// <p>Any tags to associate with the hub.</p>
17    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateHubInput {
20    /// <p>The name of the hub to create.</p>
21    pub fn hub_name(&self) -> ::std::option::Option<&str> {
22        self.hub_name.as_deref()
23    }
24    /// <p>A description of the hub.</p>
25    pub fn hub_description(&self) -> ::std::option::Option<&str> {
26        self.hub_description.as_deref()
27    }
28    /// <p>The display name of the hub.</p>
29    pub fn hub_display_name(&self) -> ::std::option::Option<&str> {
30        self.hub_display_name.as_deref()
31    }
32    /// <p>The searchable keywords for the hub.</p>
33    ///
34    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.hub_search_keywords.is_none()`.
35    pub fn hub_search_keywords(&self) -> &[::std::string::String] {
36        self.hub_search_keywords.as_deref().unwrap_or_default()
37    }
38    /// <p>The Amazon S3 storage configuration for the hub.</p>
39    pub fn s3_storage_config(&self) -> ::std::option::Option<&crate::types::HubS3StorageConfig> {
40        self.s3_storage_config.as_ref()
41    }
42    /// <p>Any tags to associate with the hub.</p>
43    ///
44    /// 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()`.
45    pub fn tags(&self) -> &[crate::types::Tag] {
46        self.tags.as_deref().unwrap_or_default()
47    }
48}
49impl CreateHubInput {
50    /// Creates a new builder-style object to manufacture [`CreateHubInput`](crate::operation::create_hub::CreateHubInput).
51    pub fn builder() -> crate::operation::create_hub::builders::CreateHubInputBuilder {
52        crate::operation::create_hub::builders::CreateHubInputBuilder::default()
53    }
54}
55
56/// A builder for [`CreateHubInput`](crate::operation::create_hub::CreateHubInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateHubInputBuilder {
60    pub(crate) hub_name: ::std::option::Option<::std::string::String>,
61    pub(crate) hub_description: ::std::option::Option<::std::string::String>,
62    pub(crate) hub_display_name: ::std::option::Option<::std::string::String>,
63    pub(crate) hub_search_keywords: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
64    pub(crate) s3_storage_config: ::std::option::Option<crate::types::HubS3StorageConfig>,
65    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
66}
67impl CreateHubInputBuilder {
68    /// <p>The name of the hub to create.</p>
69    /// This field is required.
70    pub fn hub_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.hub_name = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The name of the hub to create.</p>
75    pub fn set_hub_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.hub_name = input;
77        self
78    }
79    /// <p>The name of the hub to create.</p>
80    pub fn get_hub_name(&self) -> &::std::option::Option<::std::string::String> {
81        &self.hub_name
82    }
83    /// <p>A description of the hub.</p>
84    /// This field is required.
85    pub fn hub_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.hub_description = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>A description of the hub.</p>
90    pub fn set_hub_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.hub_description = input;
92        self
93    }
94    /// <p>A description of the hub.</p>
95    pub fn get_hub_description(&self) -> &::std::option::Option<::std::string::String> {
96        &self.hub_description
97    }
98    /// <p>The display name of the hub.</p>
99    pub fn hub_display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.hub_display_name = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>The display name of the hub.</p>
104    pub fn set_hub_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.hub_display_name = input;
106        self
107    }
108    /// <p>The display name of the hub.</p>
109    pub fn get_hub_display_name(&self) -> &::std::option::Option<::std::string::String> {
110        &self.hub_display_name
111    }
112    /// Appends an item to `hub_search_keywords`.
113    ///
114    /// To override the contents of this collection use [`set_hub_search_keywords`](Self::set_hub_search_keywords).
115    ///
116    /// <p>The searchable keywords for the hub.</p>
117    pub fn hub_search_keywords(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        let mut v = self.hub_search_keywords.unwrap_or_default();
119        v.push(input.into());
120        self.hub_search_keywords = ::std::option::Option::Some(v);
121        self
122    }
123    /// <p>The searchable keywords for the hub.</p>
124    pub fn set_hub_search_keywords(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
125        self.hub_search_keywords = input;
126        self
127    }
128    /// <p>The searchable keywords for the hub.</p>
129    pub fn get_hub_search_keywords(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
130        &self.hub_search_keywords
131    }
132    /// <p>The Amazon S3 storage configuration for the hub.</p>
133    pub fn s3_storage_config(mut self, input: crate::types::HubS3StorageConfig) -> Self {
134        self.s3_storage_config = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>The Amazon S3 storage configuration for the hub.</p>
138    pub fn set_s3_storage_config(mut self, input: ::std::option::Option<crate::types::HubS3StorageConfig>) -> Self {
139        self.s3_storage_config = input;
140        self
141    }
142    /// <p>The Amazon S3 storage configuration for the hub.</p>
143    pub fn get_s3_storage_config(&self) -> &::std::option::Option<crate::types::HubS3StorageConfig> {
144        &self.s3_storage_config
145    }
146    /// Appends an item to `tags`.
147    ///
148    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
149    ///
150    /// <p>Any tags to associate with the hub.</p>
151    pub fn tags(mut self, input: crate::types::Tag) -> Self {
152        let mut v = self.tags.unwrap_or_default();
153        v.push(input);
154        self.tags = ::std::option::Option::Some(v);
155        self
156    }
157    /// <p>Any tags to associate with the hub.</p>
158    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
159        self.tags = input;
160        self
161    }
162    /// <p>Any tags to associate with the hub.</p>
163    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
164        &self.tags
165    }
166    /// Consumes the builder and constructs a [`CreateHubInput`](crate::operation::create_hub::CreateHubInput).
167    pub fn build(self) -> ::std::result::Result<crate::operation::create_hub::CreateHubInput, ::aws_smithy_types::error::operation::BuildError> {
168        ::std::result::Result::Ok(crate::operation::create_hub::CreateHubInput {
169            hub_name: self.hub_name,
170            hub_description: self.hub_description,
171            hub_display_name: self.hub_display_name,
172            hub_search_keywords: self.hub_search_keywords,
173            s3_storage_config: self.s3_storage_config,
174            tags: self.tags,
175        })
176    }
177}