Skip to main content

aws_sdk_devopsagent/operation/get_service/
_get_service_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Output containing the requested service details.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetServiceOutput {
7    /// Represents a registered service with its configuration and accessible resources.
8    pub service: ::std::option::Option<crate::types::RegisteredService>,
9    /// Tags associated with the Service.
10    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
11    _request_id: Option<String>,
12}
13impl GetServiceOutput {
14    /// Represents a registered service with its configuration and accessible resources.
15    pub fn service(&self) -> ::std::option::Option<&crate::types::RegisteredService> {
16        self.service.as_ref()
17    }
18    /// Tags associated with the Service.
19    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
20        self.tags.as_ref()
21    }
22}
23impl ::aws_types::request_id::RequestId for GetServiceOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl GetServiceOutput {
29    /// Creates a new builder-style object to manufacture [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
30    pub fn builder() -> crate::operation::get_service::builders::GetServiceOutputBuilder {
31        crate::operation::get_service::builders::GetServiceOutputBuilder::default()
32    }
33}
34
35/// A builder for [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct GetServiceOutputBuilder {
39    pub(crate) service: ::std::option::Option<crate::types::RegisteredService>,
40    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
41    _request_id: Option<String>,
42}
43impl GetServiceOutputBuilder {
44    /// Represents a registered service with its configuration and accessible resources.
45    /// This field is required.
46    pub fn service(mut self, input: crate::types::RegisteredService) -> Self {
47        self.service = ::std::option::Option::Some(input);
48        self
49    }
50    /// Represents a registered service with its configuration and accessible resources.
51    pub fn set_service(mut self, input: ::std::option::Option<crate::types::RegisteredService>) -> Self {
52        self.service = input;
53        self
54    }
55    /// Represents a registered service with its configuration and accessible resources.
56    pub fn get_service(&self) -> &::std::option::Option<crate::types::RegisteredService> {
57        &self.service
58    }
59    /// Adds a key-value pair to `tags`.
60    ///
61    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
62    ///
63    /// Tags associated with the Service.
64    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
65        let mut hash_map = self.tags.unwrap_or_default();
66        hash_map.insert(k.into(), v.into());
67        self.tags = ::std::option::Option::Some(hash_map);
68        self
69    }
70    /// Tags associated with the Service.
71    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
72        self.tags = input;
73        self
74    }
75    /// Tags associated with the Service.
76    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
77        &self.tags
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
89    pub fn build(self) -> crate::operation::get_service::GetServiceOutput {
90        crate::operation::get_service::GetServiceOutput {
91            service: self.service,
92            tags: self.tags,
93            _request_id: self._request_id,
94        }
95    }
96}