aws_sdk_datazone/operation/accept_predictions/
_accept_predictions_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct AcceptPredictionsOutput {
6 pub domain_id: ::std::string::String,
8 pub asset_id: ::std::string::String,
10 pub revision: ::std::string::String,
12 _request_id: Option<String>,
13}
14impl AcceptPredictionsOutput {
15 pub fn domain_id(&self) -> &str {
17 use std::ops::Deref;
18 self.domain_id.deref()
19 }
20 pub fn asset_id(&self) -> &str {
22 use std::ops::Deref;
23 self.asset_id.deref()
24 }
25 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 pub fn builder() -> crate::operation::accept_predictions::builders::AcceptPredictionsOutputBuilder {
39 crate::operation::accept_predictions::builders::AcceptPredictionsOutputBuilder::default()
40 }
41}
42
43#[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 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 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61 self.domain_id = input;
62 self
63 }
64 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
66 &self.domain_id
67 }
68 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 pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.asset_id = input;
77 self
78 }
79 pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
81 &self.asset_id
82 }
83 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 pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.revision = input;
92 self
93 }
94 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 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}