{-# 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.Transfer.DescribeSecurityPolicy
(
DescribeSecurityPolicy (..),
newDescribeSecurityPolicy,
describeSecurityPolicy_securityPolicyName,
DescribeSecurityPolicyResponse (..),
newDescribeSecurityPolicyResponse,
describeSecurityPolicyResponse_httpStatus,
describeSecurityPolicyResponse_securityPolicy,
)
where
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
import Amazonka.Transfer.Types
data DescribeSecurityPolicy = DescribeSecurityPolicy'
{
DescribeSecurityPolicy -> Text
securityPolicyName :: Prelude.Text
}
deriving (DescribeSecurityPolicy -> DescribeSecurityPolicy -> Bool
(DescribeSecurityPolicy -> DescribeSecurityPolicy -> Bool)
-> (DescribeSecurityPolicy -> DescribeSecurityPolicy -> Bool)
-> Eq DescribeSecurityPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSecurityPolicy -> DescribeSecurityPolicy -> Bool
$c/= :: DescribeSecurityPolicy -> DescribeSecurityPolicy -> Bool
== :: DescribeSecurityPolicy -> DescribeSecurityPolicy -> Bool
$c== :: DescribeSecurityPolicy -> DescribeSecurityPolicy -> Bool
Prelude.Eq, ReadPrec [DescribeSecurityPolicy]
ReadPrec DescribeSecurityPolicy
Int -> ReadS DescribeSecurityPolicy
ReadS [DescribeSecurityPolicy]
(Int -> ReadS DescribeSecurityPolicy)
-> ReadS [DescribeSecurityPolicy]
-> ReadPrec DescribeSecurityPolicy
-> ReadPrec [DescribeSecurityPolicy]
-> Read DescribeSecurityPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSecurityPolicy]
$creadListPrec :: ReadPrec [DescribeSecurityPolicy]
readPrec :: ReadPrec DescribeSecurityPolicy
$creadPrec :: ReadPrec DescribeSecurityPolicy
readList :: ReadS [DescribeSecurityPolicy]
$creadList :: ReadS [DescribeSecurityPolicy]
readsPrec :: Int -> ReadS DescribeSecurityPolicy
$creadsPrec :: Int -> ReadS DescribeSecurityPolicy
Prelude.Read, Int -> DescribeSecurityPolicy -> ShowS
[DescribeSecurityPolicy] -> ShowS
DescribeSecurityPolicy -> String
(Int -> DescribeSecurityPolicy -> ShowS)
-> (DescribeSecurityPolicy -> String)
-> ([DescribeSecurityPolicy] -> ShowS)
-> Show DescribeSecurityPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSecurityPolicy] -> ShowS
$cshowList :: [DescribeSecurityPolicy] -> ShowS
show :: DescribeSecurityPolicy -> String
$cshow :: DescribeSecurityPolicy -> String
showsPrec :: Int -> DescribeSecurityPolicy -> ShowS
$cshowsPrec :: Int -> DescribeSecurityPolicy -> ShowS
Prelude.Show, (forall x. DescribeSecurityPolicy -> Rep DescribeSecurityPolicy x)
-> (forall x.
Rep DescribeSecurityPolicy x -> DescribeSecurityPolicy)
-> Generic DescribeSecurityPolicy
forall x. Rep DescribeSecurityPolicy x -> DescribeSecurityPolicy
forall x. DescribeSecurityPolicy -> Rep DescribeSecurityPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeSecurityPolicy x -> DescribeSecurityPolicy
$cfrom :: forall x. DescribeSecurityPolicy -> Rep DescribeSecurityPolicy x
Prelude.Generic)
newDescribeSecurityPolicy ::
Prelude.Text ->
DescribeSecurityPolicy
newDescribeSecurityPolicy :: Text -> DescribeSecurityPolicy
newDescribeSecurityPolicy Text
pSecurityPolicyName_ =
DescribeSecurityPolicy' :: Text -> DescribeSecurityPolicy
DescribeSecurityPolicy'
{ $sel:securityPolicyName:DescribeSecurityPolicy' :: Text
securityPolicyName =
Text
pSecurityPolicyName_
}
describeSecurityPolicy_securityPolicyName :: Lens.Lens' DescribeSecurityPolicy Prelude.Text
describeSecurityPolicy_securityPolicyName :: (Text -> f Text)
-> DescribeSecurityPolicy -> f DescribeSecurityPolicy
describeSecurityPolicy_securityPolicyName = (DescribeSecurityPolicy -> Text)
-> (DescribeSecurityPolicy -> Text -> DescribeSecurityPolicy)
-> Lens DescribeSecurityPolicy DescribeSecurityPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityPolicy' {Text
securityPolicyName :: Text
$sel:securityPolicyName:DescribeSecurityPolicy' :: DescribeSecurityPolicy -> Text
securityPolicyName} -> Text
securityPolicyName) (\s :: DescribeSecurityPolicy
s@DescribeSecurityPolicy' {} Text
a -> DescribeSecurityPolicy
s {$sel:securityPolicyName:DescribeSecurityPolicy' :: Text
securityPolicyName = Text
a} :: DescribeSecurityPolicy)
instance Core.AWSRequest DescribeSecurityPolicy where
type
AWSResponse DescribeSecurityPolicy =
DescribeSecurityPolicyResponse
request :: DescribeSecurityPolicy -> Request DescribeSecurityPolicy
request = Service -> DescribeSecurityPolicy -> Request DescribeSecurityPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeSecurityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeSecurityPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeSecurityPolicy))
-> Logger
-> Service
-> Proxy DescribeSecurityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeSecurityPolicy)))
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 ->
Int -> DescribedSecurityPolicy -> DescribeSecurityPolicyResponse
DescribeSecurityPolicyResponse'
(Int -> DescribedSecurityPolicy -> DescribeSecurityPolicyResponse)
-> Either String Int
-> Either
String (DescribedSecurityPolicy -> DescribeSecurityPolicyResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String (DescribedSecurityPolicy -> DescribeSecurityPolicyResponse)
-> Either String DescribedSecurityPolicy
-> Either String DescribeSecurityPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DescribedSecurityPolicy
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"SecurityPolicy")
)
instance Prelude.Hashable DescribeSecurityPolicy
instance Prelude.NFData DescribeSecurityPolicy
instance Core.ToHeaders DescribeSecurityPolicy where
toHeaders :: DescribeSecurityPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeSecurityPolicy -> 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
"TransferService.DescribeSecurityPolicy" ::
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 DescribeSecurityPolicy where
toJSON :: DescribeSecurityPolicy -> Value
toJSON DescribeSecurityPolicy' {Text
securityPolicyName :: Text
$sel:securityPolicyName:DescribeSecurityPolicy' :: DescribeSecurityPolicy -> 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
"SecurityPolicyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
securityPolicyName)
]
)
instance Core.ToPath DescribeSecurityPolicy where
toPath :: DescribeSecurityPolicy -> ByteString
toPath = ByteString -> DescribeSecurityPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeSecurityPolicy where
toQuery :: DescribeSecurityPolicy -> QueryString
toQuery = QueryString -> DescribeSecurityPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeSecurityPolicyResponse = DescribeSecurityPolicyResponse'
{
DescribeSecurityPolicyResponse -> Int
httpStatus :: Prelude.Int,
DescribeSecurityPolicyResponse -> DescribedSecurityPolicy
securityPolicy :: DescribedSecurityPolicy
}
deriving (DescribeSecurityPolicyResponse
-> DescribeSecurityPolicyResponse -> Bool
(DescribeSecurityPolicyResponse
-> DescribeSecurityPolicyResponse -> Bool)
-> (DescribeSecurityPolicyResponse
-> DescribeSecurityPolicyResponse -> Bool)
-> Eq DescribeSecurityPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSecurityPolicyResponse
-> DescribeSecurityPolicyResponse -> Bool
$c/= :: DescribeSecurityPolicyResponse
-> DescribeSecurityPolicyResponse -> Bool
== :: DescribeSecurityPolicyResponse
-> DescribeSecurityPolicyResponse -> Bool
$c== :: DescribeSecurityPolicyResponse
-> DescribeSecurityPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DescribeSecurityPolicyResponse]
ReadPrec DescribeSecurityPolicyResponse
Int -> ReadS DescribeSecurityPolicyResponse
ReadS [DescribeSecurityPolicyResponse]
(Int -> ReadS DescribeSecurityPolicyResponse)
-> ReadS [DescribeSecurityPolicyResponse]
-> ReadPrec DescribeSecurityPolicyResponse
-> ReadPrec [DescribeSecurityPolicyResponse]
-> Read DescribeSecurityPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSecurityPolicyResponse]
$creadListPrec :: ReadPrec [DescribeSecurityPolicyResponse]
readPrec :: ReadPrec DescribeSecurityPolicyResponse
$creadPrec :: ReadPrec DescribeSecurityPolicyResponse
readList :: ReadS [DescribeSecurityPolicyResponse]
$creadList :: ReadS [DescribeSecurityPolicyResponse]
readsPrec :: Int -> ReadS DescribeSecurityPolicyResponse
$creadsPrec :: Int -> ReadS DescribeSecurityPolicyResponse
Prelude.Read, Int -> DescribeSecurityPolicyResponse -> ShowS
[DescribeSecurityPolicyResponse] -> ShowS
DescribeSecurityPolicyResponse -> String
(Int -> DescribeSecurityPolicyResponse -> ShowS)
-> (DescribeSecurityPolicyResponse -> String)
-> ([DescribeSecurityPolicyResponse] -> ShowS)
-> Show DescribeSecurityPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSecurityPolicyResponse] -> ShowS
$cshowList :: [DescribeSecurityPolicyResponse] -> ShowS
show :: DescribeSecurityPolicyResponse -> String
$cshow :: DescribeSecurityPolicyResponse -> String
showsPrec :: Int -> DescribeSecurityPolicyResponse -> ShowS
$cshowsPrec :: Int -> DescribeSecurityPolicyResponse -> ShowS
Prelude.Show, (forall x.
DescribeSecurityPolicyResponse
-> Rep DescribeSecurityPolicyResponse x)
-> (forall x.
Rep DescribeSecurityPolicyResponse x
-> DescribeSecurityPolicyResponse)
-> Generic DescribeSecurityPolicyResponse
forall x.
Rep DescribeSecurityPolicyResponse x
-> DescribeSecurityPolicyResponse
forall x.
DescribeSecurityPolicyResponse
-> Rep DescribeSecurityPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSecurityPolicyResponse x
-> DescribeSecurityPolicyResponse
$cfrom :: forall x.
DescribeSecurityPolicyResponse
-> Rep DescribeSecurityPolicyResponse x
Prelude.Generic)
newDescribeSecurityPolicyResponse ::
Prelude.Int ->
DescribedSecurityPolicy ->
DescribeSecurityPolicyResponse
newDescribeSecurityPolicyResponse :: Int -> DescribedSecurityPolicy -> DescribeSecurityPolicyResponse
newDescribeSecurityPolicyResponse
Int
pHttpStatus_
DescribedSecurityPolicy
pSecurityPolicy_ =
DescribeSecurityPolicyResponse' :: Int -> DescribedSecurityPolicy -> DescribeSecurityPolicyResponse
DescribeSecurityPolicyResponse'
{ $sel:httpStatus:DescribeSecurityPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:securityPolicy:DescribeSecurityPolicyResponse' :: DescribedSecurityPolicy
securityPolicy = DescribedSecurityPolicy
pSecurityPolicy_
}
describeSecurityPolicyResponse_httpStatus :: Lens.Lens' DescribeSecurityPolicyResponse Prelude.Int
describeSecurityPolicyResponse_httpStatus :: (Int -> f Int)
-> DescribeSecurityPolicyResponse
-> f DescribeSecurityPolicyResponse
describeSecurityPolicyResponse_httpStatus = (DescribeSecurityPolicyResponse -> Int)
-> (DescribeSecurityPolicyResponse
-> Int -> DescribeSecurityPolicyResponse)
-> Lens
DescribeSecurityPolicyResponse
DescribeSecurityPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeSecurityPolicyResponse' :: DescribeSecurityPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeSecurityPolicyResponse
s@DescribeSecurityPolicyResponse' {} Int
a -> DescribeSecurityPolicyResponse
s {$sel:httpStatus:DescribeSecurityPolicyResponse' :: Int
httpStatus = Int
a} :: DescribeSecurityPolicyResponse)
describeSecurityPolicyResponse_securityPolicy :: Lens.Lens' DescribeSecurityPolicyResponse DescribedSecurityPolicy
describeSecurityPolicyResponse_securityPolicy :: (DescribedSecurityPolicy -> f DescribedSecurityPolicy)
-> DescribeSecurityPolicyResponse
-> f DescribeSecurityPolicyResponse
describeSecurityPolicyResponse_securityPolicy = (DescribeSecurityPolicyResponse -> DescribedSecurityPolicy)
-> (DescribeSecurityPolicyResponse
-> DescribedSecurityPolicy -> DescribeSecurityPolicyResponse)
-> Lens
DescribeSecurityPolicyResponse
DescribeSecurityPolicyResponse
DescribedSecurityPolicy
DescribedSecurityPolicy
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityPolicyResponse' {DescribedSecurityPolicy
securityPolicy :: DescribedSecurityPolicy
$sel:securityPolicy:DescribeSecurityPolicyResponse' :: DescribeSecurityPolicyResponse -> DescribedSecurityPolicy
securityPolicy} -> DescribedSecurityPolicy
securityPolicy) (\s :: DescribeSecurityPolicyResponse
s@DescribeSecurityPolicyResponse' {} DescribedSecurityPolicy
a -> DescribeSecurityPolicyResponse
s {$sel:securityPolicy:DescribeSecurityPolicyResponse' :: DescribedSecurityPolicy
securityPolicy = DescribedSecurityPolicy
a} :: DescribeSecurityPolicyResponse)
instance
Prelude.NFData
DescribeSecurityPolicyResponse