aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-s3/include/aws/s3/model/PublicAccessBlockConfiguration.h
blob: b78baafaf4afff54f51e576c4054ccc2706fa2e7 (plain) (blame)
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
/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#pragma once
#include <aws/s3/S3_EXPORTS.h>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace S3
{
namespace Model
{

  /**
   * <p>The PublicAccessBlock configuration that you want to apply to this Amazon S3
   * bucket. You can enable the configuration options in any combination. For more
   * information about when Amazon S3 considers a bucket or object public, see <a
   * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status">The
   * Meaning of "Public"</a> in the <i>Amazon S3 User Guide</i>. </p><p><h3>See
   * Also:</h3>   <a
   * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PublicAccessBlockConfiguration">AWS
   * API Reference</a></p>
   */
  class AWS_S3_API PublicAccessBlockConfiguration
  {
  public:
    PublicAccessBlockConfiguration();
    PublicAccessBlockConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode);
    PublicAccessBlockConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;


    /**
     * <p>Specifies whether Amazon S3 should block public access control lists (ACLs)
     * for this bucket and objects in this bucket. Setting this element to
     * <code>TRUE</code> causes the following behavior:</p> <ul> <li> <p>PUT Bucket acl
     * and PUT Object acl calls fail if the specified ACL is public.</p> </li> <li>
     * <p>PUT Object calls fail if the request includes a public ACL.</p> </li> <li>
     * <p>PUT Bucket calls fail if the request includes a public ACL.</p> </li> </ul>
     * <p>Enabling this setting doesn't affect existing policies or ACLs.</p>
     */
    inline bool GetBlockPublicAcls() const{ return m_blockPublicAcls; }

    /**
     * <p>Specifies whether Amazon S3 should block public access control lists (ACLs)
     * for this bucket and objects in this bucket. Setting this element to
     * <code>TRUE</code> causes the following behavior:</p> <ul> <li> <p>PUT Bucket acl
     * and PUT Object acl calls fail if the specified ACL is public.</p> </li> <li>
     * <p>PUT Object calls fail if the request includes a public ACL.</p> </li> <li>
     * <p>PUT Bucket calls fail if the request includes a public ACL.</p> </li> </ul>
     * <p>Enabling this setting doesn't affect existing policies or ACLs.</p>
     */
    inline bool BlockPublicAclsHasBeenSet() const { return m_blockPublicAclsHasBeenSet; }

    /**
     * <p>Specifies whether Amazon S3 should block public access control lists (ACLs)
     * for this bucket and objects in this bucket. Setting this element to
     * <code>TRUE</code> causes the following behavior:</p> <ul> <li> <p>PUT Bucket acl
     * and PUT Object acl calls fail if the specified ACL is public.</p> </li> <li>
     * <p>PUT Object calls fail if the request includes a public ACL.</p> </li> <li>
     * <p>PUT Bucket calls fail if the request includes a public ACL.</p> </li> </ul>
     * <p>Enabling this setting doesn't affect existing policies or ACLs.</p>
     */
    inline void SetBlockPublicAcls(bool value) { m_blockPublicAclsHasBeenSet = true; m_blockPublicAcls = value; }

    /**
     * <p>Specifies whether Amazon S3 should block public access control lists (ACLs)
     * for this bucket and objects in this bucket. Setting this element to
     * <code>TRUE</code> causes the following behavior:</p> <ul> <li> <p>PUT Bucket acl
     * and PUT Object acl calls fail if the specified ACL is public.</p> </li> <li>
     * <p>PUT Object calls fail if the request includes a public ACL.</p> </li> <li>
     * <p>PUT Bucket calls fail if the request includes a public ACL.</p> </li> </ul>
     * <p>Enabling this setting doesn't affect existing policies or ACLs.</p>
     */
    inline PublicAccessBlockConfiguration& WithBlockPublicAcls(bool value) { SetBlockPublicAcls(value); return *this;}


    /**
     * <p>Specifies whether Amazon S3 should ignore public ACLs for this bucket and
     * objects in this bucket. Setting this element to <code>TRUE</code> causes Amazon
     * S3 to ignore all public ACLs on this bucket and objects in this bucket.</p>
     * <p>Enabling this setting doesn't affect the persistence of any existing ACLs and
     * doesn't prevent new public ACLs from being set.</p>
     */
    inline bool GetIgnorePublicAcls() const{ return m_ignorePublicAcls; }

    /**
     * <p>Specifies whether Amazon S3 should ignore public ACLs for this bucket and
     * objects in this bucket. Setting this element to <code>TRUE</code> causes Amazon
     * S3 to ignore all public ACLs on this bucket and objects in this bucket.</p>
     * <p>Enabling this setting doesn't affect the persistence of any existing ACLs and
     * doesn't prevent new public ACLs from being set.</p>
     */
    inline bool IgnorePublicAclsHasBeenSet() const { return m_ignorePublicAclsHasBeenSet; }

    /**
     * <p>Specifies whether Amazon S3 should ignore public ACLs for this bucket and
     * objects in this bucket. Setting this element to <code>TRUE</code> causes Amazon
     * S3 to ignore all public ACLs on this bucket and objects in this bucket.</p>
     * <p>Enabling this setting doesn't affect the persistence of any existing ACLs and
     * doesn't prevent new public ACLs from being set.</p>
     */
    inline void SetIgnorePublicAcls(bool value) { m_ignorePublicAclsHasBeenSet = true; m_ignorePublicAcls = value; }

    /**
     * <p>Specifies whether Amazon S3 should ignore public ACLs for this bucket and
     * objects in this bucket. Setting this element to <code>TRUE</code> causes Amazon
     * S3 to ignore all public ACLs on this bucket and objects in this bucket.</p>
     * <p>Enabling this setting doesn't affect the persistence of any existing ACLs and
     * doesn't prevent new public ACLs from being set.</p>
     */
    inline PublicAccessBlockConfiguration& WithIgnorePublicAcls(bool value) { SetIgnorePublicAcls(value); return *this;}


    /**
     * <p>Specifies whether Amazon S3 should block public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> causes Amazon S3 to reject
     * calls to PUT Bucket policy if the specified bucket policy allows public access.
     * </p> <p>Enabling this setting doesn't affect existing bucket policies.</p>
     */
    inline bool GetBlockPublicPolicy() const{ return m_blockPublicPolicy; }

    /**
     * <p>Specifies whether Amazon S3 should block public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> causes Amazon S3 to reject
     * calls to PUT Bucket policy if the specified bucket policy allows public access.
     * </p> <p>Enabling this setting doesn't affect existing bucket policies.</p>
     */
    inline bool BlockPublicPolicyHasBeenSet() const { return m_blockPublicPolicyHasBeenSet; }

    /**
     * <p>Specifies whether Amazon S3 should block public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> causes Amazon S3 to reject
     * calls to PUT Bucket policy if the specified bucket policy allows public access.
     * </p> <p>Enabling this setting doesn't affect existing bucket policies.</p>
     */
    inline void SetBlockPublicPolicy(bool value) { m_blockPublicPolicyHasBeenSet = true; m_blockPublicPolicy = value; }

    /**
     * <p>Specifies whether Amazon S3 should block public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> causes Amazon S3 to reject
     * calls to PUT Bucket policy if the specified bucket policy allows public access.
     * </p> <p>Enabling this setting doesn't affect existing bucket policies.</p>
     */
    inline PublicAccessBlockConfiguration& WithBlockPublicPolicy(bool value) { SetBlockPublicPolicy(value); return *this;}


    /**
     * <p>Specifies whether Amazon S3 should restrict public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> restricts access to this
     * bucket to only AWS service principals and authorized users within this account
     * if the bucket has a public policy.</p> <p>Enabling this setting doesn't affect
     * previously stored bucket policies, except that public and cross-account access
     * within any public bucket policy, including non-public delegation to specific
     * accounts, is blocked.</p>
     */
    inline bool GetRestrictPublicBuckets() const{ return m_restrictPublicBuckets; }

    /**
     * <p>Specifies whether Amazon S3 should restrict public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> restricts access to this
     * bucket to only AWS service principals and authorized users within this account
     * if the bucket has a public policy.</p> <p>Enabling this setting doesn't affect
     * previously stored bucket policies, except that public and cross-account access
     * within any public bucket policy, including non-public delegation to specific
     * accounts, is blocked.</p>
     */
    inline bool RestrictPublicBucketsHasBeenSet() const { return m_restrictPublicBucketsHasBeenSet; }

    /**
     * <p>Specifies whether Amazon S3 should restrict public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> restricts access to this
     * bucket to only AWS service principals and authorized users within this account
     * if the bucket has a public policy.</p> <p>Enabling this setting doesn't affect
     * previously stored bucket policies, except that public and cross-account access
     * within any public bucket policy, including non-public delegation to specific
     * accounts, is blocked.</p>
     */
    inline void SetRestrictPublicBuckets(bool value) { m_restrictPublicBucketsHasBeenSet = true; m_restrictPublicBuckets = value; }

    /**
     * <p>Specifies whether Amazon S3 should restrict public bucket policies for this
     * bucket. Setting this element to <code>TRUE</code> restricts access to this
     * bucket to only AWS service principals and authorized users within this account
     * if the bucket has a public policy.</p> <p>Enabling this setting doesn't affect
     * previously stored bucket policies, except that public and cross-account access
     * within any public bucket policy, including non-public delegation to specific
     * accounts, is blocked.</p>
     */
    inline PublicAccessBlockConfiguration& WithRestrictPublicBuckets(bool value) { SetRestrictPublicBuckets(value); return *this;}

  private:

    bool m_blockPublicAcls;
    bool m_blockPublicAclsHasBeenSet;

    bool m_ignorePublicAcls;
    bool m_ignorePublicAclsHasBeenSet;

    bool m_blockPublicPolicy;
    bool m_blockPublicPolicyHasBeenSet;

    bool m_restrictPublicBuckets;
    bool m_restrictPublicBucketsHasBeenSet;
  };

} // namespace Model
} // namespace S3
} // namespace Aws