aws_sdk_sagemaker/operation/create_workforce/_create_workforce_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 CreateWorkforceInput {
6 /// <p>Use this parameter to configure an Amazon Cognito private workforce. A single Cognito workforce is created using and corresponds to a single <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html"> Amazon Cognito user pool</a>.</p>
7 /// <p>Do not use <code>OidcConfig</code> if you specify values for <code>CognitoConfig</code>.</p>
8 pub cognito_config: ::std::option::Option<crate::types::CognitoConfig>,
9 /// <p>Use this parameter to configure a private workforce using your own OIDC Identity Provider.</p>
10 /// <p>Do not use <code>CognitoConfig</code> if you specify values for <code>OidcConfig</code>.</p>
11 pub oidc_config: ::std::option::Option<crate::types::OidcConfig>,
12 /// <p>A list of IP address ranges (<a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html">CIDRs</a>). Used to create an allow list of IP addresses for a private workforce. Workers will only be able to log in to their worker portal from an IP address within this range. By default, a workforce isn't restricted to specific IP addresses.</p>
13 pub source_ip_config: ::std::option::Option<crate::types::SourceIpConfig>,
14 /// <p>The name of the private workforce.</p>
15 pub workforce_name: ::std::option::Option<::std::string::String>,
16 /// <p>An array of key-value pairs that contain metadata to help you categorize and organize our workforce. Each tag consists of a key and a value, both of which you define.</p>
17 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18 /// <p>Use this parameter to configure a workforce using VPC.</p>
19 pub workforce_vpc_config: ::std::option::Option<crate::types::WorkforceVpcConfigRequest>,
20 /// <p>Use this parameter to specify whether you want <code>IPv4</code> only or <code>dualstack</code> (<code>IPv4</code> and <code>IPv6</code>) to support your labeling workforce.</p>
21 pub ip_address_type: ::std::option::Option<crate::types::WorkforceIpAddressType>,
22}
23impl CreateWorkforceInput {
24 /// <p>Use this parameter to configure an Amazon Cognito private workforce. A single Cognito workforce is created using and corresponds to a single <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html"> Amazon Cognito user pool</a>.</p>
25 /// <p>Do not use <code>OidcConfig</code> if you specify values for <code>CognitoConfig</code>.</p>
26 pub fn cognito_config(&self) -> ::std::option::Option<&crate::types::CognitoConfig> {
27 self.cognito_config.as_ref()
28 }
29 /// <p>Use this parameter to configure a private workforce using your own OIDC Identity Provider.</p>
30 /// <p>Do not use <code>CognitoConfig</code> if you specify values for <code>OidcConfig</code>.</p>
31 pub fn oidc_config(&self) -> ::std::option::Option<&crate::types::OidcConfig> {
32 self.oidc_config.as_ref()
33 }
34 /// <p>A list of IP address ranges (<a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html">CIDRs</a>). Used to create an allow list of IP addresses for a private workforce. Workers will only be able to log in to their worker portal from an IP address within this range. By default, a workforce isn't restricted to specific IP addresses.</p>
35 pub fn source_ip_config(&self) -> ::std::option::Option<&crate::types::SourceIpConfig> {
36 self.source_ip_config.as_ref()
37 }
38 /// <p>The name of the private workforce.</p>
39 pub fn workforce_name(&self) -> ::std::option::Option<&str> {
40 self.workforce_name.as_deref()
41 }
42 /// <p>An array of key-value pairs that contain metadata to help you categorize and organize our workforce. Each tag consists of a key and a value, both of which you define.</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 /// <p>Use this parameter to configure a workforce using VPC.</p>
49 pub fn workforce_vpc_config(&self) -> ::std::option::Option<&crate::types::WorkforceVpcConfigRequest> {
50 self.workforce_vpc_config.as_ref()
51 }
52 /// <p>Use this parameter to specify whether you want <code>IPv4</code> only or <code>dualstack</code> (<code>IPv4</code> and <code>IPv6</code>) to support your labeling workforce.</p>
53 pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::WorkforceIpAddressType> {
54 self.ip_address_type.as_ref()
55 }
56}
57impl CreateWorkforceInput {
58 /// Creates a new builder-style object to manufacture [`CreateWorkforceInput`](crate::operation::create_workforce::CreateWorkforceInput).
59 pub fn builder() -> crate::operation::create_workforce::builders::CreateWorkforceInputBuilder {
60 crate::operation::create_workforce::builders::CreateWorkforceInputBuilder::default()
61 }
62}
63
64/// A builder for [`CreateWorkforceInput`](crate::operation::create_workforce::CreateWorkforceInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CreateWorkforceInputBuilder {
68 pub(crate) cognito_config: ::std::option::Option<crate::types::CognitoConfig>,
69 pub(crate) oidc_config: ::std::option::Option<crate::types::OidcConfig>,
70 pub(crate) source_ip_config: ::std::option::Option<crate::types::SourceIpConfig>,
71 pub(crate) workforce_name: ::std::option::Option<::std::string::String>,
72 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
73 pub(crate) workforce_vpc_config: ::std::option::Option<crate::types::WorkforceVpcConfigRequest>,
74 pub(crate) ip_address_type: ::std::option::Option<crate::types::WorkforceIpAddressType>,
75}
76impl CreateWorkforceInputBuilder {
77 /// <p>Use this parameter to configure an Amazon Cognito private workforce. A single Cognito workforce is created using and corresponds to a single <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html"> Amazon Cognito user pool</a>.</p>
78 /// <p>Do not use <code>OidcConfig</code> if you specify values for <code>CognitoConfig</code>.</p>
79 pub fn cognito_config(mut self, input: crate::types::CognitoConfig) -> Self {
80 self.cognito_config = ::std::option::Option::Some(input);
81 self
82 }
83 /// <p>Use this parameter to configure an Amazon Cognito private workforce. A single Cognito workforce is created using and corresponds to a single <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html"> Amazon Cognito user pool</a>.</p>
84 /// <p>Do not use <code>OidcConfig</code> if you specify values for <code>CognitoConfig</code>.</p>
85 pub fn set_cognito_config(mut self, input: ::std::option::Option<crate::types::CognitoConfig>) -> Self {
86 self.cognito_config = input;
87 self
88 }
89 /// <p>Use this parameter to configure an Amazon Cognito private workforce. A single Cognito workforce is created using and corresponds to a single <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html"> Amazon Cognito user pool</a>.</p>
90 /// <p>Do not use <code>OidcConfig</code> if you specify values for <code>CognitoConfig</code>.</p>
91 pub fn get_cognito_config(&self) -> &::std::option::Option<crate::types::CognitoConfig> {
92 &self.cognito_config
93 }
94 /// <p>Use this parameter to configure a private workforce using your own OIDC Identity Provider.</p>
95 /// <p>Do not use <code>CognitoConfig</code> if you specify values for <code>OidcConfig</code>.</p>
96 pub fn oidc_config(mut self, input: crate::types::OidcConfig) -> Self {
97 self.oidc_config = ::std::option::Option::Some(input);
98 self
99 }
100 /// <p>Use this parameter to configure a private workforce using your own OIDC Identity Provider.</p>
101 /// <p>Do not use <code>CognitoConfig</code> if you specify values for <code>OidcConfig</code>.</p>
102 pub fn set_oidc_config(mut self, input: ::std::option::Option<crate::types::OidcConfig>) -> Self {
103 self.oidc_config = input;
104 self
105 }
106 /// <p>Use this parameter to configure a private workforce using your own OIDC Identity Provider.</p>
107 /// <p>Do not use <code>CognitoConfig</code> if you specify values for <code>OidcConfig</code>.</p>
108 pub fn get_oidc_config(&self) -> &::std::option::Option<crate::types::OidcConfig> {
109 &self.oidc_config
110 }
111 /// <p>A list of IP address ranges (<a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html">CIDRs</a>). Used to create an allow list of IP addresses for a private workforce. Workers will only be able to log in to their worker portal from an IP address within this range. By default, a workforce isn't restricted to specific IP addresses.</p>
112 pub fn source_ip_config(mut self, input: crate::types::SourceIpConfig) -> Self {
113 self.source_ip_config = ::std::option::Option::Some(input);
114 self
115 }
116 /// <p>A list of IP address ranges (<a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html">CIDRs</a>). Used to create an allow list of IP addresses for a private workforce. Workers will only be able to log in to their worker portal from an IP address within this range. By default, a workforce isn't restricted to specific IP addresses.</p>
117 pub fn set_source_ip_config(mut self, input: ::std::option::Option<crate::types::SourceIpConfig>) -> Self {
118 self.source_ip_config = input;
119 self
120 }
121 /// <p>A list of IP address ranges (<a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html">CIDRs</a>). Used to create an allow list of IP addresses for a private workforce. Workers will only be able to log in to their worker portal from an IP address within this range. By default, a workforce isn't restricted to specific IP addresses.</p>
122 pub fn get_source_ip_config(&self) -> &::std::option::Option<crate::types::SourceIpConfig> {
123 &self.source_ip_config
124 }
125 /// <p>The name of the private workforce.</p>
126 /// This field is required.
127 pub fn workforce_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.workforce_name = ::std::option::Option::Some(input.into());
129 self
130 }
131 /// <p>The name of the private workforce.</p>
132 pub fn set_workforce_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.workforce_name = input;
134 self
135 }
136 /// <p>The name of the private workforce.</p>
137 pub fn get_workforce_name(&self) -> &::std::option::Option<::std::string::String> {
138 &self.workforce_name
139 }
140 /// Appends an item to `tags`.
141 ///
142 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
143 ///
144 /// <p>An array of key-value pairs that contain metadata to help you categorize and organize our workforce. Each tag consists of a key and a value, both of which you define.</p>
145 pub fn tags(mut self, input: crate::types::Tag) -> Self {
146 let mut v = self.tags.unwrap_or_default();
147 v.push(input);
148 self.tags = ::std::option::Option::Some(v);
149 self
150 }
151 /// <p>An array of key-value pairs that contain metadata to help you categorize and organize our workforce. Each tag consists of a key and a value, both of which you define.</p>
152 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
153 self.tags = input;
154 self
155 }
156 /// <p>An array of key-value pairs that contain metadata to help you categorize and organize our workforce. Each tag consists of a key and a value, both of which you define.</p>
157 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
158 &self.tags
159 }
160 /// <p>Use this parameter to configure a workforce using VPC.</p>
161 pub fn workforce_vpc_config(mut self, input: crate::types::WorkforceVpcConfigRequest) -> Self {
162 self.workforce_vpc_config = ::std::option::Option::Some(input);
163 self
164 }
165 /// <p>Use this parameter to configure a workforce using VPC.</p>
166 pub fn set_workforce_vpc_config(mut self, input: ::std::option::Option<crate::types::WorkforceVpcConfigRequest>) -> Self {
167 self.workforce_vpc_config = input;
168 self
169 }
170 /// <p>Use this parameter to configure a workforce using VPC.</p>
171 pub fn get_workforce_vpc_config(&self) -> &::std::option::Option<crate::types::WorkforceVpcConfigRequest> {
172 &self.workforce_vpc_config
173 }
174 /// <p>Use this parameter to specify whether you want <code>IPv4</code> only or <code>dualstack</code> (<code>IPv4</code> and <code>IPv6</code>) to support your labeling workforce.</p>
175 pub fn ip_address_type(mut self, input: crate::types::WorkforceIpAddressType) -> Self {
176 self.ip_address_type = ::std::option::Option::Some(input);
177 self
178 }
179 /// <p>Use this parameter to specify whether you want <code>IPv4</code> only or <code>dualstack</code> (<code>IPv4</code> and <code>IPv6</code>) to support your labeling workforce.</p>
180 pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::WorkforceIpAddressType>) -> Self {
181 self.ip_address_type = input;
182 self
183 }
184 /// <p>Use this parameter to specify whether you want <code>IPv4</code> only or <code>dualstack</code> (<code>IPv4</code> and <code>IPv6</code>) to support your labeling workforce.</p>
185 pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::WorkforceIpAddressType> {
186 &self.ip_address_type
187 }
188 /// Consumes the builder and constructs a [`CreateWorkforceInput`](crate::operation::create_workforce::CreateWorkforceInput).
189 pub fn build(
190 self,
191 ) -> ::std::result::Result<crate::operation::create_workforce::CreateWorkforceInput, ::aws_smithy_types::error::operation::BuildError> {
192 ::std::result::Result::Ok(crate::operation::create_workforce::CreateWorkforceInput {
193 cognito_config: self.cognito_config,
194 oidc_config: self.oidc_config,
195 source_ip_config: self.source_ip_config,
196 workforce_name: self.workforce_name,
197 tags: self.tags,
198 workforce_vpc_config: self.workforce_vpc_config,
199 ip_address_type: self.ip_address_type,
200 })
201 }
202}