{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kendra.CreateQuerySuggestionsBlockList
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a block list to exlcude certain queries from suggestions.
--
-- Any query that contains words or phrases specified in the block list is
-- blocked or filtered out from being shown as a suggestion.
--
-- You need to provide the file location of your block list text file in
-- your S3 bucket. In your text file, enter each block word or phrase on a
-- separate line.
--
-- For information on the current quota limits for block lists, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/quotas.html Quotas for Amazon Kendra>.
--
-- @CreateQuerySuggestionsBlockList@ is currently not supported in the
-- Amazon Web Services GovCloud (US-West) region.
--
-- For an example of creating a block list for query suggestions using the
-- Python SDK, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html#suggestions-block-list Query suggestions block list>.
module Amazonka.Kendra.CreateQuerySuggestionsBlockList
  ( -- * Creating a Request
    CreateQuerySuggestionsBlockList (..),
    newCreateQuerySuggestionsBlockList,

    -- * Request Lenses
    createQuerySuggestionsBlockList_clientToken,
    createQuerySuggestionsBlockList_description,
    createQuerySuggestionsBlockList_tags,
    createQuerySuggestionsBlockList_indexId,
    createQuerySuggestionsBlockList_name,
    createQuerySuggestionsBlockList_sourceS3Path,
    createQuerySuggestionsBlockList_roleArn,

    -- * Destructuring the Response
    CreateQuerySuggestionsBlockListResponse (..),
    newCreateQuerySuggestionsBlockListResponse,

    -- * Response Lenses
    createQuerySuggestionsBlockListResponse_id,
    createQuerySuggestionsBlockListResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateQuerySuggestionsBlockList' smart constructor.
data CreateQuerySuggestionsBlockList = CreateQuerySuggestionsBlockList'
  { -- | A token that you provide to identify the request to create a query
    -- suggestions block list.
    CreateQuerySuggestionsBlockList -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | A user-friendly description for the block list.
    --
    -- For example, the description \"List of all offensive words that can
    -- appear in user queries and need to be blocked from suggestions.\"
    CreateQuerySuggestionsBlockList -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A tag that you can assign to a block list that categorizes the block
    -- list.
    CreateQuerySuggestionsBlockList -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The identifier of the index you want to create a query suggestions block
    -- list for.
    CreateQuerySuggestionsBlockList -> Text
indexId :: Prelude.Text,
    -- | A user friendly name for the block list.
    --
    -- For example, the block list named \'offensive-words\' includes all
    -- offensive words that could appear in user queries and need to be blocked
    -- from suggestions.
    CreateQuerySuggestionsBlockList -> Text
name :: Prelude.Text,
    -- | The S3 path to your block list text file in your S3 bucket.
    --
    -- Each block word or phrase should be on a separate line in a text file.
    --
    -- For information on the current quota limits for block lists, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/quotas.html Quotas for Amazon Kendra>.
    CreateQuerySuggestionsBlockList -> S3Path
sourceS3Path :: S3Path,
    -- | The IAM (Identity and Access Management) role used by Amazon Kendra to
    -- access the block list text file in your S3 bucket.
    --
    -- You need permissions to the role ARN (Amazon Web Services Resource
    -- Name). The role needs S3 read permissions to your file in S3 and needs
    -- to give STS (Security Token Service) assume role permissions to Amazon
    -- Kendra.
    CreateQuerySuggestionsBlockList -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateQuerySuggestionsBlockList
-> CreateQuerySuggestionsBlockList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQuerySuggestionsBlockList
-> CreateQuerySuggestionsBlockList -> Bool
$c/= :: CreateQuerySuggestionsBlockList
-> CreateQuerySuggestionsBlockList -> Bool
== :: CreateQuerySuggestionsBlockList
-> CreateQuerySuggestionsBlockList -> Bool
$c== :: CreateQuerySuggestionsBlockList
-> CreateQuerySuggestionsBlockList -> Bool
Prelude.Eq, ReadPrec [CreateQuerySuggestionsBlockList]
ReadPrec CreateQuerySuggestionsBlockList
Int -> ReadS CreateQuerySuggestionsBlockList
ReadS [CreateQuerySuggestionsBlockList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQuerySuggestionsBlockList]
$creadListPrec :: ReadPrec [CreateQuerySuggestionsBlockList]
readPrec :: ReadPrec CreateQuerySuggestionsBlockList
$creadPrec :: ReadPrec CreateQuerySuggestionsBlockList
readList :: ReadS [CreateQuerySuggestionsBlockList]
$creadList :: ReadS [CreateQuerySuggestionsBlockList]
readsPrec :: Int -> ReadS CreateQuerySuggestionsBlockList
$creadsPrec :: Int -> ReadS CreateQuerySuggestionsBlockList
Prelude.Read, Int -> CreateQuerySuggestionsBlockList -> ShowS
[CreateQuerySuggestionsBlockList] -> ShowS
CreateQuerySuggestionsBlockList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQuerySuggestionsBlockList] -> ShowS
$cshowList :: [CreateQuerySuggestionsBlockList] -> ShowS
show :: CreateQuerySuggestionsBlockList -> String
$cshow :: CreateQuerySuggestionsBlockList -> String
showsPrec :: Int -> CreateQuerySuggestionsBlockList -> ShowS
$cshowsPrec :: Int -> CreateQuerySuggestionsBlockList -> ShowS
Prelude.Show, forall x.
Rep CreateQuerySuggestionsBlockList x
-> CreateQuerySuggestionsBlockList
forall x.
CreateQuerySuggestionsBlockList
-> Rep CreateQuerySuggestionsBlockList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateQuerySuggestionsBlockList x
-> CreateQuerySuggestionsBlockList
$cfrom :: forall x.
CreateQuerySuggestionsBlockList
-> Rep CreateQuerySuggestionsBlockList x
Prelude.Generic)

-- |
-- Create a value of 'CreateQuerySuggestionsBlockList' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'createQuerySuggestionsBlockList_clientToken' - A token that you provide to identify the request to create a query
-- suggestions block list.
--
-- 'description', 'createQuerySuggestionsBlockList_description' - A user-friendly description for the block list.
--
-- For example, the description \"List of all offensive words that can
-- appear in user queries and need to be blocked from suggestions.\"
--
-- 'tags', 'createQuerySuggestionsBlockList_tags' - A tag that you can assign to a block list that categorizes the block
-- list.
--
-- 'indexId', 'createQuerySuggestionsBlockList_indexId' - The identifier of the index you want to create a query suggestions block
-- list for.
--
-- 'name', 'createQuerySuggestionsBlockList_name' - A user friendly name for the block list.
--
-- For example, the block list named \'offensive-words\' includes all
-- offensive words that could appear in user queries and need to be blocked
-- from suggestions.
--
-- 'sourceS3Path', 'createQuerySuggestionsBlockList_sourceS3Path' - The S3 path to your block list text file in your S3 bucket.
--
-- Each block word or phrase should be on a separate line in a text file.
--
-- For information on the current quota limits for block lists, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/quotas.html Quotas for Amazon Kendra>.
--
-- 'roleArn', 'createQuerySuggestionsBlockList_roleArn' - The IAM (Identity and Access Management) role used by Amazon Kendra to
-- access the block list text file in your S3 bucket.
--
-- You need permissions to the role ARN (Amazon Web Services Resource
-- Name). The role needs S3 read permissions to your file in S3 and needs
-- to give STS (Security Token Service) assume role permissions to Amazon
-- Kendra.
newCreateQuerySuggestionsBlockList ::
  -- | 'indexId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'sourceS3Path'
  S3Path ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateQuerySuggestionsBlockList
newCreateQuerySuggestionsBlockList :: Text -> Text -> S3Path -> Text -> CreateQuerySuggestionsBlockList
newCreateQuerySuggestionsBlockList
  Text
pIndexId_
  Text
pName_
  S3Path
pSourceS3Path_
  Text
pRoleArn_ =
    CreateQuerySuggestionsBlockList'
      { $sel:clientToken:CreateQuerySuggestionsBlockList' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateQuerySuggestionsBlockList' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateQuerySuggestionsBlockList' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:indexId:CreateQuerySuggestionsBlockList' :: Text
indexId = Text
pIndexId_,
        $sel:name:CreateQuerySuggestionsBlockList' :: Text
name = Text
pName_,
        $sel:sourceS3Path:CreateQuerySuggestionsBlockList' :: S3Path
sourceS3Path = S3Path
pSourceS3Path_,
        $sel:roleArn:CreateQuerySuggestionsBlockList' :: Text
roleArn = Text
pRoleArn_
      }

-- | A token that you provide to identify the request to create a query
-- suggestions block list.
createQuerySuggestionsBlockList_clientToken :: Lens.Lens' CreateQuerySuggestionsBlockList (Prelude.Maybe Prelude.Text)
createQuerySuggestionsBlockList_clientToken :: Lens' CreateQuerySuggestionsBlockList (Maybe Text)
createQuerySuggestionsBlockList_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockList' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateQuerySuggestionsBlockList
s@CreateQuerySuggestionsBlockList' {} Maybe Text
a -> CreateQuerySuggestionsBlockList
s {$sel:clientToken:CreateQuerySuggestionsBlockList' :: Maybe Text
clientToken = Maybe Text
a} :: CreateQuerySuggestionsBlockList)

