{-# 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.CreateAssistant
-- 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 Amazon Connect Wisdom assistant.
module Amazonka.Wisdom.CreateAssistant
  ( -- * Creating a Request
    CreateAssistant (..),
    newCreateAssistant,

    -- * Request Lenses
    createAssistant_clientToken,
    createAssistant_description,
    createAssistant_serverSideEncryptionConfiguration,
    createAssistant_tags,
    createAssistant_name,
    createAssistant_type,

    -- * Destructuring the Response
    CreateAssistantResponse (..),
    newCreateAssistantResponse,

    -- * Response Lenses
    createAssistantResponse_assistant,
    createAssistantResponse_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:/ 'newCreateAssistant' smart constructor.
data CreateAssistant = CreateAssistant'
  { -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateAssistant -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The description of the assistant.
    CreateAssistant -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The KMS key used for encryption.
    CreateAssistant -> Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: Prelude.Maybe ServerSideEncryptionConfiguration,
    -- | The tags used to organize, track, or control access for this resource.
    CreateAssistant -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the assistant.
    CreateAssistant -> Text
name :: Prelude.Text,
    -- | The type of assistant.
    CreateAssistant -> AssistantType
type' :: AssistantType
  }
  deriving (CreateAssistant -> CreateAssistant -> Bool
(CreateAssistant -> CreateAssistant -> Bool)
-> (CreateAssistant -> CreateAssistant -> Bool)
-> Eq CreateAssistant
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssistant -> CreateAssistant -> Bool
$c/= :: CreateAssistant -> CreateAssistant -> Bool
== :: CreateAssistant -> CreateAssistant -> Bool
$c== :: CreateAssistant -> CreateAssistant -> Bool
Prelude.Eq, ReadPrec [CreateAssistant]
ReadPrec CreateAssistant
Int -> ReadS CreateAssistant
ReadS [CreateAssistant]
(Int -> ReadS CreateAssistant)
-> ReadS [CreateAssistant]
-> ReadPrec CreateAssistant
-> ReadPrec [CreateAssistant]
-> Read CreateAssistant
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssistant]
$creadListPrec :: ReadPrec [CreateAssistant]
readPrec :: ReadPrec CreateAssistant
$creadPrec :: ReadPrec CreateAssistant
readList :: ReadS [CreateAssistant]
$creadList :: ReadS [CreateAssistant]
readsPrec :: Int -> ReadS CreateAssistant
$creadsPrec :: Int -> ReadS CreateAssistant
Prelude.Read, Int -> CreateAssistant -> ShowS
[CreateAssistant] -> ShowS
CreateAssistant -> String
(Int -> CreateAssistant -> ShowS)
-> (CreateAssistant -> String)
-> ([CreateAssistant] -> ShowS)
-> Show CreateAssistant
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssistant] -> ShowS
$cshowList :: [CreateAssistant] -> ShowS
show :: CreateAssistant -> String
$cshow :: CreateAssistant -> String
showsPrec :: Int -> CreateAssistant -> ShowS
$cshowsPrec :: Int -> CreateAssistant -> ShowS
Prelude.Show, (forall x. CreateAssistant -> Rep CreateAssistant x)
-> (forall x. Rep CreateAssistant x -> CreateAssistant)
-> Generic CreateAssistant
forall x. Rep CreateAssistant x -> CreateAssistant
forall x. CreateAssistant -> Rep CreateAssistant x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAssistant x -> CreateAssistant
$cfrom :: forall x. CreateAssistant -> Rep CreateAssistant x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssistant' 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', 'createAssistant_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'description', 'createAssistant_description' - The description of the assistant.
--
-- 'serverSideEncryptionConfiguration', 'createAssistant_serverSideEncryptionConfiguration' - The KMS key used for encryption.
--
-- 'tags', 'createAssistant_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'name', 'createAssistant_name' - The name of the assistant.
--
-- 'type'', 'createAssistant_type' - The type of assistant.
newCreateAssistant ::
  -- | 'name'
  Prelude.Text ->
  -- | 'type''
  AssistantType ->
  CreateAssistant
newCreateAssistant :: Text -> AssistantType -> CreateAssistant
newCreateAssistant Text
pName_ AssistantType
pType_ =
  CreateAssistant' :: Maybe Text
-> Maybe Text
-> Maybe ServerSideEncryptionConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> AssistantType
-> CreateAssistant
CreateAssistant'
    { $sel:clientToken:CreateAssistant' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateAssistant' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryptionConfiguration:CreateAssistant' :: Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = Maybe ServerSideEncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateAssistant' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateAssistant' :: Text
name = Text
pName_,
      $sel:type':CreateAssistant' :: AssistantType
type' = AssistantType
pType_
    }

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

-- | The description of the assistant.
createAssistant_description :: Lens.Lens' CreateAssistant (Prelude.Maybe Prelude.Text)
createAssistant_description :: (Maybe Text -> f (Maybe Text))
-> CreateAssistant -> f CreateAssistant
createAssistant_description = (CreateAssistant -> Maybe Text)
-> (CreateAssistant -> Maybe Text -> CreateAssistant)
-> Lens CreateAssistant CreateAssistant (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistant' {Maybe Text
description :: Maybe Text
$sel:description:CreateAssistant' :: CreateAssistant -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateAssistant
s@CreateAssistant' {} Maybe Text
a -> CreateAssistant
s {$sel:description:CreateAssistant' :: Maybe Text
description = Maybe Text
a} :: CreateAssistant)

-- | The KMS key used for encryption.
createAssistant_serverSideEncryptionConfiguration :: Lens.Lens' CreateAssistant (Prelude.Maybe ServerSideEncryptionConfiguration)
createAssistant_serverSideEncryptionConfiguration :: (Maybe ServerSideEncryptionConfiguration
 -> f (Maybe ServerSideEncryptionConfiguration))
-> CreateAssistant -> f CreateAssistant
createAssistant_serverSideEncryptionConfiguration = (CreateAssistant -> Maybe ServerSideEncryptionConfiguration)
-> (CreateAssistant
    -> Maybe ServerSideEncryptionConfiguration -> CreateAssistant)
-> Lens
     CreateAssistant
     CreateAssistant
     (Maybe ServerSideEncryptionConfiguration)
     (Maybe ServerSideEncryptionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistant' {Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: Maybe ServerSideEncryptionConfiguration
$sel:serverSideEncryptionConfiguration:CreateAssistant' :: CreateAssistant -> Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration} -> Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration) (\s :: CreateAssistant
s@CreateAssistant' {} Maybe ServerSideEncryptionConfiguration
a -> CreateAssistant
s {$sel:serverSideEncryptionConfiguration:CreateAssistant' :: Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = Maybe ServerSideEncryptionConfiguration
a} :: CreateAssistant)

-- | The tags used to organize, track, or control access for this resource.
createAssistant_tags :: Lens.Lens' CreateAssistant (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createAssistant_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAssistant -> f CreateAssistant
createAssistant_tags = (CreateAssistant -> Maybe (HashMap Text Text))
-> (CreateAssistant
    -> Maybe (HashMap Text Text) -> CreateAssistant)
-> Lens
     CreateAssistant
     CreateAssistant
     (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 (\CreateAssistant' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateAssistant' :: CreateAssistant -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateAssistant
s@CreateAssistant' {} Maybe (HashMap Text Text)
a -> CreateAssistant
s {$sel:tags:CreateAssistant' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateAssistant) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateAssistant -> f CreateAssistant)
-> ((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)))
-> CreateAssistant
-> f CreateAssistant
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 name of the assistant.
createAssistant_name :: Lens.Lens' CreateAssistant Prelude.Text
createAssistant_name :: (Text -> f Text) -> CreateAssistant -> f CreateAssistant
createAssistant_name = (CreateAssistant -> Text)
-> (CreateAssistant -> Text -> CreateAssistant)
-> Lens CreateAssistant CreateAssistant Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistant' {Text
name :: Text
$sel:name:CreateAssistant' :: CreateAssistant -> Text
name} -> Text
name) (\s :: CreateAssistant
s@CreateAssistant' {} Text
a -> CreateAssistant
s {$sel:name:CreateAssistant' :: Text
name = Text
a} :: CreateAssistant)

-- | The type of assistant.
createAssistant_type :: Lens.Lens' CreateAssistant AssistantType
createAssistant_type :: (AssistantType -> f AssistantType)
-> CreateAssistant -> f CreateAssistant
createAssistant_type = (CreateAssistant -> AssistantType)
-> (CreateAssistant -> AssistantType -> CreateAssistant)
-> Lens CreateAssistant CreateAssistant AssistantType AssistantType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistant' {AssistantType
type' :: AssistantType
$sel:type':CreateAssistant' :: CreateAssistant -> AssistantType
type'} -> AssistantType
type') (\s :: CreateAssistant
s@CreateAssistant' {} AssistantType
a -> CreateAssistant
s {$sel:type':CreateAssistant' :: AssistantType
type' = AssistantType
a} :: CreateAssistant)

instance Core.AWSRequest CreateAssistant where
  type
    AWSResponse CreateAssistant =
      CreateAssistantResponse
  request :: CreateAssistant -> Request CreateAssistant
request = Service -> CreateAssistant -> Request CreateAssistant
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateAssistant
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAssistant)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateAssistant))
-> Logger
-> Service
-> Proxy CreateAssistant
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAssistant)))
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 AssistantData -> Int -> CreateAssistantResponse
CreateAssistantResponse'
            (Maybe AssistantData -> Int -> CreateAssistantResponse)
-> Either String (Maybe AssistantData)
-> Either String (Int -> CreateAssistantResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AssistantData)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assistant")
            Either String (Int -> CreateAssistantResponse)
-> Either String Int -> Either String CreateAssistantResponse
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 CreateAssistant

instance Prelude.NFData CreateAssistant

instance Core.ToHeaders CreateAssistant where
  toHeaders :: CreateAssistant -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAssistant -> 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 CreateAssistant where
  toJSON :: CreateAssistant -> Value
toJSON CreateAssistant' {Maybe Text
Maybe (HashMap Text Text)
Maybe ServerSideEncryptionConfiguration
Text
AssistantType
type' :: AssistantType
name :: Text
tags :: Maybe (HashMap Text Text)
serverSideEncryptionConfiguration :: Maybe ServerSideEncryptionConfiguration
description :: Maybe Text
clientToken :: Maybe Text
$sel:type':CreateAssistant' :: CreateAssistant -> AssistantType
$sel:name:CreateAssistant' :: CreateAssistant -> Text
$sel:tags:CreateAssistant' :: CreateAssistant -> Maybe (HashMap Text Text)
$sel:serverSideEncryptionConfiguration:CreateAssistant' :: CreateAssistant -> Maybe ServerSideEncryptionConfiguration
$sel:description:CreateAssistant' :: CreateAssistant -> Maybe Text
$sel:clientToken:CreateAssistant' :: CreateAssistant -> 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
"description" 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
description,
            (Text
"serverSideEncryptionConfiguration" Text -> ServerSideEncryptionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ServerSideEncryptionConfiguration -> Pair)
-> Maybe ServerSideEncryptionConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration,
            (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
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> AssistantType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AssistantType
type')
          ]
      )

