aws_sdk_datazone/operation/accept_predictions/
_accept_predictions_output.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 AcceptPredictionsOutput {
6    /// <p>The identifier of the Amazon DataZone domain.</p>
7    pub domain_id: ::std::string::String,
8    /// <p>The ID of the asset.</p>
9    pub asset_id: ::std::string::String,
10    /// <p>The revision that is to be made to the asset.</p>
11    pub revision: ::std::string::String,
12    _request_id: Option<String>,
13}
14impl AcceptPredictionsOutput {
15    /// <p>The identifier of the Amazon DataZone domain.</p>
16    pub fn domain_id(&self) -> &str {
17        use std::ops::Deref;
18        self.domain_id.deref()
19    }
20    /// <p>The ID of the asset.</p>
21    pub fn asset_id(&self) -> &str {
22        use std::ops::Deref;
23        self.asset_id.deref()
24    }
25    /// <p>The revision that is to be made to the asset.</p>
26    pub fn revision(&self) -> &str {
27        use std::ops::Deref;
28        self.revision.deref()
29    }
30}
31impl ::aws_types::request_id::RequestId for AcceptPredictionsOutput {
32    fn request_id(&self) -> Option<&str> {
33        self._request_id.as_deref()
34    }
35}
36impl AcceptPredictionsOutput {
37    /// Creates a new builder-style object to manufacture [`AcceptPredictionsOutput`](crate::operation::accept_predictions::AcceptPredictionsOutput).
38    pub fn builder() -> crate::operation::accept_predictions::builders::AcceptPredictionsOutputBuilder {
39        crate::operation::accept_predictions::builders::AcceptPredictionsOutputBuilder::default()
40    }
41}
42
43/// A builder for [`AcceptPredictionsOutput`](crate::operation::accept_predictions::AcceptPredictionsOutput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct AcceptPredictionsOutputBuilder {
47    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
48    pub(crate) asset_id: ::std::option::Option<::std::string::String>,
49    pub(crate) revision: ::std::option::Option<::std::string::String>,
50    _request_id: Option<String>,
51}
52impl AcceptPredictionsOutputBuilder {
53    /// <p>The identifier of the Amazon DataZone domain.</p>
54    /// This field is required.
55    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.domain_id = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>The identifier of the Amazon DataZone domain.</p>
60    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.domain_id = input;
62        self
63    }
64    /// <p>The identifier of the Amazon DataZone domain.</p>
65    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
66        &self.domain_id
67    }
68    /// <p>The ID of the asset.</p>
69    /// This field is required.
70    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.asset_id = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The ID of the asset.</p>
75    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.asset_id = input;
77        self
78    }
79    /// <p>The ID of the asset.</p>
80    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
81        &self.asset_id
82    }
83    /// <p>The revision that is to be made to the asset.</p>
84    /// This field is required.
85    pub fn revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.revision = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The revision that is to be made to the asset.</p>
90    pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.revision = input;
92        self
93    }
94    /// <p>The revision that is to be made to the asset.</p>
95    pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
96        &self.revision
97    }
98    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
99        self._request_id = Some(request_id.into());
100        self
101    }
102
103    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
104        self._request_id = request_id;
105        self
106    }
107    /// Consumes the builder and constructs a [`AcceptPredictionsOutput`](crate::operation::accept_predictions::AcceptPredictionsOutput).
108    /// This method will fail if any of the following fields are not set:
109    /// - [`domain_id`](crate::operation::accept_predictions::builders::AcceptPredictionsOutputBuilder::domain_id)
110    /// - [`asset_id`](crate::operation::accept_predictions::builders::AcceptPredictionsOutputBuilder::asset_id)
111    /// - [`revision`](crate::operation::accept_predictions::builders::AcceptPredictionsOutputBuilder::revision)
112    pub fn build(
113        self,
114    ) -> ::std::result::Result<crate::operation::accept_predictions::AcceptPredictionsOutput, ::aws_smithy_types::error::operation::BuildError> {
115        ::std::result::Result::Ok(crate::operation::accept_predictions::AcceptPredictionsOutput {
116            domain_id: self.domain_id.ok_or_else(|| {
117                ::aws_smithy_types::error::operation::BuildError::missing_field(
118                    "domain_id",
119                    "domain_id was not specified but it is required when building AcceptPredictionsOutput",
120                )
121            })?,
122            asset_id: self.asset_id.ok_or_else(|| {
123                ::aws_smithy_types::error::operation::BuildError::missing_field(
124                    "asset_id",
125                    "asset_id was not specified but it is required when building AcceptPredictionsOutput",
126                )
127            })?,
128            revision: self.revision.ok_or_else(|| {
129                ::aws_smithy_types::error::operation::BuildError::missing_field(
130                    "revision",
131                    "revision was not specified but it is required when building AcceptPredictionsOutput",
132                )
133            })?,
134            _request_id: self._request_id,
135        })
136    }
137}