{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Synthetics.Types.ArtifactConfigOutput 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.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
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]
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
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. 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'
    { $sel:s3Encryption:ArtifactConfigOutput' :: Maybe S3EncryptionConfig
s3Encryption =
        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 :: Lens' ArtifactConfigOutput (Maybe S3EncryptionConfig)
artifactConfigOutput_s3Encryption = 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 Data.FromJSON ArtifactConfigOutput where
  parseJSON :: Value -> Parser ArtifactConfigOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ArtifactConfigOutput"
      ( \Object
x ->
          Maybe S3EncryptionConfig -> ArtifactConfigOutput
ArtifactConfigOutput'
            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
"S3Encryption")
      )

instance Prelude.Hashable ArtifactConfigOutput where
  hashWithSalt :: Int -> ArtifactConfigOutput -> Int
hashWithSalt Int
_salt ArtifactConfigOutput' {Maybe S3EncryptionConfig
s3Encryption :: Maybe S3EncryptionConfig
$sel:s3Encryption:ArtifactConfigOutput' :: ArtifactConfigOutput -> Maybe S3EncryptionConfig
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3EncryptionConfig
s3Encryption

instance Prelude.NFData ArtifactConfigOutput where
  rnf :: ArtifactConfigOutput -> ()
rnf ArtifactConfigOutput' {Maybe S3EncryptionConfig
s3Encryption :: Maybe S3EncryptionConfig
$sel:s3Encryption:ArtifactConfigOutput' :: ArtifactConfigOutput -> Maybe S3EncryptionConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe S3EncryptionConfig
s3Encryption