aws_sdk_datazone/operation/accept_predictions/
_accept_predictions_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 AcceptPredictionsInput {
6    /// <p>The identifier of the Amazon DataZone domain.</p>
7    pub domain_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the asset.</p>
9    pub identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The revision that is to be made to the asset.</p>
11    pub revision: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies the rule (or the conditions) under which a prediction can be accepted.</p>
13    pub accept_rule: ::std::option::Option<crate::types::AcceptRule>,
14    /// <p>Specifies the prediction (aka, the automatically generated piece of metadata) and the target (for example, a column name) that can be accepted.</p>
15    pub accept_choices: ::std::option::Option<::std::vec::Vec<crate::types::AcceptChoice>>,
16    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18}
19impl AcceptPredictionsInput {
20    /// <p>The identifier of the Amazon DataZone domain.</p>
21    pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
22        self.domain_identifier.as_deref()
23    }
24    /// <p>The identifier of the asset.</p>
25    pub fn identifier(&self) -> ::std::option::Option<&str> {
26        self.identifier.as_deref()
27    }
28    /// <p>The revision that is to be made to the asset.</p>
29    pub fn revision(&self) -> ::std::option::Option<&str> {
30        self.revision.as_deref()
31    }
32    /// <p>Specifies the rule (or the conditions) under which a prediction can be accepted.</p>
33    pub fn accept_rule(&self) -> ::std::option::Option<&crate::types::AcceptRule> {
34        self.accept_rule.as_ref()
35    }
36    /// <p>Specifies the prediction (aka, the automatically generated piece of metadata) and the target (for example, a column name) that can be accepted.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.accept_choices.is_none()`.
39    pub fn accept_choices(&self) -> &[crate::types::AcceptChoice] {
40        self.accept_choices.as_deref().unwrap_or_default()
41    }
42    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
43    pub fn client_token(&self) -> ::std::option::Option<&str> {
44        self.client_token.as_deref()
45    }
46}
47impl AcceptPredictionsInput {
48    /// Creates a new builder-style object to manufacture [`AcceptPredictionsInput`](crate::operation::accept_predictions::AcceptPredictionsInput).
49    pub fn builder() -> crate::operation::accept_predictions::builders::AcceptPredictionsInputBuilder {
50        crate::operation::accept_predictions::builders::AcceptPredictionsInputBuilder::default()
51    }
52}
53
54/// A builder for [`AcceptPredictionsInput`](crate::operation::accept_predictions::AcceptPredictionsInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct AcceptPredictionsInputBuilder {
58    pub(crate) domain_identifier: ::std::option::Option<::std::string::String>,
59    pub(crate) identifier: ::std::option::Option<::std::string::String>,
60    pub(crate) revision: ::std::option::Option<::std::string::String>,
61    pub(crate) accept_rule: ::std::option::Option<crate::types::AcceptRule>,
62    pub(crate) accept_choices: ::std::option::Option<::std::vec::Vec<crate::types::AcceptChoice>>,
63    pub(crate) client_token: ::std::option::Option<::std::string::String>,
64}
65impl AcceptPredictionsInputBuilder {
66    /// <p>The identifier of the Amazon DataZone domain.</p>
67    /// This field is required.
68    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.domain_identifier = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The identifier of the Amazon DataZone domain.</p>
73    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.domain_identifier = input;
75        self
76    }
77    /// <p>The identifier of the Amazon DataZone domain.</p>
78    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
79        &self.domain_identifier
80    }
81    /// <p>The identifier of the asset.</p>
82    /// This field is required.
83    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.identifier = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The identifier of the asset.</p>
88    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.identifier = input;
90        self
91    }
92    /// <p>The identifier of the asset.</p>
93    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
94        &self.identifier
95    }
96    /// <p>The revision that is to be made to the asset.</p>
97    pub fn revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.revision = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The revision that is to be made to the asset.</p>
102    pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.revision = input;
104        self
105    }
106    /// <p>The revision that is to be made to the asset.</p>
107    pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
108        &self.revision
109    }
110    /// <p>Specifies the rule (or the conditions) under which a prediction can be accepted.</p>
111    pub fn accept_rule(mut self, input: crate::types::AcceptRule) -> Self {
112        self.accept_rule = ::std::option::Option::Some(input);
113        self
114    }
115    /// <p>Specifies the rule (or the conditions) under which a prediction can be accepted.</p>
116    pub fn set_accept_rule(mut self, input: ::std::option::Option<crate::types::AcceptRule>) -> Self {
117        self.accept_rule = input;
118        self
119    }
120    /// <p>Specifies the rule (or the conditions) under which a prediction can be accepted.</p>
121    pub fn get_accept_rule(&self) -> &::std::option::Option<crate::types::AcceptRule> {
122        &self.accept_rule
123    }
124    /// Appends an item to `accept_choices`.
125    ///
126    /// To override the contents of this collection use [`set_accept_choices`](Self::set_accept_choices).
127    ///
128    /// <p>Specifies the prediction (aka, the automatically generated piece of metadata) and the target (for example, a column name) that can be accepted.</p>
129    pub fn accept_choices(mut self, input: crate::types::AcceptChoice) -> Self {
130        let mut v = self.accept_choices.unwrap_or_default();
131        v.push(input);
132        self.accept_choices = ::std::option::Option::Some(v);
133        self
134    }
135    /// <p>Specifies the prediction (aka, the automatically generated piece of metadata) and the target (for example, a column name) that can be accepted.</p>
136    pub fn set_accept_choices(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AcceptChoice>>) -> Self {
137        self.accept_choices = input;
138        self
139    }
140    /// <p>Specifies the prediction (aka, the automatically generated piece of metadata) and the target (for example, a column name) that can be accepted.</p>
141    pub fn get_accept_choices(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AcceptChoice>> {
142        &self.accept_choices
143    }
144    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
145    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.client_token = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
150    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.client_token = input;
152        self
153    }
154    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
155    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
156        &self.client_token
157    }
158    /// Consumes the builder and constructs a [`AcceptPredictionsInput`](crate::operation::accept_predictions::AcceptPredictionsInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<crate::operation::accept_predictions::AcceptPredictionsInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::accept_predictions::AcceptPredictionsInput {
163            domain_identifier: self.domain_identifier,
164            identifier: self.identifier,
165            revision: self.revision,
166            accept_rule: self.accept_rule,
167            accept_choices: self.accept_choices,
168            client_token: self.client_token,
169        })
170    }
171}