-- | A user-friendly description for the block list.
--
-- For example, the description \"List of all offensive words that can
-- appear in user queries and need to be blocked from suggestions.\"
createQuerySuggestionsBlockList_description :: Lens.Lens' CreateQuerySuggestionsBlockList (Prelude.Maybe Prelude.Text)
createQuerySuggestionsBlockList_description :: Lens' CreateQuerySuggestionsBlockList (Maybe Text)
createQuerySuggestionsBlockList_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockList' {Maybe Text
description :: Maybe Text
$sel:description:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateQuerySuggestionsBlockList
s@CreateQuerySuggestionsBlockList' {} Maybe Text
a -> CreateQuerySuggestionsBlockList
s {$sel:description:CreateQuerySuggestionsBlockList' :: Maybe Text
description = Maybe Text
a} :: CreateQuerySuggestionsBlockList)

-- | A tag that you can assign to a block list that categorizes the block
-- list.
createQuerySuggestionsBlockList_tags :: Lens.Lens' CreateQuerySuggestionsBlockList (Prelude.Maybe [Tag])
createQuerySuggestionsBlockList_tags :: Lens' CreateQuerySuggestionsBlockList (Maybe [Tag])
createQuerySuggestionsBlockList_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockList' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateQuerySuggestionsBlockList
s@CreateQuerySuggestionsBlockList' {} Maybe [Tag]
a -> CreateQuerySuggestionsBlockList
s {$sel:tags:CreateQuerySuggestionsBlockList' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateQuerySuggestionsBlockList) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the index you want to create a query suggestions block
-- list for.
createQuerySuggestionsBlockList_indexId :: Lens.Lens' CreateQuerySuggestionsBlockList Prelude.Text
createQuerySuggestionsBlockList_indexId :: Lens' CreateQuerySuggestionsBlockList Text
createQuerySuggestionsBlockList_indexId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockList' {Text
indexId :: Text
$sel:indexId:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
indexId} -> Text
indexId) (\s :: CreateQuerySuggestionsBlockList
s@CreateQuerySuggestionsBlockList' {} Text
a -> CreateQuerySuggestionsBlockList
s {$sel:indexId:CreateQuerySuggestionsBlockList' :: Text
indexId = Text
a} :: CreateQuerySuggestionsBlockList)

