/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace kendra { namespace Model { /** *

Provides information about the user context for an Amazon Kendra index.

*

User context filtering is a kind of personalized search with the benefit of * controlling access to documents. For example, not all teams that search the * company portal for information should access top-secret company documents, nor * are these documents relevant to all users. Only specific users or groups of * teams given access to top-secret documents should see these documents in their * search results.

You provide one of the following:

  • User * token

  • User ID, the groups the user belongs to, and any data * sources the groups can access.

If you provide both, an * exception is thrown.

See Also:

AWS * API Reference

*/ class UserContext { public: AWS_KENDRA_API UserContext(); AWS_KENDRA_API UserContext(Aws::Utils::Json::JsonView jsonValue); AWS_KENDRA_API UserContext& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_KENDRA_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline const Aws::String& GetToken() const{ return m_token; } /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline bool TokenHasBeenSet() const { return m_tokenHasBeenSet; } /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline void SetToken(const Aws::String& value) { m_tokenHasBeenSet = true; m_token = value; } /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline void SetToken(Aws::String&& value) { m_tokenHasBeenSet = true; m_token = std::move(value); } /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline void SetToken(const char* value) { m_tokenHasBeenSet = true; m_token.assign(value); } /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline UserContext& WithToken(const Aws::String& value) { SetToken(value); return *this;} /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline UserContext& WithToken(Aws::String&& value) { SetToken(std::move(value)); return *this;} /** *

The user context token for filtering search results for a user. It must be a * JWT or a JSON token.

*/ inline UserContext& WithToken(const char* value) { SetToken(value); return *this;} /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline const Aws::String& GetUserId() const{ return m_userId; } /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline bool UserIdHasBeenSet() const { return m_userIdHasBeenSet; } /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline void SetUserId(const Aws::String& value) { m_userIdHasBeenSet = true; m_userId = value; } /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline void SetUserId(Aws::String&& value) { m_userIdHasBeenSet = true; m_userId = std::move(value); } /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline void SetUserId(const char* value) { m_userIdHasBeenSet = true; m_userId.assign(value); } /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline UserContext& WithUserId(const Aws::String& value) { SetUserId(value); return *this;} /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline UserContext& WithUserId(Aws::String&& value) { SetUserId(std::move(value)); return *this;} /** *

The identifier of the user you want to filter search results based on their * access to documents.

*/ inline UserContext& WithUserId(const char* value) { SetUserId(value); return *this;} /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline const Aws::Vector& GetGroups() const{ return m_groups; } /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline bool GroupsHasBeenSet() const { return m_groupsHasBeenSet; } /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline void SetGroups(const Aws::Vector& value) { m_groupsHasBeenSet = true; m_groups = value; } /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline void SetGroups(Aws::Vector&& value) { m_groupsHasBeenSet = true; m_groups = std::move(value); } /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline UserContext& WithGroups(const Aws::Vector& value) { SetGroups(value); return *this;} /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline UserContext& WithGroups(Aws::Vector&& value) { SetGroups(std::move(value)); return *this;} /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline UserContext& AddGroups(const Aws::String& value) { m_groupsHasBeenSet = true; m_groups.push_back(value); return *this; } /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline UserContext& AddGroups(Aws::String&& value) { m_groupsHasBeenSet = true; m_groups.push_back(std::move(value)); return *this; } /** *

The list of groups you want to filter search results based on the groups' * access to documents.

*/ inline UserContext& AddGroups(const char* value) { m_groupsHasBeenSet = true; m_groups.push_back(value); return *this; } /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline const Aws::Vector& GetDataSourceGroups() const{ return m_dataSourceGroups; } /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline bool DataSourceGroupsHasBeenSet() const { return m_dataSourceGroupsHasBeenSet; } /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline void SetDataSourceGroups(const Aws::Vector& value) { m_dataSourceGroupsHasBeenSet = true; m_dataSourceGroups = value; } /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline void SetDataSourceGroups(Aws::Vector&& value) { m_dataSourceGroupsHasBeenSet = true; m_dataSourceGroups = std::move(value); } /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline UserContext& WithDataSourceGroups(const Aws::Vector& value) { SetDataSourceGroups(value); return *this;} /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline UserContext& WithDataSourceGroups(Aws::Vector&& value) { SetDataSourceGroups(std::move(value)); return *this;} /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline UserContext& AddDataSourceGroups(const DataSourceGroup& value) { m_dataSourceGroupsHasBeenSet = true; m_dataSourceGroups.push_back(value); return *this; } /** *

The list of data source groups you want to filter search results based on * groups' access to documents in that data source.

*/ inline UserContext& AddDataSourceGroups(DataSourceGroup&& value) { m_dataSourceGroupsHasBeenSet = true; m_dataSourceGroups.push_back(std::move(value)); return *this; } private: Aws::String m_token; bool m_tokenHasBeenSet = false; Aws::String m_userId; bool m_userIdHasBeenSet = false; Aws::Vector m_groups; bool m_groupsHasBeenSet = false; Aws::Vector m_dataSourceGroups; bool m_dataSourceGroupsHasBeenSet = false; }; } // namespace Model } // namespace kendra } // namespace Aws