{-# 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.EC2.Types.DestinationOptionsResponse
-- 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.EC2.Types.DestinationOptionsResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.DestinationFileFormat
import qualified Amazonka.Prelude as Prelude

-- | Describes the destination options for a flow log.
--
-- /See:/ 'newDestinationOptionsResponse' smart constructor.
data DestinationOptionsResponse = DestinationOptionsResponse'
  { -- | The format for the flow log.
    DestinationOptionsResponse -> Maybe DestinationFileFormat
fileFormat :: Prelude.Maybe DestinationFileFormat,
    -- | Indicates whether to use Hive-compatible prefixes for flow logs stored
    -- in Amazon S3.
    DestinationOptionsResponse -> Maybe Bool
hiveCompatiblePartitions :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether to partition the flow log per hour.
    DestinationOptionsResponse -> Maybe Bool
perHourPartition :: Prelude.Maybe Prelude.Bool
  }
  deriving (DestinationOptionsResponse -> DestinationOptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DestinationOptionsResponse -> DestinationOptionsResponse -> Bool
$c/= :: DestinationOptionsResponse -> DestinationOptionsResponse -> Bool
== :: DestinationOptionsResponse -> DestinationOptionsResponse -> Bool
$c== :: DestinationOptionsResponse -> DestinationOptionsResponse -> Bool
Prelude.Eq, ReadPrec [DestinationOptionsResponse]
ReadPrec DestinationOptionsResponse
Int -> ReadS DestinationOptionsResponse
ReadS [DestinationOptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DestinationOptionsResponse]
$creadListPrec :: ReadPrec [DestinationOptionsResponse]
readPrec :: ReadPrec DestinationOptionsResponse
$creadPrec :: ReadPrec DestinationOptionsResponse
readList :: ReadS [DestinationOptionsResponse]
$creadList :: ReadS [DestinationOptionsResponse]
readsPrec :: Int -> ReadS DestinationOptionsResponse
$creadsPrec :: Int -> ReadS DestinationOptionsResponse
Prelude.Read, Int -> DestinationOptionsResponse -> ShowS
[DestinationOptionsResponse] -> ShowS
DestinationOptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DestinationOptionsResponse] -> ShowS
$cshowList :: [DestinationOptionsResponse] -> ShowS
show :: DestinationOptionsResponse -> String
$cshow :: DestinationOptionsResponse -> String
showsPrec :: Int -> DestinationOptionsResponse -> ShowS
$cshowsPrec :: Int -> DestinationOptionsResponse -> ShowS
Prelude.Show, forall x.
Rep DestinationOptionsResponse x -> DestinationOptionsResponse
forall x.
DestinationOptionsResponse -> Rep DestinationOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DestinationOptionsResponse x -> DestinationOptionsResponse
$cfrom :: forall x.
DestinationOptionsResponse -> Rep DestinationOptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DestinationOptionsResponse' 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:
--
-- 'fileFormat', 'destinationOptionsResponse_fileFormat' - The format for the flow log.
--
-- 'hiveCompatiblePartitions', 'destinationOptionsResponse_hiveCompatiblePartitions' - Indicates whether to use Hive-compatible prefixes for flow logs stored
-- in Amazon S3.
--
-- 'perHourPartition', 'destinationOptionsResponse_perHourPartition' - Indicates whether to partition the flow log per hour.
newDestinationOptionsResponse ::
  DestinationOptionsResponse
newDestinationOptionsResponse :: DestinationOptionsResponse
newDestinationOptionsResponse =
  DestinationOptionsResponse'
    { $sel:fileFormat:DestinationOptionsResponse' :: Maybe DestinationFileFormat
fileFormat =
        forall a. Maybe a
Prelude.Nothing,
      $sel:hiveCompatiblePartitions:DestinationOptionsResponse' :: Maybe Bool
hiveCompatiblePartitions = forall a. Maybe a
Prelude.Nothing,
      $sel:perHourPartition:DestinationOptionsResponse' :: Maybe Bool
perHourPartition = forall a. Maybe a
Prelude.Nothing
    }

-- | The format for the flow log.
destinationOptionsResponse_fileFormat :: Lens.Lens' DestinationOptionsResponse (Prelude.Maybe DestinationFileFormat)
destinationOptionsResponse_fileFormat :: Lens' DestinationOptionsResponse (Maybe DestinationFileFormat)
destinationOptionsResponse_fileFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationOptionsResponse' {Maybe DestinationFileFormat
fileFormat :: Maybe DestinationFileFormat
$sel:fileFormat:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe DestinationFileFormat
fileFormat} -> Maybe DestinationFileFormat
fileFormat) (\s :: DestinationOptionsResponse
s@DestinationOptionsResponse' {} Maybe DestinationFileFormat
a -> DestinationOptionsResponse
s {$sel:fileFormat:DestinationOptionsResponse' :: Maybe DestinationFileFormat
fileFormat = Maybe DestinationFileFormat
a} :: DestinationOptionsResponse)