-- | A user friendly name for the block list.
--
-- For example, the block list named \'offensive-words\' includes all
-- offensive words that could appear in user queries and need to be blocked
-- from suggestions.
createQuerySuggestionsBlockList_name :: Lens.Lens' CreateQuerySuggestionsBlockList Prelude.Text
createQuerySuggestionsBlockList_name :: Lens' CreateQuerySuggestionsBlockList Text
createQuerySuggestionsBlockList_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockList' {Text
name :: Text
$sel:name:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
name} -> Text
name) (\s :: CreateQuerySuggestionsBlockList
s@CreateQuerySuggestionsBlockList' {} Text
a -> CreateQuerySuggestionsBlockList
s {$sel:name:CreateQuerySuggestionsBlockList' :: Text
name = Text
a} :: CreateQuerySuggestionsBlockList)

-- | The S3 path to your block list text file in your S3 bucket.
--
-- Each block word or phrase should be on a separate line in a text file.
--
-- For information on the current quota limits for block lists, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/quotas.html Quotas for Amazon Kendra>.
createQuerySuggestionsBlockList_sourceS3Path :: Lens.Lens' CreateQuerySuggestionsBlockList S3Path
createQuerySuggestionsBlockList_sourceS3Path :: Lens' CreateQuerySuggestionsBlockList S3Path
createQuerySuggestionsBlockList_sourceS3Path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockList' {S3Path
sourceS3Path :: S3Path
$sel:sourceS3Path:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> S3Path
sourceS3Path} -> S3Path
sourceS3Path) (\s :: CreateQuerySuggestionsBlockList
s@CreateQuerySuggestionsBlockList' {} S3Path
a -> CreateQuerySuggestionsBlockList
s {$sel:sourceS3Path:CreateQuerySuggestionsBlockList' :: S3Path
sourceS3Path = S3Path
a} :: CreateQuerySuggestionsBlockList)

