{-# 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.Glue.CreateSecurityConfiguration
(
CreateSecurityConfiguration (..),
newCreateSecurityConfiguration,
createSecurityConfiguration_name,
createSecurityConfiguration_encryptionConfiguration,
CreateSecurityConfigurationResponse (..),
newCreateSecurityConfigurationResponse,
createSecurityConfigurationResponse_name,
createSecurityConfigurationResponse_createdTimestamp,
createSecurityConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
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 CreateSecurityConfiguration = CreateSecurityConfiguration'
{
CreateSecurityConfiguration -> Text
name :: Prelude.Text,
CreateSecurityConfiguration -> EncryptionConfiguration
encryptionConfiguration :: EncryptionConfiguration
}
deriving (CreateSecurityConfiguration -> CreateSecurityConfiguration -> Bool
(CreateSecurityConfiguration
-> CreateSecurityConfiguration -> Bool)
-> (CreateSecurityConfiguration
-> CreateSecurityConfiguration -> Bool)
-> Eq CreateSecurityConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSecurityConfiguration -> CreateSecurityConfiguration -> Bool
$c/= :: CreateSecurityConfiguration -> CreateSecurityConfiguration -> Bool
== :: CreateSecurityConfiguration -> CreateSecurityConfiguration -> Bool
$c== :: CreateSecurityConfiguration -> CreateSecurityConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateSecurityConfiguration]
ReadPrec CreateSecurityConfiguration
Int -> ReadS CreateSecurityConfiguration
ReadS [CreateSecurityConfiguration]
(Int -> ReadS CreateSecurityConfiguration)
-> ReadS [CreateSecurityConfiguration]
-> ReadPrec CreateSecurityConfiguration
-> ReadPrec [CreateSecurityConfiguration]
-> Read CreateSecurityConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSecurityConfiguration]
$creadListPrec :: ReadPrec [CreateSecurityConfiguration]
readPrec :: ReadPrec CreateSecurityConfiguration
$creadPrec :: ReadPrec CreateSecurityConfiguration
readList :: ReadS [CreateSecurityConfiguration]
$creadList :: ReadS [CreateSecurityConfiguration]
readsPrec :: Int -> ReadS CreateSecurityConfiguration
$creadsPrec :: Int -> ReadS CreateSecurityConfiguration
Prelude.Read, Int -> CreateSecurityConfiguration -> ShowS
[CreateSecurityConfiguration] -> ShowS
CreateSecurityConfiguration -> String
(Int -> CreateSecurityConfiguration -> ShowS)
-> (CreateSecurityConfiguration -> String)
-> ([CreateSecurityConfiguration] -> ShowS)
-> Show CreateSecurityConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSecurityConfiguration] -> ShowS
$cshowList :: [CreateSecurityConfiguration] -> ShowS
show :: CreateSecurityConfiguration -> String
$cshow :: CreateSecurityConfiguration -> String
showsPrec :: Int -> CreateSecurityConfiguration -> ShowS
$cshowsPrec :: Int -> CreateSecurityConfiguration -> ShowS
Prelude.Show, (forall x.
CreateSecurityConfiguration -> Rep CreateSecurityConfiguration x)
-> (forall x.
Rep CreateSecurityConfiguration x -> CreateSecurityConfiguration)
-> Generic CreateSecurityConfiguration
forall x.
Rep CreateSecurityConfiguration x -> CreateSecurityConfiguration
forall x.
CreateSecurityConfiguration -> Rep CreateSecurityConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSecurityConfiguration x -> CreateSecurityConfiguration
$cfrom :: forall x.
CreateSecurityConfiguration -> Rep CreateSecurityConfiguration x
Prelude.Generic)
newCreateSecurityConfiguration ::
Prelude.Text ->
EncryptionConfiguration ->
CreateSecurityConfiguration
newCreateSecurityConfiguration :: Text -> EncryptionConfiguration -> CreateSecurityConfiguration
newCreateSecurityConfiguration
Text
pName_
EncryptionConfiguration
pEncryptionConfiguration_ =
CreateSecurityConfiguration' :: Text -> EncryptionConfiguration -> CreateSecurityConfiguration
CreateSecurityConfiguration'
{ $sel:name:CreateSecurityConfiguration' :: Text
name = Text
pName_,
$sel:encryptionConfiguration:CreateSecurityConfiguration' :: EncryptionConfiguration
encryptionConfiguration =
EncryptionConfiguration
pEncryptionConfiguration_
}
createSecurityConfiguration_name :: Lens.Lens' CreateSecurityConfiguration Prelude.Text
createSecurityConfiguration_name :: (Text -> f Text)
-> CreateSecurityConfiguration -> f CreateSecurityConfiguration
createSecurityConfiguration_name = (CreateSecurityConfiguration -> Text)
-> (CreateSecurityConfiguration
-> Text -> CreateSecurityConfiguration)
-> Lens
CreateSecurityConfiguration CreateSecurityConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityConfiguration' {Text
name :: Text
$sel:name:CreateSecurityConfiguration' :: CreateSecurityConfiguration -> Text
name} -> Text
name) (\s :: CreateSecurityConfiguration
s@CreateSecurityConfiguration' {} Text
a -> CreateSecurityConfiguration
s {$sel:name:CreateSecurityConfiguration' :: Text
name = Text
a} :: CreateSecurityConfiguration)
createSecurityConfiguration_encryptionConfiguration :: Lens.Lens' CreateSecurityConfiguration EncryptionConfiguration
createSecurityConfiguration_encryptionConfiguration :: (EncryptionConfiguration -> f EncryptionConfiguration)
-> CreateSecurityConfiguration -> f CreateSecurityConfiguration
createSecurityConfiguration_encryptionConfiguration = (CreateSecurityConfiguration -> EncryptionConfiguration)
-> (CreateSecurityConfiguration
-> EncryptionConfiguration -> CreateSecurityConfiguration)
-> Lens
CreateSecurityConfiguration
CreateSecurityConfiguration
EncryptionConfiguration
EncryptionConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityConfiguration' {EncryptionConfiguration
encryptionConfiguration :: EncryptionConfiguration
$sel:encryptionConfiguration:CreateSecurityConfiguration' :: CreateSecurityConfiguration -> EncryptionConfiguration
encryptionConfiguration} -> EncryptionConfiguration
encryptionConfiguration) (\s :: CreateSecurityConfiguration
s@CreateSecurityConfiguration' {} EncryptionConfiguration
a -> CreateSecurityConfiguration
s {$sel:encryptionConfiguration:CreateSecurityConfiguration' :: EncryptionConfiguration
encryptionConfiguration = EncryptionConfiguration
a} :: CreateSecurityConfiguration)
instance Core.AWSRequest CreateSecurityConfiguration where
type
AWSResponse CreateSecurityConfiguration =
CreateSecurityConfigurationResponse
request :: CreateSecurityConfiguration -> Request CreateSecurityConfiguration
request = Service
-> CreateSecurityConfiguration
-> Request CreateSecurityConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateSecurityConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSecurityConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateSecurityConfiguration))
-> Logger
-> Service
-> Proxy CreateSecurityConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSecurityConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe POSIX -> Int -> CreateSecurityConfigurationResponse
CreateSecurityConfigurationResponse'
(Maybe Text
-> Maybe POSIX -> Int -> CreateSecurityConfigurationResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe POSIX -> Int -> CreateSecurityConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
Either
String (Maybe POSIX -> Int -> CreateSecurityConfigurationResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> CreateSecurityConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedTimestamp")
Either String (Int -> CreateSecurityConfigurationResponse)
-> Either String Int
-> Either String CreateSecurityConfigurationResponse
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 CreateSecurityConfiguration
instance Prelude.NFData CreateSecurityConfiguration
instance Core.ToHeaders CreateSecurityConfiguration where
toHeaders :: CreateSecurityConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateSecurityConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSGlue.CreateSecurityConfiguration" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateSecurityConfiguration where
toJSON :: CreateSecurityConfiguration -> Value
toJSON CreateSecurityConfiguration' {Text
EncryptionConfiguration
encryptionConfiguration :: EncryptionConfiguration
name :: Text
$sel:encryptionConfiguration:CreateSecurityConfiguration' :: CreateSecurityConfiguration -> EncryptionConfiguration
$sel:name:CreateSecurityConfiguration' :: CreateSecurityConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"EncryptionConfiguration"
Text -> EncryptionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EncryptionConfiguration
encryptionConfiguration
)
]
)
instance Core.ToPath CreateSecurityConfiguration where
toPath :: CreateSecurityConfiguration -> ByteString
toPath = ByteString -> CreateSecurityConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateSecurityConfiguration where
toQuery :: CreateSecurityConfiguration -> QueryString
toQuery = QueryString -> CreateSecurityConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateSecurityConfigurationResponse = CreateSecurityConfigurationResponse'
{
CreateSecurityConfigurationResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CreateSecurityConfigurationResponse -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX,
CreateSecurityConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateSecurityConfigurationResponse
-> CreateSecurityConfigurationResponse -> Bool
(CreateSecurityConfigurationResponse
-> CreateSecurityConfigurationResponse -> Bool)
-> (CreateSecurityConfigurationResponse
-> CreateSecurityConfigurationResponse -> Bool)
-> Eq CreateSecurityConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSecurityConfigurationResponse
-> CreateSecurityConfigurationResponse -> Bool
$c/= :: CreateSecurityConfigurationResponse
-> CreateSecurityConfigurationResponse -> Bool
== :: CreateSecurityConfigurationResponse
-> CreateSecurityConfigurationResponse -> Bool
$c== :: CreateSecurityConfigurationResponse
-> CreateSecurityConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreateSecurityConfigurationResponse]
ReadPrec CreateSecurityConfigurationResponse
Int -> ReadS CreateSecurityConfigurationResponse
ReadS [CreateSecurityConfigurationResponse]
(Int -> ReadS CreateSecurityConfigurationResponse)
-> ReadS [CreateSecurityConfigurationResponse]
-> ReadPrec CreateSecurityConfigurationResponse
-> ReadPrec [CreateSecurityConfigurationResponse]
-> Read CreateSecurityConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSecurityConfigurationResponse]
$creadListPrec :: ReadPrec [CreateSecurityConfigurationResponse]
readPrec :: ReadPrec CreateSecurityConfigurationResponse
$creadPrec :: ReadPrec CreateSecurityConfigurationResponse
readList :: ReadS [CreateSecurityConfigurationResponse]
$creadList :: ReadS [CreateSecurityConfigurationResponse]
readsPrec :: Int -> ReadS CreateSecurityConfigurationResponse
$creadsPrec :: Int -> ReadS CreateSecurityConfigurationResponse
Prelude.Read, Int -> CreateSecurityConfigurationResponse -> ShowS
[CreateSecurityConfigurationResponse] -> ShowS
CreateSecurityConfigurationResponse -> String
(Int -> CreateSecurityConfigurationResponse -> ShowS)
-> (CreateSecurityConfigurationResponse -> String)
-> ([CreateSecurityConfigurationResponse] -> ShowS)
-> Show CreateSecurityConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSecurityConfigurationResponse] -> ShowS
$cshowList :: [CreateSecurityConfigurationResponse] -> ShowS
show :: CreateSecurityConfigurationResponse -> String
$cshow :: CreateSecurityConfigurationResponse -> String
showsPrec :: Int -> CreateSecurityConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreateSecurityConfigurationResponse -> ShowS
Prelude.Show, (forall x.
CreateSecurityConfigurationResponse
-> Rep CreateSecurityConfigurationResponse x)
-> (forall x.
Rep CreateSecurityConfigurationResponse x
-> CreateSecurityConfigurationResponse)
-> Generic CreateSecurityConfigurationResponse
forall x.
Rep CreateSecurityConfigurationResponse x
-> CreateSecurityConfigurationResponse
forall x.
CreateSecurityConfigurationResponse
-> Rep CreateSecurityConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSecurityConfigurationResponse x
-> CreateSecurityConfigurationResponse
$cfrom :: forall x.
CreateSecurityConfigurationResponse
-> Rep CreateSecurityConfigurationResponse x
Prelude.Generic)
newCreateSecurityConfigurationResponse ::
Prelude.Int ->
CreateSecurityConfigurationResponse
newCreateSecurityConfigurationResponse :: Int -> CreateSecurityConfigurationResponse
newCreateSecurityConfigurationResponse Int
pHttpStatus_ =
CreateSecurityConfigurationResponse' :: Maybe Text
-> Maybe POSIX -> Int -> CreateSecurityConfigurationResponse
CreateSecurityConfigurationResponse'
{ $sel:name:CreateSecurityConfigurationResponse' :: Maybe Text
name =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:CreateSecurityConfigurationResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateSecurityConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createSecurityConfigurationResponse_name :: Lens.Lens' CreateSecurityConfigurationResponse (Prelude.Maybe Prelude.Text)
createSecurityConfigurationResponse_name :: (Maybe Text -> f (Maybe Text))
-> CreateSecurityConfigurationResponse
-> f CreateSecurityConfigurationResponse
createSecurityConfigurationResponse_name = (CreateSecurityConfigurationResponse -> Maybe Text)
-> (CreateSecurityConfigurationResponse
-> Maybe Text -> CreateSecurityConfigurationResponse)
-> Lens
CreateSecurityConfigurationResponse
CreateSecurityConfigurationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityConfigurationResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateSecurityConfigurationResponse' :: CreateSecurityConfigurationResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateSecurityConfigurationResponse
s@CreateSecurityConfigurationResponse' {} Maybe Text
a -> CreateSecurityConfigurationResponse
s {$sel:name:CreateSecurityConfigurationResponse' :: Maybe Text
name = Maybe Text
a} :: CreateSecurityConfigurationResponse)
createSecurityConfigurationResponse_createdTimestamp :: Lens.Lens' CreateSecurityConfigurationResponse (Prelude.Maybe Prelude.UTCTime)
createSecurityConfigurationResponse_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateSecurityConfigurationResponse
-> f CreateSecurityConfigurationResponse
createSecurityConfigurationResponse_createdTimestamp = (CreateSecurityConfigurationResponse -> Maybe POSIX)
-> (CreateSecurityConfigurationResponse
-> Maybe POSIX -> CreateSecurityConfigurationResponse)
-> Lens
CreateSecurityConfigurationResponse
CreateSecurityConfigurationResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityConfigurationResponse' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:CreateSecurityConfigurationResponse' :: CreateSecurityConfigurationResponse -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: CreateSecurityConfigurationResponse
s@CreateSecurityConfigurationResponse' {} Maybe POSIX
a -> CreateSecurityConfigurationResponse
s {$sel:createdTimestamp:CreateSecurityConfigurationResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: CreateSecurityConfigurationResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> CreateSecurityConfigurationResponse
-> f CreateSecurityConfigurationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateSecurityConfigurationResponse
-> f CreateSecurityConfigurationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
createSecurityConfigurationResponse_httpStatus :: Lens.Lens' CreateSecurityConfigurationResponse Prelude.Int
createSecurityConfigurationResponse_httpStatus :: (Int -> f Int)
-> CreateSecurityConfigurationResponse
-> f CreateSecurityConfigurationResponse
createSecurityConfigurationResponse_httpStatus = (CreateSecurityConfigurationResponse -> Int)
-> (CreateSecurityConfigurationResponse
-> Int -> CreateSecurityConfigurationResponse)
-> Lens
CreateSecurityConfigurationResponse
CreateSecurityConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSecurityConfigurationResponse' :: CreateSecurityConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateSecurityConfigurationResponse
s@CreateSecurityConfigurationResponse' {} Int
a -> CreateSecurityConfigurationResponse
s {$sel:httpStatus:CreateSecurityConfigurationResponse' :: Int
httpStatus = Int
a} :: CreateSecurityConfigurationResponse)
instance
Prelude.NFData
CreateSecurityConfigurationResponse