{-# 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.CloudFront.Types.FieldLevelEncryptionSummary
-- 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.CloudFront.Types.FieldLevelEncryptionSummary where

import Amazonka.CloudFront.Types.ContentTypeProfileConfig
import Amazonka.CloudFront.Types.QueryArgProfileConfig
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

-- | A summary of a field-level encryption item.
--
-- /See:/ 'newFieldLevelEncryptionSummary' smart constructor.
data FieldLevelEncryptionSummary = FieldLevelEncryptionSummary'
  { -- | An optional comment about the field-level encryption item. The comment
    -- cannot be longer than 128 characters.
    FieldLevelEncryptionSummary -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | A summary of a content type-profile mapping.
    FieldLevelEncryptionSummary -> Maybe ContentTypeProfileConfig
contentTypeProfileConfig :: Prelude.Maybe ContentTypeProfileConfig,
    -- | A summary of a query argument-profile mapping.
    FieldLevelEncryptionSummary -> Maybe QueryArgProfileConfig
queryArgProfileConfig :: Prelude.Maybe QueryArgProfileConfig,
    -- | The unique ID of a field-level encryption item.
    FieldLevelEncryptionSummary -> Text
id :: Prelude.Text,
    -- | The last time that the summary of field-level encryption items was
    -- modified.
    FieldLevelEncryptionSummary -> ISO8601
lastModifiedTime :: Data.ISO8601
  }
  deriving (FieldLevelEncryptionSummary -> FieldLevelEncryptionSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldLevelEncryptionSummary -> FieldLevelEncryptionSummary -> Bool
$c/= :: FieldLevelEncryptionSummary -> FieldLevelEncryptionSummary -> Bool
== :: FieldLevelEncryptionSummary -> FieldLevelEncryptionSummary -> Bool
$c== :: FieldLevelEncryptionSummary -> FieldLevelEncryptionSummary -> Bool
Prelude.Eq, ReadPrec [FieldLevelEncryptionSummary]
ReadPrec FieldLevelEncryptionSummary
Int -> ReadS FieldLevelEncryptionSummary
ReadS [FieldLevelEncryptionSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FieldLevelEncryptionSummary]
$creadListPrec :: ReadPrec [FieldLevelEncryptionSummary]
readPrec :: ReadPrec FieldLevelEncryptionSummary
$creadPrec :: ReadPrec FieldLevelEncryptionSummary
readList :: ReadS [FieldLevelEncryptionSummary]
$creadList :: ReadS [FieldLevelEncryptionSummary]
readsPrec :: Int -> ReadS FieldLevelEncryptionSummary
$creadsPrec :: Int -> ReadS FieldLevelEncryptionSummary
Prelude.Read, Int -> FieldLevelEncryptionSummary -> ShowS
[FieldLevelEncryptionSummary] -> ShowS
FieldLevelEncryptionSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldLevelEncryptionSummary] -> ShowS
$cshowList :: [FieldLevelEncryptionSummary] -> ShowS
show :: FieldLevelEncryptionSummary -> String
$cshow :: FieldLevelEncryptionSummary -> String
showsPrec :: Int -> FieldLevelEncryptionSummary -> ShowS
$cshowsPrec :: Int -> FieldLevelEncryptionSummary -> ShowS
Prelude.Show, forall x.
Rep FieldLevelEncryptionSummary x -> FieldLevelEncryptionSummary
forall x.
FieldLevelEncryptionSummary -> Rep FieldLevelEncryptionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FieldLevelEncryptionSummary x -> FieldLevelEncryptionSummary
$cfrom :: forall x.
FieldLevelEncryptionSummary -> Rep FieldLevelEncryptionSummary x
Prelude.Generic)

-- |
-- Create a value of 'FieldLevelEncryptionSummary' 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:
--
-- 'comment', 'fieldLevelEncryptionSummary_comment' - An optional comment about the field-level encryption item. The comment
-- cannot be longer than 128 characters.
--
-- 'contentTypeProfileConfig', 'fieldLevelEncryptionSummary_contentTypeProfileConfig' - A summary of a content type-profile mapping.
--
-- 'queryArgProfileConfig', 'fieldLevelEncryptionSummary_queryArgProfileConfig' - A summary of a query argument-profile mapping.
--
-- 'id', 'fieldLevelEncryptionSummary_id' - The unique ID of a field-level encryption item.
--
-- 'lastModifiedTime', 'fieldLevelEncryptionSummary_lastModifiedTime' - The last time that the summary of field-level encryption items was
-- modified.
newFieldLevelEncryptionSummary ::
  -- | 'id'
  Prelude.Text ->
  -- | 'lastModifiedTime'
  Prelude.UTCTime ->
  FieldLevelEncryptionSummary
