{-# 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.OpsWorks.Types.CloudWatchLogsLogStream
-- 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.OpsWorks.Types.CloudWatchLogsLogStream where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpsWorks.Types.CloudWatchLogsEncoding
import Amazonka.OpsWorks.Types.CloudWatchLogsInitialPosition
import Amazonka.OpsWorks.Types.CloudWatchLogsTimeZone
import qualified Amazonka.Prelude as Prelude

-- | Describes the Amazon CloudWatch logs configuration for a layer. For
-- detailed information about members of this data type, see the
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html CloudWatch Logs Agent Reference>.
--
-- /See:/ 'newCloudWatchLogsLogStream' smart constructor.
data CloudWatchLogsLogStream = CloudWatchLogsLogStream'
  { -- | Specifies the max number of log events in a batch, up to 10000. The
    -- default value is 1000.
    CloudWatchLogsLogStream -> Maybe Int
batchCount :: Prelude.Maybe Prelude.Int,
    -- | Specifies the maximum size of log events in a batch, in bytes, up to
    -- 1048576 bytes. The default value is 32768 bytes. This size is calculated
    -- as the sum of all event messages in UTF-8, plus 26 bytes for each log
    -- event.
    CloudWatchLogsLogStream -> Maybe Int
batchSize :: Prelude.Maybe Prelude.Int,
    -- | Specifies the time duration for the batching of log events. The minimum
    -- value is 5000ms and default value is 5000ms.
    CloudWatchLogsLogStream -> Maybe Int
bufferDuration :: Prelude.Maybe Prelude.Int,
    -- | Specifies how the time stamp is extracted from logs. For more
    -- information, see the
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html CloudWatch Logs Agent Reference>.
    CloudWatchLogsLogStream -> Maybe Text
datetimeFormat :: Prelude.Maybe Prelude.Text,
    -- | Specifies the encoding of the log file so that the file can be read
    -- correctly. The default is @utf_8@. Encodings supported by Python
    -- @codecs.decode()@ can be used here.
    CloudWatchLogsLogStream -> Maybe CloudWatchLogsEncoding
encoding :: Prelude.Maybe CloudWatchLogsEncoding,
    -- | Specifies log files that you want to push to CloudWatch Logs.
    --
    -- @File@ can point to a specific file or multiple files (by using wild
    -- card characters such as @\/var\/log\/system.log*@). Only the latest file
    -- is pushed to CloudWatch Logs, based on file modification time. We
    -- recommend that you use wild card characters to specify a series of files
    -- of the same type, such as @access_log.2014-06-01-01@,
    -- @access_log.2014-06-01-02@, and so on by using a pattern like
    -- @access_log.*@. Don\'t use a wildcard to match multiple file types, such
    -- as @access_log_80@ and @access_log_443@. To specify multiple, different
    -- file types, add another log stream entry to the configuration file, so
    -- that each log file type is stored in a different log group.
    --
    -- Zipped files are not supported.
    CloudWatchLogsLogStream -> Maybe Text
file :: Prelude.Maybe Prelude.Text,
    -- | Specifies the range of lines for identifying a file. The valid values
    -- are one number, or two dash-delimited numbers, such as \'1\', \'2-5\'.
    -- The default value is \'1\', meaning the first line is used to calculate
    -- the fingerprint. Fingerprint lines are not sent to CloudWatch Logs
    -- unless all specified lines are available.
    CloudWatchLogsLogStream -> Maybe Text
fileFingerprintLines :: Prelude.Maybe Prelude.Text,
    -- | Specifies where to start to read data (start_of_file or end_of_file).
    -- The default is start_of_file. This setting is only used if there is no
    -- state persisted for that log stream.
    CloudWatchLogsLogStream -> Maybe CloudWatchLogsInitialPosition
initialPosition :: Prelude.Maybe CloudWatchLogsInitialPosition,
    -- | Specifies the destination log group. A log group is created
    -- automatically if it doesn\'t already exist. Log group names can be
    -- between 1 and 512 characters long. Allowed characters include a-z, A-Z,
    -- 0-9, \'_\' (underscore), \'-\' (hyphen), \'\/\' (forward slash), and
    -- \'.\' (period).
    CloudWatchLogsLogStream -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the pattern for identifying the start of a log message.
    CloudWatchLogsLogStream -> Maybe Text
multiLineStartPattern :: Prelude.Maybe Prelude.Text,
    -- | Specifies the time zone of log event time stamps.
    CloudWatchLogsLogStream -> Maybe CloudWatchLogsTimeZone
timeZone :: Prelude.Maybe CloudWatchLogsTimeZone
  }
  deriving (CloudWatchLogsLogStream -> CloudWatchLogsLogStream -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchLogsLogStream -> CloudWatchLogsLogStream -> Bool
$c/= :: CloudWatchLogsLogStream -> CloudWatchLogsLogStream -> Bool
== :: CloudWatchLogsLogStream -> CloudWatchLogsLogStream -> Bool
$c== :: CloudWatchLogsLogStream -> CloudWatchLogsLogStream -> Bool
Prelude.Eq, ReadPrec [CloudWatchLogsLogStream]
ReadPrec CloudWatchLogsLogStream
Int -> ReadS CloudWatchLogsLogStream
ReadS [CloudWatchLogsLogStream]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchLogsLogStream]
$creadListPrec :: ReadPrec [CloudWatchLogsLogStream]
readPrec :: ReadPrec CloudWatchLogsLogStream
$creadPrec :: ReadPrec CloudWatchLogsLogStream
readList :: ReadS [CloudWatchLogsLogStream]
$creadList :: ReadS [CloudWatchLogsLogStream]
readsPrec :: Int -> ReadS CloudWatchLogsLogStream
$creadsPrec :: Int -> ReadS CloudWatchLogsLogStream
Prelude.Read, Int -> CloudWatchLogsLogStream -> ShowS
[CloudWatchLogsLogStream] -> ShowS
CloudWatchLogsLogStream -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchLogsLogStream] -> ShowS
$cshowList :: [CloudWatchLogsLogStream] -> ShowS
show :: CloudWatchLogsLogStream -> String
$cshow :: CloudWatchLogsLogStream -> String
showsPrec :: Int -> CloudWatchLogsLogStream -> ShowS
$cshowsPrec :: Int -> CloudWatchLogsLogStream -> ShowS
Prelude.Show, forall x. Rep CloudWatchLogsLogStream x -> CloudWatchLogsLogStream
forall x. CloudWatchLogsLogStream -> Rep CloudWatchLogsLogStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloudWatchLogsLogStream x -> CloudWatchLogsLogStream
$cfrom :: forall x. CloudWatchLogsLogStream -> Rep CloudWatchLogsLogStream x
Prelude.Generic)

