{-# 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.Synthetics.Types.ArtifactConfigOutput
-- 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.Synthetics.Types.ArtifactConfigOutput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Synthetics.Types.S3EncryptionConfig

-- | A structure that contains the configuration for canary artifacts,
-- including the encryption-at-rest settings for artifacts that the canary
-- uploads to Amazon S3.
--
-- /See:/ 'newArtifactConfigOutput' smart constructor.
data ArtifactConfigOutput = ArtifactConfigOutput'
  { -- | A structure that contains the configuration of encryption settings for
    -- canary artifacts that are stored in Amazon S3.
    ArtifactConfigOutput -> Maybe S3EncryptionConfig
s3Encryption :: Prelude.Maybe S3EncryptionConfig
  }
  deriving (ArtifactConfigOutput -> ArtifactConfigOutput -> Bool
(ArtifactConfigOutput -> ArtifactConfigOutput -> Bool)
-> (ArtifactConfigOutput -> ArtifactConfigOutput -> Bool)
-> Eq ArtifactConfigOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArtifactConfigOutput -> ArtifactConfigOutput -> Bool
$c/= :: ArtifactConfigOutput -> ArtifactConfigOutput -> Bool
== :: ArtifactConfigOutput -> ArtifactConfigOutput -> Bool
$c== :: ArtifactConfigOutput -> ArtifactConfigOutput -> Bool
Prelude.Eq, ReadPrec [ArtifactConfigOutput]
ReadPrec ArtifactConfigOutput
Int -> ReadS ArtifactConfigOutput
ReadS [ArtifactConfigOutput]
(Int -> ReadS ArtifactConfigOutput)
-> ReadS [ArtifactConfigOutput]
-> ReadPrec ArtifactConfigOutput
-> ReadPrec [ArtifactConfigOutput]
-> Read ArtifactConfigOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArtifactConfigOutput]
$creadListPrec :: ReadPrec [ArtifactConfigOutput]
readPrec :: ReadPrec ArtifactConfigOutput
$creadPrec :: ReadPrec ArtifactConfigOutput
readList :: ReadS [ArtifactConfigOutput]
$creadList :: ReadS [ArtifactConfigOutput]
readsPrec :: Int -> ReadS ArtifactConfigOutput
$creadsPrec :: Int -> ReadS ArtifactConfigOutput
Prelude.Read, Int -> ArtifactConfigOutput -> ShowS
[ArtifactConfigOutput] -> ShowS
ArtifactConfigOutput -> String
(Int -> ArtifactConfigOutput -> ShowS)
-> (ArtifactConfigOutput -> String)
-> ([ArtifactConfigOutput] -> ShowS)
-> Show ArtifactConfigOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArtifactConfigOutput] -> ShowS
$cshowList :: [ArtifactConfigOutput] -> ShowS
show :: ArtifactConfigOutput -> String
$cshow :: ArtifactConfigOutput -> String
showsPrec :: Int -> ArtifactConfigOutput -> ShowS
$cshowsPrec :: Int -> ArtifactConfigOutput -> ShowS
Prelude.Show, (forall x. ArtifactConfigOutput -> Rep ArtifactConfigOutput x)
-> (forall x. Rep ArtifactConfigOutput x -> ArtifactConfigOutput)
-> Generic ArtifactConfigOutput
forall x. Rep ArtifactConfigOutput x -> ArtifactConfigOutput
forall x. ArtifactConfigOutput -> Rep ArtifactConfigOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArtifactConfigOutput x -> ArtifactConfigOutput
$cfrom :: forall x. ArtifactConfigOutput -> Rep ArtifactConfigOutput x
Prelude.Generic)

-- |
-- Create a value of 'ArtifactConfigOutput' 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:
--
-- 's3Encryption', 'artifactConfigOutput_s3Encryption' - A structure that contains the configuration of encryption settings for
-- canary artifacts that are stored in Amazon S3.
newArtifactConfigOutput ::
  ArtifactConfigOutput
newArtifactConfigOutput :: ArtifactConfigOutput
newArtifactConfigOutput =
  ArtifactConfigOutput' :: Maybe S3EncryptionConfig -> ArtifactConfigOutput
ArtifactConfigOutput'
    { $sel:s3Encryption:ArtifactConfigOutput' :: Maybe S3EncryptionConfig
s3Encryption =
        Maybe S3EncryptionConfig
forall a. Maybe a
Prelude.Nothing
    }

-- | A structure that contains the configuration of encryption settings for
-- canary artifacts that are stored in Amazon S3.
artifactConfigOutput_s3Encryption :: Lens.Lens' ArtifactConfigOutput (Prelude.Maybe S3EncryptionConfig)
artifactConfigOutput_s3Encryption :: (Maybe S3EncryptionConfig -> f (Maybe S3EncryptionConfig))
-> ArtifactConfigOutput -> f ArtifactConfigOutput
artifactConfigOutput_s3Encryption = (ArtifactConfigOutput -> Maybe S3EncryptionConfig)
-> (ArtifactConfigOutput
    -> Maybe S3EncryptionConfig -> ArtifactConfigOutput)
-> Lens
     ArtifactConfigOutput
     ArtifactConfigOutput
     (Maybe S3EncryptionConfig)
     (Maybe S3EncryptionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactConfigOutput' {Maybe S3EncryptionConfig
s3Encryption :: Maybe S3EncryptionConfig
$sel:s3Encryption:ArtifactConfigOutput' :: ArtifactConfigOutput -> Maybe S3EncryptionConfig
s3Encryption} -> Maybe S3EncryptionConfig
s3Encryption) (\s :: ArtifactConfigOutput
s@ArtifactConfigOutput' {} Maybe S3EncryptionConfig
a -> ArtifactConfigOutput
s {$sel:s3Encryption:ArtifactConfigOutput' :: Maybe S3EncryptionConfig
s3Encryption = Maybe S3EncryptionConfig
a} :: ArtifactConfigOutput)

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

instance Prelude.Hashable ArtifactConfigOutput

instance Prelude.NFData ArtifactConfigOutput