newFieldLevelEncryptionSummary :: Text -> UTCTime -> FieldLevelEncryptionSummary
newFieldLevelEncryptionSummary
  Text
pId_
  UTCTime
pLastModifiedTime_ =
    FieldLevelEncryptionSummary'
      { $sel:comment:FieldLevelEncryptionSummary' :: Maybe Text
comment =
          forall a. Maybe a
Prelude.Nothing,
        $sel:contentTypeProfileConfig:FieldLevelEncryptionSummary' :: Maybe ContentTypeProfileConfig
contentTypeProfileConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:queryArgProfileConfig:FieldLevelEncryptionSummary' :: Maybe QueryArgProfileConfig
queryArgProfileConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:id:FieldLevelEncryptionSummary' :: Text
id = Text
pId_,
        $sel:lastModifiedTime:FieldLevelEncryptionSummary' :: ISO8601
lastModifiedTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_
      }

-- | An optional comment about the field-level encryption item. The comment
-- cannot be longer than 128 characters.
fieldLevelEncryptionSummary_comment :: Lens.Lens' FieldLevelEncryptionSummary (Prelude.Maybe Prelude.Text)
fieldLevelEncryptionSummary_comment :: Lens' FieldLevelEncryptionSummary (Maybe Text)
fieldLevelEncryptionSummary_comment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionSummary' {Maybe Text
comment :: Maybe Text
$sel:comment:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe Text
comment} -> Maybe Text
comment) (\s :: FieldLevelEncryptionSummary
s@FieldLevelEncryptionSummary' {} Maybe Text
a -> FieldLevelEncryptionSummary
s {$sel:comment:FieldLevelEncryptionSummary' :: Maybe Text
comment = Maybe Text
a} :: FieldLevelEncryptionSummary)

-- | A summary of a content type-profile mapping.
fieldLevelEncryptionSummary_contentTypeProfileConfig :: Lens.Lens' FieldLevelEncryptionSummary (Prelude.Maybe ContentTypeProfileConfig)
fieldLevelEncryptionSummary_contentTypeProfileConfig :: Lens' FieldLevelEncryptionSummary (Maybe ContentTypeProfileConfig)
fieldLevelEncryptionSummary_contentTypeProfileConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionSummary' {Maybe ContentTypeProfileConfig
contentTypeProfileConfig :: Maybe ContentTypeProfileConfig
$sel:contentTypeProfileConfig:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe ContentTypeProfileConfig
contentTypeProfileConfig} -> Maybe ContentTypeProfileConfig
contentTypeProfileConfig) (\s :: FieldLevelEncryptionSummary
s@FieldLevelEncryptionSummary' {} Maybe ContentTypeProfileConfig
a -> FieldLevelEncryptionSummary
s {$sel:contentTypeProfileConfig:FieldLevelEncryptionSummary' :: Maybe ContentTypeProfileConfig
contentTypeProfileConfig = Maybe ContentTypeProfileConfig
a} :: FieldLevelEncryptionSummary)

-- | A summary of a query argument-profile mapping.
fieldLevelEncryptionSummary_queryArgProfileConfig :: Lens.Lens' FieldLevelEncryptionSummary (Prelude.Maybe QueryArgProfileConfig)
fieldLevelEncryptionSummary_queryArgProfileConfig :: Lens' FieldLevelEncryptionSummary (Maybe QueryArgProfileConfig)
fieldLevelEncryptionSummary_queryArgProfileConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionSummary' {Maybe QueryArgProfileConfig
queryArgProfileConfig :: Maybe QueryArgProfileConfig
$sel:queryArgProfileConfig:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe QueryArgProfileConfig
queryArgProfileConfig} -> Maybe QueryArgProfileConfig
queryArgProfileConfig) (\s :: FieldLevelEncryptionSummary
s@FieldLevelEncryptionSummary' {} Maybe QueryArgProfileConfig
a -> FieldLevelEncryptionSummary
s {$sel:queryArgProfileConfig:FieldLevelEncryptionSummary' :: Maybe QueryArgProfileConfig
queryArgProfileConfig = Maybe QueryArgProfileConfig
a} :: FieldLevelEncryptionSummary)