-- |
-- Create a value of 'CloudWatchLogsLogStream' 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:
--
-- 'batchCount', 'cloudWatchLogsLogStream_batchCount' - Specifies the max number of log events in a batch, up to 10000. The
-- default value is 1000.
--
-- 'batchSize', 'cloudWatchLogsLogStream_batchSize' - Specifies the maximum size of log events in a batch, in bytes, up to
-- 1048576 bytes. The default value is 32768 bytes. This size is calculated
-- as the sum of all event messages in UTF-8, plus 26 bytes for each log
-- event.
--
-- 'bufferDuration', 'cloudWatchLogsLogStream_bufferDuration' - Specifies the time duration for the batching of log events. The minimum
-- value is 5000ms and default value is 5000ms.
--
-- 'datetimeFormat', 'cloudWatchLogsLogStream_datetimeFormat' - Specifies how the time stamp is extracted from logs. For more
-- information, see the
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html CloudWatch Logs Agent Reference>.
--
-- 'encoding', 'cloudWatchLogsLogStream_encoding' - Specifies the encoding of the log file so that the file can be read
-- correctly. The default is @utf_8@. Encodings supported by Python
-- @codecs.decode()@ can be used here.
--
-- 'file', 'cloudWatchLogsLogStream_file' - Specifies log files that you want to push to CloudWatch Logs.
--
-- @File@ can point to a specific file or multiple files (by using wild
-- card characters such as @\/var\/log\/system.log*@). Only the latest file
-- is pushed to CloudWatch Logs, based on file modification time. We
-- recommend that you use wild card characters to specify a series of files
-- of the same type, such as @access_log.2014-06-01-01@,
-- @access_log.2014-06-01-02@, and so on by using a pattern like
-- @access_log.*@. Don\'t use a wildcard to match multiple file types, such
-- as @access_log_80@ and @access_log_443@. To specify multiple, different
-- file types, add another log stream entry to the configuration file, so
-- that each log file type is stored in a different log group.
--
-- Zipped files are not supported.
--
-- 'fileFingerprintLines', 'cloudWatchLogsLogStream_fileFingerprintLines' - Specifies the range of lines for identifying a file. The valid values
-- are one number, or two dash-delimited numbers, such as \'1\', \'2-5\'.
-- The default value is \'1\', meaning the first line is used to calculate
-- the fingerprint. Fingerprint lines are not sent to CloudWatch Logs
-- unless all specified lines are available.
--
-- 'initialPosition', 'cloudWatchLogsLogStream_initialPosition' - Specifies where to start to read data (start_of_file or end_of_file).
-- The default is start_of_file. This setting is only used if there is no
-- state persisted for that log stream.
--
-- 'logGroupName', 'cloudWatchLogsLogStream_logGroupName' - Specifies the destination log group. A log group is created
-- automatically if it doesn\'t already exist. Log group names can be
-- between 1 and 512 characters long. Allowed characters include a-z, A-Z,
-- 0-9, \'_\' (underscore), \'-\' (hyphen), \'\/\' (forward slash), and
-- \'.\' (period).
--
-- 'multiLineStartPattern', 'cloudWatchLogsLogStream_multiLineStartPattern' - Specifies the pattern for identifying the start of a log message.
--
-- 'timeZone', 'cloudWatchLogsLogStream_timeZone' - Specifies the time zone of log event time stamps.
newCloudWatchLogsLogStream ::
  CloudWatchLogsLogStream
