{-# 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.FMS.GetComplianceDetail
(
GetComplianceDetail (..),
newGetComplianceDetail,
getComplianceDetail_policyId,
getComplianceDetail_memberAccount,
GetComplianceDetailResponse (..),
newGetComplianceDetailResponse,
getComplianceDetailResponse_policyComplianceDetail,
getComplianceDetailResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.FMS.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 GetComplianceDetail = GetComplianceDetail'
{
GetComplianceDetail -> Text
policyId :: Prelude.Text,
GetComplianceDetail -> Text
memberAccount :: Prelude.Text
}
deriving (GetComplianceDetail -> GetComplianceDetail -> Bool
(GetComplianceDetail -> GetComplianceDetail -> Bool)
-> (GetComplianceDetail -> GetComplianceDetail -> Bool)
-> Eq GetComplianceDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetComplianceDetail -> GetComplianceDetail -> Bool
$c/= :: GetComplianceDetail -> GetComplianceDetail -> Bool
== :: GetComplianceDetail -> GetComplianceDetail -> Bool
$c== :: GetComplianceDetail -> GetComplianceDetail -> Bool
Prelude.Eq, ReadPrec [GetComplianceDetail]
ReadPrec GetComplianceDetail
Int -> ReadS GetComplianceDetail
ReadS [GetComplianceDetail]
(Int -> ReadS GetComplianceDetail)
-> ReadS [GetComplianceDetail]
-> ReadPrec GetComplianceDetail
-> ReadPrec [GetComplianceDetail]
-> Read GetComplianceDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetComplianceDetail]
$creadListPrec :: ReadPrec [GetComplianceDetail]
readPrec :: ReadPrec GetComplianceDetail
$creadPrec :: ReadPrec GetComplianceDetail
readList :: ReadS [GetComplianceDetail]
$creadList :: ReadS [GetComplianceDetail]
readsPrec :: Int -> ReadS GetComplianceDetail
$creadsPrec :: Int -> ReadS GetComplianceDetail
Prelude.Read, Int -> GetComplianceDetail -> ShowS
[GetComplianceDetail] -> ShowS
GetComplianceDetail -> String
(Int -> GetComplianceDetail -> ShowS)
-> (GetComplianceDetail -> String)
-> ([GetComplianceDetail] -> ShowS)
-> Show GetComplianceDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetComplianceDetail] -> ShowS
$cshowList :: [GetComplianceDetail] -> ShowS
show :: GetComplianceDetail -> String
$cshow :: GetComplianceDetail -> String
showsPrec :: Int -> GetComplianceDetail -> ShowS
$cshowsPrec :: Int -> GetComplianceDetail -> ShowS
Prelude.Show, (forall x. GetComplianceDetail -> Rep GetComplianceDetail x)
-> (forall x. Rep GetComplianceDetail x -> GetComplianceDetail)
-> Generic GetComplianceDetail
forall x. Rep GetComplianceDetail x -> GetComplianceDetail
forall x. GetComplianceDetail -> Rep GetComplianceDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetComplianceDetail x -> GetComplianceDetail
$cfrom :: forall x. GetComplianceDetail -> Rep GetComplianceDetail x
Prelude.Generic)
newGetComplianceDetail ::
Prelude.Text ->
Prelude.Text ->
GetComplianceDetail
newGetComplianceDetail :: Text -> Text -> GetComplianceDetail
newGetComplianceDetail Text
pPolicyId_ Text
pMemberAccount_ =
GetComplianceDetail' :: Text -> Text -> GetComplianceDetail
GetComplianceDetail'
{ $sel:policyId:GetComplianceDetail' :: Text
policyId = Text
pPolicyId_,
$sel:memberAccount:GetComplianceDetail' :: Text
memberAccount = Text
pMemberAccount_
}
getComplianceDetail_policyId :: Lens.Lens' GetComplianceDetail Prelude.Text
getComplianceDetail_policyId :: (Text -> f Text) -> GetComplianceDetail -> f GetComplianceDetail
getComplianceDetail_policyId = (GetComplianceDetail -> Text)
-> (GetComplianceDetail -> Text -> GetComplianceDetail)
-> Lens GetComplianceDetail GetComplianceDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceDetail' {Text
policyId :: Text
$sel:policyId:GetComplianceDetail' :: GetComplianceDetail -> Text
policyId} -> Text
policyId) (\s :: GetComplianceDetail
s@GetComplianceDetail' {} Text
a -> GetComplianceDetail
s {$sel:policyId:GetComplianceDetail' :: Text
policyId = Text
a} :: GetComplianceDetail)
getComplianceDetail_memberAccount :: Lens.Lens' GetComplianceDetail Prelude.Text
getComplianceDetail_memberAccount :: (Text -> f Text) -> GetComplianceDetail -> f GetComplianceDetail
getComplianceDetail_memberAccount = (GetComplianceDetail -> Text)
-> (GetComplianceDetail -> Text -> GetComplianceDetail)
-> Lens GetComplianceDetail GetComplianceDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceDetail' {Text
memberAccount :: Text
$sel:memberAccount:GetComplianceDetail' :: GetComplianceDetail -> Text
memberAccount} -> Text
memberAccount) (\s :: GetComplianceDetail
s@GetComplianceDetail' {} Text
a -> GetComplianceDetail
s {$sel:memberAccount:GetComplianceDetail' :: Text
memberAccount = Text
a} :: GetComplianceDetail)
instance Core.AWSRequest GetComplianceDetail where
type
AWSResponse GetComplianceDetail =
GetComplianceDetailResponse
request :: GetComplianceDetail -> Request GetComplianceDetail
request = Service -> GetComplianceDetail -> Request GetComplianceDetail
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetComplianceDetail
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetComplianceDetail)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetComplianceDetail))
-> Logger
-> Service
-> Proxy GetComplianceDetail
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetComplianceDetail)))
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 PolicyComplianceDetail -> Int -> GetComplianceDetailResponse
GetComplianceDetailResponse'
(Maybe PolicyComplianceDetail
-> Int -> GetComplianceDetailResponse)
-> Either String (Maybe PolicyComplianceDetail)
-> Either String (Int -> GetComplianceDetailResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe PolicyComplianceDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PolicyComplianceDetail")
Either String (Int -> GetComplianceDetailResponse)
-> Either String Int -> Either String GetComplianceDetailResponse
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 GetComplianceDetail
instance Prelude.NFData GetComplianceDetail
instance Core.ToHeaders GetComplianceDetail where
toHeaders :: GetComplianceDetail -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetComplianceDetail -> 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
"AWSFMS_20180101.GetComplianceDetail" ::
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 GetComplianceDetail where
toJSON :: GetComplianceDetail -> Value
toJSON GetComplianceDetail' {Text
memberAccount :: Text
policyId :: Text
$sel:memberAccount:GetComplianceDetail' :: GetComplianceDetail -> Text
$sel:policyId:GetComplianceDetail' :: GetComplianceDetail -> 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
"PolicyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
policyId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"MemberAccount" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
memberAccount)
]
)
instance Core.ToPath GetComplianceDetail where
toPath :: GetComplianceDetail -> ByteString
toPath = ByteString -> GetComplianceDetail -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetComplianceDetail where
toQuery :: GetComplianceDetail -> QueryString
toQuery = QueryString -> GetComplianceDetail -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetComplianceDetailResponse = GetComplianceDetailResponse'
{
GetComplianceDetailResponse -> Maybe PolicyComplianceDetail
policyComplianceDetail :: Prelude.Maybe PolicyComplianceDetail,
GetComplianceDetailResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetComplianceDetailResponse -> GetComplianceDetailResponse -> Bool
(GetComplianceDetailResponse
-> GetComplianceDetailResponse -> Bool)
-> (GetComplianceDetailResponse
-> GetComplianceDetailResponse -> Bool)
-> Eq GetComplianceDetailResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetComplianceDetailResponse -> GetComplianceDetailResponse -> Bool
$c/= :: GetComplianceDetailResponse -> GetComplianceDetailResponse -> Bool
== :: GetComplianceDetailResponse -> GetComplianceDetailResponse -> Bool
$c== :: GetComplianceDetailResponse -> GetComplianceDetailResponse -> Bool
Prelude.Eq, ReadPrec [GetComplianceDetailResponse]
ReadPrec GetComplianceDetailResponse
Int -> ReadS GetComplianceDetailResponse
ReadS [GetComplianceDetailResponse]
(Int -> ReadS GetComplianceDetailResponse)
-> ReadS [GetComplianceDetailResponse]
-> ReadPrec GetComplianceDetailResponse
-> ReadPrec [GetComplianceDetailResponse]
-> Read GetComplianceDetailResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetComplianceDetailResponse]
$creadListPrec :: ReadPrec [GetComplianceDetailResponse]
readPrec :: ReadPrec GetComplianceDetailResponse
$creadPrec :: ReadPrec GetComplianceDetailResponse
readList :: ReadS [GetComplianceDetailResponse]
$creadList :: ReadS [GetComplianceDetailResponse]
readsPrec :: Int -> ReadS GetComplianceDetailResponse
$creadsPrec :: Int -> ReadS GetComplianceDetailResponse
Prelude.Read, Int -> GetComplianceDetailResponse -> ShowS
[GetComplianceDetailResponse] -> ShowS
GetComplianceDetailResponse -> String
(Int -> GetComplianceDetailResponse -> ShowS)
-> (GetComplianceDetailResponse -> String)
-> ([GetComplianceDetailResponse] -> ShowS)
-> Show GetComplianceDetailResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetComplianceDetailResponse] -> ShowS
$cshowList :: [GetComplianceDetailResponse] -> ShowS
show :: GetComplianceDetailResponse -> String
$cshow :: GetComplianceDetailResponse -> String
showsPrec :: Int -> GetComplianceDetailResponse -> ShowS
$cshowsPrec :: Int -> GetComplianceDetailResponse -> ShowS
Prelude.Show, (forall x.
GetComplianceDetailResponse -> Rep GetComplianceDetailResponse x)
-> (forall x.
Rep GetComplianceDetailResponse x -> GetComplianceDetailResponse)
-> Generic GetComplianceDetailResponse
forall x.
Rep GetComplianceDetailResponse x -> GetComplianceDetailResponse
forall x.
GetComplianceDetailResponse -> Rep GetComplianceDetailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetComplianceDetailResponse x -> GetComplianceDetailResponse
$cfrom :: forall x.
GetComplianceDetailResponse -> Rep GetComplianceDetailResponse x
Prelude.Generic)
newGetComplianceDetailResponse ::
Prelude.Int ->
GetComplianceDetailResponse
newGetComplianceDetailResponse :: Int -> GetComplianceDetailResponse
newGetComplianceDetailResponse Int
pHttpStatus_ =
GetComplianceDetailResponse' :: Maybe PolicyComplianceDetail -> Int -> GetComplianceDetailResponse
GetComplianceDetailResponse'
{ $sel:policyComplianceDetail:GetComplianceDetailResponse' :: Maybe PolicyComplianceDetail
policyComplianceDetail =
Maybe PolicyComplianceDetail
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetComplianceDetailResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getComplianceDetailResponse_policyComplianceDetail :: Lens.Lens' GetComplianceDetailResponse (Prelude.Maybe PolicyComplianceDetail)
getComplianceDetailResponse_policyComplianceDetail :: (Maybe PolicyComplianceDetail -> f (Maybe PolicyComplianceDetail))
-> GetComplianceDetailResponse -> f GetComplianceDetailResponse
getComplianceDetailResponse_policyComplianceDetail = (GetComplianceDetailResponse -> Maybe PolicyComplianceDetail)
-> (GetComplianceDetailResponse
-> Maybe PolicyComplianceDetail -> GetComplianceDetailResponse)
-> Lens
GetComplianceDetailResponse
GetComplianceDetailResponse
(Maybe PolicyComplianceDetail)
(Maybe PolicyComplianceDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceDetailResponse' {Maybe PolicyComplianceDetail
policyComplianceDetail :: Maybe PolicyComplianceDetail
$sel:policyComplianceDetail:GetComplianceDetailResponse' :: GetComplianceDetailResponse -> Maybe PolicyComplianceDetail
policyComplianceDetail} -> Maybe PolicyComplianceDetail
policyComplianceDetail) (\s :: GetComplianceDetailResponse
s@GetComplianceDetailResponse' {} Maybe PolicyComplianceDetail
a -> GetComplianceDetailResponse
s {$sel:policyComplianceDetail:GetComplianceDetailResponse' :: Maybe PolicyComplianceDetail
policyComplianceDetail = Maybe PolicyComplianceDetail
a} :: GetComplianceDetailResponse)
getComplianceDetailResponse_httpStatus :: Lens.Lens' GetComplianceDetailResponse Prelude.Int
getComplianceDetailResponse_httpStatus :: (Int -> f Int)
-> GetComplianceDetailResponse -> f GetComplianceDetailResponse
getComplianceDetailResponse_httpStatus = (GetComplianceDetailResponse -> Int)
-> (GetComplianceDetailResponse
-> Int -> GetComplianceDetailResponse)
-> Lens
GetComplianceDetailResponse GetComplianceDetailResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceDetailResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetComplianceDetailResponse' :: GetComplianceDetailResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetComplianceDetailResponse
s@GetComplianceDetailResponse' {} Int
a -> GetComplianceDetailResponse
s {$sel:httpStatus:GetComplianceDetailResponse' :: Int
httpStatus = Int
a} :: GetComplianceDetailResponse)
instance Prelude.NFData GetComplianceDetailResponse