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/redshift/Redshift_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSStreamFwd.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/core/utils/memory/stl/AWSVector.h>
11 #include <aws/redshift/model/Tag.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace Utils
17 {
18 namespace Xml
19 {
20   class XmlNode;
21 } // namespace Xml
22 } // namespace Utils
23 namespace Redshift
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>The snapshot copy grant that grants Amazon Redshift permission to encrypt
30    * copied snapshots with the specified customer master key (CMK) from Amazon Web
31    * Services KMS in the destination region.</p> <p> For more information about
32    * managing snapshot copy grants, go to <a
33    * href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html">Amazon
34    * Redshift Database Encryption</a> in the <i>Amazon Redshift Cluster Management
35    * Guide</i>. </p><p><h3>See Also:</h3>   <a
36    * href="http://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/SnapshotCopyGrant">AWS
37    * API Reference</a></p>
38    */
39   class AWS_REDSHIFT_API SnapshotCopyGrant
40   {
41   public:
42     SnapshotCopyGrant();
43     SnapshotCopyGrant(const Aws::Utils::Xml::XmlNode& xmlNode);
44     SnapshotCopyGrant& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
45 
46     void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
47     void OutputToStream(Aws::OStream& oStream, const char* location) const;
48 
49 
50     /**
51      * <p>The name of the snapshot copy grant.</p>
52      */
GetSnapshotCopyGrantName()53     inline const Aws::String& GetSnapshotCopyGrantName() const{ return m_snapshotCopyGrantName; }
54 
55     /**
56      * <p>The name of the snapshot copy grant.</p>
57      */
SnapshotCopyGrantNameHasBeenSet()58     inline bool SnapshotCopyGrantNameHasBeenSet() const { return m_snapshotCopyGrantNameHasBeenSet; }
59 
60     /**
61      * <p>The name of the snapshot copy grant.</p>
62      */
SetSnapshotCopyGrantName(const Aws::String & value)63     inline void SetSnapshotCopyGrantName(const Aws::String& value) { m_snapshotCopyGrantNameHasBeenSet = true; m_snapshotCopyGrantName = value; }
64 
65     /**
66      * <p>The name of the snapshot copy grant.</p>
67      */
SetSnapshotCopyGrantName(Aws::String && value)68     inline void SetSnapshotCopyGrantName(Aws::String&& value) { m_snapshotCopyGrantNameHasBeenSet = true; m_snapshotCopyGrantName = std::move(value); }
69 
70     /**
71      * <p>The name of the snapshot copy grant.</p>
72      */
SetSnapshotCopyGrantName(const char * value)73     inline void SetSnapshotCopyGrantName(const char* value) { m_snapshotCopyGrantNameHasBeenSet = true; m_snapshotCopyGrantName.assign(value); }
74 
75     /**
76      * <p>The name of the snapshot copy grant.</p>
77      */
WithSnapshotCopyGrantName(const Aws::String & value)78     inline SnapshotCopyGrant& WithSnapshotCopyGrantName(const Aws::String& value) { SetSnapshotCopyGrantName(value); return *this;}
79 
80     /**
81      * <p>The name of the snapshot copy grant.</p>
82      */
WithSnapshotCopyGrantName(Aws::String && value)83     inline SnapshotCopyGrant& WithSnapshotCopyGrantName(Aws::String&& value) { SetSnapshotCopyGrantName(std::move(value)); return *this;}
84 
85     /**
86      * <p>The name of the snapshot copy grant.</p>
87      */
WithSnapshotCopyGrantName(const char * value)88     inline SnapshotCopyGrant& WithSnapshotCopyGrantName(const char* value) { SetSnapshotCopyGrantName(value); return *this;}
89 
90 
91     /**
92      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
93      * KMS to which Amazon Redshift is granted permission.</p>
94      */
GetKmsKeyId()95     inline const Aws::String& GetKmsKeyId() const{ return m_kmsKeyId; }
96 
97     /**
98      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
99      * KMS to which Amazon Redshift is granted permission.</p>
100      */
KmsKeyIdHasBeenSet()101     inline bool KmsKeyIdHasBeenSet() const { return m_kmsKeyIdHasBeenSet; }
102 
103     /**
104      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
105      * KMS to which Amazon Redshift is granted permission.</p>
106      */
SetKmsKeyId(const Aws::String & value)107     inline void SetKmsKeyId(const Aws::String& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = value; }
108 
109     /**
110      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
111      * KMS to which Amazon Redshift is granted permission.</p>
112      */
SetKmsKeyId(Aws::String && value)113     inline void SetKmsKeyId(Aws::String&& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = std::move(value); }
114 
115     /**
116      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
117      * KMS to which Amazon Redshift is granted permission.</p>
118      */
SetKmsKeyId(const char * value)119     inline void SetKmsKeyId(const char* value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId.assign(value); }
120 
121     /**
122      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
123      * KMS to which Amazon Redshift is granted permission.</p>
124      */
WithKmsKeyId(const Aws::String & value)125     inline SnapshotCopyGrant& WithKmsKeyId(const Aws::String& value) { SetKmsKeyId(value); return *this;}
126 
127     /**
128      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
129      * KMS to which Amazon Redshift is granted permission.</p>
130      */
WithKmsKeyId(Aws::String && value)131     inline SnapshotCopyGrant& WithKmsKeyId(Aws::String&& value) { SetKmsKeyId(std::move(value)); return *this;}
132 
133     /**
134      * <p>The unique identifier of the customer master key (CMK) in Amazon Web Services
135      * KMS to which Amazon Redshift is granted permission.</p>
136      */
WithKmsKeyId(const char * value)137     inline SnapshotCopyGrant& WithKmsKeyId(const char* value) { SetKmsKeyId(value); return *this;}
138 
139 
140     /**
141      * <p>A list of tag instances.</p>
142      */
GetTags()143     inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }
144 
145     /**
146      * <p>A list of tag instances.</p>
147      */
TagsHasBeenSet()148     inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
149 
150     /**
151      * <p>A list of tag instances.</p>
152      */
SetTags(const Aws::Vector<Tag> & value)153     inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }
154 
155     /**
156      * <p>A list of tag instances.</p>
157      */
SetTags(Aws::Vector<Tag> && value)158     inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }
159 
160     /**
161      * <p>A list of tag instances.</p>
162      */
WithTags(const Aws::Vector<Tag> & value)163     inline SnapshotCopyGrant& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}
164 
165     /**
166      * <p>A list of tag instances.</p>
167      */
WithTags(Aws::Vector<Tag> && value)168     inline SnapshotCopyGrant& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}
169 
170     /**
171      * <p>A list of tag instances.</p>
172      */
AddTags(const Tag & value)173     inline SnapshotCopyGrant& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
174 
175     /**
176      * <p>A list of tag instances.</p>
177      */
AddTags(Tag && value)178     inline SnapshotCopyGrant& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }
179 
180   private:
181 
182     Aws::String m_snapshotCopyGrantName;
183     bool m_snapshotCopyGrantNameHasBeenSet;
184 
185     Aws::String m_kmsKeyId;
186     bool m_kmsKeyIdHasBeenSet;
187 
188     Aws::Vector<Tag> m_tags;
189     bool m_tagsHasBeenSet;
190   };
191 
192 } // namespace Model
193 } // namespace Redshift
194 } // namespace Aws
195