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

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

-- |
-- Module      : Amazonka.LexModels.Types.LogSettingsResponse
-- 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)
module Amazonka.LexModels.Types.LogSettingsResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexModels.Types.Destination
import Amazonka.LexModels.Types.LogType
import qualified Amazonka.Prelude as Prelude

-- | The settings for conversation logs.
--
-- /See:/ 'newLogSettingsResponse' smart constructor.
data LogSettingsResponse = LogSettingsResponse'
  { -- | The destination where logs are delivered.
    LogSettingsResponse -> Maybe Destination
destination :: Prelude.Maybe Destination,
    -- | The Amazon Resource Name (ARN) of the key used to encrypt audio logs in
    -- an S3 bucket.
    LogSettingsResponse -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The type of logging that is enabled.
    LogSettingsResponse -> Maybe LogType
logType :: Prelude.Maybe LogType,
    -- | The Amazon Resource Name (ARN) of the CloudWatch Logs log group or S3
    -- bucket where the logs are delivered.
    LogSettingsResponse -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
    -- | The resource prefix is the first part of the S3 object key within the S3
    -- bucket that you specified to contain audio logs. For CloudWatch Logs it
    -- is the prefix of the log stream name within the log group that you
    -- specified.
    LogSettingsResponse -> Maybe Text
resourcePrefix :: Prelude.Maybe Prelude.Text
  }
  deriving (LogSettingsResponse -> LogSettingsResponse -> Bool
(LogSettingsResponse -> LogSettingsResponse -> Bool)
-> (LogSettingsResponse -> LogSettingsResponse -> Bool)
-> Eq LogSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogSettingsResponse -> LogSettingsResponse -> Bool
$c/= :: LogSettingsResponse -> LogSettingsResponse -> Bool
== :: LogSettingsResponse -> LogSettingsResponse -> Bool
$c== :: LogSettingsResponse -> LogSettingsResponse -> Bool
Prelude.Eq, ReadPrec [LogSettingsResponse]
ReadPrec LogSettingsResponse
Int -> ReadS LogSettingsResponse
ReadS [LogSettingsResponse]
(Int -> ReadS LogSettingsResponse)
-> ReadS [LogSettingsResponse]
-> ReadPrec LogSettingsResponse
-> ReadPrec [LogSettingsResponse]
-> Read LogSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogSettingsResponse]
$creadListPrec :: ReadPrec [LogSettingsResponse]
readPrec :: ReadPrec LogSettingsResponse
$creadPrec :: ReadPrec LogSettingsResponse
readList :: ReadS [LogSettingsResponse]
$creadList :: ReadS [LogSettingsResponse]
readsPrec :: Int -> ReadS LogSettingsResponse
$creadsPrec :: Int -> ReadS LogSettingsResponse
Prelude.Read, Int -> LogSettingsResponse -> ShowS
[LogSettingsResponse] -> ShowS
LogSettingsResponse -> String
(Int -> LogSettingsResponse -> ShowS)
-> (LogSettingsResponse -> String)
-> ([LogSettingsResponse] -> ShowS)
-> Show LogSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogSettingsResponse] -> ShowS
$cshowList :: [LogSettingsResponse] -> ShowS
show :: LogSettingsResponse -> String
$cshow :: LogSettingsResponse -> String
showsPrec :: Int -> LogSettingsResponse -> ShowS
$cshowsPrec :: Int -> LogSettingsResponse -> ShowS
Prelude.Show, (forall x. LogSettingsResponse -> Rep LogSettingsResponse x)
-> (forall x. Rep LogSettingsResponse x -> LogSettingsResponse)
-> Generic LogSettingsResponse
forall x. Rep LogSettingsResponse x -> LogSettingsResponse
forall x. LogSettingsResponse -> Rep LogSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogSettingsResponse x -> LogSettingsResponse
$cfrom :: forall x. LogSettingsResponse -> Rep LogSettingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'LogSettingsResponse' 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:
--
-- 'destination', 'logSettingsResponse_destination' - The destination where logs are delivered.
--
-- 'kmsKeyArn', 'logSettingsResponse_kmsKeyArn' - The Amazon Resource Name (ARN) of the key used to encrypt audio logs in
-- an S3 bucket.
--
-- 'logType', 'logSettingsResponse_logType' - The type of logging that is enabled.
--
-- 'resourceArn', 'logSettingsResponse_resourceArn' - The Amazon Resource Name (ARN) of the CloudWatch Logs log group or S3
-- bucket where the logs are delivered.
--
-- 'resourcePrefix', 'logSettingsResponse_resourcePrefix' - The resource prefix is the first part of the S3 object key within the S3
-- bucket that you specified to contain audio logs. For CloudWatch Logs it
-- is the prefix of the log stream name within the log group that you
-- specified.
newLogSettingsResponse ::
  LogSettingsResponse
