1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The detailed data about the current state of this service instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct ServiceInstanceState {
    /// <p>The service spec that was used to create the service instance.</p>
    pub spec: ::std::option::Option<::std::string::String>,
    /// <p>The name of the service template that was used to create the service instance.</p>
    pub template_name: ::std::option::Option<::std::string::String>,
    /// <p>The major version of the service template that was used to create the service pipeline.</p>
    pub template_major_version: ::std::option::Option<::std::string::String>,
    /// <p>The minor version of the service template that was used to create the service pipeline.</p>
    pub template_minor_version: ::std::option::Option<::std::string::String>,
    /// <p>The IDs for the last successful components deployed for this service instance.</p>
    pub last_successful_component_deployment_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The ID for the last successful environment deployed for this service instance.</p>
    pub last_successful_environment_deployment_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID for the last successful service pipeline deployed for this service instance.</p>
    pub last_successful_service_pipeline_deployment_id: ::std::option::Option<::std::string::String>,
}
impl ServiceInstanceState {
    /// <p>The service spec that was used to create the service instance.</p>
    pub fn spec(&self) -> ::std::option::Option<&str> {
        self.spec.as_deref()
    }
    /// <p>The name of the service template that was used to create the service instance.</p>
    pub fn template_name(&self) -> ::std::option::Option<&str> {
        self.template_name.as_deref()
    }
    /// <p>The major version of the service template that was used to create the service pipeline.</p>
    pub fn template_major_version(&self) -> ::std::option::Option<&str> {
        self.template_major_version.as_deref()
    }
    /// <p>The minor version of the service template that was used to create the service pipeline.</p>
    pub fn template_minor_version(&self) -> ::std::option::Option<&str> {
        self.template_minor_version.as_deref()
    }
    /// <p>The IDs for the last successful components deployed for this service instance.</p>
    pub fn last_successful_component_deployment_ids(&self) -> ::std::option::Option<&[::std::string::String]> {
        self.last_successful_component_deployment_ids.as_deref()
    }
    /// <p>The ID for the last successful environment deployed for this service instance.</p>
    pub fn last_successful_environment_deployment_id(&self) -> ::std::option::Option<&str> {
        self.last_successful_environment_deployment_id.as_deref()
    }
    /// <p>The ID for the last successful service pipeline deployed for this service instance.</p>
    pub fn last_successful_service_pipeline_deployment_id(&self) -> ::std::option::Option<&str> {
        self.last_successful_service_pipeline_deployment_id.as_deref()
    }
}
impl ::std::fmt::Debug for ServiceInstanceState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ServiceInstanceState");
        formatter.field("spec", &"*** Sensitive Data Redacted ***");
        formatter.field("template_name", &self.template_name);
        formatter.field("template_major_version", &self.template_major_version);
        formatter.field("template_minor_version", &self.template_minor_version);
        formatter.field("last_successful_component_deployment_ids", &self.last_successful_component_deployment_ids);
        formatter.field(
            "last_successful_environment_deployment_id",
            &self.last_successful_environment_deployment_id,
        );
        formatter.field(
            "last_successful_service_pipeline_deployment_id",
            &self.last_successful_service_pipeline_deployment_id,
        );
        formatter.finish()
    }
}
impl ServiceInstanceState {
    /// Creates a new builder-style object to manufacture [`ServiceInstanceState`](crate::types::ServiceInstanceState).
    pub fn builder() -> crate::types::builders::ServiceInstanceStateBuilder {
        crate::types::builders::ServiceInstanceStateBuilder::default()
    }
}