-- | The IAM (Identity and Access Management) role used by Amazon Kendra to
-- access the block list text file in your S3 bucket.
--
-- You need permissions to the role ARN (Amazon Web Services Resource
-- Name). The role needs S3 read permissions to your file in S3 and needs
-- to give STS (Security Token Service) assume role permissions to Amazon
-- Kendra.
createQuerySuggestionsBlockList_roleArn :: Lens.Lens' CreateQuerySuggestionsBlockList Prelude.Text
createQuerySuggestionsBlockList_roleArn :: Lens' CreateQuerySuggestionsBlockList Text
createQuerySuggestionsBlockList_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockList' {Text
roleArn :: Text
$sel:roleArn:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
roleArn} -> Text
roleArn) (\s :: CreateQuerySuggestionsBlockList
s@CreateQuerySuggestionsBlockList' {} Text
a -> CreateQuerySuggestionsBlockList
s {$sel:roleArn:CreateQuerySuggestionsBlockList' :: Text
roleArn = Text
a} :: CreateQuerySuggestionsBlockList)

instance
  Core.AWSRequest
    CreateQuerySuggestionsBlockList
  where
  type
    AWSResponse CreateQuerySuggestionsBlockList =
      CreateQuerySuggestionsBlockListResponse
  request :: (Service -> Service)
-> CreateQuerySuggestionsBlockList
-> Request CreateQuerySuggestionsBlockList
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateQuerySuggestionsBlockList
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateQuerySuggestionsBlockList)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateQuerySuggestionsBlockListResponse
CreateQuerySuggestionsBlockListResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    CreateQuerySuggestionsBlockList
  where
  hashWithSalt :: Int -> CreateQuerySuggestionsBlockList -> Int
hashWithSalt
    Int
_salt
    CreateQuerySuggestionsBlockList' {Maybe [Tag]
Maybe Text
Text
S3Path
roleArn :: Text
sourceS3Path :: S3Path
name :: Text
indexId :: Text
tags :: Maybe [Tag]
description :: Maybe Text
clientToken :: Maybe Text
$sel:roleArn:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:sourceS3Path:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> S3Path
$sel:name:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:indexId:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:tags:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe [Tag]
$sel:description:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
$sel:clientToken:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
indexId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3Path
sourceS3Path
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance
  Prelude.NFData
    CreateQuerySuggestionsBlockList
  where
  rnf :: CreateQuerySuggestionsBlockList -> ()
