{-# 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.FlowLog
-- 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.FlowLog 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.DestinationOptionsResponse
import Amazonka.EC2.Types.LogDestinationType
import Amazonka.EC2.Types.Tag
import Amazonka.EC2.Types.TrafficType
import qualified Amazonka.Prelude as Prelude

-- | Describes a flow log.
--
-- /See:/ 'newFlowLog' smart constructor.
data FlowLog = FlowLog'
  { -- | The date and time the flow log was created.
    FlowLog -> Maybe ISO8601
creationTime :: Prelude.Maybe Data.ISO8601,
    -- | The ARN of the IAM role that allows the service to publish flow logs
    -- across accounts.
    FlowLog -> Maybe Text
deliverCrossAccountRole :: Prelude.Maybe Prelude.Text,
    -- | Information about the error that occurred. @Rate limited@ indicates that
    -- CloudWatch Logs throttling has been applied for one or more network
    -- interfaces, or that you\'ve reached the limit on the number of log
    -- groups that you can create. @Access error@ indicates that the IAM role
    -- associated with the flow log does not have sufficient permissions to
    -- publish to CloudWatch Logs. @Unknown error@ indicates an internal error.
    FlowLog -> Maybe Text
deliverLogsErrorMessage :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the IAM role allows the service to publish logs to CloudWatch
    -- Logs.
    FlowLog -> Maybe Text
deliverLogsPermissionArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the logs delivery (@SUCCESS@ | @FAILED@).
    FlowLog -> Maybe Text
deliverLogsStatus :: Prelude.Maybe Prelude.Text,
    -- | The destination options.
    FlowLog -> Maybe DestinationOptionsResponse
destinationOptions :: Prelude.Maybe DestinationOptionsResponse,
    -- | The ID of the flow log.
    FlowLog -> Maybe Text
flowLogId :: Prelude.Maybe Prelude.Text,
    -- | The status of the flow log (@ACTIVE@).
    FlowLog -> Maybe Text
flowLogStatus :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the destination for the flow log data.
    FlowLog -> Maybe Text
logDestination :: Prelude.Maybe Prelude.Text,
    -- | The type of destination for the flow log data.
    FlowLog -> Maybe LogDestinationType
logDestinationType :: Prelude.Maybe LogDestinationType,
    -- | The format of the flow log record.
    FlowLog -> Maybe Text
logFormat :: Prelude.Maybe Prelude.Text,
    -- | The name of the flow log group.
    FlowLog -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text,
    -- | The maximum interval of time, in seconds, during which a flow of packets
    -- is captured and aggregated into a flow log record.
    --
    -- When a network interface is attached to a
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances Nitro-based instance>,
    -- the aggregation interval is always 60 seconds (1 minute) or less,
    -- regardless of the specified value.
    --
    -- Valid Values: @60@ | @600@
    FlowLog -> Maybe Int
maxAggregationInterval :: Prelude.Maybe Prelude.Int,
    -- | The ID of the resource being monitored.
    FlowLog -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The tags for the flow log.
    FlowLog -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The type of traffic captured for the flow log.
    FlowLog -> Maybe TrafficType
trafficType :: Prelude.Maybe TrafficType
  }
  deriving (FlowLog -> FlowLog -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FlowLog -> FlowLog -> Bool
$c/= :: FlowLog -> FlowLog -> Bool
== :: FlowLog -> FlowLog -> Bool
$c== :: FlowLog -> FlowLog -> Bool
Prelude.Eq, ReadPrec [FlowLog]
ReadPrec FlowLog
Int -> ReadS FlowLog
ReadS [FlowLog]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FlowLog]
$creadListPrec :: ReadPrec [FlowLog]
readPrec :: ReadPrec FlowLog
$creadPrec :: ReadPrec FlowLog
readList :: ReadS [FlowLog]
$creadList :: ReadS [FlowLog]
readsPrec :: Int -> ReadS FlowLog
$creadsPrec :: Int -> ReadS FlowLog
Prelude.Read, Int -> FlowLog -> ShowS
[FlowLog] -> ShowS
FlowLog -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FlowLog] -> ShowS
$cshowList :: [FlowLog] -> ShowS
show :: FlowLog -> String
$cshow :: FlowLog -> String
showsPrec :: Int -> FlowLog -> ShowS
$cshowsPrec :: Int -> FlowLog -> ShowS
Prelude.Show, forall x. Rep FlowLog x -> FlowLog
forall x. FlowLog -> Rep FlowLog x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FlowLog x -> FlowLog
$cfrom :: forall x. FlowLog -> Rep FlowLog x
Prelude.Generic)

