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/kendra/Kendra_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSString.h> 9 #include <aws/kendra/model/PrincipalType.h> 10 #include <aws/kendra/model/ReadAccessType.h> 11 #include <utility> 12 13 namespace Aws 14 { 15 namespace Utils 16 { 17 namespace Json 18 { 19 class JsonValue; 20 class JsonView; 21 } // namespace Json 22 } // namespace Utils 23 namespace kendra 24 { 25 namespace Model 26 { 27 28 /** 29 * <p>Provides user and group information for document access 30 * filtering.</p><p><h3>See Also:</h3> <a 31 * href="http://docs.aws.amazon.com/goto/WebAPI/kendra-2019-02-03/Principal">AWS 32 * API Reference</a></p> 33 */ 34 class AWS_KENDRA_API Principal 35 { 36 public: 37 Principal(); 38 Principal(Aws::Utils::Json::JsonView jsonValue); 39 Principal& operator=(Aws::Utils::Json::JsonView jsonValue); 40 Aws::Utils::Json::JsonValue Jsonize() const; 41 42 43 /** 44 * <p>The name of the user or group.</p> 45 */ GetName()46 inline const Aws::String& GetName() const{ return m_name; } 47 48 /** 49 * <p>The name of the user or group.</p> 50 */ NameHasBeenSet()51 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } 52 53 /** 54 * <p>The name of the user or group.</p> 55 */ SetName(const Aws::String & value)56 inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } 57 58 /** 59 * <p>The name of the user or group.</p> 60 */ SetName(Aws::String && value)61 inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } 62 63 /** 64 * <p>The name of the user or group.</p> 65 */ SetName(const char * value)66 inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } 67 68 /** 69 * <p>The name of the user or group.</p> 70 */ WithName(const Aws::String & value)71 inline Principal& WithName(const Aws::String& value) { SetName(value); return *this;} 72 73 /** 74 * <p>The name of the user or group.</p> 75 */ WithName(Aws::String && value)76 inline Principal& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} 77 78 /** 79 * <p>The name of the user or group.</p> 80 */ WithName(const char * value)81 inline Principal& WithName(const char* value) { SetName(value); return *this;} 82 83 84 /** 85 * <p>The type of principal.</p> 86 */ GetType()87 inline const PrincipalType& GetType() const{ return m_type; } 88 89 /** 90 * <p>The type of principal.</p> 91 */ TypeHasBeenSet()92 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } 93 94 /** 95 * <p>The type of principal.</p> 96 */ SetType(const PrincipalType & value)97 inline void SetType(const PrincipalType& value) { m_typeHasBeenSet = true; m_type = value; } 98 99 /** 100 * <p>The type of principal.</p> 101 */ SetType(PrincipalType && value)102 inline void SetType(PrincipalType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } 103 104 /** 105 * <p>The type of principal.</p> 106 */ WithType(const PrincipalType & value)107 inline Principal& WithType(const PrincipalType& value) { SetType(value); return *this;} 108 109 /** 110 * <p>The type of principal.</p> 111 */ WithType(PrincipalType && value)112 inline Principal& WithType(PrincipalType&& value) { SetType(std::move(value)); return *this;} 113 114 115 /** 116 * <p>Whether to allow or deny access to the principal.</p> 117 */ GetAccess()118 inline const ReadAccessType& GetAccess() const{ return m_access; } 119 120 /** 121 * <p>Whether to allow or deny access to the principal.</p> 122 */ AccessHasBeenSet()123 inline bool AccessHasBeenSet() const { return m_accessHasBeenSet; } 124 125 /** 126 * <p>Whether to allow or deny access to the principal.</p> 127 */ SetAccess(const ReadAccessType & value)128 inline void SetAccess(const ReadAccessType& value) { m_accessHasBeenSet = true; m_access = value; } 129 130 /** 131 * <p>Whether to allow or deny access to the principal.</p> 132 */ SetAccess(ReadAccessType && value)133 inline void SetAccess(ReadAccessType&& value) { m_accessHasBeenSet = true; m_access = std::move(value); } 134 135 /** 136 * <p>Whether to allow or deny access to the principal.</p> 137 */ WithAccess(const ReadAccessType & value)138 inline Principal& WithAccess(const ReadAccessType& value) { SetAccess(value); return *this;} 139 140 /** 141 * <p>Whether to allow or deny access to the principal.</p> 142 */ WithAccess(ReadAccessType && value)143 inline Principal& WithAccess(ReadAccessType&& value) { SetAccess(std::move(value)); return *this;} 144 145 146 /** 147 * <p>The identifier of the data source the principal should access documents 148 * from.</p> 149 */ GetDataSourceId()150 inline const Aws::String& GetDataSourceId() const{ return m_dataSourceId; } 151 152 /** 153 * <p>The identifier of the data source the principal should access documents 154 * from.</p> 155 */ DataSourceIdHasBeenSet()156 inline bool DataSourceIdHasBeenSet() const { return m_dataSourceIdHasBeenSet; } 157 158 /** 159 * <p>The identifier of the data source the principal should access documents 160 * from.</p> 161 */ SetDataSourceId(const Aws::String & value)162 inline void SetDataSourceId(const Aws::String& value) { m_dataSourceIdHasBeenSet = true; m_dataSourceId = value; } 163 164 /** 165 * <p>The identifier of the data source the principal should access documents 166 * from.</p> 167 */ SetDataSourceId(Aws::String && value)168 inline void SetDataSourceId(Aws::String&& value) { m_dataSourceIdHasBeenSet = true; m_dataSourceId = std::move(value); } 169 170 /** 171 * <p>The identifier of the data source the principal should access documents 172 * from.</p> 173 */ SetDataSourceId(const char * value)174 inline void SetDataSourceId(const char* value) { m_dataSourceIdHasBeenSet = true; m_dataSourceId.assign(value); } 175 176 /** 177 * <p>The identifier of the data source the principal should access documents 178 * from.</p> 179 */ WithDataSourceId(const Aws::String & value)180 inline Principal& WithDataSourceId(const Aws::String& value) { SetDataSourceId(value); return *this;} 181 182 /** 183 * <p>The identifier of the data source the principal should access documents 184 * from.</p> 185 */ WithDataSourceId(Aws::String && value)186 inline Principal& WithDataSourceId(Aws::String&& value) { SetDataSourceId(std::move(value)); return *this;} 187 188 /** 189 * <p>The identifier of the data source the principal should access documents 190 * from.</p> 191 */ WithDataSourceId(const char * value)192 inline Principal& WithDataSourceId(const char* value) { SetDataSourceId(value); return *this;} 193 194 private: 195 196 Aws::String m_name; 197 bool m_nameHasBeenSet; 198 199 PrincipalType m_type; 200 bool m_typeHasBeenSet; 201 202 ReadAccessType m_access; 203 bool m_accessHasBeenSet; 204 205 Aws::String m_dataSourceId; 206 bool m_dataSourceIdHasBeenSet; 207 }; 208 209 } // namespace Model 210 } // namespace kendra 211 } // namespace Aws 212