-- | Indicates whether to use Hive-compatible prefixes for flow logs stored
-- in Amazon S3.
destinationOptionsResponse_hiveCompatiblePartitions :: Lens.Lens' DestinationOptionsResponse (Prelude.Maybe Prelude.Bool)
destinationOptionsResponse_hiveCompatiblePartitions :: Lens' DestinationOptionsResponse (Maybe Bool)
destinationOptionsResponse_hiveCompatiblePartitions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationOptionsResponse' {Maybe Bool
hiveCompatiblePartitions :: Maybe Bool
$sel:hiveCompatiblePartitions:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe Bool
hiveCompatiblePartitions} -> Maybe Bool
hiveCompatiblePartitions) (\s :: DestinationOptionsResponse
s@DestinationOptionsResponse' {} Maybe Bool
a -> DestinationOptionsResponse
s {$sel:hiveCompatiblePartitions:DestinationOptionsResponse' :: Maybe Bool
hiveCompatiblePartitions = Maybe Bool
a} :: DestinationOptionsResponse)

-- | Indicates whether to partition the flow log per hour.
destinationOptionsResponse_perHourPartition :: Lens.Lens' DestinationOptionsResponse (Prelude.Maybe Prelude.Bool)
destinationOptionsResponse_perHourPartition :: Lens' DestinationOptionsResponse (Maybe Bool)
destinationOptionsResponse_perHourPartition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationOptionsResponse' {Maybe Bool
perHourPartition :: Maybe Bool
$sel:perHourPartition:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe Bool
perHourPartition} -> Maybe Bool
perHourPartition) (\s :: DestinationOptionsResponse
s@DestinationOptionsResponse' {} Maybe Bool
a -> DestinationOptionsResponse
s {$sel:perHourPartition:DestinationOptionsResponse' :: Maybe Bool
perHourPartition = Maybe Bool
a} :: DestinationOptionsResponse)

instance Data.FromXML DestinationOptionsResponse where
  parseXML :: [Node] -> Either String DestinationOptionsResponse
parseXML [Node]
x =
    Maybe DestinationFileFormat
-> Maybe Bool -> Maybe Bool -> DestinationOptionsResponse
DestinationOptionsResponse'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"fileFormat")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"hiveCompatiblePartitions")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"perHourPartition")

instance Prelude.Hashable DestinationOptionsResponse where
  hashWithSalt :: Int -> DestinationOptionsResponse -> Int
hashWithSalt Int
_salt DestinationOptionsResponse' {Maybe Bool
Maybe DestinationFileFormat
perHourPartition :: Maybe Bool
hiveCompatiblePartitions :: Maybe Bool
fileFormat :: Maybe DestinationFileFormat
$sel:perHourPartition:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe Bool
$sel:hiveCompatiblePartitions:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe Bool
$sel:fileFormat:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe DestinationFileFormat
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DestinationFileFormat
fileFormat
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
hiveCompatiblePartitions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
perHourPartition

instance Prelude.NFData DestinationOptionsResponse where
  rnf :: DestinationOptionsResponse -> ()
rnf DestinationOptionsResponse' {Maybe Bool
Maybe DestinationFileFormat
perHourPartition :: Maybe Bool
hiveCompatiblePartitions :: Maybe Bool
fileFormat :: Maybe DestinationFileFormat
$sel:perHourPartition:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe Bool
$sel:hiveCompatiblePartitions:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe Bool
$sel:fileFormat:DestinationOptionsResponse' :: DestinationOptionsResponse -> Maybe DestinationFileFormat
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DestinationFileFormat
fileFormat
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
hiveCompatiblePartitions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
perHourPartition