instance Core.ToPath CreateAssistant where
  toPath :: CreateAssistant -> ByteString
toPath = ByteString -> CreateAssistant -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/assistants"

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

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

-- |
-- Create a value of 'CreateAssistantResponse' 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:
--
-- 'assistant', 'createAssistantResponse_assistant' - Information about the assistant.
--
-- 'httpStatus', 'createAssistantResponse_httpStatus' - The response's http status code.
newCreateAssistantResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAssistantResponse
newCreateAssistantResponse :: Int -> CreateAssistantResponse
newCreateAssistantResponse Int
pHttpStatus_ =
  CreateAssistantResponse' :: Maybe AssistantData -> Int -> CreateAssistantResponse
CreateAssistantResponse'
    { $sel:assistant:CreateAssistantResponse' :: Maybe AssistantData
assistant =
        Maybe AssistantData
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAssistantResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the assistant.
createAssistantResponse_assistant :: Lens.Lens' CreateAssistantResponse (Prelude.Maybe AssistantData)
createAssistantResponse_assistant :: (Maybe AssistantData -> f (Maybe AssistantData))
-> CreateAssistantResponse -> f CreateAssistantResponse
createAssistantResponse_assistant = (CreateAssistantResponse -> Maybe AssistantData)
-> (CreateAssistantResponse
    -> Maybe AssistantData -> CreateAssistantResponse)
-> Lens
     CreateAssistantResponse
     CreateAssistantResponse
     (Maybe AssistantData)
     (Maybe AssistantData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssistantResponse' {Maybe AssistantData
assistant :: Maybe AssistantData
$sel:assistant:CreateAssistantResponse' :: CreateAssistantResponse -> Maybe AssistantData
assistant} -> Maybe AssistantData
assistant) (\s :: CreateAssistantResponse
s@CreateAssistantResponse' {} Maybe AssistantData
a -> CreateAssistantResponse
s {$sel:assistant:CreateAssistantResponse' :: Maybe AssistantData
assistant = Maybe AssistantData
a} :: CreateAssistantResponse)

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

instance Prelude.NFData CreateAssistantResponse