{-# 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.Chime.StartMeetingTranscription
-- 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)
--
-- Starts transcription for the specified @meetingId@.
module Amazonka.Chime.StartMeetingTranscription
  ( -- * Creating a Request
    StartMeetingTranscription (..),
    newStartMeetingTranscription,

    -- * Request Lenses
    startMeetingTranscription_meetingId,
    startMeetingTranscription_transcriptionConfiguration,

    -- * Destructuring the Response
    StartMeetingTranscriptionResponse (..),
    newStartMeetingTranscriptionResponse,

    -- * Response Lenses
    startMeetingTranscriptionResponse_httpStatus,
  )
where

import Amazonka.Chime.Types
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

-- | /See:/ 'newStartMeetingTranscription' smart constructor.
data StartMeetingTranscription = StartMeetingTranscription'
  { -- | The unique ID of the meeting being transcribed.
    StartMeetingTranscription -> Text
meetingId :: Prelude.Text,
    -- | The configuration for the current transcription operation. Must contain
    -- @EngineTranscribeSettings@ or @EngineTranscribeMedicalSettings@.
    StartMeetingTranscription -> TranscriptionConfiguration
transcriptionConfiguration :: TranscriptionConfiguration
  }
  deriving (StartMeetingTranscription -> StartMeetingTranscription -> Bool
(StartMeetingTranscription -> StartMeetingTranscription -> Bool)
-> (StartMeetingTranscription -> StartMeetingTranscription -> Bool)
-> Eq StartMeetingTranscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartMeetingTranscription -> StartMeetingTranscription -> Bool
$c/= :: StartMeetingTranscription -> StartMeetingTranscription -> Bool
== :: StartMeetingTranscription -> StartMeetingTranscription -> Bool
$c== :: StartMeetingTranscription -> StartMeetingTranscription -> Bool
Prelude.Eq, ReadPrec [StartMeetingTranscription]
ReadPrec StartMeetingTranscription
Int -> ReadS StartMeetingTranscription
ReadS [StartMeetingTranscription]
(Int -> ReadS StartMeetingTranscription)
-> ReadS [StartMeetingTranscription]
-> ReadPrec StartMeetingTranscription
-> ReadPrec [StartMeetingTranscription]
-> Read StartMeetingTranscription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartMeetingTranscription]
$creadListPrec :: ReadPrec [StartMeetingTranscription]
readPrec :: ReadPrec StartMeetingTranscription
$creadPrec :: ReadPrec StartMeetingTranscription
readList :: ReadS [StartMeetingTranscription]
$creadList :: ReadS [StartMeetingTranscription]
readsPrec :: Int -> ReadS StartMeetingTranscription
$creadsPrec :: Int -> ReadS StartMeetingTranscription
Prelude.Read, Int -> StartMeetingTranscription -> ShowS
[StartMeetingTranscription] -> ShowS
StartMeetingTranscription -> String
(Int -> StartMeetingTranscription -> ShowS)
-> (StartMeetingTranscription -> String)
-> ([StartMeetingTranscription] -> ShowS)
-> Show StartMeetingTranscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartMeetingTranscription] -> ShowS
$cshowList :: [StartMeetingTranscription] -> ShowS
show :: StartMeetingTranscription -> String
$cshow :: StartMeetingTranscription -> String
showsPrec :: Int -> StartMeetingTranscription -> ShowS
$cshowsPrec :: Int -> StartMeetingTranscription -> ShowS
Prelude.Show, (forall x.
 StartMeetingTranscription -> Rep StartMeetingTranscription x)
-> (forall x.
    Rep StartMeetingTranscription x -> StartMeetingTranscription)
-> Generic StartMeetingTranscription
forall x.
Rep StartMeetingTranscription x -> StartMeetingTranscription
forall x.
StartMeetingTranscription -> Rep StartMeetingTranscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartMeetingTranscription x -> StartMeetingTranscription
$cfrom :: forall x.
StartMeetingTranscription -> Rep StartMeetingTranscription x
Prelude.Generic)

-- |
-- Create a value of 'StartMeetingTranscription' 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:
--
-- 'meetingId', 'startMeetingTranscription_meetingId' - The unique ID of the meeting being transcribed.
--
-- 'transcriptionConfiguration', 'startMeetingTranscription_transcriptionConfiguration' - The configuration for the current transcription operation. Must contain
-- @EngineTranscribeSettings@ or @EngineTranscribeMedicalSettings@.
newStartMeetingTranscription ::
  -- | 'meetingId'
  Prelude.Text ->
  -- | 'transcriptionConfiguration'
  TranscriptionConfiguration ->
  StartMeetingTranscription
newStartMeetingTranscription :: Text -> TranscriptionConfiguration -> StartMeetingTranscription
newStartMeetingTranscription
  Text
pMeetingId_
  TranscriptionConfiguration
pTranscriptionConfiguration_ =
    StartMeetingTranscription' :: Text -> TranscriptionConfiguration -> StartMeetingTranscription
StartMeetingTranscription'
      { $sel:meetingId:StartMeetingTranscription' :: Text
meetingId = Text
pMeetingId_,
        $sel:transcriptionConfiguration:StartMeetingTranscription' :: TranscriptionConfiguration
transcriptionConfiguration =
          TranscriptionConfiguration
pTranscriptionConfiguration_
      }