newLogSettingsResponse :: LogSettingsResponse
newLogSettingsResponse =
  LogSettingsResponse' :: Maybe Destination
-> Maybe Text
-> Maybe LogType
-> Maybe Text
-> Maybe Text
-> LogSettingsResponse
LogSettingsResponse'
    { $sel:destination:LogSettingsResponse' :: Maybe Destination
destination = Maybe Destination
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:LogSettingsResponse' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:logType:LogSettingsResponse' :: Maybe LogType
logType = Maybe LogType
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:LogSettingsResponse' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourcePrefix:LogSettingsResponse' :: Maybe Text
resourcePrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The destination where logs are delivered.
logSettingsResponse_destination :: Lens.Lens' LogSettingsResponse (Prelude.Maybe Destination)
logSettingsResponse_destination :: (Maybe Destination -> f (Maybe Destination))
-> LogSettingsResponse -> f LogSettingsResponse
logSettingsResponse_destination = (LogSettingsResponse -> Maybe Destination)
-> (LogSettingsResponse
    -> Maybe Destination -> LogSettingsResponse)
-> Lens
     LogSettingsResponse
     LogSettingsResponse
     (Maybe Destination)
     (Maybe Destination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsResponse' {Maybe Destination
destination :: Maybe Destination
$sel:destination:LogSettingsResponse' :: LogSettingsResponse -> Maybe Destination
destination} -> Maybe Destination
destination) (\s :: LogSettingsResponse
s@LogSettingsResponse' {} Maybe Destination
a -> LogSettingsResponse
s {$sel:destination:LogSettingsResponse' :: Maybe Destination
destination = Maybe Destination
a} :: LogSettingsResponse)

-- | The Amazon Resource Name (ARN) of the key used to encrypt audio logs in
-- an S3 bucket.
logSettingsResponse_kmsKeyArn :: Lens.Lens' LogSettingsResponse (Prelude.Maybe Prelude.Text)
logSettingsResponse_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> LogSettingsResponse -> f LogSettingsResponse
logSettingsResponse_kmsKeyArn = (LogSettingsResponse -> Maybe Text)
-> (LogSettingsResponse -> Maybe Text -> LogSettingsResponse)
-> Lens
     LogSettingsResponse LogSettingsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsResponse' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:LogSettingsResponse' :: LogSettingsResponse -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: LogSettingsResponse
s@LogSettingsResponse' {} Maybe Text
a -> LogSettingsResponse
s {$sel:kmsKeyArn:LogSettingsResponse' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: LogSettingsResponse)

-- | The type of logging that is enabled.
logSettingsResponse_logType :: Lens.Lens' LogSettingsResponse (Prelude.Maybe LogType)
logSettingsResponse_logType :: (Maybe LogType -> f (Maybe LogType))
-> LogSettingsResponse -> f LogSettingsResponse
logSettingsResponse_logType = (LogSettingsResponse -> Maybe LogType)
-> (LogSettingsResponse -> Maybe LogType -> LogSettingsResponse)
-> Lens
     LogSettingsResponse
     LogSettingsResponse
     (Maybe LogType)
     (Maybe LogType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsResponse' {Maybe LogType
logType :: Maybe LogType
$sel:logType:LogSettingsResponse' :: LogSettingsResponse -> Maybe LogType
logType} -> Maybe LogType
logType) (\s :: LogSettingsResponse
s@LogSettingsResponse' {} Maybe LogType
a -> LogSettingsResponse
s {$sel:logType:LogSettingsResponse' :: Maybe LogType
logType = Maybe LogType
a} :: LogSettingsResponse)