-- |
-- Create a value of 'FlowLog' 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:
--
-- 'creationTime', 'flowLog_creationTime' - The date and time the flow log was created.
--
-- 'deliverCrossAccountRole', 'flowLog_deliverCrossAccountRole' - The ARN of the IAM role that allows the service to publish flow logs
-- across accounts.
--
-- 'deliverLogsErrorMessage', 'flowLog_deliverLogsErrorMessage' - Information about the error that occurred. @Rate limited@ indicates that
-- CloudWatch Logs throttling has been applied for one or more network
-- interfaces, or that you\'ve reached the limit on the number of log
-- groups that you can create. @Access error@ indicates that the IAM role
-- associated with the flow log does not have sufficient permissions to
-- publish to CloudWatch Logs. @Unknown error@ indicates an internal error.
--
-- 'deliverLogsPermissionArn', 'flowLog_deliverLogsPermissionArn' - The ARN of the IAM role allows the service to publish logs to CloudWatch
-- Logs.
--
-- 'deliverLogsStatus', 'flowLog_deliverLogsStatus' - The status of the logs delivery (@SUCCESS@ | @FAILED@).
--
-- 'destinationOptions', 'flowLog_destinationOptions' - The destination options.
--
-- 'flowLogId', 'flowLog_flowLogId' - The ID of the flow log.
--
-- 'flowLogStatus', 'flowLog_flowLogStatus' - The status of the flow log (@ACTIVE@).
--
-- 'logDestination', 'flowLog_logDestination' - The Amazon Resource Name (ARN) of the destination for the flow log data.
--
-- 'logDestinationType', 'flowLog_logDestinationType' - The type of destination for the flow log data.
--
-- 'logFormat', 'flowLog_logFormat' - The format of the flow log record.
--
-- 'logGroupName', 'flowLog_logGroupName' - The name of the flow log group.
--
-- 'maxAggregationInterval', 'flowLog_maxAggregationInterval' - The maximum interval of time, in seconds, during which a flow of packets
-- is captured and aggregated into a flow log record.
--
-- When a network interface is attached to a
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances Nitro-based instance>,
-- the aggregation interval is always 60 seconds (1 minute) or less,
-- regardless of the specified value.
--
-- Valid Values: @60@ | @600@
--
-- 'resourceId', 'flowLog_resourceId' - The ID of the resource being monitored.
--
-- 'tags', 'flowLog_tags' - The tags for the flow log.
--
-- 'trafficType', 'flowLog_trafficType' - The type of traffic captured for the flow log.
newFlowLog ::
  FlowLog