/// A builder for [`ServiceInstanceState`](crate::types::ServiceInstanceState).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct ServiceInstanceStateBuilder {
    pub(crate) spec: ::std::option::Option<::std::string::String>,
    pub(crate) template_name: ::std::option::Option<::std::string::String>,
    pub(crate) template_major_version: ::std::option::Option<::std::string::String>,
    pub(crate) template_minor_version: ::std::option::Option<::std::string::String>,
    pub(crate) last_successful_component_deployment_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) last_successful_environment_deployment_id: ::std::option::Option<::std::string::String>,
    pub(crate) last_successful_service_pipeline_deployment_id: ::std::option::Option<::std::string::String>,
}
impl ServiceInstanceStateBuilder {
    /// <p>The service spec that was used to create the service instance.</p>
    pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.spec = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The service spec that was used to create the service instance.</p>
    pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.spec = input;
        self
    }
    /// <p>The service spec that was used to create the service instance.</p>
    pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
        &self.spec
    }
    /// <p>The name of the service template that was used to create the service instance.</p>
    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the service template that was used to create the service instance.</p>
    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_name = input;
        self
    }
    /// <p>The name of the service template that was used to create the service instance.</p>
    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_name
    }
    /// <p>The major version of the service template that was used to create the service pipeline.</p>
    pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_major_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The major version of the service template that was used to create the service pipeline.</p>
    pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_major_version = input;
        self
    }
    /// <p>The major version of the service template that was used to create the service pipeline.</p>
    pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_major_version
    }
    /// <p>The minor version of the service template that was used to create the service pipeline.</p>
    pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_minor_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The minor version of the service template that was used to create the service pipeline.</p>
    pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_minor_version = input;
        self
    }
    /// <p>The minor version of the service template that was used to create the service pipeline.</p>
    pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_minor_version
    }
    /// Appends an item to `last_successful_component_deployment_ids`.
    ///
    /// To override the contents of this collection use [`set_last_successful_component_deployment_ids`](Self::set_last_successful_component_deployment_ids).
    ///
    /// <p>The IDs for the last successful components deployed for this service instance.</p>
    pub fn last_successful_component_deployment_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.last_successful_component_deployment_ids.unwrap_or_default();
        v.push(input.into());
        self.last_successful_component_deployment_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The IDs for the last successful components deployed for this service instance.</p>
    pub fn set_last_successful_component_deployment_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.last_successful_component_deployment_ids = input;
        self
    }
    /// <p>The IDs for the last successful components deployed for this service instance.</p>
    pub fn get_last_successful_component_deployment_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.last_successful_component_deployment_ids
    }
    /// <p>The ID for the last successful environment deployed for this service instance.</p>
    pub fn last_successful_environment_deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_successful_environment_deployment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID for the last successful environment deployed for this service instance.</p>
    pub fn set_last_successful_environment_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_successful_environment_deployment_id = input;
        self
    }
    /// <p>The ID for the last successful environment deployed for this service instance.</p>
    pub fn get_last_successful_environment_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_successful_environment_deployment_id
    }
    /// <p>The ID for the last successful service pipeline deployed for this service instance.</p>
    pub fn last_successful_service_pipeline_deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_successful_service_pipeline_deployment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID for the last successful service pipeline deployed for this service instance.</p>
    pub fn set_last_successful_service_pipeline_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_successful_service_pipeline_deployment_id = input;
        self
    }
    /// <p>The ID for the last successful service pipeline deployed for this service instance.</p>
    pub fn get_last_successful_service_pipeline_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_successful_service_pipeline_deployment_id
    }
    /// Consumes the builder and constructs a [`ServiceInstanceState`](crate::types::ServiceInstanceState).
    pub fn build(self) -> crate::types::ServiceInstanceState {
        crate::types::ServiceInstanceState {
            spec: self.spec,
            template_name: self.template_name,
            template_major_version: self.template_major_version,
            template_minor_version: self.template_minor_version,
            last_successful_component_deployment_ids: self.last_successful_component_deployment_ids,
            last_successful_environment_deployment_id: self.last_successful_environment_deployment_id,
            last_successful_service_pipeline_deployment_id: self.last_successful_service_pipeline_deployment_id,
        }
    }
}
impl ::std::fmt::Debug for ServiceInstanceStateBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ServiceInstanceStateBuilder");
        formatter.field("spec", &"*** Sensitive Data Redacted ***");
        formatter.field("template_name", &self.template_name);
        formatter.field("template_major_version", &self.template_major_version);
        formatter.field("template_minor_version", &self.template_minor_version);
        formatter.field("last_successful_component_deployment_ids", &self.last_successful_component_deployment_ids);
        formatter.field(
            "last_successful_environment_deployment_id",
            &self.last_successful_environment_deployment_id,
        );
        formatter.field(
            "last_successful_service_pipeline_deployment_id",
            &self.last_successful_service_pipeline_deployment_id,
        );
        formatter.finish()
    }
}