-- | The Amazon Resource Name (ARN) of the CloudWatch Logs log group or S3
-- bucket where the logs are delivered.
logSettingsResponse_resourceArn :: Lens.Lens' LogSettingsResponse (Prelude.Maybe Prelude.Text)
logSettingsResponse_resourceArn :: (Maybe Text -> f (Maybe Text))
-> LogSettingsResponse -> f LogSettingsResponse
logSettingsResponse_resourceArn = (LogSettingsResponse -> Maybe Text)
-> (LogSettingsResponse -> Maybe Text -> LogSettingsResponse)
-> Lens
     LogSettingsResponse LogSettingsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsResponse' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:LogSettingsResponse' :: LogSettingsResponse -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: LogSettingsResponse
s@LogSettingsResponse' {} Maybe Text
a -> LogSettingsResponse
s {$sel:resourceArn:LogSettingsResponse' :: Maybe Text
resourceArn = Maybe Text
a} :: LogSettingsResponse)

-- | The resource prefix is the first part of the S3 object key within the S3
-- bucket that you specified to contain audio logs. For CloudWatch Logs it
-- is the prefix of the log stream name within the log group that you
-- specified.
logSettingsResponse_resourcePrefix :: Lens.Lens' LogSettingsResponse (Prelude.Maybe Prelude.Text)
logSettingsResponse_resourcePrefix :: (Maybe Text -> f (Maybe Text))
-> LogSettingsResponse -> f LogSettingsResponse
logSettingsResponse_resourcePrefix = (LogSettingsResponse -> Maybe Text)
-> (LogSettingsResponse -> Maybe Text -> LogSettingsResponse)
-> Lens
     LogSettingsResponse LogSettingsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsResponse' {Maybe Text
resourcePrefix :: Maybe Text
$sel:resourcePrefix:LogSettingsResponse' :: LogSettingsResponse -> Maybe Text
resourcePrefix} -> Maybe Text
resourcePrefix) (\s :: LogSettingsResponse
s@LogSettingsResponse' {} Maybe Text
a -> LogSettingsResponse
s {$sel:resourcePrefix:LogSettingsResponse' :: Maybe Text
resourcePrefix = Maybe Text
a} :: LogSettingsResponse)

instance Core.FromJSON LogSettingsResponse where
  parseJSON :: Value -> Parser LogSettingsResponse
parseJSON =
    String
-> (Object -> Parser LogSettingsResponse)
-> Value
-> Parser LogSettingsResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LogSettingsResponse"
      ( \Object
x ->
          Maybe Destination
-> Maybe Text
-> Maybe LogType
-> Maybe Text
-> Maybe Text
-> LogSettingsResponse
LogSettingsResponse'
            (Maybe Destination
 -> Maybe Text
 -> Maybe LogType
 -> Maybe Text
 -> Maybe Text
 -> LogSettingsResponse)
-> Parser (Maybe Destination)
-> Parser
     (Maybe Text
      -> Maybe LogType
      -> Maybe Text
      -> Maybe Text
      -> LogSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Destination)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destination")
            Parser
  (Maybe Text
   -> Maybe LogType
   -> Maybe Text
   -> Maybe Text
   -> LogSettingsResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe LogType -> Maybe Text -> Maybe Text -> LogSettingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"kmsKeyArn")
            Parser
  (Maybe LogType -> Maybe Text -> Maybe Text -> LogSettingsResponse)
-> Parser (Maybe LogType)
-> Parser (Maybe Text -> Maybe Text -> LogSettingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LogType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"logType")
            Parser (Maybe Text -> Maybe Text -> LogSettingsResponse)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> LogSettingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceArn")
            Parser (Maybe Text -> LogSettingsResponse)
-> Parser (Maybe Text) -> Parser LogSettingsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourcePrefix")
      )

instance Prelude.Hashable LogSettingsResponse

instance Prelude.NFData LogSettingsResponse