newFlowLog :: FlowLog
newFlowLog =
  FlowLog'
    { $sel:creationTime:FlowLog' :: Maybe ISO8601
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:deliverCrossAccountRole:FlowLog' :: Maybe Text
deliverCrossAccountRole = forall a. Maybe a
Prelude.Nothing,
      $sel:deliverLogsErrorMessage:FlowLog' :: Maybe Text
deliverLogsErrorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:deliverLogsPermissionArn:FlowLog' :: Maybe Text
deliverLogsPermissionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:deliverLogsStatus:FlowLog' :: Maybe Text
deliverLogsStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationOptions:FlowLog' :: Maybe DestinationOptionsResponse
destinationOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:flowLogId:FlowLog' :: Maybe Text
flowLogId = forall a. Maybe a
Prelude.Nothing,
      $sel:flowLogStatus:FlowLog' :: Maybe Text
flowLogStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:logDestination:FlowLog' :: Maybe Text
logDestination = forall a. Maybe a
Prelude.Nothing,
      $sel:logDestinationType:FlowLog' :: Maybe LogDestinationType
logDestinationType = forall a. Maybe a
Prelude.Nothing,
      $sel:logFormat:FlowLog' :: Maybe Text
logFormat = forall a. Maybe a
Prelude.Nothing,
      $sel:logGroupName:FlowLog' :: Maybe Text
logGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:maxAggregationInterval:FlowLog' :: Maybe Int
maxAggregationInterval = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:FlowLog' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:FlowLog' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:trafficType:FlowLog' :: Maybe TrafficType
trafficType = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time the flow log was created.
flowLog_creationTime :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.UTCTime)
flowLog_creationTime :: Lens' FlowLog (Maybe UTCTime)
flowLog_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe ISO8601
creationTime :: Maybe ISO8601
$sel:creationTime:FlowLog' :: FlowLog -> Maybe ISO8601
creationTime} -> Maybe ISO8601
creationTime) (\s :: FlowLog
s@FlowLog' {} Maybe ISO8601
a -> FlowLog
s {$sel:creationTime:FlowLog' :: Maybe ISO8601
creationTime = Maybe ISO8601
a} :: FlowLog) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ARN of the IAM role that allows the service to publish flow logs
-- across accounts.
flowLog_deliverCrossAccountRole :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_deliverCrossAccountRole :: Lens' FlowLog (Maybe Text)
flowLog_deliverCrossAccountRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
deliverCrossAccountRole :: Maybe Text
$sel:deliverCrossAccountRole:FlowLog' :: FlowLog -> Maybe Text
deliverCrossAccountRole} -> Maybe Text
deliverCrossAccountRole) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:deliverCrossAccountRole:FlowLog' :: Maybe Text
deliverCrossAccountRole = Maybe Text
a} :: FlowLog)

-- | Information about the error that occurred. @Rate limited@ indicates that
-- CloudWatch Logs throttling has been applied for one or more network
-- interfaces, or that you\'ve reached the limit on the number of log
-- groups that you can create. @Access error@ indicates that the IAM role
-- associated with the flow log does not have sufficient permissions to
-- publish to CloudWatch Logs. @Unknown error@ indicates an internal error.
flowLog_deliverLogsErrorMessage :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_deliverLogsErrorMessage :: Lens' FlowLog (Maybe Text)
flowLog_deliverLogsErrorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
deliverLogsErrorMessage :: Maybe Text
$sel:deliverLogsErrorMessage:FlowLog' :: FlowLog -> Maybe Text
deliverLogsErrorMessage} -> Maybe Text
deliverLogsErrorMessage) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:deliverLogsErrorMessage:FlowLog' :: Maybe Text
deliverLogsErrorMessage = Maybe Text
a} :: FlowLog)

-- | The ARN of the IAM role allows the service to publish logs to CloudWatch
-- Logs.
flowLog_deliverLogsPermissionArn :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_deliverLogsPermissionArn :: Lens' FlowLog (Maybe Text)
flowLog_deliverLogsPermissionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
deliverLogsPermissionArn :: Maybe Text
$sel:deliverLogsPermissionArn:FlowLog' :: FlowLog -> Maybe Text
deliverLogsPermissionArn} -> Maybe Text
deliverLogsPermissionArn) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:deliverLogsPermissionArn:FlowLog' :: Maybe Text
deliverLogsPermissionArn = Maybe Text
a} :: FlowLog)

-- | The status of the logs delivery (@SUCCESS@ | @FAILED@).
flowLog_deliverLogsStatus :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_deliverLogsStatus :: Lens' FlowLog (Maybe Text)
flowLog_deliverLogsStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
deliverLogsStatus :: Maybe Text
$sel:deliverLogsStatus:FlowLog' :: FlowLog -> Maybe Text
deliverLogsStatus} -> Maybe Text
deliverLogsStatus) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:deliverLogsStatus:FlowLog' :: Maybe Text
deliverLogsStatus = Maybe Text
a} :: FlowLog)

-- | The destination options.
flowLog_destinationOptions :: Lens.Lens' FlowLog (Prelude.Maybe DestinationOptionsResponse)
flowLog_destinationOptions :: Lens' FlowLog (Maybe DestinationOptionsResponse)
flowLog_destinationOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe DestinationOptionsResponse
destinationOptions :: Maybe DestinationOptionsResponse
$sel:destinationOptions:FlowLog' :: FlowLog -> Maybe DestinationOptionsResponse
destinationOptions} -> Maybe DestinationOptionsResponse
destinationOptions) (\s :: FlowLog
s@FlowLog' {} Maybe DestinationOptionsResponse
a -> FlowLog
s {$sel:destinationOptions:FlowLog' :: Maybe DestinationOptionsResponse
destinationOptions = Maybe DestinationOptionsResponse
a} :: FlowLog)

-- | The ID of the flow log.
flowLog_flowLogId :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_flowLogId :: Lens' FlowLog (Maybe Text)
flowLog_flowLogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
flowLogId :: Maybe Text
$sel:flowLogId:FlowLog' :: FlowLog -> Maybe Text
flowLogId} -> Maybe Text
flowLogId) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:flowLogId:FlowLog' :: Maybe Text
flowLogId = Maybe Text
a} :: FlowLog)

-- | The status of the flow log (@ACTIVE@).
flowLog_flowLogStatus :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_flowLogStatus :: Lens' FlowLog (Maybe Text)
flowLog_flowLogStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
flowLogStatus :: Maybe Text
$sel:flowLogStatus:FlowLog' :: FlowLog -> Maybe Text
flowLogStatus} -> Maybe Text
flowLogStatus) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:flowLogStatus:FlowLog' :: Maybe Text
flowLogStatus = Maybe Text
a} :: FlowLog)

-- | The Amazon Resource Name (ARN) of the destination for the flow log data.
flowLog_logDestination :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_logDestination :: Lens' FlowLog (Maybe Text)
flowLog_logDestination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
logDestination :: Maybe Text
$sel:logDestination:FlowLog' :: FlowLog -> Maybe Text
logDestination} -> Maybe Text
logDestination) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:logDestination:FlowLog' :: Maybe Text
logDestination = Maybe Text
a} :: FlowLog)

-- | The type of destination for the flow log data.
flowLog_logDestinationType :: Lens.Lens' FlowLog (Prelude.Maybe LogDestinationType)
flowLog_logDestinationType :: Lens' FlowLog (Maybe LogDestinationType)
flowLog_logDestinationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe LogDestinationType
logDestinationType :: Maybe LogDestinationType
$sel:logDestinationType:FlowLog' :: FlowLog -> Maybe LogDestinationType
logDestinationType} -> Maybe LogDestinationType
logDestinationType) (\s :: FlowLog
s@FlowLog' {} Maybe LogDestinationType
a -> FlowLog
s {$sel:logDestinationType:FlowLog' :: Maybe LogDestinationType
logDestinationType = Maybe LogDestinationType
a} :: FlowLog)

-- | The format of the flow log record.
flowLog_logFormat :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_logFormat :: Lens' FlowLog (Maybe Text)
flowLog_logFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
logFormat :: Maybe Text
$sel:logFormat:FlowLog' :: FlowLog -> Maybe Text
logFormat} -> Maybe Text
logFormat) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:logFormat:FlowLog' :: Maybe Text
logFormat = Maybe Text
a} :: FlowLog)

-- | The name of the flow log group.
flowLog_logGroupName :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_logGroupName :: Lens' FlowLog (Maybe Text)
flowLog_logGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
logGroupName :: Maybe Text
$sel:logGroupName:FlowLog' :: FlowLog -> Maybe Text
logGroupName} -> Maybe Text
logGroupName) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:logGroupName:FlowLog' :: Maybe Text
logGroupName = Maybe Text
a} :: FlowLog)

