{-# 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.S3.Types.SseKmsEncryptedObjects
-- 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.S3.Types.SseKmsEncryptedObjects where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.SseKmsEncryptedObjectsStatus

-- | A container for filter information for the selection of S3 objects
-- encrypted with Amazon Web Services KMS.
--
-- /See:/ 'newSseKmsEncryptedObjects' smart constructor.
data SseKmsEncryptedObjects = SseKmsEncryptedObjects'
  { -- | Specifies whether Amazon S3 replicates objects created with server-side
    -- encryption using an Amazon Web Services KMS key stored in Amazon Web
    -- Services Key Management Service.
    SseKmsEncryptedObjects -> SseKmsEncryptedObjectsStatus
status :: SseKmsEncryptedObjectsStatus
  }
  deriving (SseKmsEncryptedObjects -> SseKmsEncryptedObjects -> Bool
(SseKmsEncryptedObjects -> SseKmsEncryptedObjects -> Bool)
-> (SseKmsEncryptedObjects -> SseKmsEncryptedObjects -> Bool)
-> Eq SseKmsEncryptedObjects
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SseKmsEncryptedObjects -> SseKmsEncryptedObjects -> Bool
$c/= :: SseKmsEncryptedObjects -> SseKmsEncryptedObjects -> Bool
== :: SseKmsEncryptedObjects -> SseKmsEncryptedObjects -> Bool
$c== :: SseKmsEncryptedObjects -> SseKmsEncryptedObjects -> Bool
Prelude.Eq, ReadPrec [SseKmsEncryptedObjects]
ReadPrec SseKmsEncryptedObjects
Int -> ReadS SseKmsEncryptedObjects
ReadS [SseKmsEncryptedObjects]
(Int -> ReadS SseKmsEncryptedObjects)
-> ReadS [SseKmsEncryptedObjects]
-> ReadPrec SseKmsEncryptedObjects
-> ReadPrec [SseKmsEncryptedObjects]
-> Read SseKmsEncryptedObjects
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SseKmsEncryptedObjects]
$creadListPrec :: ReadPrec [SseKmsEncryptedObjects]
readPrec :: ReadPrec SseKmsEncryptedObjects
$creadPrec :: ReadPrec SseKmsEncryptedObjects
readList :: ReadS [SseKmsEncryptedObjects]
$creadList :: ReadS [SseKmsEncryptedObjects]
readsPrec :: Int -> ReadS SseKmsEncryptedObjects
$creadsPrec :: Int -> ReadS SseKmsEncryptedObjects
Prelude.Read, Int -> SseKmsEncryptedObjects -> ShowS
[SseKmsEncryptedObjects] -> ShowS
SseKmsEncryptedObjects -> String
(Int -> SseKmsEncryptedObjects -> ShowS)
-> (SseKmsEncryptedObjects -> String)
-> ([SseKmsEncryptedObjects] -> ShowS)
-> Show SseKmsEncryptedObjects
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SseKmsEncryptedObjects] -> ShowS
$cshowList :: [SseKmsEncryptedObjects] -> ShowS
show :: SseKmsEncryptedObjects -> String
$cshow :: SseKmsEncryptedObjects -> String
showsPrec :: Int -> SseKmsEncryptedObjects -> ShowS
$cshowsPrec :: Int -> SseKmsEncryptedObjects -> ShowS
Prelude.Show, (forall x. SseKmsEncryptedObjects -> Rep SseKmsEncryptedObjects x)
-> (forall x.
    Rep SseKmsEncryptedObjects x -> SseKmsEncryptedObjects)
-> Generic SseKmsEncryptedObjects
forall x. Rep SseKmsEncryptedObjects x -> SseKmsEncryptedObjects
forall x. SseKmsEncryptedObjects -> Rep SseKmsEncryptedObjects x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SseKmsEncryptedObjects x -> SseKmsEncryptedObjects
$cfrom :: forall x. SseKmsEncryptedObjects -> Rep SseKmsEncryptedObjects x
Prelude.Generic)