-- | The unique ID of the meeting being transcribed.
startMeetingTranscription_meetingId :: Lens.Lens' StartMeetingTranscription Prelude.Text
startMeetingTranscription_meetingId :: (Text -> f Text)
-> StartMeetingTranscription -> f StartMeetingTranscription
startMeetingTranscription_meetingId = (StartMeetingTranscription -> Text)
-> (StartMeetingTranscription -> Text -> StartMeetingTranscription)
-> Lens
     StartMeetingTranscription StartMeetingTranscription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMeetingTranscription' {Text
meetingId :: Text
$sel:meetingId:StartMeetingTranscription' :: StartMeetingTranscription -> Text
meetingId} -> Text
meetingId) (\s :: StartMeetingTranscription
s@StartMeetingTranscription' {} Text
a -> StartMeetingTranscription
s {$sel:meetingId:StartMeetingTranscription' :: Text
meetingId = Text
a} :: StartMeetingTranscription)

-- | The configuration for the current transcription operation. Must contain
-- @EngineTranscribeSettings@ or @EngineTranscribeMedicalSettings@.
startMeetingTranscription_transcriptionConfiguration :: Lens.Lens' StartMeetingTranscription TranscriptionConfiguration
startMeetingTranscription_transcriptionConfiguration :: (TranscriptionConfiguration -> f TranscriptionConfiguration)
-> StartMeetingTranscription -> f StartMeetingTranscription
startMeetingTranscription_transcriptionConfiguration = (StartMeetingTranscription -> TranscriptionConfiguration)
-> (StartMeetingTranscription
    -> TranscriptionConfiguration -> StartMeetingTranscription)
-> Lens
     StartMeetingTranscription
     StartMeetingTranscription
     TranscriptionConfiguration
     TranscriptionConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMeetingTranscription' {TranscriptionConfiguration
transcriptionConfiguration :: TranscriptionConfiguration
$sel:transcriptionConfiguration:StartMeetingTranscription' :: StartMeetingTranscription -> TranscriptionConfiguration
transcriptionConfiguration} -> TranscriptionConfiguration
transcriptionConfiguration) (\s :: StartMeetingTranscription
s@StartMeetingTranscription' {} TranscriptionConfiguration
a -> StartMeetingTranscription
s {$sel:transcriptionConfiguration:StartMeetingTranscription' :: TranscriptionConfiguration
transcriptionConfiguration = TranscriptionConfiguration
a} :: StartMeetingTranscription)

instance Core.AWSRequest StartMeetingTranscription where
  type
    AWSResponse StartMeetingTranscription =
      StartMeetingTranscriptionResponse
  request :: StartMeetingTranscription -> Request StartMeetingTranscription
request = Service
-> StartMeetingTranscription -> Request StartMeetingTranscription
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartMeetingTranscription
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartMeetingTranscription)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse StartMeetingTranscription))
-> Logger
-> Service
-> Proxy StartMeetingTranscription
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartMeetingTranscription)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> StartMeetingTranscriptionResponse
StartMeetingTranscriptionResponse'
            (Int -> StartMeetingTranscriptionResponse)
-> Either String Int
-> Either String StartMeetingTranscriptionResponse
forall (f :: * -> *) a b. Functor 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 StartMeetingTranscription

instance Prelude.NFData StartMeetingTranscription

instance Core.ToHeaders StartMeetingTranscription where
  toHeaders :: StartMeetingTranscription -> ResponseHeaders
toHeaders = ResponseHeaders -> StartMeetingTranscription -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON StartMeetingTranscription where
  toJSON :: StartMeetingTranscription -> Value
toJSON StartMeetingTranscription' {Text
TranscriptionConfiguration
transcriptionConfiguration :: TranscriptionConfiguration
meetingId :: Text
$sel:transcriptionConfiguration:StartMeetingTranscription' :: StartMeetingTranscription -> TranscriptionConfiguration
$sel:meetingId:StartMeetingTranscription' :: StartMeetingTranscription -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"TranscriptionConfiguration"
                  Text -> TranscriptionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TranscriptionConfiguration
transcriptionConfiguration
              )
          ]
      )

instance Core.ToPath StartMeetingTranscription where
  toPath :: StartMeetingTranscription -> ByteString
toPath StartMeetingTranscription' {Text
TranscriptionConfiguration
transcriptionConfiguration :: TranscriptionConfiguration
meetingId :: Text
$sel:transcriptionConfiguration:StartMeetingTranscription' :: StartMeetingTranscription -> TranscriptionConfiguration
$sel:meetingId:StartMeetingTranscription' :: StartMeetingTranscription -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/meetings/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
meetingId, ByteString
"/transcription"]

instance Core.ToQuery StartMeetingTranscription where
  toQuery :: StartMeetingTranscription -> QueryString
toQuery =
    QueryString -> StartMeetingTranscription -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"operation=start"])

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

-- |
-- Create a value of 'StartMeetingTranscriptionResponse' 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:
--
-- 'httpStatus', 'startMeetingTranscriptionResponse_httpStatus' - The response's http status code.
newStartMeetingTranscriptionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartMeetingTranscriptionResponse
newStartMeetingTranscriptionResponse :: Int -> StartMeetingTranscriptionResponse
newStartMeetingTranscriptionResponse Int
pHttpStatus_ =
  StartMeetingTranscriptionResponse' :: Int -> StartMeetingTranscriptionResponse
StartMeetingTranscriptionResponse'
    { $sel:httpStatus:StartMeetingTranscriptionResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    StartMeetingTranscriptionResponse