{-# 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.SecurityLake.Types.LogsStatus
-- 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.SecurityLake.Types.LogsStatus 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
import Amazonka.SecurityLake.Types.SourceStatus

-- | Retrieves the Logs status for the Amazon Security Lake account.
--
-- /See:/ 'newLogsStatus' smart constructor.
data LogsStatus = LogsStatus'
  { -- | The health status of services, including error codes and patterns.
    LogsStatus -> SourceStatus
healthStatus :: SourceStatus,
    -- | Defines path the stored logs are available which has information on your
    -- systems, applications, and services.
    LogsStatus -> Text
pathToLogs :: Prelude.Text
  }
  deriving (LogsStatus -> LogsStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogsStatus -> LogsStatus -> Bool
$c/= :: LogsStatus -> LogsStatus -> Bool
== :: LogsStatus -> LogsStatus -> Bool
$c== :: LogsStatus -> LogsStatus -> Bool
Prelude.Eq, ReadPrec [LogsStatus]
ReadPrec LogsStatus
Int -> ReadS LogsStatus
ReadS [LogsStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogsStatus]
$creadListPrec :: ReadPrec [LogsStatus]
readPrec :: ReadPrec LogsStatus
$creadPrec :: ReadPrec LogsStatus
readList :: ReadS [LogsStatus]
$creadList :: ReadS [LogsStatus]
readsPrec :: Int -> ReadS LogsStatus
$creadsPrec :: Int -> ReadS LogsStatus
Prelude.Read, Int -> LogsStatus -> ShowS
[LogsStatus] -> ShowS
LogsStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogsStatus] -> ShowS
$cshowList :: [LogsStatus] -> ShowS
show :: LogsStatus -> String
$cshow :: LogsStatus -> String
showsPrec :: Int -> LogsStatus -> ShowS
$cshowsPrec :: Int -> LogsStatus -> ShowS
Prelude.Show, forall x. Rep LogsStatus x -> LogsStatus
forall x. LogsStatus -> Rep LogsStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogsStatus x -> LogsStatus
$cfrom :: forall x. LogsStatus -> Rep LogsStatus x
Prelude.Generic)

-- |
-- Create a value of 'LogsStatus' 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:
--
-- 'healthStatus', 'logsStatus_healthStatus' - The health status of services, including error codes and patterns.
--
-- 'pathToLogs', 'logsStatus_pathToLogs' - Defines path the stored logs are available which has information on your
-- systems, applications, and services.
newLogsStatus ::
  -- | 'healthStatus'
  SourceStatus ->
  -- | 'pathToLogs'
  Prelude.Text ->
  LogsStatus
newLogsStatus :: SourceStatus -> Text -> LogsStatus
newLogsStatus SourceStatus
pHealthStatus_ Text
pPathToLogs_ =
  LogsStatus'
    { $sel:healthStatus:LogsStatus' :: SourceStatus
healthStatus = SourceStatus
pHealthStatus_,
      $sel:pathToLogs:LogsStatus' :: Text
pathToLogs = Text
pPathToLogs_
    }

-- | The health status of services, including error codes and patterns.
logsStatus_healthStatus :: Lens.Lens' LogsStatus SourceStatus
logsStatus_healthStatus :: Lens' LogsStatus SourceStatus
logsStatus_healthStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogsStatus' {SourceStatus
healthStatus :: SourceStatus
$sel:healthStatus:LogsStatus' :: LogsStatus -> SourceStatus
healthStatus} -> SourceStatus
healthStatus) (\s :: LogsStatus
s@LogsStatus' {} SourceStatus
a -> LogsStatus
s {$sel:healthStatus:LogsStatus' :: SourceStatus
healthStatus = SourceStatus
a} :: LogsStatus)

-- | Defines path the stored logs are available which has information on your
-- systems, applications, and services.
logsStatus_pathToLogs :: Lens.Lens' LogsStatus Prelude.Text
logsStatus_pathToLogs :: Lens' LogsStatus Text
logsStatus_pathToLogs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogsStatus' {Text
pathToLogs :: Text
$sel:pathToLogs:LogsStatus' :: LogsStatus -> Text
pathToLogs} -> Text
pathToLogs) (\s :: LogsStatus
s@LogsStatus' {} Text
a -> LogsStatus
s {$sel:pathToLogs:LogsStatus' :: Text
pathToLogs = Text
a} :: LogsStatus)

instance Data.FromJSON LogsStatus where
  parseJSON :: Value -> Parser LogsStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LogsStatus"
      ( \Object
x ->
          SourceStatus -> Text -> LogsStatus
LogsStatus'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"healthStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"pathToLogs")
      )

instance Prelude.Hashable LogsStatus where
  hashWithSalt :: Int -> LogsStatus -> Int
hashWithSalt Int
_salt LogsStatus' {Text
SourceStatus
pathToLogs :: Text
healthStatus :: SourceStatus
$sel:pathToLogs:LogsStatus' :: LogsStatus -> Text
$sel:healthStatus:LogsStatus' :: LogsStatus -> SourceStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SourceStatus
healthStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pathToLogs

instance Prelude.NFData LogsStatus where
  rnf :: LogsStatus -> ()
rnf LogsStatus' {Text
SourceStatus
pathToLogs :: Text
healthStatus :: SourceStatus
$sel:pathToLogs:LogsStatus' :: LogsStatus -> Text
$sel:healthStatus:LogsStatus' :: LogsStatus -> SourceStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf SourceStatus
healthStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
pathToLogs