{-# 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.SecurityHub.Types.AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails where

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

-- | Information about CloudWatch Logs for the build project.
--
-- /See:/ 'newAwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' smart constructor.
data AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails = AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails'
  { -- | The current status of the logs in CloudWatch Logs for a build project.
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The group name of the logs in CloudWatch Logs.
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The prefix of the stream name of the CloudWatch Logs.
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Bool
(AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
 -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Bool)
-> (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
    -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Bool)
-> Eq AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Bool
$c/= :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Bool
== :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Bool
$c== :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Bool
Prelude.Eq, ReadPrec [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
ReadPrec AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
Int -> ReadS AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
ReadS [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
(Int -> ReadS AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> ReadS [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
-> ReadPrec AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> ReadPrec [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
-> Read AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
$creadListPrec :: ReadPrec [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
readPrec :: ReadPrec AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
$creadPrec :: ReadPrec AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
readList :: ReadS [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
$creadList :: ReadS [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails]
readsPrec :: Int -> ReadS AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
$creadsPrec :: Int -> ReadS AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
Prelude.Read, Int -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> ShowS
[AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails] -> ShowS
AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> String
(Int
 -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> ShowS)
-> (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> String)
-> ([AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails] -> ShowS)
-> Show AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails] -> ShowS
$cshowList :: [AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails] -> ShowS
show :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> String
$cshow :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> String
showsPrec :: Int -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> ShowS
$cshowsPrec :: Int -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> ShowS
Prelude.Show, (forall x.
 AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
 -> Rep AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails x)
-> (forall x.
    Rep AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails x
    -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Generic AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
forall x.
Rep AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails x
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
forall x.
AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> Rep AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails x
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
$cfrom :: forall x.
AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> Rep AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' 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:
--
-- 'status', 'awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_status' - The current status of the logs in CloudWatch Logs for a build project.
--
-- 'groupName', 'awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_groupName' - The group name of the logs in CloudWatch Logs.
--
-- 'streamName', 'awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_streamName' - The prefix of the stream name of the CloudWatch Logs.
newAwsCodeBuildProjectLogsConfigCloudWatchLogsDetails ::
  AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
newAwsCodeBuildProjectLogsConfigCloudWatchLogsDetails :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
newAwsCodeBuildProjectLogsConfigCloudWatchLogsDetails =
  AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails'
    { $sel:status:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: Maybe Text
groupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: Maybe Text
streamName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the logs in CloudWatch Logs for a build project.
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_status :: Lens.Lens' AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_status :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> f AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_status = (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text)
-> (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
    -> Maybe Text
    -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Lens
     AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
     AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' {Maybe Text
status :: Maybe Text
$sel:status:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
s@AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' {} Maybe Text
a -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
s {$sel:status:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: Maybe Text
status = Maybe Text
a} :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)

-- | The group name of the logs in CloudWatch Logs.
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_groupName :: Lens.Lens' AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_groupName :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> f AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_groupName = (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text)
-> (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
    -> Maybe Text
    -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Lens
     AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
     AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' {Maybe Text
groupName :: Maybe Text
$sel:groupName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
s@AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' {} Maybe Text
a -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
s {$sel:groupName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: Maybe Text
groupName = Maybe Text
a} :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)

-- | The prefix of the stream name of the CloudWatch Logs.
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_streamName :: Lens.Lens' AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_streamName :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
-> f AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
awsCodeBuildProjectLogsConfigCloudWatchLogsDetails_streamName = (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text)
-> (AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
    -> Maybe Text
    -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Lens
     AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
     AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' {Maybe Text
streamName :: Maybe Text
$sel:streamName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
s@AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' {} Maybe Text
a -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
s {$sel:streamName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: Maybe Text
streamName = Maybe Text
a} :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)

instance
  Core.FromJSON
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
  where
  parseJSON :: Value -> Parser AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
parseJSON =
    String
-> (Object
    -> Parser AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Value
-> Parser AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
              Parser
  (Maybe Text
   -> Maybe Text
   -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupName")
              Parser
  (Maybe Text -> AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails)
-> Parser (Maybe Text)
-> Parser AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StreamName")
      )

instance
  Prelude.Hashable
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails

instance
  Prelude.NFData
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails

instance
  Core.ToJSON
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails
  where
  toJSON :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Value
toJSON
    AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' {Maybe Text
streamName :: Maybe Text
groupName :: Maybe Text
status :: Maybe Text
$sel:streamName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
$sel:groupName:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
$sel:status:AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails' :: AwsCodeBuildProjectLogsConfigCloudWatchLogsDetails -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"Status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
status,
              (Text
"GroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupName,
              (Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName
            ]
        )