rnf CreateQuerySuggestionsBlockList' {Maybe [Tag]
Maybe Text
Text
S3Path
roleArn :: Text
sourceS3Path :: S3Path
name :: Text
indexId :: Text
tags :: Maybe [Tag]
description :: Maybe Text
clientToken :: Maybe Text
$sel:roleArn:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:sourceS3Path:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> S3Path
$sel:name:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:indexId:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:tags:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe [Tag]
$sel:description:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
$sel:clientToken:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
indexId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf S3Path
sourceS3Path
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

instance
  Data.ToHeaders
    CreateQuerySuggestionsBlockList
  where
  toHeaders :: CreateQuerySuggestionsBlockList -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSKendraFrontendService.CreateQuerySuggestionsBlockList" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateQuerySuggestionsBlockList where
  toJSON :: CreateQuerySuggestionsBlockList -> Value
toJSON CreateQuerySuggestionsBlockList' {Maybe [Tag]
Maybe Text
Text
S3Path
roleArn :: Text
sourceS3Path :: S3Path
name :: Text
indexId :: Text
tags :: Maybe [Tag]
description :: Maybe Text
clientToken :: Maybe Text
$sel:roleArn:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:sourceS3Path:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> S3Path
$sel:name:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:indexId:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Text
$sel:tags:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe [Tag]
$sel:description:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
$sel:clientToken:CreateQuerySuggestionsBlockList' :: CreateQuerySuggestionsBlockList -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"IndexId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
indexId),
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"SourceS3Path" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3Path
sourceS3Path),
            forall a. a -> Maybe a
Prelude.Just (Key
"RoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
          ]
      )

instance Data.ToPath CreateQuerySuggestionsBlockList where
  toPath :: CreateQuerySuggestionsBlockList -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateQuerySuggestionsBlockList where
  toQuery :: CreateQuerySuggestionsBlockList -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateQuerySuggestionsBlockListResponse' smart constructor.
data CreateQuerySuggestionsBlockListResponse = CreateQuerySuggestionsBlockListResponse'
  { -- | The identifier of the created block list.
    CreateQuerySuggestionsBlockListResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateQuerySuggestionsBlockListResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateQuerySuggestionsBlockListResponse
-> CreateQuerySuggestionsBlockListResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQuerySuggestionsBlockListResponse
-> CreateQuerySuggestionsBlockListResponse -> Bool
$c/= :: CreateQuerySuggestionsBlockListResponse
-> CreateQuerySuggestionsBlockListResponse -> Bool
== :: CreateQuerySuggestionsBlockListResponse
-> CreateQuerySuggestionsBlockListResponse -> Bool
$c== :: CreateQuerySuggestionsBlockListResponse
-> CreateQuerySuggestionsBlockListResponse -> Bool
Prelude.Eq, ReadPrec [CreateQuerySuggestionsBlockListResponse]
ReadPrec CreateQuerySuggestionsBlockListResponse
Int -> ReadS CreateQuerySuggestionsBlockListResponse
ReadS [CreateQuerySuggestionsBlockListResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQuerySuggestionsBlockListResponse]
$creadListPrec :: ReadPrec [CreateQuerySuggestionsBlockListResponse]
readPrec :: ReadPrec CreateQuerySuggestionsBlockListResponse
$creadPrec :: ReadPrec CreateQuerySuggestionsBlockListResponse
readList :: ReadS [CreateQuerySuggestionsBlockListResponse]
$creadList :: ReadS [CreateQuerySuggestionsBlockListResponse]
readsPrec :: Int -> ReadS CreateQuerySuggestionsBlockListResponse
$creadsPrec :: Int -> ReadS CreateQuerySuggestionsBlockListResponse
Prelude.Read, Int -> CreateQuerySuggestionsBlockListResponse -> ShowS
[CreateQuerySuggestionsBlockListResponse] -> ShowS
CreateQuerySuggestionsBlockListResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQuerySuggestionsBlockListResponse] -> ShowS
$cshowList :: [CreateQuerySuggestionsBlockListResponse] -> ShowS
show :: CreateQuerySuggestionsBlockListResponse -> String
$cshow :: CreateQuerySuggestionsBlockListResponse -> String
showsPrec :: Int -> CreateQuerySuggestionsBlockListResponse -> ShowS
$cshowsPrec :: Int -> CreateQuerySuggestionsBlockListResponse -> ShowS
Prelude.Show, forall x.
Rep CreateQuerySuggestionsBlockListResponse x
-> CreateQuerySuggestionsBlockListResponse
forall x.
CreateQuerySuggestionsBlockListResponse
-> Rep CreateQuerySuggestionsBlockListResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateQuerySuggestionsBlockListResponse x
-> CreateQuerySuggestionsBlockListResponse
$cfrom :: forall x.
CreateQuerySuggestionsBlockListResponse
-> Rep CreateQuerySuggestionsBlockListResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateQuerySuggestionsBlockListResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'id', 'createQuerySuggestionsBlockListResponse_id' - The identifier of the created block list.
--
-- 'httpStatus', 'createQuerySuggestionsBlockListResponse_httpStatus' - The response's http status code.
newCreateQuerySuggestionsBlockListResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateQuerySuggestionsBlockListResponse
newCreateQuerySuggestionsBlockListResponse :: Int -> CreateQuerySuggestionsBlockListResponse
newCreateQuerySuggestionsBlockListResponse
  Int
