aws_sdk_comprehend/operation/create_endpoint/_create_endpoint_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 CreateEndpointInput {
6 /// <p>This is the descriptive suffix that becomes part of the <code>EndpointArn</code> used for all subsequent requests to this resource.</p>
7 pub endpoint_name: ::std::option::Option<::std::string::String>,
8 /// <p>The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.</p>
9 pub model_arn: ::std::option::Option<::std::string::String>,
10 /// <p>The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.</p>
11 pub desired_inference_units: ::std::option::Option<i32>,
12 /// <p>An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a <code>ResourceInUseException</code>.</p>
13 pub client_request_token: ::std::option::Option<::std::string::String>,
14 /// <p>Tags to associate with the endpoint. A tag is a key-value pair that adds metadata to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint to indicate its use by the sales department.</p>
15 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId).</p>
17 pub data_access_role_arn: ::std::option::Option<::std::string::String>,
18 /// <p>The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached.</p>
19 pub flywheel_arn: ::std::option::Option<::std::string::String>,
20}
21impl CreateEndpointInput {
22 /// <p>This is the descriptive suffix that becomes part of the <code>EndpointArn</code> used for all subsequent requests to this resource.</p>
23 pub fn endpoint_name(&self) -> ::std::option::Option<&str> {
24 self.endpoint_name.as_deref()
25 }
26 /// <p>The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.</p>
27 pub fn model_arn(&self) -> ::std::option::Option<&str> {
28 self.model_arn.as_deref()
29 }
30 /// <p>The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.</p>
31 pub fn desired_inference_units(&self) -> ::std::option::Option<i32> {
32 self.desired_inference_units
33 }
34 /// <p>An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a <code>ResourceInUseException</code>.</p>
35 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
36 self.client_request_token.as_deref()
37 }
38 /// <p>Tags to associate with the endpoint. A tag is a key-value pair that adds metadata to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint to indicate its use by the sales department.</p>
39 ///
40 /// 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()`.
41 pub fn tags(&self) -> &[crate::types::Tag] {
42 self.tags.as_deref().unwrap_or_default()
43 }
44 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId).</p>
45 pub fn data_access_role_arn(&self) -> ::std::option::Option<&str> {
46 self.data_access_role_arn.as_deref()
47 }
48 /// <p>The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached.</p>
49 pub fn flywheel_arn(&self) -> ::std::option::Option<&str> {
50 self.flywheel_arn.as_deref()
51 }
52}
53impl CreateEndpointInput {
54 /// Creates a new builder-style object to manufacture [`CreateEndpointInput`](crate::operation::create_endpoint::CreateEndpointInput).
55 pub fn builder() -> crate::operation::create_endpoint::builders::CreateEndpointInputBuilder {
56 crate::operation::create_endpoint::builders::CreateEndpointInputBuilder::default()
57 }
58}
59
60/// A builder for [`CreateEndpointInput`](crate::operation::create_endpoint::CreateEndpointInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateEndpointInputBuilder {
64 pub(crate) endpoint_name: ::std::option::Option<::std::string::String>,
65 pub(crate) model_arn: ::std::option::Option<::std::string::String>,
66 pub(crate) desired_inference_units: ::std::option::Option<i32>,
67 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
68 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
69 pub(crate) data_access_role_arn: ::std::option::Option<::std::string::String>,
70 pub(crate) flywheel_arn: ::std::option::Option<::std::string::String>,
71}
72impl CreateEndpointInputBuilder {
73 /// <p>This is the descriptive suffix that becomes part of the <code>EndpointArn</code> used for all subsequent requests to this resource.</p>
74 /// This field is required.
75 pub fn endpoint_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.endpoint_name = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>This is the descriptive suffix that becomes part of the <code>EndpointArn</code> used for all subsequent requests to this resource.</p>
80 pub fn set_endpoint_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.endpoint_name = input;
82 self
83 }
84 /// <p>This is the descriptive suffix that becomes part of the <code>EndpointArn</code> used for all subsequent requests to this resource.</p>
85 pub fn get_endpoint_name(&self) -> &::std::option::Option<::std::string::String> {
86 &self.endpoint_name
87 }
88 /// <p>The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.</p>
89 pub fn model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.model_arn = ::std::option::Option::Some(input.into());
91 self
92 }
93 /// <p>The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.</p>
94 pub fn set_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.model_arn = input;
96 self
97 }
98 /// <p>The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.</p>
99 pub fn get_model_arn(&self) -> &::std::option::Option<::std::string::String> {
100 &self.model_arn
101 }
102 /// <p>The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.</p>
103 /// This field is required.
104 pub fn desired_inference_units(mut self, input: i32) -> Self {
105 self.desired_inference_units = ::std::option::Option::Some(input);
106 self
107 }
108 /// <p>The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.</p>
109 pub fn set_desired_inference_units(mut self, input: ::std::option::Option<i32>) -> Self {
110 self.desired_inference_units = input;
111 self
112 }
113 /// <p>The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.</p>
114 pub fn get_desired_inference_units(&self) -> &::std::option::Option<i32> {
115 &self.desired_inference_units
116 }
117 /// <p>An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a <code>ResourceInUseException</code>.</p>
118 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.client_request_token = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <p>An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a <code>ResourceInUseException</code>.</p>
123 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.client_request_token = input;
125 self
126 }
127 /// <p>An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a <code>ResourceInUseException</code>.</p>
128 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
129 &self.client_request_token
130 }
131 /// Appends an item to `tags`.
132 ///
133 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
134 ///
135 /// <p>Tags to associate with the endpoint. A tag is a key-value pair that adds metadata to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint to indicate its use by the sales department.</p>
136 pub fn tags(mut self, input: crate::types::Tag) -> Self {
137 let mut v = self.tags.unwrap_or_default();
138 v.push(input);
139 self.tags = ::std::option::Option::Some(v);
140 self
141 }
142 /// <p>Tags to associate with the endpoint. A tag is a key-value pair that adds metadata to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint to indicate its use by the sales department.</p>
143 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
144 self.tags = input;
145 self
146 }
147 /// <p>Tags to associate with the endpoint. A tag is a key-value pair that adds metadata to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint to indicate its use by the sales department.</p>
148 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
149 &self.tags
150 }
151 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId).</p>
152 pub fn data_access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.data_access_role_arn = ::std::option::Option::Some(input.into());
154 self
155 }
156 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId).</p>
157 pub fn set_data_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.data_access_role_arn = input;
159 self
160 }
161 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId).</p>
162 pub fn get_data_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
163 &self.data_access_role_arn
164 }
165 /// <p>The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached.</p>
166 pub fn flywheel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.flywheel_arn = ::std::option::Option::Some(input.into());
168 self
169 }
170 /// <p>The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached.</p>
171 pub fn set_flywheel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.flywheel_arn = input;
173 self
174 }
175 /// <p>The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached.</p>
176 pub fn get_flywheel_arn(&self) -> &::std::option::Option<::std::string::String> {
177 &self.flywheel_arn
178 }
179 /// Consumes the builder and constructs a [`CreateEndpointInput`](crate::operation::create_endpoint::CreateEndpointInput).
180 pub fn build(
181 self,
182 ) -> ::std::result::Result<crate::operation::create_endpoint::CreateEndpointInput, ::aws_smithy_types::error::operation::BuildError> {
183 ::std::result::Result::Ok(crate::operation::create_endpoint::CreateEndpointInput {
184 endpoint_name: self.endpoint_name,
185 model_arn: self.model_arn,
186 desired_inference_units: self.desired_inference_units,
187 client_request_token: self.client_request_token,
188 tags: self.tags,
189 data_access_role_arn: self.data_access_role_arn,
190 flywheel_arn: self.flywheel_arn,
191 })
192 }
193}