{-# 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.KafkaConnect.Types.S3LogDeliveryDescription
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.KafkaConnect.Types.S3LogDeliveryDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The description of the details about delivering logs to Amazon S3.
--
-- /See:/ 'newS3LogDeliveryDescription' smart constructor.
data S3LogDeliveryDescription = S3LogDeliveryDescription'
  { -- | The name of the S3 bucket that is the destination for log delivery.
    S3LogDeliveryDescription -> Maybe Text
bucket :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether connector logs get sent to the specified Amazon S3
    -- destination.
    S3LogDeliveryDescription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The S3 prefix that is the destination for log delivery.
    S3LogDeliveryDescription -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (S3LogDeliveryDescription -> S3LogDeliveryDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3LogDeliveryDescription -> S3LogDeliveryDescription -> Bool
$c/= :: S3LogDeliveryDescription -> S3LogDeliveryDescription -> Bool
== :: S3LogDeliveryDescription -> S3LogDeliveryDescription -> Bool
$c== :: S3LogDeliveryDescription -> S3LogDeliveryDescription -> Bool
Prelude.Eq, ReadPrec [S3LogDeliveryDescription]
ReadPrec S3LogDeliveryDescription
Int -> ReadS S3LogDeliveryDescription
ReadS [S3LogDeliveryDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3LogDeliveryDescription]
$creadListPrec :: ReadPrec [S3LogDeliveryDescription]
readPrec :: ReadPrec S3LogDeliveryDescription
$creadPrec :: ReadPrec S3LogDeliveryDescription
readList :: ReadS [S3LogDeliveryDescription]
$creadList :: ReadS [S3LogDeliveryDescription]
readsPrec :: Int -> ReadS S3LogDeliveryDescription
$creadsPrec :: Int -> ReadS S3LogDeliveryDescription
Prelude.Read, Int -> S3LogDeliveryDescription -> ShowS
[S3LogDeliveryDescription] -> ShowS
S3LogDeliveryDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3LogDeliveryDescription] -> ShowS
$cshowList :: [S3LogDeliveryDescription] -> ShowS
show :: S3LogDeliveryDescription -> String
$cshow :: S3LogDeliveryDescription -> String
showsPrec :: Int -> S3LogDeliveryDescription -> ShowS
$cshowsPrec :: Int -> S3LogDeliveryDescription -> ShowS
Prelude.Show, forall x.
Rep S3LogDeliveryDescription x -> S3LogDeliveryDescription
forall x.
S3LogDeliveryDescription -> Rep S3LogDeliveryDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3LogDeliveryDescription x -> S3LogDeliveryDescription
$cfrom :: forall x.
S3LogDeliveryDescription -> Rep S3LogDeliveryDescription x
Prelude.Generic)

-- |
-- Create a value of 'S3LogDeliveryDescription' 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:
--
-- 'bucket', 's3LogDeliveryDescription_bucket' - The name of the S3 bucket that is the destination for log delivery.
--
-- 'enabled', 's3LogDeliveryDescription_enabled' - Specifies whether connector logs get sent to the specified Amazon S3
-- destination.
--
-- 'prefix', 's3LogDeliveryDescription_prefix' - The S3 prefix that is the destination for log delivery.
newS3LogDeliveryDescription ::
  S3LogDeliveryDescription
newS3LogDeliveryDescription :: S3LogDeliveryDescription
newS3LogDeliveryDescription =
  S3LogDeliveryDescription'
    { $sel:bucket:S3LogDeliveryDescription' :: Maybe Text
bucket = forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:S3LogDeliveryDescription' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:prefix:S3LogDeliveryDescription' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the S3 bucket that is the destination for log delivery.
s3LogDeliveryDescription_bucket :: Lens.Lens' S3LogDeliveryDescription (Prelude.Maybe Prelude.Text)
s3LogDeliveryDescription_bucket :: Lens' S3LogDeliveryDescription (Maybe Text)
s3LogDeliveryDescription_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogDeliveryDescription' {Maybe Text
bucket :: Maybe Text
$sel:bucket:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Text
bucket} -> Maybe Text
bucket) (\s :: S3LogDeliveryDescription
s@S3LogDeliveryDescription' {} Maybe Text
a -> S3LogDeliveryDescription
s {$sel:bucket:S3LogDeliveryDescription' :: Maybe Text
bucket = Maybe Text
a} :: S3LogDeliveryDescription)

-- | Specifies whether connector logs get sent to the specified Amazon S3
-- destination.
s3LogDeliveryDescription_enabled :: Lens.Lens' S3LogDeliveryDescription (Prelude.Maybe Prelude.Bool)
s3LogDeliveryDescription_enabled :: Lens' S3LogDeliveryDescription (Maybe Bool)
s3LogDeliveryDescription_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogDeliveryDescription' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: S3LogDeliveryDescription
s@S3LogDeliveryDescription' {} Maybe Bool
a -> S3LogDeliveryDescription
s {$sel:enabled:S3LogDeliveryDescription' :: Maybe Bool
enabled = Maybe Bool
a} :: S3LogDeliveryDescription)

-- | The S3 prefix that is the destination for log delivery.
s3LogDeliveryDescription_prefix :: Lens.Lens' S3LogDeliveryDescription (Prelude.Maybe Prelude.Text)
s3LogDeliveryDescription_prefix :: Lens' S3LogDeliveryDescription (Maybe Text)
s3LogDeliveryDescription_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogDeliveryDescription' {Maybe Text
prefix :: Maybe Text
$sel:prefix:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: S3LogDeliveryDescription
s@S3LogDeliveryDescription' {} Maybe Text
a -> S3LogDeliveryDescription
s {$sel:prefix:S3LogDeliveryDescription' :: Maybe Text
prefix = Maybe Text
a} :: S3LogDeliveryDescription)

instance Data.FromJSON S3LogDeliveryDescription where
  parseJSON :: Value -> Parser S3LogDeliveryDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"S3LogDeliveryDescription"
      ( \Object
x ->
          Maybe Text -> Maybe Bool -> Maybe Text -> S3LogDeliveryDescription
S3LogDeliveryDescription'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bucket")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"enabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"prefix")
      )

instance Prelude.Hashable S3LogDeliveryDescription where
  hashWithSalt :: Int -> S3LogDeliveryDescription -> Int
hashWithSalt Int
_salt S3LogDeliveryDescription' {Maybe Bool
Maybe Text
prefix :: Maybe Text
enabled :: Maybe Bool
bucket :: Maybe Text
$sel:prefix:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Text
$sel:enabled:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Bool
$sel:bucket:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefix

instance Prelude.NFData S3LogDeliveryDescription where
  rnf :: S3LogDeliveryDescription -> ()
rnf S3LogDeliveryDescription' {Maybe Bool
Maybe Text
prefix :: Maybe Text
enabled :: Maybe Bool
bucket :: Maybe Text
$sel:prefix:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Text
$sel:enabled:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Bool
$sel:bucket:S3LogDeliveryDescription' :: S3LogDeliveryDescription -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefix