aws_sdk_ivschat/operation/send_event/
_send_event_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SendEventInput {
6 pub room_identifier: ::std::option::Option<::std::string::String>,
8 pub event_name: ::std::option::Option<::std::string::String>,
10 pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl SendEventInput {
14 pub fn room_identifier(&self) -> ::std::option::Option<&str> {
16 self.room_identifier.as_deref()
17 }
18 pub fn event_name(&self) -> ::std::option::Option<&str> {
20 self.event_name.as_deref()
21 }
22 pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
24 self.attributes.as_ref()
25 }
26}
27impl SendEventInput {
28 pub fn builder() -> crate::operation::send_event::builders::SendEventInputBuilder {
30 crate::operation::send_event::builders::SendEventInputBuilder::default()
31 }
32}
33
34#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct SendEventInputBuilder {
38 pub(crate) room_identifier: ::std::option::Option<::std::string::String>,
39 pub(crate) event_name: ::std::option::Option<::std::string::String>,
40 pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
41}
42impl SendEventInputBuilder {
43 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 pub fn set_room_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.room_identifier = input;
52 self
53 }
54 pub fn get_room_identifier(&self) -> &::std::option::Option<::std::string::String> {
56 &self.room_identifier
57 }
58 pub fn event_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.event_name = ::std::option::Option::Some(input.into());
62 self
63 }
64 pub fn set_event_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.event_name = input;
67 self
68 }
69 pub fn get_event_name(&self) -> &::std::option::Option<::std::string::String> {
71 &self.event_name
72 }
73 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
79 let mut hash_map = self.attributes.unwrap_or_default();
80 hash_map.insert(k.into(), v.into());
81 self.attributes = ::std::option::Option::Some(hash_map);
82 self
83 }
84 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
86 self.attributes = input;
87 self
88 }
89 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
91 &self.attributes
92 }
93 pub fn build(self) -> ::std::result::Result<crate::operation::send_event::SendEventInput, ::aws_smithy_types::error::operation::BuildError> {
95 ::std::result::Result::Ok(crate::operation::send_event::SendEventInput {
96 room_identifier: self.room_identifier,
97 event_name: self.event_name,
98 attributes: self.attributes,
99 })
100 }
101}