-- | The maximum interval of time, in seconds, during which a flow of packets
-- is captured and aggregated into a flow log record.
--
-- When a network interface is attached to a
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances Nitro-based instance>,
-- the aggregation interval is always 60 seconds (1 minute) or less,
-- regardless of the specified value.
--
-- Valid Values: @60@ | @600@
flowLog_maxAggregationInterval :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Int)
flowLog_maxAggregationInterval :: Lens' FlowLog (Maybe Int)
flowLog_maxAggregationInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Int
maxAggregationInterval :: Maybe Int
$sel:maxAggregationInterval:FlowLog' :: FlowLog -> Maybe Int
maxAggregationInterval} -> Maybe Int
maxAggregationInterval) (\s :: FlowLog
s@FlowLog' {} Maybe Int
a -> FlowLog
s {$sel:maxAggregationInterval:FlowLog' :: Maybe Int
maxAggregationInterval = Maybe Int
a} :: FlowLog)

-- | The ID of the resource being monitored.
flowLog_resourceId :: Lens.Lens' FlowLog (Prelude.Maybe Prelude.Text)
flowLog_resourceId :: Lens' FlowLog (Maybe Text)
flowLog_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:FlowLog' :: FlowLog -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: FlowLog
s@FlowLog' {} Maybe Text
a -> FlowLog
s {$sel:resourceId:FlowLog' :: Maybe Text
resourceId = Maybe Text
a} :: FlowLog)

-- | The tags for the flow log.
flowLog_tags :: Lens.Lens' FlowLog (Prelude.Maybe [Tag])
flowLog_tags :: Lens' FlowLog (Maybe [Tag])
flowLog_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:FlowLog' :: FlowLog -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: FlowLog
s@FlowLog' {} Maybe [Tag]
a -> FlowLog
s {$sel:tags:FlowLog' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: FlowLog) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of traffic captured for the flow log.
flowLog_trafficType :: Lens.Lens' FlowLog (Prelude.Maybe TrafficType)
flowLog_trafficType :: Lens' FlowLog (Maybe TrafficType)
flowLog_trafficType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowLog' {Maybe TrafficType
trafficType :: Maybe TrafficType
$sel:trafficType:FlowLog' :: FlowLog -> Maybe TrafficType
trafficType} -> Maybe TrafficType
trafficType) (\s :: FlowLog
s@FlowLog' {} Maybe TrafficType
a -> FlowLog
s {$sel:trafficType:FlowLog' :: Maybe TrafficType
trafficType = Maybe TrafficType
a} :: FlowLog)

instance Data.FromXML FlowLog where
  parseXML :: [Node] -> Either String FlowLog
parseXML [Node]
x =
    Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DestinationOptionsResponse
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LogDestinationType
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Tag]
-> Maybe TrafficType
-> FlowLog
FlowLog'
      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
"creationTime")
      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
"deliverCrossAccountRole")
      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
"deliverLogsErrorMessage")
      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
"deliverLogsPermissionArn")
      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
"deliverLogsStatus")
      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
"destinationOptions")
      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
"flowLogId")
      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
"flowLogStatus")
      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
"logDestination")
      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
"logDestinationType")
      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
"logFormat")
      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
"logGroupName")
      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
"maxAggregationInterval")
      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
"resourceId")
      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
"tagSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      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
"trafficType")

instance Prelude.Hashable FlowLog where
  hashWithSalt :: Int -> FlowLog -> Int
