{-# 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.Wisdom.CreateAssistantAssociation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an association between an Amazon Connect Wisdom assistant and
-- another resource. Currently, the only supported association is with a
-- knowledge base. An assistant can have only a single association.
module Amazonka.Wisdom.CreateAssistantAssociation
  ( -- * Creating a Request
    CreateAssistantAssociation (..),
    newCreateAssistantAssociation,

    -- * Request Lenses
    createAssistantAssociation_clientToken,
    createAssistantAssociation_tags,
    createAssistantAssociation_assistantId,
    createAssistantAssociation_association,
    createAssistantAssociation_associationType,

    -- * Destructuring the Response
    CreateAssistantAssociationResponse (..),
    newCreateAssistantAssociationResponse,

    -- * Response Lenses
    createAssistantAssociationResponse_assistantAssociation,
    createAssistantAssociationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Wisdom.Types

-- | /See:/ 'newCreateAssistantAssociation' smart constructor.
data CreateAssistantAssociation = CreateAssistantAssociation'
  { -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateAssistantAssociation -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for this resource.
    CreateAssistantAssociation -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identifier of the Wisdom assistant. Can be either the ID or the ARN.
    -- URLs cannot contain the ARN.
    CreateAssistantAssociation -> Text
assistantId :: Prelude.Text,
    -- | The identifier of the associated resource.
    CreateAssistantAssociation -> AssistantAssociationInputData
association :: AssistantAssociationInputData,
    -- | The type of association.
    CreateAssistantAssociation -> AssociationType
associationType :: AssociationType
  }
  deriving (CreateAssistantAssociation -> CreateAssistantAssociation -> Bool
(CreateAssistantAssociation -> CreateAssistantAssociation -> Bool)
-> (CreateAssistantAssociation
    -> CreateAssistantAssociation -> Bool)
-> Eq CreateAssistantAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssistantAssociation -> CreateAssistantAssociation -> Bool
$c/= :: CreateAssistantAssociation -> CreateAssistantAssociation -> Bool
== :: CreateAssistantAssociation -> CreateAssistantAssociation -> Bool
$c== :: CreateAssistantAssociation -> CreateAssistantAssociation -> Bool
Prelude.Eq, ReadPrec [CreateAssistantAssociation]
ReadPrec CreateAssistantAssociation
Int -> ReadS CreateAssistantAssociation
ReadS [CreateAssistantAssociation]
(Int -> ReadS CreateAssistantAssociation)
-> ReadS [CreateAssistantAssociation]
-> ReadPrec CreateAssistantAssociation
-> ReadPrec [CreateAssistantAssociation]
-> Read CreateAssistantAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssistantAssociation]
$creadListPrec :: ReadPrec [CreateAssistantAssociation]
readPrec :: ReadPrec CreateAssistantAssociation
$creadPrec :: ReadPrec CreateAssistantAssociation
readList :: ReadS [CreateAssistantAssociation]
$creadList :: ReadS [CreateAssistantAssociation]
readsPrec :: Int -> ReadS CreateAssistantAssociation
$creadsPrec :: Int -> ReadS CreateAssistantAssociation
Prelude.Read, Int -> CreateAssistantAssociation -> ShowS
[CreateAssistantAssociation] -> ShowS
CreateAssistantAssociation -> String
(Int -> CreateAssistantAssociation -> ShowS)
-> (CreateAssistantAssociation -> String)
-> ([CreateAssistantAssociation] -> ShowS)
-> Show CreateAssistantAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssistantAssociation] -> ShowS
$cshowList :: [CreateAssistantAssociation] -> ShowS
show :: CreateAssistantAssociation -> String
$cshow :: CreateAssistantAssociation -> String
showsPrec :: Int -> CreateAssistantAssociation -> ShowS
$cshowsPrec :: Int -> CreateAssistantAssociation -> ShowS
Prelude.Show, (forall x.
 CreateAssistantAssociation -> Rep CreateAssistantAssociation x)
-> (forall x.
    Rep CreateAssistantAssociation x -> CreateAssistantAssociation)
-> Generic CreateAssistantAssociation
forall x.
Rep CreateAssistantAssociation x -> CreateAssistantAssociation
forall x.
CreateAssistantAssociation -> Rep CreateAssistantAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAssistantAssociation x -> CreateAssistantAssociation
$cfrom :: forall x.
CreateAssistantAssociation -> Rep CreateAssistantAssociation x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssistantAssociation' 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', 'createAssistantAssociation_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'tags', 'createAssistantAssociation_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'assistantId', 'createAssistantAssociation_assistantId' - The identifier of the Wisdom assistant. Can be either the ID or the ARN.
-- URLs cannot contain the ARN.
--
-- 'association', 'createAssistantAssociation_association' - The identifier of the associated resource.
--
-- 'associationType', 'createAssistantAssociation_associationType' - The type of association.
newCreateAssistantAssociation ::
  -- | 'assistantId'
  Prelude.Text ->
  -- | 'association'
  AssistantAssociationInputData ->
  -- | 'associationType'
  AssociationType ->
  CreateAssistantAssociation
newCreateAssistantAssociation :: Text
-> AssistantAssociationInputData
-> AssociationType
-> CreateAssistantAssociation
newCreateAssistantAssociation
  Text
pAssistantId_
  AssistantAssociationInputData
pAssociation_
  AssociationType
pAssociationType_ =
    CreateAssistantAssociation' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> AssistantAssociationInputData
-> AssociationType
-> CreateAssistantAssociation
CreateAssistantAssociation'
      { $sel:clientToken:CreateAssistantAssociation' :: Maybe Text
clientToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateAssistantAssociation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:assistantId:CreateAssistantAssociation' :: Text
assistantId = Text
pAssistantId_,
        $sel:association:CreateAssistantAssociation' :: AssistantAssociationInputData
association = AssistantAssociationInputData
pAssociation_,
        $sel:associationType:CreateAssistantAssociation' :: AssociationType
associationType = AssociationType
pAssociationType_
      }

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
createAssistantAssociation_clientToken :: Lens.Lens' CreateAssistantAssociation (Prelude.Maybe Prelude.Text)
createAssistantAssociation_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateAssistantAssociation -> f CreateAssistantAssociation
createAssistantAssociation_clientToken = (CreateAssistantAssociation -> Maybe Text)
-> (CreateAssistantAssociation
    -> Maybe Text -> CreateAssistantAssociation)
-> Lens
     CreateAssistantAssociation
     CreateAssistantAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistantAssociation' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateAssistantAssociation' :: CreateAssistantAssociation -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateAssistantAssociation
s@CreateAssistantAssociation' {} Maybe Text
a -> CreateAssistantAssociation
s {$sel:clientToken:CreateAssistantAssociation' :: Maybe Text
clientToken = Maybe Text
a} :: CreateAssistantAssociation)

