{-# 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.AMP.DescribeRuleGroupsNamespace
(
DescribeRuleGroupsNamespace (..),
newDescribeRuleGroupsNamespace,
describeRuleGroupsNamespace_name,
describeRuleGroupsNamespace_workspaceId,
DescribeRuleGroupsNamespaceResponse (..),
newDescribeRuleGroupsNamespaceResponse,
describeRuleGroupsNamespaceResponse_httpStatus,
describeRuleGroupsNamespaceResponse_ruleGroupsNamespace,
)
where
import Amazonka.AMP.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 DescribeRuleGroupsNamespace = DescribeRuleGroupsNamespace'
{
DescribeRuleGroupsNamespace -> Text
name :: Prelude.Text,
DescribeRuleGroupsNamespace -> Text
workspaceId :: Prelude.Text
}
deriving (DescribeRuleGroupsNamespace -> DescribeRuleGroupsNamespace -> Bool
(DescribeRuleGroupsNamespace
-> DescribeRuleGroupsNamespace -> Bool)
-> (DescribeRuleGroupsNamespace
-> DescribeRuleGroupsNamespace -> Bool)
-> Eq DescribeRuleGroupsNamespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuleGroupsNamespace -> DescribeRuleGroupsNamespace -> Bool
$c/= :: DescribeRuleGroupsNamespace -> DescribeRuleGroupsNamespace -> Bool
== :: DescribeRuleGroupsNamespace -> DescribeRuleGroupsNamespace -> Bool
$c== :: DescribeRuleGroupsNamespace -> DescribeRuleGroupsNamespace -> Bool
Prelude.Eq, ReadPrec [DescribeRuleGroupsNamespace]
ReadPrec DescribeRuleGroupsNamespace
Int -> ReadS DescribeRuleGroupsNamespace
ReadS [DescribeRuleGroupsNamespace]
(Int -> ReadS DescribeRuleGroupsNamespace)
-> ReadS [DescribeRuleGroupsNamespace]
-> ReadPrec DescribeRuleGroupsNamespace
-> ReadPrec [DescribeRuleGroupsNamespace]
-> Read DescribeRuleGroupsNamespace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuleGroupsNamespace]
$creadListPrec :: ReadPrec [DescribeRuleGroupsNamespace]
readPrec :: ReadPrec DescribeRuleGroupsNamespace
$creadPrec :: ReadPrec DescribeRuleGroupsNamespace
readList :: ReadS [DescribeRuleGroupsNamespace]
$creadList :: ReadS [DescribeRuleGroupsNamespace]
readsPrec :: Int -> ReadS DescribeRuleGroupsNamespace
$creadsPrec :: Int -> ReadS DescribeRuleGroupsNamespace
Prelude.Read, Int -> DescribeRuleGroupsNamespace -> ShowS
[DescribeRuleGroupsNamespace] -> ShowS
DescribeRuleGroupsNamespace -> String
(Int -> DescribeRuleGroupsNamespace -> ShowS)
-> (DescribeRuleGroupsNamespace -> String)
-> ([DescribeRuleGroupsNamespace] -> ShowS)
-> Show DescribeRuleGroupsNamespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuleGroupsNamespace] -> ShowS
$cshowList :: [DescribeRuleGroupsNamespace] -> ShowS
show :: DescribeRuleGroupsNamespace -> String
$cshow :: DescribeRuleGroupsNamespace -> String
showsPrec :: Int -> DescribeRuleGroupsNamespace -> ShowS
$cshowsPrec :: Int -> DescribeRuleGroupsNamespace -> ShowS
Prelude.Show, (forall x.
DescribeRuleGroupsNamespace -> Rep DescribeRuleGroupsNamespace x)
-> (forall x.
Rep DescribeRuleGroupsNamespace x -> DescribeRuleGroupsNamespace)
-> Generic DescribeRuleGroupsNamespace
forall x.
Rep DescribeRuleGroupsNamespace x -> DescribeRuleGroupsNamespace
forall x.
DescribeRuleGroupsNamespace -> Rep DescribeRuleGroupsNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRuleGroupsNamespace x -> DescribeRuleGroupsNamespace
$cfrom :: forall x.
DescribeRuleGroupsNamespace -> Rep DescribeRuleGroupsNamespace x
Prelude.Generic)
newDescribeRuleGroupsNamespace ::
Prelude.Text ->
Prelude.Text ->
DescribeRuleGroupsNamespace
newDescribeRuleGroupsNamespace :: Text -> Text -> DescribeRuleGroupsNamespace
newDescribeRuleGroupsNamespace Text
pName_ Text
pWorkspaceId_ =
DescribeRuleGroupsNamespace' :: Text -> Text -> DescribeRuleGroupsNamespace
DescribeRuleGroupsNamespace'
{ $sel:name:DescribeRuleGroupsNamespace' :: Text
name = Text
pName_,
$sel:workspaceId:DescribeRuleGroupsNamespace' :: Text
workspaceId = Text
pWorkspaceId_
}
describeRuleGroupsNamespace_name :: Lens.Lens' DescribeRuleGroupsNamespace Prelude.Text
describeRuleGroupsNamespace_name :: (Text -> f Text)
-> DescribeRuleGroupsNamespace -> f DescribeRuleGroupsNamespace
describeRuleGroupsNamespace_name = (DescribeRuleGroupsNamespace -> Text)
-> (DescribeRuleGroupsNamespace
-> Text -> DescribeRuleGroupsNamespace)
-> Lens
DescribeRuleGroupsNamespace DescribeRuleGroupsNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupsNamespace' {Text
name :: Text
$sel:name:DescribeRuleGroupsNamespace' :: DescribeRuleGroupsNamespace -> Text
name} -> Text
name) (\s :: DescribeRuleGroupsNamespace
s@DescribeRuleGroupsNamespace' {} Text
a -> DescribeRuleGroupsNamespace
s {$sel:name:DescribeRuleGroupsNamespace' :: Text
name = Text
a} :: DescribeRuleGroupsNamespace)
describeRuleGroupsNamespace_workspaceId :: Lens.Lens' DescribeRuleGroupsNamespace Prelude.Text
describeRuleGroupsNamespace_workspaceId :: (Text -> f Text)
-> DescribeRuleGroupsNamespace -> f DescribeRuleGroupsNamespace
describeRuleGroupsNamespace_workspaceId = (DescribeRuleGroupsNamespace -> Text)
-> (DescribeRuleGroupsNamespace
-> Text -> DescribeRuleGroupsNamespace)
-> Lens
DescribeRuleGroupsNamespace DescribeRuleGroupsNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupsNamespace' {Text
workspaceId :: Text
$sel:workspaceId:DescribeRuleGroupsNamespace' :: DescribeRuleGroupsNamespace -> Text
workspaceId} -> Text
workspaceId) (\s :: DescribeRuleGroupsNamespace
s@DescribeRuleGroupsNamespace' {} Text
a -> DescribeRuleGroupsNamespace
s {$sel:workspaceId:DescribeRuleGroupsNamespace' :: Text
workspaceId = Text
a} :: DescribeRuleGroupsNamespace)
instance Core.AWSRequest DescribeRuleGroupsNamespace where
type
AWSResponse DescribeRuleGroupsNamespace =
DescribeRuleGroupsNamespaceResponse
request :: DescribeRuleGroupsNamespace -> Request DescribeRuleGroupsNamespace
request = Service
-> DescribeRuleGroupsNamespace
-> Request DescribeRuleGroupsNamespace
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRuleGroupsNamespace
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRuleGroupsNamespace)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRuleGroupsNamespace))
-> Logger
-> Service
-> Proxy DescribeRuleGroupsNamespace
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRuleGroupsNamespace)))
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
-> RuleGroupsNamespaceDescription
-> DescribeRuleGroupsNamespaceResponse
DescribeRuleGroupsNamespaceResponse'
(Int
-> RuleGroupsNamespaceDescription
-> DescribeRuleGroupsNamespaceResponse)
-> Either String Int
-> Either
String
(RuleGroupsNamespaceDescription
-> DescribeRuleGroupsNamespaceResponse)
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
(RuleGroupsNamespaceDescription
-> DescribeRuleGroupsNamespaceResponse)
-> Either String RuleGroupsNamespaceDescription
-> Either String DescribeRuleGroupsNamespaceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String RuleGroupsNamespaceDescription
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ruleGroupsNamespace")
)
instance Prelude.Hashable DescribeRuleGroupsNamespace
instance Prelude.NFData DescribeRuleGroupsNamespace
instance Core.ToHeaders DescribeRuleGroupsNamespace where
toHeaders :: DescribeRuleGroupsNamespace -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeRuleGroupsNamespace -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DescribeRuleGroupsNamespace where
toPath :: DescribeRuleGroupsNamespace -> ByteString
toPath DescribeRuleGroupsNamespace' {Text
workspaceId :: Text
name :: Text
$sel:workspaceId:DescribeRuleGroupsNamespace' :: DescribeRuleGroupsNamespace -> Text
$sel:name:DescribeRuleGroupsNamespace' :: DescribeRuleGroupsNamespace -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/workspaces/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workspaceId,
ByteString
"/rulegroupsnamespaces/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name
]
instance Core.ToQuery DescribeRuleGroupsNamespace where
toQuery :: DescribeRuleGroupsNamespace -> QueryString
toQuery = QueryString -> DescribeRuleGroupsNamespace -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeRuleGroupsNamespaceResponse = DescribeRuleGroupsNamespaceResponse'
{
DescribeRuleGroupsNamespaceResponse -> Int
httpStatus :: Prelude.Int,
DescribeRuleGroupsNamespaceResponse
-> RuleGroupsNamespaceDescription
ruleGroupsNamespace :: RuleGroupsNamespaceDescription
}
deriving (DescribeRuleGroupsNamespaceResponse
-> DescribeRuleGroupsNamespaceResponse -> Bool
(DescribeRuleGroupsNamespaceResponse
-> DescribeRuleGroupsNamespaceResponse -> Bool)
-> (DescribeRuleGroupsNamespaceResponse
-> DescribeRuleGroupsNamespaceResponse -> Bool)
-> Eq DescribeRuleGroupsNamespaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuleGroupsNamespaceResponse
-> DescribeRuleGroupsNamespaceResponse -> Bool
$c/= :: DescribeRuleGroupsNamespaceResponse
-> DescribeRuleGroupsNamespaceResponse -> Bool
== :: DescribeRuleGroupsNamespaceResponse
-> DescribeRuleGroupsNamespaceResponse -> Bool
$c== :: DescribeRuleGroupsNamespaceResponse
-> DescribeRuleGroupsNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRuleGroupsNamespaceResponse]
ReadPrec DescribeRuleGroupsNamespaceResponse
Int -> ReadS DescribeRuleGroupsNamespaceResponse
ReadS [DescribeRuleGroupsNamespaceResponse]
(Int -> ReadS DescribeRuleGroupsNamespaceResponse)
-> ReadS [DescribeRuleGroupsNamespaceResponse]
-> ReadPrec DescribeRuleGroupsNamespaceResponse
-> ReadPrec [DescribeRuleGroupsNamespaceResponse]
-> Read DescribeRuleGroupsNamespaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuleGroupsNamespaceResponse]
$creadListPrec :: ReadPrec [DescribeRuleGroupsNamespaceResponse]
readPrec :: ReadPrec DescribeRuleGroupsNamespaceResponse
$creadPrec :: ReadPrec DescribeRuleGroupsNamespaceResponse
readList :: ReadS [DescribeRuleGroupsNamespaceResponse]
$creadList :: ReadS [DescribeRuleGroupsNamespaceResponse]
readsPrec :: Int -> ReadS DescribeRuleGroupsNamespaceResponse
$creadsPrec :: Int -> ReadS DescribeRuleGroupsNamespaceResponse
Prelude.Read, Int -> DescribeRuleGroupsNamespaceResponse -> ShowS
[DescribeRuleGroupsNamespaceResponse] -> ShowS
DescribeRuleGroupsNamespaceResponse -> String
(Int -> DescribeRuleGroupsNamespaceResponse -> ShowS)
-> (DescribeRuleGroupsNamespaceResponse -> String)
-> ([DescribeRuleGroupsNamespaceResponse] -> ShowS)
-> Show DescribeRuleGroupsNamespaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuleGroupsNamespaceResponse] -> ShowS
$cshowList :: [DescribeRuleGroupsNamespaceResponse] -> ShowS
show :: DescribeRuleGroupsNamespaceResponse -> String
$cshow :: DescribeRuleGroupsNamespaceResponse -> String
showsPrec :: Int -> DescribeRuleGroupsNamespaceResponse -> ShowS
$cshowsPrec :: Int -> DescribeRuleGroupsNamespaceResponse -> ShowS
Prelude.Show, (forall x.
DescribeRuleGroupsNamespaceResponse
-> Rep DescribeRuleGroupsNamespaceResponse x)
-> (forall x.
Rep DescribeRuleGroupsNamespaceResponse x
-> DescribeRuleGroupsNamespaceResponse)
-> Generic DescribeRuleGroupsNamespaceResponse
forall x.
Rep DescribeRuleGroupsNamespaceResponse x
-> DescribeRuleGroupsNamespaceResponse
forall x.
DescribeRuleGroupsNamespaceResponse
-> Rep DescribeRuleGroupsNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRuleGroupsNamespaceResponse x
-> DescribeRuleGroupsNamespaceResponse
$cfrom :: forall x.
DescribeRuleGroupsNamespaceResponse
-> Rep DescribeRuleGroupsNamespaceResponse x
Prelude.Generic)
newDescribeRuleGroupsNamespaceResponse ::
Prelude.Int ->
RuleGroupsNamespaceDescription ->
DescribeRuleGroupsNamespaceResponse
newDescribeRuleGroupsNamespaceResponse :: Int
-> RuleGroupsNamespaceDescription
-> DescribeRuleGroupsNamespaceResponse
newDescribeRuleGroupsNamespaceResponse
Int
pHttpStatus_
RuleGroupsNamespaceDescription
pRuleGroupsNamespace_ =
DescribeRuleGroupsNamespaceResponse' :: Int
-> RuleGroupsNamespaceDescription
-> DescribeRuleGroupsNamespaceResponse
DescribeRuleGroupsNamespaceResponse'
{ $sel:httpStatus:DescribeRuleGroupsNamespaceResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:ruleGroupsNamespace:DescribeRuleGroupsNamespaceResponse' :: RuleGroupsNamespaceDescription
ruleGroupsNamespace =
RuleGroupsNamespaceDescription
pRuleGroupsNamespace_
}
describeRuleGroupsNamespaceResponse_httpStatus :: Lens.Lens' DescribeRuleGroupsNamespaceResponse Prelude.Int
describeRuleGroupsNamespaceResponse_httpStatus :: (Int -> f Int)
-> DescribeRuleGroupsNamespaceResponse
-> f DescribeRuleGroupsNamespaceResponse
describeRuleGroupsNamespaceResponse_httpStatus = (DescribeRuleGroupsNamespaceResponse -> Int)
-> (DescribeRuleGroupsNamespaceResponse
-> Int -> DescribeRuleGroupsNamespaceResponse)
-> Lens
DescribeRuleGroupsNamespaceResponse
DescribeRuleGroupsNamespaceResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupsNamespaceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRuleGroupsNamespaceResponse' :: DescribeRuleGroupsNamespaceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRuleGroupsNamespaceResponse
s@DescribeRuleGroupsNamespaceResponse' {} Int
a -> DescribeRuleGroupsNamespaceResponse
s {$sel:httpStatus:DescribeRuleGroupsNamespaceResponse' :: Int
httpStatus = Int
a} :: DescribeRuleGroupsNamespaceResponse)
describeRuleGroupsNamespaceResponse_ruleGroupsNamespace :: Lens.Lens' DescribeRuleGroupsNamespaceResponse RuleGroupsNamespaceDescription
describeRuleGroupsNamespaceResponse_ruleGroupsNamespace :: (RuleGroupsNamespaceDescription
-> f RuleGroupsNamespaceDescription)
-> DescribeRuleGroupsNamespaceResponse
-> f DescribeRuleGroupsNamespaceResponse
describeRuleGroupsNamespaceResponse_ruleGroupsNamespace = (DescribeRuleGroupsNamespaceResponse
-> RuleGroupsNamespaceDescription)
-> (DescribeRuleGroupsNamespaceResponse
-> RuleGroupsNamespaceDescription
-> DescribeRuleGroupsNamespaceResponse)
-> Lens
DescribeRuleGroupsNamespaceResponse
DescribeRuleGroupsNamespaceResponse
RuleGroupsNamespaceDescription
RuleGroupsNamespaceDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupsNamespaceResponse' {RuleGroupsNamespaceDescription
ruleGroupsNamespace :: RuleGroupsNamespaceDescription
$sel:ruleGroupsNamespace:DescribeRuleGroupsNamespaceResponse' :: DescribeRuleGroupsNamespaceResponse
-> RuleGroupsNamespaceDescription
ruleGroupsNamespace} -> RuleGroupsNamespaceDescription
ruleGroupsNamespace) (\s :: DescribeRuleGroupsNamespaceResponse
s@DescribeRuleGroupsNamespaceResponse' {} RuleGroupsNamespaceDescription
a -> DescribeRuleGroupsNamespaceResponse
s {$sel:ruleGroupsNamespace:DescribeRuleGroupsNamespaceResponse' :: RuleGroupsNamespaceDescription
ruleGroupsNamespace = RuleGroupsNamespaceDescription
a} :: DescribeRuleGroupsNamespaceResponse)
instance
Prelude.NFData
DescribeRuleGroupsNamespaceResponse