aws_sdk_bedrockagentruntime/operation/create_invocation/
_create_invocation_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateInvocationOutput {
6 pub session_id: ::std::string::String,
8 pub invocation_id: ::std::string::String,
10 pub created_at: ::aws_smithy_types::DateTime,
12 _request_id: Option<String>,
13}
14impl CreateInvocationOutput {
15 pub fn session_id(&self) -> &str {
17 use std::ops::Deref;
18 self.session_id.deref()
19 }
20 pub fn invocation_id(&self) -> &str {
22 use std::ops::Deref;
23 self.invocation_id.deref()
24 }
25 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
27 &self.created_at
28 }
29}
30impl ::aws_types::request_id::RequestId for CreateInvocationOutput {
31 fn request_id(&self) -> Option<&str> {
32 self._request_id.as_deref()
33 }
34}
35impl CreateInvocationOutput {
36 pub fn builder() -> crate::operation::create_invocation::builders::CreateInvocationOutputBuilder {
38 crate::operation::create_invocation::builders::CreateInvocationOutputBuilder::default()
39 }
40}
41
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateInvocationOutputBuilder {
46 pub(crate) session_id: ::std::option::Option<::std::string::String>,
47 pub(crate) invocation_id: ::std::option::Option<::std::string::String>,
48 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
49 _request_id: Option<String>,
50}
51impl CreateInvocationOutputBuilder {
52 pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55 self.session_id = ::std::option::Option::Some(input.into());
56 self
57 }
58 pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.session_id = input;
61 self
62 }
63 pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
65 &self.session_id
66 }
67 pub fn invocation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.invocation_id = ::std::option::Option::Some(input.into());
71 self
72 }
73 pub fn set_invocation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.invocation_id = input;
76 self
77 }
78 pub fn get_invocation_id(&self) -> &::std::option::Option<::std::string::String> {
80 &self.invocation_id
81 }
82 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
85 self.created_at = ::std::option::Option::Some(input);
86 self
87 }
88 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
90 self.created_at = input;
91 self
92 }
93 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
95 &self.created_at
96 }
97 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
98 self._request_id = Some(request_id.into());
99 self
100 }
101
102 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
103 self._request_id = request_id;
104 self
105 }
106 pub fn build(
112 self,
113 ) -> ::std::result::Result<crate::operation::create_invocation::CreateInvocationOutput, ::aws_smithy_types::error::operation::BuildError> {
114 ::std::result::Result::Ok(crate::operation::create_invocation::CreateInvocationOutput {
115 session_id: self.session_id.ok_or_else(|| {
116 ::aws_smithy_types::error::operation::BuildError::missing_field(
117 "session_id",
118 "session_id was not specified but it is required when building CreateInvocationOutput",
119 )
120 })?,
121 invocation_id: self.invocation_id.ok_or_else(|| {
122 ::aws_smithy_types::error::operation::BuildError::missing_field(
123 "invocation_id",
124 "invocation_id was not specified but it is required when building CreateInvocationOutput",
125 )
126 })?,
127 created_at: self.created_at.ok_or_else(|| {
128 ::aws_smithy_types::error::operation::BuildError::missing_field(
129 "created_at",
130 "created_at was not specified but it is required when building CreateInvocationOutput",
131 )
132 })?,
133 _request_id: self._request_id,
134 })
135 }
136}