aws_sdk_ssmsap/operation/get_database/
_get_database_output.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 GetDatabaseOutput {
6    /// <p>The SAP HANA database of an application registered with AWS Systems Manager for SAP.</p>
7    pub database: ::std::option::Option<crate::types::Database>,
8    /// <p>The tags of a database.</p>
9    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10    _request_id: Option<String>,
11}
12impl GetDatabaseOutput {
13    /// <p>The SAP HANA database of an application registered with AWS Systems Manager for SAP.</p>
14    pub fn database(&self) -> ::std::option::Option<&crate::types::Database> {
15        self.database.as_ref()
16    }
17    /// <p>The tags of a database.</p>
18    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
19        self.tags.as_ref()
20    }
21}
22impl ::aws_types::request_id::RequestId for GetDatabaseOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl GetDatabaseOutput {
28    /// Creates a new builder-style object to manufacture [`GetDatabaseOutput`](crate::operation::get_database::GetDatabaseOutput).
29    pub fn builder() -> crate::operation::get_database::builders::GetDatabaseOutputBuilder {
30        crate::operation::get_database::builders::GetDatabaseOutputBuilder::default()
31    }
32}
33
34/// A builder for [`GetDatabaseOutput`](crate::operation::get_database::GetDatabaseOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GetDatabaseOutputBuilder {
38    pub(crate) database: ::std::option::Option<crate::types::Database>,
39    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
40    _request_id: Option<String>,
41}
42impl GetDatabaseOutputBuilder {
43    /// <p>The SAP HANA database of an application registered with AWS Systems Manager for SAP.</p>
44    pub fn database(mut self, input: crate::types::Database) -> Self {
45        self.database = ::std::option::Option::Some(input);
46        self
47    }
48    /// <p>The SAP HANA database of an application registered with AWS Systems Manager for SAP.</p>
49    pub fn set_database(mut self, input: ::std::option::Option<crate::types::Database>) -> Self {
50        self.database = input;
51        self
52    }
53    /// <p>The SAP HANA database of an application registered with AWS Systems Manager for SAP.</p>
54    pub fn get_database(&self) -> &::std::option::Option<crate::types::Database> {
55        &self.database
56    }
57    /// Adds a key-value pair to `tags`.
58    ///
59    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
60    ///
61    /// <p>The tags of a database.</p>
62    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
63        let mut hash_map = self.tags.unwrap_or_default();
64        hash_map.insert(k.into(), v.into());
65        self.tags = ::std::option::Option::Some(hash_map);
66        self
67    }
68    /// <p>The tags of a database.</p>
69    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
70        self.tags = input;
71        self
72    }
73    /// <p>The tags of a database.</p>
74    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
75        &self.tags
76    }
77    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
78        self._request_id = Some(request_id.into());
79        self
80    }
81
82    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
83        self._request_id = request_id;
84        self
85    }
86    /// Consumes the builder and constructs a [`GetDatabaseOutput`](crate::operation::get_database::GetDatabaseOutput).
87    pub fn build(self) -> crate::operation::get_database::GetDatabaseOutput {
88        crate::operation::get_database::GetDatabaseOutput {
89            database: self.database,
90            tags: self.tags,
91            _request_id: self._request_id,
92        }
93    }
94}