-- | The unique ID of a field-level encryption item.
fieldLevelEncryptionSummary_id :: Lens.Lens' FieldLevelEncryptionSummary Prelude.Text
fieldLevelEncryptionSummary_id :: Lens' FieldLevelEncryptionSummary Text
fieldLevelEncryptionSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionSummary' {Text
id :: Text
$sel:id:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Text
id} -> Text
id) (\s :: FieldLevelEncryptionSummary
s@FieldLevelEncryptionSummary' {} Text
a -> FieldLevelEncryptionSummary
s {$sel:id:FieldLevelEncryptionSummary' :: Text
id = Text
a} :: FieldLevelEncryptionSummary)

-- | The last time that the summary of field-level encryption items was
-- modified.
fieldLevelEncryptionSummary_lastModifiedTime :: Lens.Lens' FieldLevelEncryptionSummary Prelude.UTCTime
fieldLevelEncryptionSummary_lastModifiedTime :: Lens' FieldLevelEncryptionSummary UTCTime
fieldLevelEncryptionSummary_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryptionSummary' {ISO8601
lastModifiedTime :: ISO8601
$sel:lastModifiedTime:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> ISO8601
lastModifiedTime} -> ISO8601
lastModifiedTime) (\s :: FieldLevelEncryptionSummary
s@FieldLevelEncryptionSummary' {} ISO8601
a -> FieldLevelEncryptionSummary
s {$sel:lastModifiedTime:FieldLevelEncryptionSummary' :: ISO8601
lastModifiedTime = ISO8601
a} :: FieldLevelEncryptionSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromXML FieldLevelEncryptionSummary where
  parseXML :: [Node] -> Either String FieldLevelEncryptionSummary
parseXML [Node]
x =
    Maybe Text
-> Maybe ContentTypeProfileConfig
-> Maybe QueryArgProfileConfig
-> Text
-> ISO8601
-> FieldLevelEncryptionSummary
FieldLevelEncryptionSummary'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Comment")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ContentTypeProfileConfig")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"QueryArgProfileConfig")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Id")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LastModifiedTime")

instance Prelude.Hashable FieldLevelEncryptionSummary where
  hashWithSalt :: Int -> FieldLevelEncryptionSummary -> Int
hashWithSalt Int
_salt FieldLevelEncryptionSummary' {Maybe Text
Maybe ContentTypeProfileConfig
Maybe QueryArgProfileConfig
Text
ISO8601
lastModifiedTime :: ISO8601
id :: Text
queryArgProfileConfig :: Maybe QueryArgProfileConfig
contentTypeProfileConfig :: Maybe ContentTypeProfileConfig
comment :: Maybe Text
$sel:lastModifiedTime:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> ISO8601
$sel:id:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Text
$sel:queryArgProfileConfig:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe QueryArgProfileConfig
$sel:contentTypeProfileConfig:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe ContentTypeProfileConfig
$sel:comment:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContentTypeProfileConfig
contentTypeProfileConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QueryArgProfileConfig
queryArgProfileConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
lastModifiedTime

instance Prelude.NFData FieldLevelEncryptionSummary where
  rnf :: FieldLevelEncryptionSummary -> ()
rnf FieldLevelEncryptionSummary' {Maybe Text
Maybe ContentTypeProfileConfig
Maybe QueryArgProfileConfig
Text
ISO8601
lastModifiedTime :: ISO8601
id :: Text
queryArgProfileConfig :: Maybe QueryArgProfileConfig
contentTypeProfileConfig :: Maybe ContentTypeProfileConfig
comment :: Maybe Text
$sel:lastModifiedTime:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> ISO8601
$sel:id:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Text
$sel:queryArgProfileConfig:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe QueryArgProfileConfig
$sel:contentTypeProfileConfig:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe ContentTypeProfileConfig
$sel:comment:FieldLevelEncryptionSummary' :: FieldLevelEncryptionSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
comment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContentTypeProfileConfig
contentTypeProfileConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe QueryArgProfileConfig
queryArgProfileConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
lastModifiedTime