Skip to main content

aws_sdk_devopsagent/operation/create_chat/
_create_chat_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Response structure for creating a new chat
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateChatOutput {
7    /// The unique identifier for the created execution
8    pub execution_id: ::std::string::String,
9    /// Timestamp when the chat was created
10    pub created_at: ::aws_smithy_types::DateTime,
11    _request_id: Option<String>,
12}
13impl CreateChatOutput {
14    /// The unique identifier for the created execution
15    pub fn execution_id(&self) -> &str {
16        use std::ops::Deref;
17        self.execution_id.deref()
18    }
19    /// Timestamp when the chat was created
20    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
21        &self.created_at
22    }
23}
24impl ::aws_types::request_id::RequestId for CreateChatOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl CreateChatOutput {
30    /// Creates a new builder-style object to manufacture [`CreateChatOutput`](crate::operation::create_chat::CreateChatOutput).
31    pub fn builder() -> crate::operation::create_chat::builders::CreateChatOutputBuilder {
32        crate::operation::create_chat::builders::CreateChatOutputBuilder::default()
33    }
34}
35
36/// A builder for [`CreateChatOutput`](crate::operation::create_chat::CreateChatOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateChatOutputBuilder {
40    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
41    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
42    _request_id: Option<String>,
43}
44impl CreateChatOutputBuilder {
45    /// The unique identifier for the created execution
46    /// This field is required.
47    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.execution_id = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// The unique identifier for the created execution
52    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.execution_id = input;
54        self
55    }
56    /// The unique identifier for the created execution
57    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
58        &self.execution_id
59    }
60    /// Timestamp when the chat was created
61    /// This field is required.
62    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
63        self.created_at = ::std::option::Option::Some(input);
64        self
65    }
66    /// Timestamp when the chat was created
67    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
68        self.created_at = input;
69        self
70    }
71    /// Timestamp when the chat was created
72    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
73        &self.created_at
74    }
75    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
76        self._request_id = Some(request_id.into());
77        self
78    }
79
80    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
81        self._request_id = request_id;
82        self
83    }
84    /// Consumes the builder and constructs a [`CreateChatOutput`](crate::operation::create_chat::CreateChatOutput).
85    /// This method will fail if any of the following fields are not set:
86    /// - [`execution_id`](crate::operation::create_chat::builders::CreateChatOutputBuilder::execution_id)
87    /// - [`created_at`](crate::operation::create_chat::builders::CreateChatOutputBuilder::created_at)
88    pub fn build(self) -> ::std::result::Result<crate::operation::create_chat::CreateChatOutput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::create_chat::CreateChatOutput {
90            execution_id: self.execution_id.ok_or_else(|| {
91                ::aws_smithy_types::error::operation::BuildError::missing_field(
92                    "execution_id",
93                    "execution_id was not specified but it is required when building CreateChatOutput",
94                )
95            })?,
96            created_at: self.created_at.ok_or_else(|| {
97                ::aws_smithy_types::error::operation::BuildError::missing_field(
98                    "created_at",
99                    "created_at was not specified but it is required when building CreateChatOutput",
100                )
101            })?,
102            _request_id: self._request_id,
103        })
104    }
105}