pHttpStatus_ =
    CreateQuerySuggestionsBlockListResponse'
      { $sel:id:CreateQuerySuggestionsBlockListResponse' :: Maybe Text
id =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateQuerySuggestionsBlockListResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The identifier of the created block list.
createQuerySuggestionsBlockListResponse_id :: Lens.Lens' CreateQuerySuggestionsBlockListResponse (Prelude.Maybe Prelude.Text)
createQuerySuggestionsBlockListResponse_id :: Lens' CreateQuerySuggestionsBlockListResponse (Maybe Text)
createQuerySuggestionsBlockListResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockListResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateQuerySuggestionsBlockListResponse' :: CreateQuerySuggestionsBlockListResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateQuerySuggestionsBlockListResponse
s@CreateQuerySuggestionsBlockListResponse' {} Maybe Text
a -> CreateQuerySuggestionsBlockListResponse
s {$sel:id:CreateQuerySuggestionsBlockListResponse' :: Maybe Text
id = Maybe Text
a} :: CreateQuerySuggestionsBlockListResponse)

-- | The response's http status code.
createQuerySuggestionsBlockListResponse_httpStatus :: Lens.Lens' CreateQuerySuggestionsBlockListResponse Prelude.Int
createQuerySuggestionsBlockListResponse_httpStatus :: Lens' CreateQuerySuggestionsBlockListResponse Int
createQuerySuggestionsBlockListResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQuerySuggestionsBlockListResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateQuerySuggestionsBlockListResponse' :: CreateQuerySuggestionsBlockListResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateQuerySuggestionsBlockListResponse
s@CreateQuerySuggestionsBlockListResponse' {} Int
a -> CreateQuerySuggestionsBlockListResponse
s {$sel:httpStatus:CreateQuerySuggestionsBlockListResponse' :: Int
httpStatus = Int
a} :: CreateQuerySuggestionsBlockListResponse)

instance
  Prelude.NFData
    CreateQuerySuggestionsBlockListResponse
  where
  rnf :: CreateQuerySuggestionsBlockListResponse -> ()
rnf CreateQuerySuggestionsBlockListResponse' {Int
Maybe Text
httpStatus :: Int
id :: Maybe Text
$sel:httpStatus:CreateQuerySuggestionsBlockListResponse' :: CreateQuerySuggestionsBlockListResponse -> Int
$sel:id:CreateQuerySuggestionsBlockListResponse' :: CreateQuerySuggestionsBlockListResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus