{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudFront.GetFieldLevelEncryptionConfig
(
GetFieldLevelEncryptionConfig (..),
newGetFieldLevelEncryptionConfig,
getFieldLevelEncryptionConfig_id,
GetFieldLevelEncryptionConfigResponse (..),
newGetFieldLevelEncryptionConfigResponse,
getFieldLevelEncryptionConfigResponse_eTag,
getFieldLevelEncryptionConfigResponse_fieldLevelEncryptionConfig,
getFieldLevelEncryptionConfigResponse_httpStatus,
)
where
import Amazonka.CloudFront.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetFieldLevelEncryptionConfig = GetFieldLevelEncryptionConfig'
{
GetFieldLevelEncryptionConfig -> Text
id :: Prelude.Text
}
deriving (GetFieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfig -> Bool
(GetFieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfig -> Bool)
-> (GetFieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfig -> Bool)
-> Eq GetFieldLevelEncryptionConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfig -> Bool
$c/= :: GetFieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfig -> Bool
== :: GetFieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfig -> Bool
$c== :: GetFieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfig -> Bool
Prelude.Eq, ReadPrec [GetFieldLevelEncryptionConfig]
ReadPrec GetFieldLevelEncryptionConfig
Int -> ReadS GetFieldLevelEncryptionConfig
ReadS [GetFieldLevelEncryptionConfig]
(Int -> ReadS GetFieldLevelEncryptionConfig)
-> ReadS [GetFieldLevelEncryptionConfig]
-> ReadPrec GetFieldLevelEncryptionConfig
-> ReadPrec [GetFieldLevelEncryptionConfig]
-> Read GetFieldLevelEncryptionConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFieldLevelEncryptionConfig]
$creadListPrec :: ReadPrec [GetFieldLevelEncryptionConfig]
readPrec :: ReadPrec GetFieldLevelEncryptionConfig
$creadPrec :: ReadPrec GetFieldLevelEncryptionConfig
readList :: ReadS [GetFieldLevelEncryptionConfig]
$creadList :: ReadS [GetFieldLevelEncryptionConfig]
readsPrec :: Int -> ReadS GetFieldLevelEncryptionConfig
$creadsPrec :: Int -> ReadS GetFieldLevelEncryptionConfig
Prelude.Read, Int -> GetFieldLevelEncryptionConfig -> ShowS
[GetFieldLevelEncryptionConfig] -> ShowS
GetFieldLevelEncryptionConfig -> String
(Int -> GetFieldLevelEncryptionConfig -> ShowS)
-> (GetFieldLevelEncryptionConfig -> String)
-> ([GetFieldLevelEncryptionConfig] -> ShowS)
-> Show GetFieldLevelEncryptionConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFieldLevelEncryptionConfig] -> ShowS
$cshowList :: [GetFieldLevelEncryptionConfig] -> ShowS
show :: GetFieldLevelEncryptionConfig -> String
$cshow :: GetFieldLevelEncryptionConfig -> String
showsPrec :: Int -> GetFieldLevelEncryptionConfig -> ShowS
$cshowsPrec :: Int -> GetFieldLevelEncryptionConfig -> ShowS
Prelude.Show, (forall x.
GetFieldLevelEncryptionConfig
-> Rep GetFieldLevelEncryptionConfig x)
-> (forall x.
Rep GetFieldLevelEncryptionConfig x
-> GetFieldLevelEncryptionConfig)
-> Generic GetFieldLevelEncryptionConfig
forall x.
Rep GetFieldLevelEncryptionConfig x
-> GetFieldLevelEncryptionConfig
forall x.
GetFieldLevelEncryptionConfig
-> Rep GetFieldLevelEncryptionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFieldLevelEncryptionConfig x
-> GetFieldLevelEncryptionConfig
$cfrom :: forall x.
GetFieldLevelEncryptionConfig
-> Rep GetFieldLevelEncryptionConfig x
Prelude.Generic)
newGetFieldLevelEncryptionConfig ::
Prelude.Text ->
GetFieldLevelEncryptionConfig
newGetFieldLevelEncryptionConfig :: Text -> GetFieldLevelEncryptionConfig
newGetFieldLevelEncryptionConfig Text
pId_ =
GetFieldLevelEncryptionConfig' :: Text -> GetFieldLevelEncryptionConfig
GetFieldLevelEncryptionConfig' {$sel:id:GetFieldLevelEncryptionConfig' :: Text
id = Text
pId_}
getFieldLevelEncryptionConfig_id :: Lens.Lens' GetFieldLevelEncryptionConfig Prelude.Text
getFieldLevelEncryptionConfig_id :: (Text -> f Text)
-> GetFieldLevelEncryptionConfig -> f GetFieldLevelEncryptionConfig
getFieldLevelEncryptionConfig_id = (GetFieldLevelEncryptionConfig -> Text)
-> (GetFieldLevelEncryptionConfig
-> Text -> GetFieldLevelEncryptionConfig)
-> Lens
GetFieldLevelEncryptionConfig
GetFieldLevelEncryptionConfig
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionConfig' {Text
id :: Text
$sel:id:GetFieldLevelEncryptionConfig' :: GetFieldLevelEncryptionConfig -> Text
id} -> Text
id) (\s :: GetFieldLevelEncryptionConfig
s@GetFieldLevelEncryptionConfig' {} Text
a -> GetFieldLevelEncryptionConfig
s {$sel:id:GetFieldLevelEncryptionConfig' :: Text
id = Text
a} :: GetFieldLevelEncryptionConfig)
instance
Core.AWSRequest
GetFieldLevelEncryptionConfig
where
type
AWSResponse GetFieldLevelEncryptionConfig =
GetFieldLevelEncryptionConfigResponse
request :: GetFieldLevelEncryptionConfig
-> Request GetFieldLevelEncryptionConfig
request = Service
-> GetFieldLevelEncryptionConfig
-> Request GetFieldLevelEncryptionConfig
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetFieldLevelEncryptionConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetFieldLevelEncryptionConfig)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetFieldLevelEncryptionConfig))
-> Logger
-> Service
-> Proxy GetFieldLevelEncryptionConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetFieldLevelEncryptionConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe FieldLevelEncryptionConfig
-> Int
-> GetFieldLevelEncryptionConfigResponse
GetFieldLevelEncryptionConfigResponse'
(Maybe Text
-> Maybe FieldLevelEncryptionConfig
-> Int
-> GetFieldLevelEncryptionConfigResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe FieldLevelEncryptionConfig
-> Int -> GetFieldLevelEncryptionConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"ETag")
Either
String
(Maybe FieldLevelEncryptionConfig
-> Int -> GetFieldLevelEncryptionConfigResponse)
-> Either String (Maybe FieldLevelEncryptionConfig)
-> Either String (Int -> GetFieldLevelEncryptionConfigResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node] -> Either String (Maybe FieldLevelEncryptionConfig)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
Either String (Int -> GetFieldLevelEncryptionConfigResponse)
-> Either String Int
-> Either String GetFieldLevelEncryptionConfigResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetFieldLevelEncryptionConfig
instance Prelude.NFData GetFieldLevelEncryptionConfig
instance Core.ToHeaders GetFieldLevelEncryptionConfig where
toHeaders :: GetFieldLevelEncryptionConfig -> ResponseHeaders
toHeaders = ResponseHeaders -> GetFieldLevelEncryptionConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetFieldLevelEncryptionConfig where
toPath :: GetFieldLevelEncryptionConfig -> ByteString
toPath GetFieldLevelEncryptionConfig' {Text
id :: Text
$sel:id:GetFieldLevelEncryptionConfig' :: GetFieldLevelEncryptionConfig -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/field-level-encryption/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id,
ByteString
"/config"
]
instance Core.ToQuery GetFieldLevelEncryptionConfig where
toQuery :: GetFieldLevelEncryptionConfig -> QueryString
toQuery = QueryString -> GetFieldLevelEncryptionConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetFieldLevelEncryptionConfigResponse = GetFieldLevelEncryptionConfigResponse'
{
GetFieldLevelEncryptionConfigResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
GetFieldLevelEncryptionConfigResponse
-> Maybe FieldLevelEncryptionConfig
fieldLevelEncryptionConfig :: Prelude.Maybe FieldLevelEncryptionConfig,
GetFieldLevelEncryptionConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetFieldLevelEncryptionConfigResponse
-> GetFieldLevelEncryptionConfigResponse -> Bool
(GetFieldLevelEncryptionConfigResponse
-> GetFieldLevelEncryptionConfigResponse -> Bool)
-> (GetFieldLevelEncryptionConfigResponse
-> GetFieldLevelEncryptionConfigResponse -> Bool)
-> Eq GetFieldLevelEncryptionConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFieldLevelEncryptionConfigResponse
-> GetFieldLevelEncryptionConfigResponse -> Bool
$c/= :: GetFieldLevelEncryptionConfigResponse
-> GetFieldLevelEncryptionConfigResponse -> Bool
== :: GetFieldLevelEncryptionConfigResponse
-> GetFieldLevelEncryptionConfigResponse -> Bool
$c== :: GetFieldLevelEncryptionConfigResponse
-> GetFieldLevelEncryptionConfigResponse -> Bool
Prelude.Eq, ReadPrec [GetFieldLevelEncryptionConfigResponse]
ReadPrec GetFieldLevelEncryptionConfigResponse
Int -> ReadS GetFieldLevelEncryptionConfigResponse
ReadS [GetFieldLevelEncryptionConfigResponse]
(Int -> ReadS GetFieldLevelEncryptionConfigResponse)
-> ReadS [GetFieldLevelEncryptionConfigResponse]
-> ReadPrec GetFieldLevelEncryptionConfigResponse
-> ReadPrec [GetFieldLevelEncryptionConfigResponse]
-> Read GetFieldLevelEncryptionConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFieldLevelEncryptionConfigResponse]
$creadListPrec :: ReadPrec [GetFieldLevelEncryptionConfigResponse]
readPrec :: ReadPrec GetFieldLevelEncryptionConfigResponse
$creadPrec :: ReadPrec GetFieldLevelEncryptionConfigResponse
readList :: ReadS [GetFieldLevelEncryptionConfigResponse]
$creadList :: ReadS [GetFieldLevelEncryptionConfigResponse]
readsPrec :: Int -> ReadS GetFieldLevelEncryptionConfigResponse
$creadsPrec :: Int -> ReadS GetFieldLevelEncryptionConfigResponse
Prelude.Read, Int -> GetFieldLevelEncryptionConfigResponse -> ShowS
[GetFieldLevelEncryptionConfigResponse] -> ShowS
GetFieldLevelEncryptionConfigResponse -> String
(Int -> GetFieldLevelEncryptionConfigResponse -> ShowS)
-> (GetFieldLevelEncryptionConfigResponse -> String)
-> ([GetFieldLevelEncryptionConfigResponse] -> ShowS)
-> Show GetFieldLevelEncryptionConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFieldLevelEncryptionConfigResponse] -> ShowS
$cshowList :: [GetFieldLevelEncryptionConfigResponse] -> ShowS
show :: GetFieldLevelEncryptionConfigResponse -> String
$cshow :: GetFieldLevelEncryptionConfigResponse -> String
showsPrec :: Int -> GetFieldLevelEncryptionConfigResponse -> ShowS
$cshowsPrec :: Int -> GetFieldLevelEncryptionConfigResponse -> ShowS
Prelude.Show, (forall x.
GetFieldLevelEncryptionConfigResponse
-> Rep GetFieldLevelEncryptionConfigResponse x)
-> (forall x.
Rep GetFieldLevelEncryptionConfigResponse x
-> GetFieldLevelEncryptionConfigResponse)
-> Generic GetFieldLevelEncryptionConfigResponse
forall x.
Rep GetFieldLevelEncryptionConfigResponse x
-> GetFieldLevelEncryptionConfigResponse
forall x.
GetFieldLevelEncryptionConfigResponse
-> Rep GetFieldLevelEncryptionConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFieldLevelEncryptionConfigResponse x
-> GetFieldLevelEncryptionConfigResponse
$cfrom :: forall x.
GetFieldLevelEncryptionConfigResponse
-> Rep GetFieldLevelEncryptionConfigResponse x
Prelude.Generic)
newGetFieldLevelEncryptionConfigResponse ::
Prelude.Int ->
GetFieldLevelEncryptionConfigResponse
newGetFieldLevelEncryptionConfigResponse :: Int -> GetFieldLevelEncryptionConfigResponse
newGetFieldLevelEncryptionConfigResponse Int
pHttpStatus_ =
GetFieldLevelEncryptionConfigResponse' :: Maybe Text
-> Maybe FieldLevelEncryptionConfig
-> Int
-> GetFieldLevelEncryptionConfigResponse
GetFieldLevelEncryptionConfigResponse'
{ $sel:eTag:GetFieldLevelEncryptionConfigResponse' :: Maybe Text
eTag =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fieldLevelEncryptionConfig:GetFieldLevelEncryptionConfigResponse' :: Maybe FieldLevelEncryptionConfig
fieldLevelEncryptionConfig =
Maybe FieldLevelEncryptionConfig
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetFieldLevelEncryptionConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getFieldLevelEncryptionConfigResponse_eTag :: Lens.Lens' GetFieldLevelEncryptionConfigResponse (Prelude.Maybe Prelude.Text)
getFieldLevelEncryptionConfigResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> GetFieldLevelEncryptionConfigResponse
-> f GetFieldLevelEncryptionConfigResponse
getFieldLevelEncryptionConfigResponse_eTag = (GetFieldLevelEncryptionConfigResponse -> Maybe Text)
-> (GetFieldLevelEncryptionConfigResponse
-> Maybe Text -> GetFieldLevelEncryptionConfigResponse)
-> Lens
GetFieldLevelEncryptionConfigResponse
GetFieldLevelEncryptionConfigResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionConfigResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:GetFieldLevelEncryptionConfigResponse' :: GetFieldLevelEncryptionConfigResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: GetFieldLevelEncryptionConfigResponse
s@GetFieldLevelEncryptionConfigResponse' {} Maybe Text
a -> GetFieldLevelEncryptionConfigResponse
s {$sel:eTag:GetFieldLevelEncryptionConfigResponse' :: Maybe Text
eTag = Maybe Text
a} :: GetFieldLevelEncryptionConfigResponse)
getFieldLevelEncryptionConfigResponse_fieldLevelEncryptionConfig :: Lens.Lens' GetFieldLevelEncryptionConfigResponse (Prelude.Maybe FieldLevelEncryptionConfig)
getFieldLevelEncryptionConfigResponse_fieldLevelEncryptionConfig :: (Maybe FieldLevelEncryptionConfig
-> f (Maybe FieldLevelEncryptionConfig))
-> GetFieldLevelEncryptionConfigResponse
-> f GetFieldLevelEncryptionConfigResponse
getFieldLevelEncryptionConfigResponse_fieldLevelEncryptionConfig = (GetFieldLevelEncryptionConfigResponse
-> Maybe FieldLevelEncryptionConfig)
-> (GetFieldLevelEncryptionConfigResponse
-> Maybe FieldLevelEncryptionConfig
-> GetFieldLevelEncryptionConfigResponse)
-> Lens
GetFieldLevelEncryptionConfigResponse
GetFieldLevelEncryptionConfigResponse
(Maybe FieldLevelEncryptionConfig)
(Maybe FieldLevelEncryptionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionConfigResponse' {Maybe FieldLevelEncryptionConfig
fieldLevelEncryptionConfig :: Maybe FieldLevelEncryptionConfig
$sel:fieldLevelEncryptionConfig:GetFieldLevelEncryptionConfigResponse' :: GetFieldLevelEncryptionConfigResponse
-> Maybe FieldLevelEncryptionConfig
fieldLevelEncryptionConfig} -> Maybe FieldLevelEncryptionConfig
fieldLevelEncryptionConfig) (\s :: GetFieldLevelEncryptionConfigResponse
s@GetFieldLevelEncryptionConfigResponse' {} Maybe FieldLevelEncryptionConfig
a -> GetFieldLevelEncryptionConfigResponse
s {$sel:fieldLevelEncryptionConfig:GetFieldLevelEncryptionConfigResponse' :: Maybe FieldLevelEncryptionConfig
fieldLevelEncryptionConfig = Maybe FieldLevelEncryptionConfig
a} :: GetFieldLevelEncryptionConfigResponse)
getFieldLevelEncryptionConfigResponse_httpStatus :: Lens.Lens' GetFieldLevelEncryptionConfigResponse Prelude.Int
getFieldLevelEncryptionConfigResponse_httpStatus :: (Int -> f Int)
-> GetFieldLevelEncryptionConfigResponse
-> f GetFieldLevelEncryptionConfigResponse
getFieldLevelEncryptionConfigResponse_httpStatus = (GetFieldLevelEncryptionConfigResponse -> Int)
-> (GetFieldLevelEncryptionConfigResponse
-> Int -> GetFieldLevelEncryptionConfigResponse)
-> Lens
GetFieldLevelEncryptionConfigResponse
GetFieldLevelEncryptionConfigResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetFieldLevelEncryptionConfigResponse' :: GetFieldLevelEncryptionConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetFieldLevelEncryptionConfigResponse
s@GetFieldLevelEncryptionConfigResponse' {} Int
a -> GetFieldLevelEncryptionConfigResponse
s {$sel:httpStatus:GetFieldLevelEncryptionConfigResponse' :: Int
httpStatus = Int
a} :: GetFieldLevelEncryptionConfigResponse)
instance
Prelude.NFData
GetFieldLevelEncryptionConfigResponse