Skip to main content

aws_sdk_pinpoint/types/
_send_users_message_response.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides information about which users and endpoints a message was sent to.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SendUsersMessageResponse {
7    /// <p>The unique identifier for the application that was used to send the message.</p>
8    pub application_id: ::std::option::Option<::std::string::String>,
9    /// <p>The unique identifier that was assigned to the message request.</p>
10    pub request_id: ::std::option::Option<::std::string::String>,
11    /// <p>An object that indicates which endpoints the message was sent to, for each user. The object lists user IDs and, for each user ID, provides the endpoint IDs that the message was sent to. For each endpoint ID, it provides an EndpointMessageResult object.</p>
12    pub result: ::std::option::Option<
13        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::EndpointMessageResult>>,
14    >,
15}
16impl SendUsersMessageResponse {
17    /// <p>The unique identifier for the application that was used to send the message.</p>
18    pub fn application_id(&self) -> ::std::option::Option<&str> {
19        self.application_id.as_deref()
20    }
21    /// <p>The unique identifier that was assigned to the message request.</p>
22    pub fn request_id(&self) -> ::std::option::Option<&str> {
23        self.request_id.as_deref()
24    }
25    /// <p>An object that indicates which endpoints the message was sent to, for each user. The object lists user IDs and, for each user ID, provides the endpoint IDs that the message was sent to. For each endpoint ID, it provides an EndpointMessageResult object.</p>
26    pub fn result(
27        &self,
28    ) -> ::std::option::Option<
29        &::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::EndpointMessageResult>>,
30    > {
31        self.result.as_ref()
32    }
33}
34impl SendUsersMessageResponse {
35    /// Creates a new builder-style object to manufacture [`SendUsersMessageResponse`](crate::types::SendUsersMessageResponse).
36    pub fn builder() -> crate::types::builders::SendUsersMessageResponseBuilder {
37        crate::types::builders::SendUsersMessageResponseBuilder::default()
38    }
39}
40
41/// A builder for [`SendUsersMessageResponse`](crate::types::SendUsersMessageResponse).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct SendUsersMessageResponseBuilder {
45    pub(crate) application_id: ::std::option::Option<::std::string::String>,
46    pub(crate) request_id: ::std::option::Option<::std::string::String>,
47    pub(crate) result: ::std::option::Option<
48        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::EndpointMessageResult>>,
49    >,
50}
51impl SendUsersMessageResponseBuilder {
52    /// <p>The unique identifier for the application that was used to send the message.</p>
53    /// This field is required.
54    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.application_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The unique identifier for the application that was used to send the message.</p>
59    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.application_id = input;
61        self
62    }
63    /// <p>The unique identifier for the application that was used to send the message.</p>
64    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.application_id
66    }
67    /// <p>The unique identifier that was assigned to the message request.</p>
68    pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.request_id = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The unique identifier that was assigned to the message request.</p>
73    pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.request_id = input;
75        self
76    }
77    /// <p>The unique identifier that was assigned to the message request.</p>
78    pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.request_id
80    }
81    /// Adds a key-value pair to `result`.
82    ///
83    /// To override the contents of this collection use [`set_result`](Self::set_result).
84    ///
85    /// <p>An object that indicates which endpoints the message was sent to, for each user. The object lists user IDs and, for each user ID, provides the endpoint IDs that the message was sent to. For each endpoint ID, it provides an EndpointMessageResult object.</p>
86    pub fn result(
87        mut self,
88        k: impl ::std::convert::Into<::std::string::String>,
89        v: ::std::collections::HashMap<::std::string::String, crate::types::EndpointMessageResult>,
90    ) -> Self {
91        let mut hash_map = self.result.unwrap_or_default();
92        hash_map.insert(k.into(), v);
93        self.result = ::std::option::Option::Some(hash_map);
94        self
95    }
96    /// <p>An object that indicates which endpoints the message was sent to, for each user. The object lists user IDs and, for each user ID, provides the endpoint IDs that the message was sent to. For each endpoint ID, it provides an EndpointMessageResult object.</p>
97    pub fn set_result(
98        mut self,
99        input: ::std::option::Option<
100            ::std::collections::HashMap<
101                ::std::string::String,
102                ::std::collections::HashMap<::std::string::String, crate::types::EndpointMessageResult>,
103            >,
104        >,
105    ) -> Self {
106        self.result = input;
107        self
108    }
109    /// <p>An object that indicates which endpoints the message was sent to, for each user. The object lists user IDs and, for each user ID, provides the endpoint IDs that the message was sent to. For each endpoint ID, it provides an EndpointMessageResult object.</p>
110    pub fn get_result(
111        &self,
112    ) -> &::std::option::Option<
113        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::EndpointMessageResult>>,
114    > {
115        &self.result
116    }
117    /// Consumes the builder and constructs a [`SendUsersMessageResponse`](crate::types::SendUsersMessageResponse).
118    pub fn build(self) -> crate::types::SendUsersMessageResponse {
119        crate::types::SendUsersMessageResponse {
120            application_id: self.application_id,
121            request_id: self.request_id,
122            result: self.result,
123        }
124    }
125}