-- | The tags used to organize, track, or control access for this resource.
createAssistantAssociation_tags :: Lens.Lens' CreateAssistantAssociation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createAssistantAssociation_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAssistantAssociation -> f CreateAssistantAssociation
createAssistantAssociation_tags = (CreateAssistantAssociation -> Maybe (HashMap Text Text))
-> (CreateAssistantAssociation
    -> Maybe (HashMap Text Text) -> CreateAssistantAssociation)
-> Lens
     CreateAssistantAssociation
     CreateAssistantAssociation
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistantAssociation' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateAssistantAssociation' :: CreateAssistantAssociation -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateAssistantAssociation
s@CreateAssistantAssociation' {} Maybe (HashMap Text Text)
a -> CreateAssistantAssociation
s {$sel:tags:CreateAssistantAssociation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateAssistantAssociation) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateAssistantAssociation -> f CreateAssistantAssociation)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAssistantAssociation
-> f CreateAssistantAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the Wisdom assistant. Can be either the ID or the ARN.
-- URLs cannot contain the ARN.
createAssistantAssociation_assistantId :: Lens.Lens' CreateAssistantAssociation Prelude.Text
createAssistantAssociation_assistantId :: (Text -> f Text)
-> CreateAssistantAssociation -> f CreateAssistantAssociation
createAssistantAssociation_assistantId = (CreateAssistantAssociation -> Text)
-> (CreateAssistantAssociation
    -> Text -> CreateAssistantAssociation)
