AWS SDK for C++  0.12.9
AWS SDK for C++
AccessControlPolicy.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
16 #include <aws/s3/S3_EXPORTS.h>
18 #include <aws/s3/model/Owner.h>
19 #include <aws/s3/model/Grant.h>
20 
21 namespace Aws
22 {
23 namespace Utils
24 {
25 namespace Xml
26 {
27  class XmlNode;
28 } // namespace Xml
29 } // namespace Utils
30 namespace S3
31 {
32 namespace Model
33 {
34 
36  {
37  public:
40  AccessControlPolicy& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
41 
42  void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
43 
47  inline const Aws::Vector<Grant>& GetGrants() const{ return m_grants; }
48 
52  inline void SetGrants(const Aws::Vector<Grant>& value) { m_grantsHasBeenSet = true; m_grants = value; }
53 
57  inline void SetGrants(Aws::Vector<Grant>&& value) { m_grantsHasBeenSet = true; m_grants = value; }
58 
62  inline AccessControlPolicy& WithGrants(const Aws::Vector<Grant>& value) { SetGrants(value); return *this;}
63 
67  inline AccessControlPolicy& WithGrants(Aws::Vector<Grant>&& value) { SetGrants(value); return *this;}
68 
72  inline AccessControlPolicy& AddGrants(const Grant& value) { m_grantsHasBeenSet = true; m_grants.push_back(value); return *this; }
73 
77  inline AccessControlPolicy& AddGrants(Grant&& value) { m_grantsHasBeenSet = true; m_grants.push_back(value); return *this; }
78 
79 
80  inline const Owner& GetOwner() const{ return m_owner; }
81 
82 
83  inline void SetOwner(const Owner& value) { m_ownerHasBeenSet = true; m_owner = value; }
84 
85 
86  inline void SetOwner(Owner&& value) { m_ownerHasBeenSet = true; m_owner = value; }
87 
88 
89  inline AccessControlPolicy& WithOwner(const Owner& value) { SetOwner(value); return *this;}
90 
91 
92  inline AccessControlPolicy& WithOwner(Owner&& value) { SetOwner(value); return *this;}
93 
94  private:
95  Aws::Vector<Grant> m_grants;
96  bool m_grantsHasBeenSet;
97  Owner m_owner;
98  bool m_ownerHasBeenSet;
99  };
100 
101 } // namespace Model
102 } // namespace S3
103 } // namespace Aws
AccessControlPolicy & WithGrants(Aws::Vector< Grant > &&value)
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
AccessControlPolicy & WithOwner(Owner &&value)
#define AWS_S3_API
Definition: S3_EXPORTS.h:34
AccessControlPolicy & AddGrants(const Grant &value)
void SetGrants(Aws::Vector< Grant > &&value)
const Aws::Vector< Grant > & GetGrants() const
void SetGrants(const Aws::Vector< Grant > &value)
AccessControlPolicy & WithOwner(const Owner &value)
AccessControlPolicy & WithGrants(const Aws::Vector< Grant > &value)
AccessControlPolicy & AddGrants(Grant &&value)
JSON (JavaScript Object Notation).