/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include 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
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::VectorThe 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::VectorThe list of groups you want to filter search results based on the groups' * access to documents.
*/ inline void SetGroups(Aws::VectorThe list of groups you want to filter search results based on the groups' * access to documents.
*/ inline UserContext& WithGroups(const Aws::VectorThe list of groups you want to filter search results based on the groups' * access to documents.
*/ inline UserContext& WithGroups(Aws::VectorThe 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::VectorThe 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::VectorThe 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::VectorThe 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::VectorThe 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::VectorThe 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