aws_sdk_bedrockagentruntime/operation/update_session/
_update_session_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 UpdateSessionOutput {
6    /// <p>The unique identifier of the session you updated.</p>
7    pub session_id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the session that was updated.</p>
9    pub session_arn: ::std::string::String,
10    /// <p>The status of the session you updated.</p>
11    pub session_status: crate::types::SessionStatus,
12    /// <p>The timestamp for when the session was created.</p>
13    pub created_at: ::aws_smithy_types::DateTime,
14    /// <p>The timestamp for when the session was last modified.</p>
15    pub last_updated_at: ::aws_smithy_types::DateTime,
16    _request_id: Option<String>,
17}
18impl UpdateSessionOutput {
19    /// <p>The unique identifier of the session you updated.</p>
20    pub fn session_id(&self) -> &str {
21        use std::ops::Deref;
22        self.session_id.deref()
23    }
24    /// <p>The Amazon Resource Name (ARN) of the session that was updated.</p>
25    pub fn session_arn(&self) -> &str {
26        use std::ops::Deref;
27        self.session_arn.deref()
28    }
29    /// <p>The status of the session you updated.</p>
30    pub fn session_status(&self) -> &crate::types::SessionStatus {
31        &self.session_status
32    }
33    /// <p>The timestamp for when the session was created.</p>
34    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
35        &self.created_at
36    }
37    /// <p>The timestamp for when the session was last modified.</p>
38    pub fn last_updated_at(&self) -> &::aws_smithy_types::DateTime {
39        &self.last_updated_at
40    }
41}
42impl ::aws_types::request_id::RequestId for UpdateSessionOutput {
43    fn request_id(&self) -> Option<&str> {
44        self._request_id.as_deref()
45    }
46}
47impl UpdateSessionOutput {
48    /// Creates a new builder-style object to manufacture [`UpdateSessionOutput`](crate::operation::update_session::UpdateSessionOutput).
49    pub fn builder() -> crate::operation::update_session::builders::UpdateSessionOutputBuilder {
50        crate::operation::update_session::builders::UpdateSessionOutputBuilder::default()
51    }
52}
53
54/// A builder for [`UpdateSessionOutput`](crate::operation::update_session::UpdateSessionOutput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct UpdateSessionOutputBuilder {
58    pub(crate) session_id: ::std::option::Option<::std::string::String>,
59    pub(crate) session_arn: ::std::option::Option<::std::string::String>,
60    pub(crate) session_status: ::std::option::Option<crate::types::SessionStatus>,
61    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
62    pub(crate) last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
63    _request_id: Option<String>,
64}
65impl UpdateSessionOutputBuilder {
66    /// <p>The unique identifier of the session you updated.</p>
67    /// This field is required.
68    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.session_id = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The unique identifier of the session you updated.</p>
73    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.session_id = input;
75        self
76    }
77    /// <p>The unique identifier of the session you updated.</p>
78    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.session_id
80    }
81    /// <p>The Amazon Resource Name (ARN) of the session that was updated.</p>
82    /// This field is required.
83    pub fn session_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.session_arn = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The Amazon Resource Name (ARN) of the session that was updated.</p>
88    pub fn set_session_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.session_arn = input;
90        self
91    }
92    /// <p>The Amazon Resource Name (ARN) of the session that was updated.</p>
93    pub fn get_session_arn(&self) -> &::std::option::Option<::std::string::String> {
94        &self.session_arn
95    }
96    /// <p>The status of the session you updated.</p>
97    /// This field is required.
98    pub fn session_status(mut self, input: crate::types::SessionStatus) -> Self {
99        self.session_status = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The status of the session you updated.</p>
103    pub fn set_session_status(mut self, input: ::std::option::Option<crate::types::SessionStatus>) -> Self {
104        self.session_status = input;
105        self
106    }
107    /// <p>The status of the session you updated.</p>
108    pub fn get_session_status(&self) -> &::std::option::Option<crate::types::SessionStatus> {
109        &self.session_status
110    }
111    /// <p>The timestamp for when the session was created.</p>
112    /// This field is required.
113    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
114        self.created_at = ::std::option::Option::Some(input);
115        self
116    }
117    /// <p>The timestamp for when the session was created.</p>
118    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
119        self.created_at = input;
120        self
121    }
122    /// <p>The timestamp for when the session was created.</p>
123    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
124        &self.created_at
125    }
126    /// <p>The timestamp for when the session was last modified.</p>
127    /// This field is required.
128    pub fn last_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
129        self.last_updated_at = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>The timestamp for when the session was last modified.</p>
133    pub fn set_last_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
134        self.last_updated_at = input;
135        self
136    }
137    /// <p>The timestamp for when the session was last modified.</p>
138    pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
139        &self.last_updated_at
140    }
141    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
142        self._request_id = Some(request_id.into());
143        self
144    }
145
146    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
147        self._request_id = request_id;
148        self
149    }
150    /// Consumes the builder and constructs a [`UpdateSessionOutput`](crate::operation::update_session::UpdateSessionOutput).
151    /// This method will fail if any of the following fields are not set:
152    /// - [`session_id`](crate::operation::update_session::builders::UpdateSessionOutputBuilder::session_id)
153    /// - [`session_arn`](crate::operation::update_session::builders::UpdateSessionOutputBuilder::session_arn)
154    /// - [`session_status`](crate::operation::update_session::builders::UpdateSessionOutputBuilder::session_status)
155    /// - [`created_at`](crate::operation::update_session::builders::UpdateSessionOutputBuilder::created_at)
156    /// - [`last_updated_at`](crate::operation::update_session::builders::UpdateSessionOutputBuilder::last_updated_at)
157    pub fn build(
158        self,
159    ) -> ::std::result::Result<crate::operation::update_session::UpdateSessionOutput, ::aws_smithy_types::error::operation::BuildError> {
160        ::std::result::Result::Ok(crate::operation::update_session::UpdateSessionOutput {
161            session_id: self.session_id.ok_or_else(|| {
162                ::aws_smithy_types::error::operation::BuildError::missing_field(
163                    "session_id",
164                    "session_id was not specified but it is required when building UpdateSessionOutput",
165                )
166            })?,
167            session_arn: self.session_arn.ok_or_else(|| {
168                ::aws_smithy_types::error::operation::BuildError::missing_field(
169                    "session_arn",
170                    "session_arn was not specified but it is required when building UpdateSessionOutput",
171                )
172            })?,
173            session_status: self.session_status.ok_or_else(|| {
174                ::aws_smithy_types::error::operation::BuildError::missing_field(
175                    "session_status",
176                    "session_status was not specified but it is required when building UpdateSessionOutput",
177                )
178            })?,
179            created_at: self.created_at.ok_or_else(|| {
180                ::aws_smithy_types::error::operation::BuildError::missing_field(
181                    "created_at",
182                    "created_at was not specified but it is required when building UpdateSessionOutput",
183                )
184            })?,
185            last_updated_at: self.last_updated_at.ok_or_else(|| {
186                ::aws_smithy_types::error::operation::BuildError::missing_field(
187                    "last_updated_at",
188                    "last_updated_at was not specified but it is required when building UpdateSessionOutput",
189                )
190            })?,
191            _request_id: self._request_id,
192        })
193    }
194}