{-# 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.GetFieldLevelEncryptionProfile
(
GetFieldLevelEncryptionProfile (..),
newGetFieldLevelEncryptionProfile,
getFieldLevelEncryptionProfile_id,
GetFieldLevelEncryptionProfileResponse (..),
newGetFieldLevelEncryptionProfileResponse,
getFieldLevelEncryptionProfileResponse_eTag,
getFieldLevelEncryptionProfileResponse_fieldLevelEncryptionProfile,
getFieldLevelEncryptionProfileResponse_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 GetFieldLevelEncryptionProfile = GetFieldLevelEncryptionProfile'
{
GetFieldLevelEncryptionProfile -> Text
id :: Prelude.Text
}
deriving (GetFieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfile -> Bool
(GetFieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfile -> Bool)
-> (GetFieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfile -> Bool)
-> Eq GetFieldLevelEncryptionProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfile -> Bool
$c/= :: GetFieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfile -> Bool
== :: GetFieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfile -> Bool
$c== :: GetFieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfile -> Bool
Prelude.Eq, ReadPrec [GetFieldLevelEncryptionProfile]
ReadPrec GetFieldLevelEncryptionProfile
Int -> ReadS GetFieldLevelEncryptionProfile
ReadS [GetFieldLevelEncryptionProfile]
(Int -> ReadS GetFieldLevelEncryptionProfile)
-> ReadS [GetFieldLevelEncryptionProfile]
-> ReadPrec GetFieldLevelEncryptionProfile
-> ReadPrec [GetFieldLevelEncryptionProfile]
-> Read GetFieldLevelEncryptionProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFieldLevelEncryptionProfile]
$creadListPrec :: ReadPrec [GetFieldLevelEncryptionProfile]
readPrec :: ReadPrec GetFieldLevelEncryptionProfile
$creadPrec :: ReadPrec GetFieldLevelEncryptionProfile
readList :: ReadS [GetFieldLevelEncryptionProfile]
$creadList :: ReadS [GetFieldLevelEncryptionProfile]
readsPrec :: Int -> ReadS GetFieldLevelEncryptionProfile
$creadsPrec :: Int -> ReadS GetFieldLevelEncryptionProfile
Prelude.Read, Int -> GetFieldLevelEncryptionProfile -> ShowS
[GetFieldLevelEncryptionProfile] -> ShowS
GetFieldLevelEncryptionProfile -> String
(Int -> GetFieldLevelEncryptionProfile -> ShowS)
-> (GetFieldLevelEncryptionProfile -> String)
-> ([GetFieldLevelEncryptionProfile] -> ShowS)
-> Show GetFieldLevelEncryptionProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFieldLevelEncryptionProfile] -> ShowS
$cshowList :: [GetFieldLevelEncryptionProfile] -> ShowS
show :: GetFieldLevelEncryptionProfile -> String
$cshow :: GetFieldLevelEncryptionProfile -> String
showsPrec :: Int -> GetFieldLevelEncryptionProfile -> ShowS
$cshowsPrec :: Int -> GetFieldLevelEncryptionProfile -> ShowS
Prelude.Show, (forall x.
GetFieldLevelEncryptionProfile
-> Rep GetFieldLevelEncryptionProfile x)
-> (forall x.
Rep GetFieldLevelEncryptionProfile x
-> GetFieldLevelEncryptionProfile)
-> Generic GetFieldLevelEncryptionProfile
forall x.
Rep GetFieldLevelEncryptionProfile x
-> GetFieldLevelEncryptionProfile
forall x.
GetFieldLevelEncryptionProfile
-> Rep GetFieldLevelEncryptionProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFieldLevelEncryptionProfile x
-> GetFieldLevelEncryptionProfile
$cfrom :: forall x.
GetFieldLevelEncryptionProfile
-> Rep GetFieldLevelEncryptionProfile x
Prelude.Generic)
newGetFieldLevelEncryptionProfile ::
Prelude.Text ->
GetFieldLevelEncryptionProfile
newGetFieldLevelEncryptionProfile :: Text -> GetFieldLevelEncryptionProfile
newGetFieldLevelEncryptionProfile Text
pId_ =
GetFieldLevelEncryptionProfile' :: Text -> GetFieldLevelEncryptionProfile
GetFieldLevelEncryptionProfile' {$sel:id:GetFieldLevelEncryptionProfile' :: Text
id = Text
pId_}
getFieldLevelEncryptionProfile_id :: Lens.Lens' GetFieldLevelEncryptionProfile Prelude.Text
getFieldLevelEncryptionProfile_id :: (Text -> f Text)
-> GetFieldLevelEncryptionProfile
-> f GetFieldLevelEncryptionProfile
getFieldLevelEncryptionProfile_id = (GetFieldLevelEncryptionProfile -> Text)
-> (GetFieldLevelEncryptionProfile
-> Text -> GetFieldLevelEncryptionProfile)
-> Lens
GetFieldLevelEncryptionProfile
GetFieldLevelEncryptionProfile
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionProfile' {Text
id :: Text
$sel:id:GetFieldLevelEncryptionProfile' :: GetFieldLevelEncryptionProfile -> Text
id} -> Text
id) (\s :: GetFieldLevelEncryptionProfile
s@GetFieldLevelEncryptionProfile' {} Text
a -> GetFieldLevelEncryptionProfile
s {$sel:id:GetFieldLevelEncryptionProfile' :: Text
id = Text
a} :: GetFieldLevelEncryptionProfile)
instance
Core.AWSRequest
GetFieldLevelEncryptionProfile
where
type
AWSResponse GetFieldLevelEncryptionProfile =
GetFieldLevelEncryptionProfileResponse
request :: GetFieldLevelEncryptionProfile
-> Request GetFieldLevelEncryptionProfile
request = Service
-> GetFieldLevelEncryptionProfile
-> Request GetFieldLevelEncryptionProfile
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetFieldLevelEncryptionProfile
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetFieldLevelEncryptionProfile)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetFieldLevelEncryptionProfile))
-> Logger
-> Service
-> Proxy GetFieldLevelEncryptionProfile
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetFieldLevelEncryptionProfile)))
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 FieldLevelEncryptionProfile
-> Int
-> GetFieldLevelEncryptionProfileResponse
GetFieldLevelEncryptionProfileResponse'
(Maybe Text
-> Maybe FieldLevelEncryptionProfile
-> Int
-> GetFieldLevelEncryptionProfileResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe FieldLevelEncryptionProfile
-> Int -> GetFieldLevelEncryptionProfileResponse)
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 FieldLevelEncryptionProfile
-> Int -> GetFieldLevelEncryptionProfileResponse)
-> Either String (Maybe FieldLevelEncryptionProfile)
-> Either String (Int -> GetFieldLevelEncryptionProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node] -> Either String (Maybe FieldLevelEncryptionProfile)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
Either String (Int -> GetFieldLevelEncryptionProfileResponse)
-> Either String Int
-> Either String GetFieldLevelEncryptionProfileResponse
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
GetFieldLevelEncryptionProfile
instance
Prelude.NFData
GetFieldLevelEncryptionProfile
instance
Core.ToHeaders
GetFieldLevelEncryptionProfile
where
toHeaders :: GetFieldLevelEncryptionProfile -> ResponseHeaders
toHeaders = ResponseHeaders
-> GetFieldLevelEncryptionProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetFieldLevelEncryptionProfile where
toPath :: GetFieldLevelEncryptionProfile -> ByteString
toPath GetFieldLevelEncryptionProfile' {Text
id :: Text
$sel:id:GetFieldLevelEncryptionProfile' :: GetFieldLevelEncryptionProfile -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/field-level-encryption-profile/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id
]
instance Core.ToQuery GetFieldLevelEncryptionProfile where
toQuery :: GetFieldLevelEncryptionProfile -> QueryString
toQuery = QueryString -> GetFieldLevelEncryptionProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetFieldLevelEncryptionProfileResponse = GetFieldLevelEncryptionProfileResponse'
{
GetFieldLevelEncryptionProfileResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
GetFieldLevelEncryptionProfileResponse
-> Maybe FieldLevelEncryptionProfile
fieldLevelEncryptionProfile :: Prelude.Maybe FieldLevelEncryptionProfile,
GetFieldLevelEncryptionProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetFieldLevelEncryptionProfileResponse
-> GetFieldLevelEncryptionProfileResponse -> Bool
(GetFieldLevelEncryptionProfileResponse
-> GetFieldLevelEncryptionProfileResponse -> Bool)
-> (GetFieldLevelEncryptionProfileResponse
-> GetFieldLevelEncryptionProfileResponse -> Bool)
-> Eq GetFieldLevelEncryptionProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFieldLevelEncryptionProfileResponse
-> GetFieldLevelEncryptionProfileResponse -> Bool
$c/= :: GetFieldLevelEncryptionProfileResponse
-> GetFieldLevelEncryptionProfileResponse -> Bool
== :: GetFieldLevelEncryptionProfileResponse
-> GetFieldLevelEncryptionProfileResponse -> Bool
$c== :: GetFieldLevelEncryptionProfileResponse
-> GetFieldLevelEncryptionProfileResponse -> Bool
Prelude.Eq, ReadPrec [GetFieldLevelEncryptionProfileResponse]
ReadPrec GetFieldLevelEncryptionProfileResponse
Int -> ReadS GetFieldLevelEncryptionProfileResponse
ReadS [GetFieldLevelEncryptionProfileResponse]
(Int -> ReadS GetFieldLevelEncryptionProfileResponse)
-> ReadS [GetFieldLevelEncryptionProfileResponse]
-> ReadPrec GetFieldLevelEncryptionProfileResponse
-> ReadPrec [GetFieldLevelEncryptionProfileResponse]
-> Read GetFieldLevelEncryptionProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFieldLevelEncryptionProfileResponse]
$creadListPrec :: ReadPrec [GetFieldLevelEncryptionProfileResponse]
readPrec :: ReadPrec GetFieldLevelEncryptionProfileResponse
$creadPrec :: ReadPrec GetFieldLevelEncryptionProfileResponse
readList :: ReadS [GetFieldLevelEncryptionProfileResponse]
$creadList :: ReadS [GetFieldLevelEncryptionProfileResponse]
readsPrec :: Int -> ReadS GetFieldLevelEncryptionProfileResponse
$creadsPrec :: Int -> ReadS GetFieldLevelEncryptionProfileResponse
Prelude.Read, Int -> GetFieldLevelEncryptionProfileResponse -> ShowS
[GetFieldLevelEncryptionProfileResponse] -> ShowS
GetFieldLevelEncryptionProfileResponse -> String
(Int -> GetFieldLevelEncryptionProfileResponse -> ShowS)
-> (GetFieldLevelEncryptionProfileResponse -> String)
-> ([GetFieldLevelEncryptionProfileResponse] -> ShowS)
-> Show GetFieldLevelEncryptionProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFieldLevelEncryptionProfileResponse] -> ShowS
$cshowList :: [GetFieldLevelEncryptionProfileResponse] -> ShowS
show :: GetFieldLevelEncryptionProfileResponse -> String
$cshow :: GetFieldLevelEncryptionProfileResponse -> String
showsPrec :: Int -> GetFieldLevelEncryptionProfileResponse -> ShowS
$cshowsPrec :: Int -> GetFieldLevelEncryptionProfileResponse -> ShowS
Prelude.Show, (forall x.
GetFieldLevelEncryptionProfileResponse
-> Rep GetFieldLevelEncryptionProfileResponse x)
-> (forall x.
Rep GetFieldLevelEncryptionProfileResponse x
-> GetFieldLevelEncryptionProfileResponse)
-> Generic GetFieldLevelEncryptionProfileResponse
forall x.
Rep GetFieldLevelEncryptionProfileResponse x
-> GetFieldLevelEncryptionProfileResponse
forall x.
GetFieldLevelEncryptionProfileResponse
-> Rep GetFieldLevelEncryptionProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFieldLevelEncryptionProfileResponse x
-> GetFieldLevelEncryptionProfileResponse
$cfrom :: forall x.
GetFieldLevelEncryptionProfileResponse
-> Rep GetFieldLevelEncryptionProfileResponse x
Prelude.Generic)
newGetFieldLevelEncryptionProfileResponse ::
Prelude.Int ->
GetFieldLevelEncryptionProfileResponse
newGetFieldLevelEncryptionProfileResponse :: Int -> GetFieldLevelEncryptionProfileResponse
newGetFieldLevelEncryptionProfileResponse
Int
pHttpStatus_ =
GetFieldLevelEncryptionProfileResponse' :: Maybe Text
-> Maybe FieldLevelEncryptionProfile
-> Int
-> GetFieldLevelEncryptionProfileResponse
GetFieldLevelEncryptionProfileResponse'
{ $sel:eTag:GetFieldLevelEncryptionProfileResponse' :: Maybe Text
eTag =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fieldLevelEncryptionProfile:GetFieldLevelEncryptionProfileResponse' :: Maybe FieldLevelEncryptionProfile
fieldLevelEncryptionProfile =
Maybe FieldLevelEncryptionProfile
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetFieldLevelEncryptionProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getFieldLevelEncryptionProfileResponse_eTag :: Lens.Lens' GetFieldLevelEncryptionProfileResponse (Prelude.Maybe Prelude.Text)
getFieldLevelEncryptionProfileResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> GetFieldLevelEncryptionProfileResponse
-> f GetFieldLevelEncryptionProfileResponse
getFieldLevelEncryptionProfileResponse_eTag = (GetFieldLevelEncryptionProfileResponse -> Maybe Text)
-> (GetFieldLevelEncryptionProfileResponse
-> Maybe Text -> GetFieldLevelEncryptionProfileResponse)
-> Lens
GetFieldLevelEncryptionProfileResponse
GetFieldLevelEncryptionProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionProfileResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:GetFieldLevelEncryptionProfileResponse' :: GetFieldLevelEncryptionProfileResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: GetFieldLevelEncryptionProfileResponse
s@GetFieldLevelEncryptionProfileResponse' {} Maybe Text
a -> GetFieldLevelEncryptionProfileResponse
s {$sel:eTag:GetFieldLevelEncryptionProfileResponse' :: Maybe Text
eTag = Maybe Text
a} :: GetFieldLevelEncryptionProfileResponse)
getFieldLevelEncryptionProfileResponse_fieldLevelEncryptionProfile :: Lens.Lens' GetFieldLevelEncryptionProfileResponse (Prelude.Maybe FieldLevelEncryptionProfile)
getFieldLevelEncryptionProfileResponse_fieldLevelEncryptionProfile :: (Maybe FieldLevelEncryptionProfile
-> f (Maybe FieldLevelEncryptionProfile))
-> GetFieldLevelEncryptionProfileResponse
-> f GetFieldLevelEncryptionProfileResponse
getFieldLevelEncryptionProfileResponse_fieldLevelEncryptionProfile = (GetFieldLevelEncryptionProfileResponse
-> Maybe FieldLevelEncryptionProfile)
-> (GetFieldLevelEncryptionProfileResponse
-> Maybe FieldLevelEncryptionProfile
-> GetFieldLevelEncryptionProfileResponse)
-> Lens
GetFieldLevelEncryptionProfileResponse
GetFieldLevelEncryptionProfileResponse
(Maybe FieldLevelEncryptionProfile)
(Maybe FieldLevelEncryptionProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionProfileResponse' {Maybe FieldLevelEncryptionProfile
fieldLevelEncryptionProfile :: Maybe FieldLevelEncryptionProfile
$sel:fieldLevelEncryptionProfile:GetFieldLevelEncryptionProfileResponse' :: GetFieldLevelEncryptionProfileResponse
-> Maybe FieldLevelEncryptionProfile
fieldLevelEncryptionProfile} -> Maybe FieldLevelEncryptionProfile
fieldLevelEncryptionProfile) (\s :: GetFieldLevelEncryptionProfileResponse
s@GetFieldLevelEncryptionProfileResponse' {} Maybe FieldLevelEncryptionProfile
a -> GetFieldLevelEncryptionProfileResponse
s {$sel:fieldLevelEncryptionProfile:GetFieldLevelEncryptionProfileResponse' :: Maybe FieldLevelEncryptionProfile
fieldLevelEncryptionProfile = Maybe FieldLevelEncryptionProfile
a} :: GetFieldLevelEncryptionProfileResponse)
getFieldLevelEncryptionProfileResponse_httpStatus :: Lens.Lens' GetFieldLevelEncryptionProfileResponse Prelude.Int
getFieldLevelEncryptionProfileResponse_httpStatus :: (Int -> f Int)
-> GetFieldLevelEncryptionProfileResponse
-> f GetFieldLevelEncryptionProfileResponse
getFieldLevelEncryptionProfileResponse_httpStatus = (GetFieldLevelEncryptionProfileResponse -> Int)
-> (GetFieldLevelEncryptionProfileResponse
-> Int -> GetFieldLevelEncryptionProfileResponse)
-> Lens
GetFieldLevelEncryptionProfileResponse
GetFieldLevelEncryptionProfileResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFieldLevelEncryptionProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetFieldLevelEncryptionProfileResponse' :: GetFieldLevelEncryptionProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetFieldLevelEncryptionProfileResponse
s@GetFieldLevelEncryptionProfileResponse' {} Int
a -> GetFieldLevelEncryptionProfileResponse
s {$sel:httpStatus:GetFieldLevelEncryptionProfileResponse' :: Int
httpStatus = Int
a} :: GetFieldLevelEncryptionProfileResponse)
instance
Prelude.NFData
GetFieldLevelEncryptionProfileResponse