-> Lens
     CreateAssistantAssociation CreateAssistantAssociation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistantAssociation' {Text
assistantId :: Text
$sel:assistantId:CreateAssistantAssociation' :: CreateAssistantAssociation -> Text
assistantId} -> Text
assistantId) (\s :: CreateAssistantAssociation
s@CreateAssistantAssociation' {} Text
a -> CreateAssistantAssociation
s {$sel:assistantId:CreateAssistantAssociation' :: Text
assistantId = Text
a} :: CreateAssistantAssociation)

-- | The identifier of the associated resource.
createAssistantAssociation_association :: Lens.Lens' CreateAssistantAssociation AssistantAssociationInputData
createAssistantAssociation_association :: (AssistantAssociationInputData -> f AssistantAssociationInputData)
-> CreateAssistantAssociation -> f CreateAssistantAssociation
createAssistantAssociation_association = (CreateAssistantAssociation -> AssistantAssociationInputData)
-> (CreateAssistantAssociation
    -> AssistantAssociationInputData -> CreateAssistantAssociation)
-> Lens
     CreateAssistantAssociation
     CreateAssistantAssociation
     AssistantAssociationInputData
     AssistantAssociationInputData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistantAssociation' {AssistantAssociationInputData
association :: AssistantAssociationInputData
$sel:association:CreateAssistantAssociation' :: CreateAssistantAssociation -> AssistantAssociationInputData
association} -> AssistantAssociationInputData
association) (\s :: CreateAssistantAssociation
s@CreateAssistantAssociation' {} AssistantAssociationInputData
a -> CreateAssistantAssociation
s {$sel:association:CreateAssistantAssociation' :: AssistantAssociationInputData
association = AssistantAssociationInputData
a} :: CreateAssistantAssociation)

-- | The type of association.
createAssistantAssociation_associationType :: Lens.Lens' CreateAssistantAssociation AssociationType
createAssistantAssociation_associationType :: (AssociationType -> f AssociationType)
-> CreateAssistantAssociation -> f CreateAssistantAssociation
createAssistantAssociation_associationType = (CreateAssistantAssociation -> AssociationType)
-> (CreateAssistantAssociation
    -> AssociationType -> CreateAssistantAssociation)
-> Lens
     CreateAssistantAssociation
     CreateAssistantAssociation
     AssociationType
     AssociationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistantAssociation' {AssociationType
associationType :: AssociationType
$sel:associationType:CreateAssistantAssociation' :: CreateAssistantAssociation -> AssociationType
associationType} -> AssociationType
associationType) (\s :: CreateAssistantAssociation
s@CreateAssistantAssociation' {} AssociationType
a -> CreateAssistantAssociation
s {$sel:associationType:CreateAssistantAssociation' :: AssociationType
associationType = AssociationType
a} :: CreateAssistantAssociation)

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

instance Prelude.Hashable CreateAssistantAssociation

instance Prelude.NFData CreateAssistantAssociation

instance Core.ToHeaders CreateAssistantAssociation where
  toHeaders :: CreateAssistantAssociation -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAssistantAssociation -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateAssistantAssociation where
  toJSON :: CreateAssistantAssociation -> Value
toJSON CreateAssistantAssociation' {Maybe Text
Maybe (HashMap Text Text)
Text
AssistantAssociationInputData
AssociationType
associationType :: AssociationType
association :: AssistantAssociationInputData
assistantId :: Text
tags :: Maybe (HashMap Text Text)
clientToken :: Maybe Text
$sel:associationType:CreateAssistantAssociation' :: CreateAssistantAssociation -> AssociationType
$sel:association:CreateAssistantAssociation' :: CreateAssistantAssociation -> AssistantAssociationInputData
$sel:assistantId:CreateAssistantAssociation' :: CreateAssistantAssociation -> Text
$sel:tags:CreateAssistantAssociation' :: CreateAssistantAssociation -> Maybe (HashMap Text Text)
$sel:clientToken:CreateAssistantAssociation' :: CreateAssistantAssociation -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"association" Text -> AssistantAssociationInputData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AssistantAssociationInputData
association),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"associationType" Text -> AssociationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AssociationType
associationType)
          ]
      )

instance Core.ToPath CreateAssistantAssociation where
  toPath :: CreateAssistantAssociation -> ByteString
toPath CreateAssistantAssociation' {Maybe Text
Maybe (HashMap Text Text)
Text
AssistantAssociationInputData
AssociationType
associationType :: AssociationType
association :: AssistantAssociationInputData
assistantId :: Text
tags :: Maybe (HashMap Text Text)
clientToken :: Maybe Text
$sel:associationType:CreateAssistantAssociation' :: CreateAssistantAssociation -> AssociationType
$sel:association:CreateAssistantAssociation' :: CreateAssistantAssociation -> AssistantAssociationInputData
$sel:assistantId:CreateAssistantAssociation' :: CreateAssistantAssociation -> Text
$sel:tags:CreateAssistantAssociation' :: CreateAssistantAssociation -> Maybe (HashMap Text Text)
$sel:clientToken:CreateAssistantAssociation' :: CreateAssistantAssociation -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/assistants/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assistantId,
        ByteString
"/associations"
      ]

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

-- | /See:/ 'newCreateAssistantAssociationResponse' smart constructor.
data CreateAssistantAssociationResponse = CreateAssistantAssociationResponse'
  { -- | The assistant association.
    CreateAssistantAssociationResponse
-> Maybe AssistantAssociationData
assistantAssociation :: Prelude.Maybe AssistantAssociationData,
    -- | The response's http status code.
    CreateAssistantAssociationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateAssistantAssociationResponse
-> CreateAssistantAssociationResponse -> Bool
(CreateAssistantAssociationResponse
 -> CreateAssistantAssociationResponse -> Bool)
-> (CreateAssistantAssociationResponse
    -> CreateAssistantAssociationResponse -> Bool)
-> Eq CreateAssistantAssociationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssistantAssociationResponse
-> CreateAssistantAssociationResponse -> Bool
$c/= :: CreateAssistantAssociationResponse
-> CreateAssistantAssociationResponse -> Bool
== :: CreateAssistantAssociationResponse
-> CreateAssistantAssociationResponse -> Bool
$c== :: CreateAssistantAssociationResponse
-> CreateAssistantAssociationResponse -> Bool
Prelude.Eq, ReadPrec [CreateAssistantAssociationResponse]
ReadPrec CreateAssistantAssociationResponse
Int -> ReadS CreateAssistantAssociationResponse
ReadS [CreateAssistantAssociationResponse]
(Int -> ReadS CreateAssistantAssociationResponse)
-> ReadS [CreateAssistantAssociationResponse]
-> ReadPrec CreateAssistantAssociationResponse
-> ReadPrec [CreateAssistantAssociationResponse]
-> Read CreateAssistantAssociationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssistantAssociationResponse]
$creadListPrec :: ReadPrec [CreateAssistantAssociationResponse]
readPrec :: ReadPrec CreateAssistantAssociationResponse
$creadPrec :: ReadPrec CreateAssistantAssociationResponse
readList :: ReadS [CreateAssistantAssociationResponse]
$creadList :: ReadS [CreateAssistantAssociationResponse]
readsPrec :: Int -> ReadS CreateAssistantAssociationResponse
$creadsPrec :: Int -> ReadS CreateAssistantAssociationResponse
Prelude.Read, Int -> CreateAssistantAssociationResponse -> ShowS
[CreateAssistantAssociationResponse] -> ShowS
CreateAssistantAssociationResponse -> String
(Int -> CreateAssistantAssociationResponse -> ShowS)
-> (CreateAssistantAssociationResponse -> String)
-> ([CreateAssistantAssociationResponse] -> ShowS)
-> Show CreateAssistantAssociationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssistantAssociationResponse] -> ShowS
$cshowList :: [CreateAssistantAssociationResponse] -> ShowS
show :: CreateAssistantAssociationResponse -> String
$cshow :: CreateAssistantAssociationResponse -> String
showsPrec :: Int -> CreateAssistantAssociationResponse -> ShowS
$cshowsPrec :: Int -> CreateAssistantAssociationResponse -> ShowS
Prelude.Show, (forall x.
 CreateAssistantAssociationResponse
 -> Rep CreateAssistantAssociationResponse x)
-> (forall x.
    Rep CreateAssistantAssociationResponse x
    -> CreateAssistantAssociationResponse)
-> Generic CreateAssistantAssociationResponse
forall x.
Rep CreateAssistantAssociationResponse x
-> CreateAssistantAssociationResponse
forall x.
CreateAssistantAssociationResponse
-> Rep CreateAssistantAssociationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAssistantAssociationResponse x
-> CreateAssistantAssociationResponse
$cfrom :: forall x.
CreateAssistantAssociationResponse
-> Rep CreateAssistantAssociationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssistantAssociationResponse' 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:
--
-- 'assistantAssociation', 'createAssistantAssociationResponse_assistantAssociation' - The assistant association.
--
-- 'httpStatus', 'createAssistantAssociationResponse_httpStatus' - The response's http status code.
newCreateAssistantAssociationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAssistantAssociationResponse
newCreateAssistantAssociationResponse :: Int -> CreateAssistantAssociationResponse
newCreateAssistantAssociationResponse Int
pHttpStatus_ =
  CreateAssistantAssociationResponse' :: Maybe AssistantAssociationData
-> Int -> CreateAssistantAssociationResponse
CreateAssistantAssociationResponse'
    { $sel:assistantAssociation:CreateAssistantAssociationResponse' :: Maybe AssistantAssociationData
assistantAssociation =
        Maybe AssistantAssociationData
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAssistantAssociationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The assistant association.
createAssistantAssociationResponse_assistantAssociation :: Lens.Lens' CreateAssistantAssociationResponse (Prelude.Maybe AssistantAssociationData)
createAssistantAssociationResponse_assistantAssociation :: (Maybe AssistantAssociationData
 -> f (Maybe AssistantAssociationData))
-> CreateAssistantAssociationResponse
-> f CreateAssistantAssociationResponse
createAssistantAssociationResponse_assistantAssociation = (CreateAssistantAssociationResponse
 -> Maybe AssistantAssociationData)
-> (CreateAssistantAssociationResponse
    -> Maybe AssistantAssociationData
    -> CreateAssistantAssociationResponse)
-> Lens
     CreateAssistantAssociationResponse
     CreateAssistantAssociationResponse
     (Maybe AssistantAssociationData)
     (Maybe AssistantAssociationData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistantAssociationResponse' {Maybe AssistantAssociationData
assistantAssociation :: Maybe AssistantAssociationData
$sel:assistantAssociation:CreateAssistantAssociationResponse' :: CreateAssistantAssociationResponse
-> Maybe AssistantAssociationData
assistantAssociation} -> Maybe AssistantAssociationData
assistantAssociation) (\s :: CreateAssistantAssociationResponse
s@CreateAssistantAssociationResponse' {} Maybe AssistantAssociationData
a -> CreateAssistantAssociationResponse
s {$sel:assistantAssociation:CreateAssistantAssociationResponse' :: Maybe AssistantAssociationData
assistantAssociation = Maybe AssistantAssociationData
a} :: CreateAssistantAssociationResponse)

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

instance
  Prelude.NFData
    CreateAssistantAssociationResponse