hashWithSalt Int
_salt FlowLog' {Maybe Int
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe DestinationOptionsResponse
Maybe LogDestinationType
Maybe TrafficType
trafficType :: Maybe TrafficType
tags :: Maybe [Tag]
resourceId :: Maybe Text
maxAggregationInterval :: Maybe Int
logGroupName :: Maybe Text
logFormat :: Maybe Text
logDestinationType :: Maybe LogDestinationType
logDestination :: Maybe Text
flowLogStatus :: Maybe Text
flowLogId :: Maybe Text
destinationOptions :: Maybe DestinationOptionsResponse
deliverLogsStatus :: Maybe Text
deliverLogsPermissionArn :: Maybe Text
deliverLogsErrorMessage :: Maybe Text
deliverCrossAccountRole :: Maybe Text
creationTime :: Maybe ISO8601
$sel:trafficType:FlowLog' :: FlowLog -> Maybe TrafficType
$sel:tags:FlowLog' :: FlowLog -> Maybe [Tag]
$sel:resourceId:FlowLog' :: FlowLog -> Maybe Text
$sel:maxAggregationInterval:FlowLog' :: FlowLog -> Maybe Int
$sel:logGroupName:FlowLog' :: FlowLog -> Maybe Text
$sel:logFormat:FlowLog' :: FlowLog -> Maybe Text
$sel:logDestinationType:FlowLog' :: FlowLog -> Maybe LogDestinationType
$sel:logDestination:FlowLog' :: FlowLog -> Maybe Text
$sel:flowLogStatus:FlowLog' :: FlowLog -> Maybe Text
$sel:flowLogId:FlowLog' :: FlowLog -> Maybe Text
$sel:destinationOptions:FlowLog' :: FlowLog -> Maybe DestinationOptionsResponse
$sel:deliverLogsStatus:FlowLog' :: FlowLog -> Maybe Text
$sel:deliverLogsPermissionArn:FlowLog' :: FlowLog -> Maybe Text
$sel:deliverLogsErrorMessage:FlowLog' :: FlowLog -> Maybe Text
$sel:deliverCrossAccountRole:FlowLog' :: FlowLog -> Maybe Text
$sel:creationTime:FlowLog' :: FlowLog -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deliverCrossAccountRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deliverLogsErrorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deliverLogsPermissionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deliverLogsStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DestinationOptionsResponse
destinationOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
flowLogId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
flowLogStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logDestination
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LogDestinationType
logDestinationType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logFormat
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxAggregationInterval
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TrafficType
trafficType

instance Prelude.NFData FlowLog where
  rnf :: FlowLog -> ()
rnf FlowLog' {Maybe Int
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe DestinationOptionsResponse
Maybe LogDestinationType
Maybe TrafficType
trafficType :: Maybe TrafficType
tags :: Maybe [Tag]
resourceId :: Maybe Text
maxAggregationInterval :: Maybe Int
logGroupName :: Maybe Text
logFormat :: Maybe Text
logDestinationType :: Maybe LogDestinationType
logDestination :: Maybe Text
flowLogStatus :: Maybe Text
flowLogId :: Maybe Text
destinationOptions :: Maybe DestinationOptionsResponse
deliverLogsStatus :: Maybe Text
deliverLogsPermissionArn :: Maybe Text
deliverLogsErrorMessage :: Maybe Text
deliverCrossAccountRole :: Maybe Text
creationTime :: Maybe ISO8601
$sel:trafficType:FlowLog' :: FlowLog -> Maybe TrafficType
$sel:tags:FlowLog' :: FlowLog -> Maybe [Tag]
$sel:resourceId:FlowLog' :: FlowLog -> Maybe Text
$sel:maxAggregationInterval:FlowLog' :: FlowLog -> Maybe Int
$sel:logGroupName:FlowLog' :: FlowLog -> Maybe Text
$sel:logFormat:FlowLog' :: FlowLog -> Maybe Text
$sel:logDestinationType:FlowLog' :: FlowLog -> Maybe LogDestinationType
$sel:logDestination:FlowLog' :: FlowLog -> Maybe Text
$sel:flowLogStatus:FlowLog' :: FlowLog -> Maybe Text
$sel:flowLogId:FlowLog' :: FlowLog -> Maybe Text
$sel:destinationOptions:FlowLog' :: FlowLog -> Maybe DestinationOptionsResponse
$sel:deliverLogsStatus:FlowLog' :: FlowLog -> Maybe Text
$sel:deliverLogsPermissionArn:FlowLog' :: FlowLog -> Maybe Text
$sel:deliverLogsErrorMessage:FlowLog' :: FlowLog -> Maybe Text
$sel:deliverCrossAccountRole:FlowLog' :: FlowLog -> Maybe Text
$sel:creationTime:FlowLog' :: FlowLog -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deliverCrossAccountRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deliverLogsErrorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deliverLogsPermissionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deliverLogsStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DestinationOptionsResponse
destinationOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
flowLogId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
flowLogStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logDestination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LogDestinationType
logDestinationType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logFormat
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxAggregationInterval
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TrafficType
trafficType