1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/lightsail/Lightsail_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/core/utils/memory/stl/AWSVector.h>
10 #include <aws/core/utils/memory/stl/AWSMap.h>
11 #include <aws/lightsail/model/ContainerServiceProtocol.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace Utils
17 {
18 namespace Json
19 {
20   class JsonValue;
21   class JsonView;
22 } // namespace Json
23 } // namespace Utils
24 namespace Lightsail
25 {
26 namespace Model
27 {
28 
29   /**
30    * <p>Describes the settings of a container that will be launched, or that is
31    * launched, to an Amazon Lightsail container service.</p><p><h3>See Also:</h3>
32    * <a
33    * href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/Container">AWS
34    * API Reference</a></p>
35    */
36   class AWS_LIGHTSAIL_API Container
37   {
38   public:
39     Container();
40     Container(Aws::Utils::Json::JsonView jsonValue);
41     Container& operator=(Aws::Utils::Json::JsonView jsonValue);
42     Aws::Utils::Json::JsonValue Jsonize() const;
43 
44 
45     /**
46      * <p>The name of the image used for the container.</p> <p>Container images sourced
47      * from your Lightsail container service, that are registered and stored on your
48      * service, start with a colon (<code>:</code>). For example,
49      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
50      * from a public registry like Docker Hub don't start with a colon. For example,
51      * <code>nginx:latest</code> or <code>nginx</code>.</p>
52      */
GetImage()53     inline const Aws::String& GetImage() const{ return m_image; }
54 
55     /**
56      * <p>The name of the image used for the container.</p> <p>Container images sourced
57      * from your Lightsail container service, that are registered and stored on your
58      * service, start with a colon (<code>:</code>). For example,
59      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
60      * from a public registry like Docker Hub don't start with a colon. For example,
61      * <code>nginx:latest</code> or <code>nginx</code>.</p>
62      */
ImageHasBeenSet()63     inline bool ImageHasBeenSet() const { return m_imageHasBeenSet; }
64 
65     /**
66      * <p>The name of the image used for the container.</p> <p>Container images sourced
67      * from your Lightsail container service, that are registered and stored on your
68      * service, start with a colon (<code>:</code>). For example,
69      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
70      * from a public registry like Docker Hub don't start with a colon. For example,
71      * <code>nginx:latest</code> or <code>nginx</code>.</p>
72      */
SetImage(const Aws::String & value)73     inline void SetImage(const Aws::String& value) { m_imageHasBeenSet = true; m_image = value; }
74 
75     /**
76      * <p>The name of the image used for the container.</p> <p>Container images sourced
77      * from your Lightsail container service, that are registered and stored on your
78      * service, start with a colon (<code>:</code>). For example,
79      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
80      * from a public registry like Docker Hub don't start with a colon. For example,
81      * <code>nginx:latest</code> or <code>nginx</code>.</p>
82      */
SetImage(Aws::String && value)83     inline void SetImage(Aws::String&& value) { m_imageHasBeenSet = true; m_image = std::move(value); }
84 
85     /**
86      * <p>The name of the image used for the container.</p> <p>Container images sourced
87      * from your Lightsail container service, that are registered and stored on your
88      * service, start with a colon (<code>:</code>). For example,
89      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
90      * from a public registry like Docker Hub don't start with a colon. For example,
91      * <code>nginx:latest</code> or <code>nginx</code>.</p>
92      */
SetImage(const char * value)93     inline void SetImage(const char* value) { m_imageHasBeenSet = true; m_image.assign(value); }
94 
95     /**
96      * <p>The name of the image used for the container.</p> <p>Container images sourced
97      * from your Lightsail container service, that are registered and stored on your
98      * service, start with a colon (<code>:</code>). For example,
99      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
100      * from a public registry like Docker Hub don't start with a colon. For example,
101      * <code>nginx:latest</code> or <code>nginx</code>.</p>
102      */
WithImage(const Aws::String & value)103     inline Container& WithImage(const Aws::String& value) { SetImage(value); return *this;}
104 
105     /**
106      * <p>The name of the image used for the container.</p> <p>Container images sourced
107      * from your Lightsail container service, that are registered and stored on your
108      * service, start with a colon (<code>:</code>). For example,
109      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
110      * from a public registry like Docker Hub don't start with a colon. For example,
111      * <code>nginx:latest</code> or <code>nginx</code>.</p>
112      */
WithImage(Aws::String && value)113     inline Container& WithImage(Aws::String&& value) { SetImage(std::move(value)); return *this;}
114 
115     /**
116      * <p>The name of the image used for the container.</p> <p>Container images sourced
117      * from your Lightsail container service, that are registered and stored on your
118      * service, start with a colon (<code>:</code>). For example,
119      * <code>:container-service-1.mystaticwebsite.1</code>. Container images sourced
120      * from a public registry like Docker Hub don't start with a colon. For example,
121      * <code>nginx:latest</code> or <code>nginx</code>.</p>
122      */
WithImage(const char * value)123     inline Container& WithImage(const char* value) { SetImage(value); return *this;}
124 
125 
126     /**
127      * <p>The launch command for the container.</p>
128      */
GetCommand()129     inline const Aws::Vector<Aws::String>& GetCommand() const{ return m_command; }
130 
131     /**
132      * <p>The launch command for the container.</p>
133      */
CommandHasBeenSet()134     inline bool CommandHasBeenSet() const { return m_commandHasBeenSet; }
135 
136     /**
137      * <p>The launch command for the container.</p>
138      */
SetCommand(const Aws::Vector<Aws::String> & value)139     inline void SetCommand(const Aws::Vector<Aws::String>& value) { m_commandHasBeenSet = true; m_command = value; }
140 
141     /**
142      * <p>The launch command for the container.</p>
143      */
SetCommand(Aws::Vector<Aws::String> && value)144     inline void SetCommand(Aws::Vector<Aws::String>&& value) { m_commandHasBeenSet = true; m_command = std::move(value); }
145 
146     /**
147      * <p>The launch command for the container.</p>
148      */
WithCommand(const Aws::Vector<Aws::String> & value)149     inline Container& WithCommand(const Aws::Vector<Aws::String>& value) { SetCommand(value); return *this;}
150 
151     /**
152      * <p>The launch command for the container.</p>
153      */
WithCommand(Aws::Vector<Aws::String> && value)154     inline Container& WithCommand(Aws::Vector<Aws::String>&& value) { SetCommand(std::move(value)); return *this;}
155 
156     /**
157      * <p>The launch command for the container.</p>
158      */
AddCommand(const Aws::String & value)159     inline Container& AddCommand(const Aws::String& value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; }
160 
161     /**
162      * <p>The launch command for the container.</p>
163      */
AddCommand(Aws::String && value)164     inline Container& AddCommand(Aws::String&& value) { m_commandHasBeenSet = true; m_command.push_back(std::move(value)); return *this; }
165 
166     /**
167      * <p>The launch command for the container.</p>
168      */
AddCommand(const char * value)169     inline Container& AddCommand(const char* value) { m_commandHasBeenSet = true; m_command.push_back(value); return *this; }
170 
171 
172     /**
173      * <p>The environment variables of the container.</p>
174      */
GetEnvironment()175     inline const Aws::Map<Aws::String, Aws::String>& GetEnvironment() const{ return m_environment; }
176 
177     /**
178      * <p>The environment variables of the container.</p>
179      */
EnvironmentHasBeenSet()180     inline bool EnvironmentHasBeenSet() const { return m_environmentHasBeenSet; }
181 
182     /**
183      * <p>The environment variables of the container.</p>
184      */
SetEnvironment(const Aws::Map<Aws::String,Aws::String> & value)185     inline void SetEnvironment(const Aws::Map<Aws::String, Aws::String>& value) { m_environmentHasBeenSet = true; m_environment = value; }
186 
187     /**
188      * <p>The environment variables of the container.</p>
189      */
SetEnvironment(Aws::Map<Aws::String,Aws::String> && value)190     inline void SetEnvironment(Aws::Map<Aws::String, Aws::String>&& value) { m_environmentHasBeenSet = true; m_environment = std::move(value); }
191 
192     /**
193      * <p>The environment variables of the container.</p>
194      */
WithEnvironment(const Aws::Map<Aws::String,Aws::String> & value)195     inline Container& WithEnvironment(const Aws::Map<Aws::String, Aws::String>& value) { SetEnvironment(value); return *this;}
196 
197     /**
198      * <p>The environment variables of the container.</p>
199      */
WithEnvironment(Aws::Map<Aws::String,Aws::String> && value)200     inline Container& WithEnvironment(Aws::Map<Aws::String, Aws::String>&& value) { SetEnvironment(std::move(value)); return *this;}
201 
202     /**
203      * <p>The environment variables of the container.</p>
204      */
AddEnvironment(const Aws::String & key,const Aws::String & value)205     inline Container& AddEnvironment(const Aws::String& key, const Aws::String& value) { m_environmentHasBeenSet = true; m_environment.emplace(key, value); return *this; }
206 
207     /**
208      * <p>The environment variables of the container.</p>
209      */
AddEnvironment(Aws::String && key,const Aws::String & value)210     inline Container& AddEnvironment(Aws::String&& key, const Aws::String& value) { m_environmentHasBeenSet = true; m_environment.emplace(std::move(key), value); return *this; }
211 
212     /**
213      * <p>The environment variables of the container.</p>
214      */
AddEnvironment(const Aws::String & key,Aws::String && value)215     inline Container& AddEnvironment(const Aws::String& key, Aws::String&& value) { m_environmentHasBeenSet = true; m_environment.emplace(key, std::move(value)); return *this; }
216 
217     /**
218      * <p>The environment variables of the container.</p>
219      */
AddEnvironment(Aws::String && key,Aws::String && value)220     inline Container& AddEnvironment(Aws::String&& key, Aws::String&& value) { m_environmentHasBeenSet = true; m_environment.emplace(std::move(key), std::move(value)); return *this; }
221 
222     /**
223      * <p>The environment variables of the container.</p>
224      */
AddEnvironment(const char * key,Aws::String && value)225     inline Container& AddEnvironment(const char* key, Aws::String&& value) { m_environmentHasBeenSet = true; m_environment.emplace(key, std::move(value)); return *this; }
226 
227     /**
228      * <p>The environment variables of the container.</p>
229      */
AddEnvironment(Aws::String && key,const char * value)230     inline Container& AddEnvironment(Aws::String&& key, const char* value) { m_environmentHasBeenSet = true; m_environment.emplace(std::move(key), value); return *this; }
231 
232     /**
233      * <p>The environment variables of the container.</p>
234      */
AddEnvironment(const char * key,const char * value)235     inline Container& AddEnvironment(const char* key, const char* value) { m_environmentHasBeenSet = true; m_environment.emplace(key, value); return *this; }
236 
237 
238     /**
239      * <p>The open firewall ports of the container.</p>
240      */
GetPorts()241     inline const Aws::Map<Aws::String, ContainerServiceProtocol>& GetPorts() const{ return m_ports; }
242 
243     /**
244      * <p>The open firewall ports of the container.</p>
245      */
PortsHasBeenSet()246     inline bool PortsHasBeenSet() const { return m_portsHasBeenSet; }
247 
248     /**
249      * <p>The open firewall ports of the container.</p>
250      */
SetPorts(const Aws::Map<Aws::String,ContainerServiceProtocol> & value)251     inline void SetPorts(const Aws::Map<Aws::String, ContainerServiceProtocol>& value) { m_portsHasBeenSet = true; m_ports = value; }
252 
253     /**
254      * <p>The open firewall ports of the container.</p>
255      */
SetPorts(Aws::Map<Aws::String,ContainerServiceProtocol> && value)256     inline void SetPorts(Aws::Map<Aws::String, ContainerServiceProtocol>&& value) { m_portsHasBeenSet = true; m_ports = std::move(value); }
257 
258     /**
259      * <p>The open firewall ports of the container.</p>
260      */
WithPorts(const Aws::Map<Aws::String,ContainerServiceProtocol> & value)261     inline Container& WithPorts(const Aws::Map<Aws::String, ContainerServiceProtocol>& value) { SetPorts(value); return *this;}
262 
263     /**
264      * <p>The open firewall ports of the container.</p>
265      */
WithPorts(Aws::Map<Aws::String,ContainerServiceProtocol> && value)266     inline Container& WithPorts(Aws::Map<Aws::String, ContainerServiceProtocol>&& value) { SetPorts(std::move(value)); return *this;}
267 
268     /**
269      * <p>The open firewall ports of the container.</p>
270      */
AddPorts(const Aws::String & key,const ContainerServiceProtocol & value)271     inline Container& AddPorts(const Aws::String& key, const ContainerServiceProtocol& value) { m_portsHasBeenSet = true; m_ports.emplace(key, value); return *this; }
272 
273     /**
274      * <p>The open firewall ports of the container.</p>
275      */
AddPorts(Aws::String && key,const ContainerServiceProtocol & value)276     inline Container& AddPorts(Aws::String&& key, const ContainerServiceProtocol& value) { m_portsHasBeenSet = true; m_ports.emplace(std::move(key), value); return *this; }
277 
278     /**
279      * <p>The open firewall ports of the container.</p>
280      */
AddPorts(const Aws::String & key,ContainerServiceProtocol && value)281     inline Container& AddPorts(const Aws::String& key, ContainerServiceProtocol&& value) { m_portsHasBeenSet = true; m_ports.emplace(key, std::move(value)); return *this; }
282 
283     /**
284      * <p>The open firewall ports of the container.</p>
285      */
AddPorts(Aws::String && key,ContainerServiceProtocol && value)286     inline Container& AddPorts(Aws::String&& key, ContainerServiceProtocol&& value) { m_portsHasBeenSet = true; m_ports.emplace(std::move(key), std::move(value)); return *this; }
287 
288     /**
289      * <p>The open firewall ports of the container.</p>
290      */
AddPorts(const char * key,ContainerServiceProtocol && value)291     inline Container& AddPorts(const char* key, ContainerServiceProtocol&& value) { m_portsHasBeenSet = true; m_ports.emplace(key, std::move(value)); return *this; }
292 
293     /**
294      * <p>The open firewall ports of the container.</p>
295      */
AddPorts(const char * key,const ContainerServiceProtocol & value)296     inline Container& AddPorts(const char* key, const ContainerServiceProtocol& value) { m_portsHasBeenSet = true; m_ports.emplace(key, value); return *this; }
297 
298   private:
299 
300     Aws::String m_image;
301     bool m_imageHasBeenSet;
302 
303     Aws::Vector<Aws::String> m_command;
304     bool m_commandHasBeenSet;
305 
306     Aws::Map<Aws::String, Aws::String> m_environment;
307     bool m_environmentHasBeenSet;
308 
309     Aws::Map<Aws::String, ContainerServiceProtocol> m_ports;
310     bool m_portsHasBeenSet;
311   };
312 
313 } // namespace Model
314 } // namespace Lightsail
315 } // namespace Aws
316