aws_sdk_imagebuilder/operation/list_lifecycle_execution_resources/
_list_lifecycle_execution_resources_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 ListLifecycleExecutionResourcesOutput {
6    /// <p>Runtime details for the specified runtime instance of the lifecycle policy.</p>
7    pub lifecycle_execution_id: ::std::option::Option<::std::string::String>,
8    /// <p>The current state of the lifecycle runtime instance.</p>
9    pub lifecycle_execution_state: ::std::option::Option<crate::types::LifecycleExecutionState>,
10    /// <p>A list of resources that were identified for lifecycle actions.</p>
11    pub resources: ::std::option::Option<::std::vec::Vec<crate::types::LifecycleExecutionResource>>,
12    /// <p>The next token used for paginated responses. When this field isn't empty, there are additional elements that the service hasn't included in this request. Use this token with the next request to retrieve additional objects.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14    _request_id: Option<String>,
15}
16impl ListLifecycleExecutionResourcesOutput {
17    /// <p>Runtime details for the specified runtime instance of the lifecycle policy.</p>
18    pub fn lifecycle_execution_id(&self) -> ::std::option::Option<&str> {
19        self.lifecycle_execution_id.as_deref()
20    }
21    /// <p>The current state of the lifecycle runtime instance.</p>
22    pub fn lifecycle_execution_state(&self) -> ::std::option::Option<&crate::types::LifecycleExecutionState> {
23        self.lifecycle_execution_state.as_ref()
24    }
25    /// <p>A list of resources that were identified for lifecycle actions.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`.
28    pub fn resources(&self) -> &[crate::types::LifecycleExecutionResource] {
29        self.resources.as_deref().unwrap_or_default()
30    }
31    /// <p>The next token used for paginated responses. When this field isn't empty, there are additional elements that the service hasn't included in this request. Use this token with the next request to retrieve additional objects.</p>
32    pub fn next_token(&self) -> ::std::option::Option<&str> {
33        self.next_token.as_deref()
34    }
35}
36impl ::aws_types::request_id::RequestId for ListLifecycleExecutionResourcesOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl ListLifecycleExecutionResourcesOutput {
42    /// Creates a new builder-style object to manufacture [`ListLifecycleExecutionResourcesOutput`](crate::operation::list_lifecycle_execution_resources::ListLifecycleExecutionResourcesOutput).
43    pub fn builder() -> crate::operation::list_lifecycle_execution_resources::builders::ListLifecycleExecutionResourcesOutputBuilder {
44        crate::operation::list_lifecycle_execution_resources::builders::ListLifecycleExecutionResourcesOutputBuilder::default()
45    }
46}
47
48/// A builder for [`ListLifecycleExecutionResourcesOutput`](crate::operation::list_lifecycle_execution_resources::ListLifecycleExecutionResourcesOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct ListLifecycleExecutionResourcesOutputBuilder {
52    pub(crate) lifecycle_execution_id: ::std::option::Option<::std::string::String>,
53    pub(crate) lifecycle_execution_state: ::std::option::Option<crate::types::LifecycleExecutionState>,
54    pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::LifecycleExecutionResource>>,
55    pub(crate) next_token: ::std::option::Option<::std::string::String>,
56    _request_id: Option<String>,
57}
58impl ListLifecycleExecutionResourcesOutputBuilder {
59    /// <p>Runtime details for the specified runtime instance of the lifecycle policy.</p>
60    pub fn lifecycle_execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.lifecycle_execution_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>Runtime details for the specified runtime instance of the lifecycle policy.</p>
65    pub fn set_lifecycle_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.lifecycle_execution_id = input;
67        self
68    }
69    /// <p>Runtime details for the specified runtime instance of the lifecycle policy.</p>
70    pub fn get_lifecycle_execution_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.lifecycle_execution_id
72    }
73    /// <p>The current state of the lifecycle runtime instance.</p>
74    pub fn lifecycle_execution_state(mut self, input: crate::types::LifecycleExecutionState) -> Self {
75        self.lifecycle_execution_state = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>The current state of the lifecycle runtime instance.</p>
79    pub fn set_lifecycle_execution_state(mut self, input: ::std::option::Option<crate::types::LifecycleExecutionState>) -> Self {
80        self.lifecycle_execution_state = input;
81        self
82    }
83    /// <p>The current state of the lifecycle runtime instance.</p>
84    pub fn get_lifecycle_execution_state(&self) -> &::std::option::Option<crate::types::LifecycleExecutionState> {
85        &self.lifecycle_execution_state
86    }
87    /// Appends an item to `resources`.
88    ///
89    /// To override the contents of this collection use [`set_resources`](Self::set_resources).
90    ///
91    /// <p>A list of resources that were identified for lifecycle actions.</p>
92    pub fn resources(mut self, input: crate::types::LifecycleExecutionResource) -> Self {
93        let mut v = self.resources.unwrap_or_default();
94        v.push(input);
95        self.resources = ::std::option::Option::Some(v);
96        self
97    }
98    /// <p>A list of resources that were identified for lifecycle actions.</p>
99    pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LifecycleExecutionResource>>) -> Self {
100        self.resources = input;
101        self
102    }
103    /// <p>A list of resources that were identified for lifecycle actions.</p>
104    pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LifecycleExecutionResource>> {
105        &self.resources
106    }
107    /// <p>The next token used for paginated responses. When this field isn't empty, there are additional elements that the service hasn't included in this request. Use this token with the next request to retrieve additional objects.</p>
108    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.next_token = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The next token used for paginated responses. When this field isn't empty, there are additional elements that the service hasn't included in this request. Use this token with the next request to retrieve additional objects.</p>
113    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.next_token = input;
115        self
116    }
117    /// <p>The next token used for paginated responses. When this field isn't empty, there are additional elements that the service hasn't included in this request. Use this token with the next request to retrieve additional objects.</p>
118    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
119        &self.next_token
120    }
121    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
122        self._request_id = Some(request_id.into());
123        self
124    }
125
126    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
127        self._request_id = request_id;
128        self
129    }
130    /// Consumes the builder and constructs a [`ListLifecycleExecutionResourcesOutput`](crate::operation::list_lifecycle_execution_resources::ListLifecycleExecutionResourcesOutput).
131    pub fn build(self) -> crate::operation::list_lifecycle_execution_resources::ListLifecycleExecutionResourcesOutput {
132        crate::operation::list_lifecycle_execution_resources::ListLifecycleExecutionResourcesOutput {
133            lifecycle_execution_id: self.lifecycle_execution_id,
134            lifecycle_execution_state: self.lifecycle_execution_state,
135            resources: self.resources,
136            next_token: self.next_token,
137            _request_id: self._request_id,
138        }
139    }
140}