{-# 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.GetSecurityConfiguration
(
GetSecurityConfiguration (..),
newGetSecurityConfiguration,
getSecurityConfiguration_name,
GetSecurityConfigurationResponse (..),
newGetSecurityConfigurationResponse,
getSecurityConfigurationResponse_securityConfiguration,
getSecurityConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetSecurityConfiguration = GetSecurityConfiguration'
{
GetSecurityConfiguration -> Text
name :: Prelude.Text
}
deriving (GetSecurityConfiguration -> GetSecurityConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSecurityConfiguration -> GetSecurityConfiguration -> Bool
$c/= :: GetSecurityConfiguration -> GetSecurityConfiguration -> Bool
== :: GetSecurityConfiguration -> GetSecurityConfiguration -> Bool
$c== :: GetSecurityConfiguration -> GetSecurityConfiguration -> Bool
Prelude.Eq, ReadPrec [GetSecurityConfiguration]
ReadPrec GetSecurityConfiguration
Int -> ReadS GetSecurityConfiguration
ReadS [GetSecurityConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSecurityConfiguration]
$creadListPrec :: ReadPrec [GetSecurityConfiguration]
readPrec :: ReadPrec GetSecurityConfiguration
$creadPrec :: ReadPrec GetSecurityConfiguration
readList :: ReadS [GetSecurityConfiguration]
$creadList :: ReadS [GetSecurityConfiguration]
readsPrec :: Int -> ReadS GetSecurityConfiguration
$creadsPrec :: Int -> ReadS GetSecurityConfiguration
Prelude.Read, Int -> GetSecurityConfiguration -> ShowS
[GetSecurityConfiguration] -> ShowS
GetSecurityConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSecurityConfiguration] -> ShowS
$cshowList :: [GetSecurityConfiguration] -> ShowS
show :: GetSecurityConfiguration -> String
$cshow :: GetSecurityConfiguration -> String
showsPrec :: Int -> GetSecurityConfiguration -> ShowS
$cshowsPrec :: Int -> GetSecurityConfiguration -> ShowS
Prelude.Show, forall x.
Rep GetSecurityConfiguration x -> GetSecurityConfiguration
forall x.
GetSecurityConfiguration -> Rep GetSecurityConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSecurityConfiguration x -> GetSecurityConfiguration
$cfrom :: forall x.
GetSecurityConfiguration -> Rep GetSecurityConfiguration x
Prelude.Generic)
newGetSecurityConfiguration ::
Prelude.Text ->
GetSecurityConfiguration
newGetSecurityConfiguration :: Text -> GetSecurityConfiguration
newGetSecurityConfiguration Text
pName_ =
GetSecurityConfiguration' {$sel:name:GetSecurityConfiguration' :: Text
name = Text
pName_}
getSecurityConfiguration_name :: Lens.Lens' GetSecurityConfiguration Prelude.Text
getSecurityConfiguration_name :: Lens' GetSecurityConfiguration Text
getSecurityConfiguration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSecurityConfiguration' {Text
name :: Text
$sel:name:GetSecurityConfiguration' :: GetSecurityConfiguration -> Text
name} -> Text
name) (\s :: GetSecurityConfiguration
s@GetSecurityConfiguration' {} Text
a -> GetSecurityConfiguration
s {$sel:name:GetSecurityConfiguration' :: Text
name = Text
a} :: GetSecurityConfiguration)
instance Core.AWSRequest GetSecurityConfiguration where
type
AWSResponse GetSecurityConfiguration =
GetSecurityConfigurationResponse
request :: (Service -> Service)
-> GetSecurityConfiguration -> Request GetSecurityConfiguration
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetSecurityConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSecurityConfiguration)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe SecurityConfiguration
-> Int -> GetSecurityConfigurationResponse
GetSecurityConfigurationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SecurityConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetSecurityConfiguration where
hashWithSalt :: Int -> GetSecurityConfiguration -> Int
hashWithSalt Int
_salt GetSecurityConfiguration' {Text
name :: Text
$sel:name:GetSecurityConfiguration' :: GetSecurityConfiguration -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData GetSecurityConfiguration where
rnf :: GetSecurityConfiguration -> ()
rnf GetSecurityConfiguration' {Text
name :: Text
$sel:name:GetSecurityConfiguration' :: GetSecurityConfiguration -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders GetSecurityConfiguration where
toHeaders :: GetSecurityConfiguration -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSGlue.GetSecurityConfiguration" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetSecurityConfiguration where
toJSON :: GetSecurityConfiguration -> Value
toJSON GetSecurityConfiguration' {Text
name :: Text
$sel:name:GetSecurityConfiguration' :: GetSecurityConfiguration -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)]
)
instance Data.ToPath GetSecurityConfiguration where
toPath :: GetSecurityConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetSecurityConfiguration where
toQuery :: GetSecurityConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetSecurityConfigurationResponse = GetSecurityConfigurationResponse'
{
GetSecurityConfigurationResponse -> Maybe SecurityConfiguration
securityConfiguration :: Prelude.Maybe SecurityConfiguration,
GetSecurityConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSecurityConfigurationResponse
-> GetSecurityConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSecurityConfigurationResponse
-> GetSecurityConfigurationResponse -> Bool
$c/= :: GetSecurityConfigurationResponse
-> GetSecurityConfigurationResponse -> Bool
== :: GetSecurityConfigurationResponse
-> GetSecurityConfigurationResponse -> Bool
$c== :: GetSecurityConfigurationResponse
-> GetSecurityConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetSecurityConfigurationResponse]
ReadPrec GetSecurityConfigurationResponse
Int -> ReadS GetSecurityConfigurationResponse
ReadS [GetSecurityConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSecurityConfigurationResponse]
$creadListPrec :: ReadPrec [GetSecurityConfigurationResponse]
readPrec :: ReadPrec GetSecurityConfigurationResponse
$creadPrec :: ReadPrec GetSecurityConfigurationResponse
readList :: ReadS [GetSecurityConfigurationResponse]
$creadList :: ReadS [GetSecurityConfigurationResponse]
readsPrec :: Int -> ReadS GetSecurityConfigurationResponse
$creadsPrec :: Int -> ReadS GetSecurityConfigurationResponse
Prelude.Read, Int -> GetSecurityConfigurationResponse -> ShowS
[GetSecurityConfigurationResponse] -> ShowS
GetSecurityConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSecurityConfigurationResponse] -> ShowS
$cshowList :: [GetSecurityConfigurationResponse] -> ShowS
show :: GetSecurityConfigurationResponse -> String
$cshow :: GetSecurityConfigurationResponse -> String
showsPrec :: Int -> GetSecurityConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetSecurityConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep GetSecurityConfigurationResponse x
-> GetSecurityConfigurationResponse
forall x.
GetSecurityConfigurationResponse
-> Rep GetSecurityConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSecurityConfigurationResponse x
-> GetSecurityConfigurationResponse
$cfrom :: forall x.
GetSecurityConfigurationResponse
-> Rep GetSecurityConfigurationResponse x
Prelude.Generic)
newGetSecurityConfigurationResponse ::
Prelude.Int ->
GetSecurityConfigurationResponse
newGetSecurityConfigurationResponse :: Int -> GetSecurityConfigurationResponse
newGetSecurityConfigurationResponse Int
pHttpStatus_ =
GetSecurityConfigurationResponse'
{ $sel:securityConfiguration:GetSecurityConfigurationResponse' :: Maybe SecurityConfiguration
securityConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSecurityConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSecurityConfigurationResponse_securityConfiguration :: Lens.Lens' GetSecurityConfigurationResponse (Prelude.Maybe SecurityConfiguration)
getSecurityConfigurationResponse_securityConfiguration :: Lens'
GetSecurityConfigurationResponse (Maybe SecurityConfiguration)
getSecurityConfigurationResponse_securityConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSecurityConfigurationResponse' {Maybe SecurityConfiguration
securityConfiguration :: Maybe SecurityConfiguration
$sel:securityConfiguration:GetSecurityConfigurationResponse' :: GetSecurityConfigurationResponse -> Maybe SecurityConfiguration
securityConfiguration} -> Maybe SecurityConfiguration
securityConfiguration) (\s :: GetSecurityConfigurationResponse
s@GetSecurityConfigurationResponse' {} Maybe SecurityConfiguration
a -> GetSecurityConfigurationResponse
s {$sel:securityConfiguration:GetSecurityConfigurationResponse' :: Maybe SecurityConfiguration
securityConfiguration = Maybe SecurityConfiguration
a} :: GetSecurityConfigurationResponse)
getSecurityConfigurationResponse_httpStatus :: Lens.Lens' GetSecurityConfigurationResponse Prelude.Int
getSecurityConfigurationResponse_httpStatus :: Lens' GetSecurityConfigurationResponse Int
getSecurityConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSecurityConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSecurityConfigurationResponse' :: GetSecurityConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSecurityConfigurationResponse
s@GetSecurityConfigurationResponse' {} Int
a -> GetSecurityConfigurationResponse
s {$sel:httpStatus:GetSecurityConfigurationResponse' :: Int
httpStatus = Int
a} :: GetSecurityConfigurationResponse)
instance
Prelude.NFData
GetSecurityConfigurationResponse
where
rnf :: GetSecurityConfigurationResponse -> ()
rnf GetSecurityConfigurationResponse' {Int
Maybe SecurityConfiguration
httpStatus :: Int
securityConfiguration :: Maybe SecurityConfiguration
$sel:httpStatus:GetSecurityConfigurationResponse' :: GetSecurityConfigurationResponse -> Int
$sel:securityConfiguration:GetSecurityConfigurationResponse' :: GetSecurityConfigurationResponse -> Maybe SecurityConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SecurityConfiguration
securityConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus