{-# 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.AwsCodeBuildProjectLogsConfigS3LogsDetails
-- 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.AwsCodeBuildProjectLogsConfigS3LogsDetails where

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

-- | Information about logs built to an S3 bucket for a build project.
--
-- /See:/ 'newAwsCodeBuildProjectLogsConfigS3LogsDetails' smart constructor.
data AwsCodeBuildProjectLogsConfigS3LogsDetails = AwsCodeBuildProjectLogsConfigS3LogsDetails'
  { -- | The current status of the S3 build logs.
    AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the S3 bucket and the path prefix for S3 logs.
    AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | Whether to disable encryption of the S3 build log output.
    AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Bool
encryptionDisabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (AwsCodeBuildProjectLogsConfigS3LogsDetails
-> AwsCodeBuildProjectLogsConfigS3LogsDetails -> Bool
(AwsCodeBuildProjectLogsConfigS3LogsDetails
 -> AwsCodeBuildProjectLogsConfigS3LogsDetails -> Bool)
-> (AwsCodeBuildProjectLogsConfigS3LogsDetails
    -> AwsCodeBuildProjectLogsConfigS3LogsDetails -> Bool)
-> Eq AwsCodeBuildProjectLogsConfigS3LogsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCodeBuildProjectLogsConfigS3LogsDetails
-> AwsCodeBuildProjectLogsConfigS3LogsDetails -> Bool
$c/= :: AwsCodeBuildProjectLogsConfigS3LogsDetails
-> AwsCodeBuildProjectLogsConfigS3LogsDetails -> Bool
== :: AwsCodeBuildProjectLogsConfigS3LogsDetails
-> AwsCodeBuildProjectLogsConfigS3LogsDetails -> Bool
$c== :: AwsCodeBuildProjectLogsConfigS3LogsDetails
-> AwsCodeBuildProjectLogsConfigS3LogsDetails -> Bool
Prelude.Eq, ReadPrec [AwsCodeBuildProjectLogsConfigS3LogsDetails]
ReadPrec AwsCodeBuildProjectLogsConfigS3LogsDetails
Int -> ReadS AwsCodeBuildProjectLogsConfigS3LogsDetails
ReadS [AwsCodeBuildProjectLogsConfigS3LogsDetails]
(Int -> ReadS AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> ReadS [AwsCodeBuildProjectLogsConfigS3LogsDetails]
-> ReadPrec AwsCodeBuildProjectLogsConfigS3LogsDetails
-> ReadPrec [AwsCodeBuildProjectLogsConfigS3LogsDetails]
-> Read AwsCodeBuildProjectLogsConfigS3LogsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCodeBuildProjectLogsConfigS3LogsDetails]
$creadListPrec :: ReadPrec [AwsCodeBuildProjectLogsConfigS3LogsDetails]
readPrec :: ReadPrec AwsCodeBuildProjectLogsConfigS3LogsDetails
$creadPrec :: ReadPrec AwsCodeBuildProjectLogsConfigS3LogsDetails
readList :: ReadS [AwsCodeBuildProjectLogsConfigS3LogsDetails]
$creadList :: ReadS [AwsCodeBuildProjectLogsConfigS3LogsDetails]
readsPrec :: Int -> ReadS AwsCodeBuildProjectLogsConfigS3LogsDetails
$creadsPrec :: Int -> ReadS AwsCodeBuildProjectLogsConfigS3LogsDetails
Prelude.Read, Int -> AwsCodeBuildProjectLogsConfigS3LogsDetails -> ShowS
[AwsCodeBuildProjectLogsConfigS3LogsDetails] -> ShowS
AwsCodeBuildProjectLogsConfigS3LogsDetails -> String
(Int -> AwsCodeBuildProjectLogsConfigS3LogsDetails -> ShowS)
-> (AwsCodeBuildProjectLogsConfigS3LogsDetails -> String)
-> ([AwsCodeBuildProjectLogsConfigS3LogsDetails] -> ShowS)
-> Show AwsCodeBuildProjectLogsConfigS3LogsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCodeBuildProjectLogsConfigS3LogsDetails] -> ShowS
$cshowList :: [AwsCodeBuildProjectLogsConfigS3LogsDetails] -> ShowS
show :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> String
$cshow :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> String
showsPrec :: Int -> AwsCodeBuildProjectLogsConfigS3LogsDetails -> ShowS
$cshowsPrec :: Int -> AwsCodeBuildProjectLogsConfigS3LogsDetails -> ShowS
Prelude.Show, (forall x.
 AwsCodeBuildProjectLogsConfigS3LogsDetails
 -> Rep AwsCodeBuildProjectLogsConfigS3LogsDetails x)
-> (forall x.
    Rep AwsCodeBuildProjectLogsConfigS3LogsDetails x
    -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Generic AwsCodeBuildProjectLogsConfigS3LogsDetails
forall x.
Rep AwsCodeBuildProjectLogsConfigS3LogsDetails x
-> AwsCodeBuildProjectLogsConfigS3LogsDetails
forall x.
AwsCodeBuildProjectLogsConfigS3LogsDetails
-> Rep AwsCodeBuildProjectLogsConfigS3LogsDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCodeBuildProjectLogsConfigS3LogsDetails x
-> AwsCodeBuildProjectLogsConfigS3LogsDetails
$cfrom :: forall x.
AwsCodeBuildProjectLogsConfigS3LogsDetails
-> Rep AwsCodeBuildProjectLogsConfigS3LogsDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsCodeBuildProjectLogsConfigS3LogsDetails' 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', 'awsCodeBuildProjectLogsConfigS3LogsDetails_status' - The current status of the S3 build logs.
--
-- 'location', 'awsCodeBuildProjectLogsConfigS3LogsDetails_location' - The ARN of the S3 bucket and the path prefix for S3 logs.
--
-- 'encryptionDisabled', 'awsCodeBuildProjectLogsConfigS3LogsDetails_encryptionDisabled' - Whether to disable encryption of the S3 build log output.
newAwsCodeBuildProjectLogsConfigS3LogsDetails ::
  AwsCodeBuildProjectLogsConfigS3LogsDetails
newAwsCodeBuildProjectLogsConfigS3LogsDetails :: AwsCodeBuildProjectLogsConfigS3LogsDetails
newAwsCodeBuildProjectLogsConfigS3LogsDetails =
  AwsCodeBuildProjectLogsConfigS3LogsDetails' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsCodeBuildProjectLogsConfigS3LogsDetails
AwsCodeBuildProjectLogsConfigS3LogsDetails'
    { $sel:status:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionDisabled:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: Maybe Bool
encryptionDisabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the S3 build logs.
awsCodeBuildProjectLogsConfigS3LogsDetails_status :: Lens.Lens' AwsCodeBuildProjectLogsConfigS3LogsDetails (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectLogsConfigS3LogsDetails_status :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectLogsConfigS3LogsDetails
-> f AwsCodeBuildProjectLogsConfigS3LogsDetails
awsCodeBuildProjectLogsConfigS3LogsDetails_status = (AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Text)
-> (AwsCodeBuildProjectLogsConfigS3LogsDetails
    -> Maybe Text -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Lens
     AwsCodeBuildProjectLogsConfigS3LogsDetails
     AwsCodeBuildProjectLogsConfigS3LogsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectLogsConfigS3LogsDetails' {Maybe Text
status :: Maybe Text
$sel:status:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsCodeBuildProjectLogsConfigS3LogsDetails
s@AwsCodeBuildProjectLogsConfigS3LogsDetails' {} Maybe Text
a -> AwsCodeBuildProjectLogsConfigS3LogsDetails
s {$sel:status:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: Maybe Text
status = Maybe Text
a} :: AwsCodeBuildProjectLogsConfigS3LogsDetails)

-- | The ARN of the S3 bucket and the path prefix for S3 logs.
awsCodeBuildProjectLogsConfigS3LogsDetails_location :: Lens.Lens' AwsCodeBuildProjectLogsConfigS3LogsDetails (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectLogsConfigS3LogsDetails_location :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectLogsConfigS3LogsDetails
-> f AwsCodeBuildProjectLogsConfigS3LogsDetails
awsCodeBuildProjectLogsConfigS3LogsDetails_location = (AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Text)
-> (AwsCodeBuildProjectLogsConfigS3LogsDetails
    -> Maybe Text -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Lens
     AwsCodeBuildProjectLogsConfigS3LogsDetails
     AwsCodeBuildProjectLogsConfigS3LogsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectLogsConfigS3LogsDetails' {Maybe Text
location :: Maybe Text
$sel:location:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Text
location} -> Maybe Text
location) (\s :: AwsCodeBuildProjectLogsConfigS3LogsDetails
s@AwsCodeBuildProjectLogsConfigS3LogsDetails' {} Maybe Text
a -> AwsCodeBuildProjectLogsConfigS3LogsDetails
s {$sel:location:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: Maybe Text
location = Maybe Text
a} :: AwsCodeBuildProjectLogsConfigS3LogsDetails)

-- | Whether to disable encryption of the S3 build log output.
awsCodeBuildProjectLogsConfigS3LogsDetails_encryptionDisabled :: Lens.Lens' AwsCodeBuildProjectLogsConfigS3LogsDetails (Prelude.Maybe Prelude.Bool)
awsCodeBuildProjectLogsConfigS3LogsDetails_encryptionDisabled :: (Maybe Bool -> f (Maybe Bool))
-> AwsCodeBuildProjectLogsConfigS3LogsDetails
-> f AwsCodeBuildProjectLogsConfigS3LogsDetails
awsCodeBuildProjectLogsConfigS3LogsDetails_encryptionDisabled = (AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Bool)
-> (AwsCodeBuildProjectLogsConfigS3LogsDetails
    -> Maybe Bool -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Lens
     AwsCodeBuildProjectLogsConfigS3LogsDetails
     AwsCodeBuildProjectLogsConfigS3LogsDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectLogsConfigS3LogsDetails' {Maybe Bool
encryptionDisabled :: Maybe Bool
$sel:encryptionDisabled:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Bool
encryptionDisabled} -> Maybe Bool
encryptionDisabled) (\s :: AwsCodeBuildProjectLogsConfigS3LogsDetails
s@AwsCodeBuildProjectLogsConfigS3LogsDetails' {} Maybe Bool
a -> AwsCodeBuildProjectLogsConfigS3LogsDetails
s {$sel:encryptionDisabled:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: Maybe Bool
encryptionDisabled = Maybe Bool
a} :: AwsCodeBuildProjectLogsConfigS3LogsDetails)

instance
  Core.FromJSON
    AwsCodeBuildProjectLogsConfigS3LogsDetails
  where
  parseJSON :: Value -> Parser AwsCodeBuildProjectLogsConfigS3LogsDetails
parseJSON =
    String
-> (Object -> Parser AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Value
-> Parser AwsCodeBuildProjectLogsConfigS3LogsDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsCodeBuildProjectLogsConfigS3LogsDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsCodeBuildProjectLogsConfigS3LogsDetails
AwsCodeBuildProjectLogsConfigS3LogsDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
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 Bool -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
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
"Location")
              Parser (Maybe Bool -> AwsCodeBuildProjectLogsConfigS3LogsDetails)
-> Parser (Maybe Bool)
-> Parser AwsCodeBuildProjectLogsConfigS3LogsDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionDisabled")
      )

instance
  Prelude.Hashable
    AwsCodeBuildProjectLogsConfigS3LogsDetails

instance
  Prelude.NFData
    AwsCodeBuildProjectLogsConfigS3LogsDetails

instance
  Core.ToJSON
    AwsCodeBuildProjectLogsConfigS3LogsDetails
  where
  toJSON :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> Value
toJSON
    AwsCodeBuildProjectLogsConfigS3LogsDetails' {Maybe Bool
Maybe Text
encryptionDisabled :: Maybe Bool
location :: Maybe Text
status :: Maybe Text
$sel:encryptionDisabled:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Bool
$sel:location:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> Maybe Text
$sel:status:AwsCodeBuildProjectLogsConfigS3LogsDetails' :: AwsCodeBuildProjectLogsConfigS3LogsDetails -> 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
"Location" 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
location,
              (Text
"EncryptionDisabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
encryptionDisabled
            ]
        )