newCloudWatchLogsLogStream :: CloudWatchLogsLogStream
newCloudWatchLogsLogStream =
  CloudWatchLogsLogStream'
    { $sel:batchCount:CloudWatchLogsLogStream' :: Maybe Int
batchCount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:batchSize:CloudWatchLogsLogStream' :: Maybe Int
batchSize = forall a. Maybe a
Prelude.Nothing,
      $sel:bufferDuration:CloudWatchLogsLogStream' :: Maybe Int
bufferDuration = forall a. Maybe a
Prelude.Nothing,
      $sel:datetimeFormat:CloudWatchLogsLogStream' :: Maybe Text
datetimeFormat = forall a. Maybe a
Prelude.Nothing,
      $sel:encoding:CloudWatchLogsLogStream' :: Maybe CloudWatchLogsEncoding
encoding = forall a. Maybe a
Prelude.Nothing,
      $sel:file:CloudWatchLogsLogStream' :: Maybe Text
file = forall a. Maybe a
Prelude.Nothing,
      $sel:fileFingerprintLines:CloudWatchLogsLogStream' :: Maybe Text
fileFingerprintLines = forall a. Maybe a
Prelude.Nothing,
      $sel:initialPosition:CloudWatchLogsLogStream' :: Maybe CloudWatchLogsInitialPosition
initialPosition = forall a. Maybe a
Prelude.Nothing,
      $sel:logGroupName:CloudWatchLogsLogStream' :: Maybe Text
logGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:multiLineStartPattern:CloudWatchLogsLogStream' :: Maybe Text
multiLineStartPattern = forall a. Maybe a
Prelude.Nothing,
      $sel:timeZone:CloudWatchLogsLogStream' :: Maybe CloudWatchLogsTimeZone
timeZone = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the max number of log events in a batch, up to 10000. The
-- default value is 1000.
cloudWatchLogsLogStream_batchCount :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Int)
cloudWatchLogsLogStream_batchCount :: Lens' CloudWatchLogsLogStream (Maybe Int)
cloudWatchLogsLogStream_batchCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Int
batchCount :: Maybe Int
$sel:batchCount:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
batchCount} -> Maybe Int
batchCount) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Int
a -> CloudWatchLogsLogStream
s {$sel:batchCount:CloudWatchLogsLogStream' :: Maybe Int
batchCount = Maybe Int
a} :: CloudWatchLogsLogStream)

-- | Specifies the maximum size of log events in a batch, in bytes, up to
-- 1048576 bytes. The default value is 32768 bytes. This size is calculated
-- as the sum of all event messages in UTF-8, plus 26 bytes for each log
-- event.
cloudWatchLogsLogStream_batchSize :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Int)
cloudWatchLogsLogStream_batchSize :: Lens' CloudWatchLogsLogStream (Maybe Int)
cloudWatchLogsLogStream_batchSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Int
batchSize :: Maybe Int
$sel:batchSize:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
batchSize} -> Maybe Int
batchSize) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Int
a -> CloudWatchLogsLogStream
s {$sel:batchSize:CloudWatchLogsLogStream' :: Maybe Int
batchSize = Maybe Int
a} :: CloudWatchLogsLogStream)

-- | Specifies the time duration for the batching of log events. The minimum
-- value is 5000ms and default value is 5000ms.
cloudWatchLogsLogStream_bufferDuration :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Int)
cloudWatchLogsLogStream_bufferDuration :: Lens' CloudWatchLogsLogStream (Maybe Int)
cloudWatchLogsLogStream_bufferDuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Int
bufferDuration :: Maybe Int
$sel:bufferDuration:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
bufferDuration} -> Maybe Int
bufferDuration) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Int
a -> CloudWatchLogsLogStream
s {$sel:bufferDuration:CloudWatchLogsLogStream' :: Maybe Int
bufferDuration = Maybe Int
a} :: CloudWatchLogsLogStream)

-- | Specifies how the time stamp is extracted from logs. For more
-- information, see the
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html CloudWatch Logs Agent Reference>.
cloudWatchLogsLogStream_datetimeFormat :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Text)
cloudWatchLogsLogStream_datetimeFormat :: Lens' CloudWatchLogsLogStream (Maybe Text)
cloudWatchLogsLogStream_datetimeFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Text
datetimeFormat :: Maybe Text
$sel:datetimeFormat:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
datetimeFormat} -> Maybe Text
datetimeFormat) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Text
a -> CloudWatchLogsLogStream
s {$sel:datetimeFormat:CloudWatchLogsLogStream' :: Maybe Text
datetimeFormat = Maybe Text
a} :: CloudWatchLogsLogStream)

-- | Specifies the encoding of the log file so that the file can be read
-- correctly. The default is @utf_8@. Encodings supported by Python
-- @codecs.decode()@ can be used here.
cloudWatchLogsLogStream_encoding :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe CloudWatchLogsEncoding)
cloudWatchLogsLogStream_encoding :: Lens' CloudWatchLogsLogStream (Maybe CloudWatchLogsEncoding)
cloudWatchLogsLogStream_encoding = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe CloudWatchLogsEncoding
encoding :: Maybe CloudWatchLogsEncoding
$sel:encoding:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsEncoding
encoding} -> Maybe CloudWatchLogsEncoding
encoding) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe CloudWatchLogsEncoding
a -> CloudWatchLogsLogStream
s {$sel:encoding:CloudWatchLogsLogStream' :: Maybe CloudWatchLogsEncoding
encoding = Maybe CloudWatchLogsEncoding
a} :: CloudWatchLogsLogStream)

-- | Specifies log files that you want to push to CloudWatch Logs.
--
-- @File@ can point to a specific file or multiple files (by using wild
-- card characters such as @\/var\/log\/system.log*@). Only the latest file
-- is pushed to CloudWatch Logs, based on file modification time. We
-- recommend that you use wild card characters to specify a series of files
-- of the same type, such as @access_log.2014-06-01-01@,
-- @access_log.2014-06-01-02@, and so on by using a pattern like
-- @access_log.*@. Don\'t use a wildcard to match multiple file types, such
-- as @access_log_80@ and @access_log_443@. To specify multiple, different
-- file types, add another log stream entry to the configuration file, so
-- that each log file type is stored in a different log group.
--
-- Zipped files are not supported.
cloudWatchLogsLogStream_file :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Text)
cloudWatchLogsLogStream_file :: Lens' CloudWatchLogsLogStream (Maybe Text)
cloudWatchLogsLogStream_file = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Text
file :: Maybe Text
$sel:file:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
file} -> Maybe Text
file) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Text
a -> CloudWatchLogsLogStream
s {$sel:file:CloudWatchLogsLogStream' :: Maybe Text
file = Maybe Text
a} :: CloudWatchLogsLogStream)

-- | Specifies the range of lines for identifying a file. The valid values
-- are one number, or two dash-delimited numbers, such as \'1\', \'2-5\'.
-- The default value is \'1\', meaning the first line is used to calculate
-- the fingerprint. Fingerprint lines are not sent to CloudWatch Logs
-- unless all specified lines are available.
cloudWatchLogsLogStream_fileFingerprintLines :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Text)
cloudWatchLogsLogStream_fileFingerprintLines :: Lens' CloudWatchLogsLogStream (Maybe Text)
cloudWatchLogsLogStream_fileFingerprintLines = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Text
fileFingerprintLines :: Maybe Text
$sel:fileFingerprintLines:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
fileFingerprintLines} -> Maybe Text
fileFingerprintLines) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Text
a -> CloudWatchLogsLogStream
s {$sel:fileFingerprintLines:CloudWatchLogsLogStream' :: Maybe Text
fileFingerprintLines = Maybe Text
a} :: CloudWatchLogsLogStream)

-- | Specifies where to start to read data (start_of_file or end_of_file).
-- The default is start_of_file. This setting is only used if there is no
-- state persisted for that log stream.
cloudWatchLogsLogStream_initialPosition :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe CloudWatchLogsInitialPosition)
cloudWatchLogsLogStream_initialPosition :: Lens' CloudWatchLogsLogStream (Maybe CloudWatchLogsInitialPosition)
cloudWatchLogsLogStream_initialPosition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe CloudWatchLogsInitialPosition
initialPosition :: Maybe CloudWatchLogsInitialPosition
$sel:initialPosition:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsInitialPosition
initialPosition} -> Maybe CloudWatchLogsInitialPosition
initialPosition) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe CloudWatchLogsInitialPosition
a -> CloudWatchLogsLogStream
s {$sel:initialPosition:CloudWatchLogsLogStream' :: Maybe CloudWatchLogsInitialPosition
initialPosition = Maybe CloudWatchLogsInitialPosition
a} :: CloudWatchLogsLogStream)

-- | Specifies the destination log group. A log group is created
-- automatically if it doesn\'t already exist. Log group names can be
-- between 1 and 512 characters long. Allowed characters include a-z, A-Z,
-- 0-9, \'_\' (underscore), \'-\' (hyphen), \'\/\' (forward slash), and
-- \'.\' (period).
cloudWatchLogsLogStream_logGroupName :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Text)
cloudWatchLogsLogStream_logGroupName :: Lens' CloudWatchLogsLogStream (Maybe Text)
cloudWatchLogsLogStream_logGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Text
logGroupName :: Maybe Text
$sel:logGroupName:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
logGroupName} -> Maybe Text
logGroupName) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Text
a -> CloudWatchLogsLogStream
s {$sel:logGroupName:CloudWatchLogsLogStream' :: Maybe Text
logGroupName = Maybe Text
a} :: CloudWatchLogsLogStream)

-- | Specifies the pattern for identifying the start of a log message.
cloudWatchLogsLogStream_multiLineStartPattern :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe Prelude.Text)
cloudWatchLogsLogStream_multiLineStartPattern :: Lens' CloudWatchLogsLogStream (Maybe Text)
cloudWatchLogsLogStream_multiLineStartPattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe Text
multiLineStartPattern :: Maybe Text
$sel:multiLineStartPattern:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
multiLineStartPattern} -> Maybe Text
multiLineStartPattern) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe Text
a -> CloudWatchLogsLogStream
s {$sel:multiLineStartPattern:CloudWatchLogsLogStream' :: Maybe Text
multiLineStartPattern = Maybe Text
a} :: CloudWatchLogsLogStream)

-- | Specifies the time zone of log event time stamps.
cloudWatchLogsLogStream_timeZone :: Lens.Lens' CloudWatchLogsLogStream (Prelude.Maybe CloudWatchLogsTimeZone)
cloudWatchLogsLogStream_timeZone :: Lens' CloudWatchLogsLogStream (Maybe CloudWatchLogsTimeZone)
cloudWatchLogsLogStream_timeZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogStream' {Maybe CloudWatchLogsTimeZone
timeZone :: Maybe CloudWatchLogsTimeZone
$sel:timeZone:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsTimeZone
timeZone} -> Maybe CloudWatchLogsTimeZone
timeZone) (\s :: CloudWatchLogsLogStream
s@CloudWatchLogsLogStream' {} Maybe CloudWatchLogsTimeZone
a -> CloudWatchLogsLogStream
s {$sel:timeZone:CloudWatchLogsLogStream' :: Maybe CloudWatchLogsTimeZone
timeZone = Maybe CloudWatchLogsTimeZone
a} :: CloudWatchLogsLogStream)

instance Data.FromJSON CloudWatchLogsLogStream where
  parseJSON :: Value -> Parser CloudWatchLogsLogStream
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CloudWatchLogsLogStream"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe CloudWatchLogsEncoding
-> Maybe Text
-> Maybe Text
-> Maybe CloudWatchLogsInitialPosition
-> Maybe Text
-> Maybe Text
-> Maybe CloudWatchLogsTimeZone
-> CloudWatchLogsLogStream
CloudWatchLogsLogStream'
            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
"BatchCount")
            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
"BatchSize")
            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
"BufferDuration")
            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
"DatetimeFormat")
            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
"Encoding")
            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
"File")
            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
"FileFingerprintLines")
            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
"InitialPosition")
            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
"LogGroupName")
            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
"MultiLineStartPattern")
            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
"TimeZone")
      )

instance Prelude.Hashable CloudWatchLogsLogStream where
  hashWithSalt :: Int -> CloudWatchLogsLogStream -> Int
hashWithSalt Int
_salt CloudWatchLogsLogStream' {Maybe Int
Maybe Text
Maybe CloudWatchLogsEncoding
Maybe CloudWatchLogsInitialPosition
Maybe CloudWatchLogsTimeZone
timeZone :: Maybe CloudWatchLogsTimeZone
multiLineStartPattern :: Maybe Text
logGroupName :: Maybe Text
initialPosition :: Maybe CloudWatchLogsInitialPosition
fileFingerprintLines :: Maybe Text
file :: Maybe Text
encoding :: Maybe CloudWatchLogsEncoding
datetimeFormat :: Maybe Text
bufferDuration :: Maybe Int
batchSize :: Maybe Int
batchCount :: Maybe Int
$sel:timeZone:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsTimeZone
$sel:multiLineStartPattern:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:logGroupName:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:initialPosition:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsInitialPosition
$sel:fileFingerprintLines:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:file:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:encoding:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsEncoding
$sel:datetimeFormat:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:bufferDuration:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
$sel:batchSize:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
$sel:batchCount:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
batchCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
batchSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
bufferDuration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datetimeFormat
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudWatchLogsEncoding
encoding
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
file
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fileFingerprintLines
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudWatchLogsInitialPosition
initialPosition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
multiLineStartPattern
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudWatchLogsTimeZone
timeZone

instance Prelude.NFData CloudWatchLogsLogStream where
  rnf :: CloudWatchLogsLogStream -> ()
rnf CloudWatchLogsLogStream' {Maybe Int
Maybe Text
Maybe CloudWatchLogsEncoding
Maybe CloudWatchLogsInitialPosition
Maybe CloudWatchLogsTimeZone
timeZone :: Maybe CloudWatchLogsTimeZone
multiLineStartPattern :: Maybe Text
logGroupName :: Maybe Text
initialPosition :: Maybe CloudWatchLogsInitialPosition
fileFingerprintLines :: Maybe Text
file :: Maybe Text
encoding :: Maybe CloudWatchLogsEncoding
datetimeFormat :: Maybe Text
bufferDuration :: Maybe Int
batchSize :: Maybe Int
batchCount :: Maybe Int
$sel:timeZone:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsTimeZone
$sel:multiLineStartPattern:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:logGroupName:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:initialPosition:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsInitialPosition
$sel:fileFingerprintLines:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:file:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:encoding:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsEncoding
$sel:datetimeFormat:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:bufferDuration:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
$sel:batchSize:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
$sel:batchCount:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
batchCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
batchSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
bufferDuration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datetimeFormat
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudWatchLogsEncoding
encoding
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
file
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileFingerprintLines
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudWatchLogsInitialPosition
initialPosition
      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 Text
multiLineStartPattern
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudWatchLogsTimeZone
timeZone

instance Data.ToJSON CloudWatchLogsLogStream where
  toJSON :: CloudWatchLogsLogStream -> Value
toJSON CloudWatchLogsLogStream' {Maybe Int
Maybe Text
Maybe CloudWatchLogsEncoding
Maybe CloudWatchLogsInitialPosition
Maybe CloudWatchLogsTimeZone
timeZone :: Maybe CloudWatchLogsTimeZone
multiLineStartPattern :: Maybe Text
logGroupName :: Maybe Text
initialPosition :: Maybe CloudWatchLogsInitialPosition
fileFingerprintLines :: Maybe Text
file :: Maybe Text
encoding :: Maybe CloudWatchLogsEncoding
datetimeFormat :: Maybe Text
bufferDuration :: Maybe Int
batchSize :: Maybe Int
batchCount :: Maybe Int
$sel:timeZone:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsTimeZone
$sel:multiLineStartPattern:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:logGroupName:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:initialPosition:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsInitialPosition
$sel:fileFingerprintLines:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:file:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:encoding:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe CloudWatchLogsEncoding
$sel:datetimeFormat:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Text
$sel:bufferDuration:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
$sel:batchSize:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
$sel:batchCount:CloudWatchLogsLogStream' :: CloudWatchLogsLogStream -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BatchCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
batchCount,
            (Key
"BatchSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
batchSize,
            (Key
"BufferDuration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
bufferDuration,
            (Key
"DatetimeFormat" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
datetimeFormat,
            (Key
"Encoding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchLogsEncoding
encoding,
            (Key
"File" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
file,
            (Key
"FileFingerprintLines" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fileFingerprintLines,
            (Key
"InitialPosition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchLogsInitialPosition
initialPosition,
            (Key
"LogGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
logGroupName,
            (Key
"MultiLineStartPattern" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
multiLineStartPattern,
            (Key
"TimeZone" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchLogsTimeZone
timeZone
          ]
      )