aws_sdk_servicediscovery/operation/get_instance/
_get_instance_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 GetInstanceOutput {
6    /// <p>The ID of the Amazon Web Services account that created the namespace that contains the service that the instance is associated with. If this isn't your account ID, it's the ID of the account that shared the namespace with your account.</p>
7    pub resource_owner: ::std::option::Option<::std::string::String>,
8    /// <p>A complex type that contains information about a specified instance.</p>
9    pub instance: ::std::option::Option<crate::types::Instance>,
10    _request_id: Option<String>,
11}
12impl GetInstanceOutput {
13    /// <p>The ID of the Amazon Web Services account that created the namespace that contains the service that the instance is associated with. If this isn't your account ID, it's the ID of the account that shared the namespace with your account.</p>
14    pub fn resource_owner(&self) -> ::std::option::Option<&str> {
15        self.resource_owner.as_deref()
16    }
17    /// <p>A complex type that contains information about a specified instance.</p>
18    pub fn instance(&self) -> ::std::option::Option<&crate::types::Instance> {
19        self.instance.as_ref()
20    }
21}
22impl ::aws_types::request_id::RequestId for GetInstanceOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl GetInstanceOutput {
28    /// Creates a new builder-style object to manufacture [`GetInstanceOutput`](crate::operation::get_instance::GetInstanceOutput).
29    pub fn builder() -> crate::operation::get_instance::builders::GetInstanceOutputBuilder {
30        crate::operation::get_instance::builders::GetInstanceOutputBuilder::default()
31    }
32}
33
34/// A builder for [`GetInstanceOutput`](crate::operation::get_instance::GetInstanceOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GetInstanceOutputBuilder {
38    pub(crate) resource_owner: ::std::option::Option<::std::string::String>,
39    pub(crate) instance: ::std::option::Option<crate::types::Instance>,
40    _request_id: Option<String>,
41}
42impl GetInstanceOutputBuilder {
43    /// <p>The ID of the Amazon Web Services account that created the namespace that contains the service that the instance is associated with. If this isn't your account ID, it's the ID of the account that shared the namespace with your account.</p>
44    pub fn resource_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.resource_owner = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The ID of the Amazon Web Services account that created the namespace that contains the service that the instance is associated with. If this isn't your account ID, it's the ID of the account that shared the namespace with your account.</p>
49    pub fn set_resource_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.resource_owner = input;
51        self
52    }
53    /// <p>The ID of the Amazon Web Services account that created the namespace that contains the service that the instance is associated with. If this isn't your account ID, it's the ID of the account that shared the namespace with your account.</p>
54    pub fn get_resource_owner(&self) -> &::std::option::Option<::std::string::String> {
55        &self.resource_owner
56    }
57    /// <p>A complex type that contains information about a specified instance.</p>
58    pub fn instance(mut self, input: crate::types::Instance) -> Self {
59        self.instance = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>A complex type that contains information about a specified instance.</p>
63    pub fn set_instance(mut self, input: ::std::option::Option<crate::types::Instance>) -> Self {
64        self.instance = input;
65        self
66    }
67    /// <p>A complex type that contains information about a specified instance.</p>
68    pub fn get_instance(&self) -> &::std::option::Option<crate::types::Instance> {
69        &self.instance
70    }
71    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
72        self._request_id = Some(request_id.into());
73        self
74    }
75
76    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
77        self._request_id = request_id;
78        self
79    }
80    /// Consumes the builder and constructs a [`GetInstanceOutput`](crate::operation::get_instance::GetInstanceOutput).
81    pub fn build(self) -> crate::operation::get_instance::GetInstanceOutput {
82        crate::operation::get_instance::GetInstanceOutput {
83            resource_owner: self.resource_owner,
84            instance: self.instance,
85            _request_id: self._request_id,
86        }
87    }
88}