-- |
-- Create a value of 'SseKmsEncryptedObjects' 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', 'sseKmsEncryptedObjects_status' - Specifies whether Amazon S3 replicates objects created with server-side
-- encryption using an Amazon Web Services KMS key stored in Amazon Web
-- Services Key Management Service.
newSseKmsEncryptedObjects ::
  -- | 'status'
  SseKmsEncryptedObjectsStatus ->
  SseKmsEncryptedObjects
newSseKmsEncryptedObjects :: SseKmsEncryptedObjectsStatus -> SseKmsEncryptedObjects
newSseKmsEncryptedObjects SseKmsEncryptedObjectsStatus
pStatus_ =
  SseKmsEncryptedObjects' :: SseKmsEncryptedObjectsStatus -> SseKmsEncryptedObjects
SseKmsEncryptedObjects' {$sel:status:SseKmsEncryptedObjects' :: SseKmsEncryptedObjectsStatus
status = SseKmsEncryptedObjectsStatus
pStatus_}

-- | Specifies whether Amazon S3 replicates objects created with server-side
-- encryption using an Amazon Web Services KMS key stored in Amazon Web
-- Services Key Management Service.
sseKmsEncryptedObjects_status :: Lens.Lens' SseKmsEncryptedObjects SseKmsEncryptedObjectsStatus
sseKmsEncryptedObjects_status :: (SseKmsEncryptedObjectsStatus -> f SseKmsEncryptedObjectsStatus)
-> SseKmsEncryptedObjects -> f SseKmsEncryptedObjects
sseKmsEncryptedObjects_status = (SseKmsEncryptedObjects -> SseKmsEncryptedObjectsStatus)
-> (SseKmsEncryptedObjects
    -> SseKmsEncryptedObjectsStatus -> SseKmsEncryptedObjects)
-> Lens
     SseKmsEncryptedObjects
     SseKmsEncryptedObjects
     SseKmsEncryptedObjectsStatus
     SseKmsEncryptedObjectsStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SseKmsEncryptedObjects' {SseKmsEncryptedObjectsStatus
status :: SseKmsEncryptedObjectsStatus
$sel:status:SseKmsEncryptedObjects' :: SseKmsEncryptedObjects -> SseKmsEncryptedObjectsStatus
status} -> SseKmsEncryptedObjectsStatus
status) (\s :: SseKmsEncryptedObjects
s@SseKmsEncryptedObjects' {} SseKmsEncryptedObjectsStatus
a -> SseKmsEncryptedObjects
s {$sel:status:SseKmsEncryptedObjects' :: SseKmsEncryptedObjectsStatus
status = SseKmsEncryptedObjectsStatus
a} :: SseKmsEncryptedObjects)

instance Core.FromXML SseKmsEncryptedObjects where
  parseXML :: [Node] -> Either String SseKmsEncryptedObjects
parseXML [Node]
x =
    SseKmsEncryptedObjectsStatus -> SseKmsEncryptedObjects
SseKmsEncryptedObjects'
      (SseKmsEncryptedObjectsStatus -> SseKmsEncryptedObjects)
-> Either String SseKmsEncryptedObjectsStatus
-> Either String SseKmsEncryptedObjects
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String SseKmsEncryptedObjectsStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")

instance Prelude.Hashable SseKmsEncryptedObjects

instance Prelude.NFData SseKmsEncryptedObjects

instance Core.ToXML SseKmsEncryptedObjects where
  toXML :: SseKmsEncryptedObjects -> XML
toXML SseKmsEncryptedObjects' {SseKmsEncryptedObjectsStatus
status :: SseKmsEncryptedObjectsStatus
$sel:status:SseKmsEncryptedObjects' :: SseKmsEncryptedObjects -> SseKmsEncryptedObjectsStatus
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"Status" Name -> SseKmsEncryptedObjectsStatus -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= SseKmsEncryptedObjectsStatus
status]