aws_sdk_ivschat/operation/delete_message/
_delete_message_input.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 DeleteMessageInput {
6    /// <p>Identifier of the room where the message should be deleted. Currently this must be an ARN.</p>
7    pub room_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>ID of the message to be deleted. This is the <code>Id</code> field in the received message (see <a href="https://docs.aws.amazon.com/ivs/latest/chatmsgapireference/actions-message-subscribe.html"> Message (Subscribe)</a> in the Chat Messaging API).</p>
9    pub id: ::std::option::Option<::std::string::String>,
10    /// <p>Reason for deleting the message.</p>
11    pub reason: ::std::option::Option<::std::string::String>,
12}
13impl DeleteMessageInput {
14    /// <p>Identifier of the room where the message should be deleted. Currently this must be an ARN.</p>
15    pub fn room_identifier(&self) -> ::std::option::Option<&str> {
16        self.room_identifier.as_deref()
17    }
18    /// <p>ID of the message to be deleted. This is the <code>Id</code> field in the received message (see <a href="https://docs.aws.amazon.com/ivs/latest/chatmsgapireference/actions-message-subscribe.html"> Message (Subscribe)</a> in the Chat Messaging API).</p>
19    pub fn id(&self) -> ::std::option::Option<&str> {
20        self.id.as_deref()
21    }
22    /// <p>Reason for deleting the message.</p>
23    pub fn reason(&self) -> ::std::option::Option<&str> {
24        self.reason.as_deref()
25    }
26}
27impl DeleteMessageInput {
28    /// Creates a new builder-style object to manufacture [`DeleteMessageInput`](crate::operation::delete_message::DeleteMessageInput).
29    pub fn builder() -> crate::operation::delete_message::builders::DeleteMessageInputBuilder {
30        crate::operation::delete_message::builders::DeleteMessageInputBuilder::default()
31    }
32}
33
34/// A builder for [`DeleteMessageInput`](crate::operation::delete_message::DeleteMessageInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DeleteMessageInputBuilder {
38    pub(crate) room_identifier: ::std::option::Option<::std::string::String>,
39    pub(crate) id: ::std::option::Option<::std::string::String>,
40    pub(crate) reason: ::std::option::Option<::std::string::String>,
41}
42impl DeleteMessageInputBuilder {
43    /// <p>Identifier of the room where the message should be deleted. Currently this must be an ARN.</p>
44    /// This field is required.
45    pub fn room_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.room_identifier = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>Identifier of the room where the message should be deleted. Currently this must be an ARN.</p>
50    pub fn set_room_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.room_identifier = input;
52        self
53    }
54    /// <p>Identifier of the room where the message should be deleted. Currently this must be an ARN.</p>
55    pub fn get_room_identifier(&self) -> &::std::option::Option<::std::string::String> {
56        &self.room_identifier
57    }
58    /// <p>ID of the message to be deleted. This is the <code>Id</code> field in the received message (see <a href="https://docs.aws.amazon.com/ivs/latest/chatmsgapireference/actions-message-subscribe.html"> Message (Subscribe)</a> in the Chat Messaging API).</p>
59    /// This field is required.
60    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>ID of the message to be deleted. This is the <code>Id</code> field in the received message (see <a href="https://docs.aws.amazon.com/ivs/latest/chatmsgapireference/actions-message-subscribe.html"> Message (Subscribe)</a> in the Chat Messaging API).</p>
65    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.id = input;
67        self
68    }
69    /// <p>ID of the message to be deleted. This is the <code>Id</code> field in the received message (see <a href="https://docs.aws.amazon.com/ivs/latest/chatmsgapireference/actions-message-subscribe.html"> Message (Subscribe)</a> in the Chat Messaging API).</p>
70    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.id
72    }
73    /// <p>Reason for deleting the message.</p>
74    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.reason = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>Reason for deleting the message.</p>
79    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.reason = input;
81        self
82    }
83    /// <p>Reason for deleting the message.</p>
84    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
85        &self.reason
86    }
87    /// Consumes the builder and constructs a [`DeleteMessageInput`](crate::operation::delete_message::DeleteMessageInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::delete_message::DeleteMessageInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::delete_message::DeleteMessageInput {
92            room_identifier: self.room_identifier,
93            id: self.id,
94            reason: self.reason,
95        })
96    }
97}