{-# 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.QuickSight.DescribeIpRestriction
(
DescribeIpRestriction (..),
newDescribeIpRestriction,
describeIpRestriction_awsAccountId,
DescribeIpRestrictionResponse (..),
newDescribeIpRestrictionResponse,
describeIpRestrictionResponse_awsAccountId,
describeIpRestrictionResponse_enabled,
describeIpRestrictionResponse_ipRestrictionRuleMap,
describeIpRestrictionResponse_requestId,
describeIpRestrictionResponse_status,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeIpRestriction = DescribeIpRestriction'
{
DescribeIpRestriction -> Text
awsAccountId :: Prelude.Text
}
deriving (DescribeIpRestriction -> DescribeIpRestriction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeIpRestriction -> DescribeIpRestriction -> Bool
$c/= :: DescribeIpRestriction -> DescribeIpRestriction -> Bool
== :: DescribeIpRestriction -> DescribeIpRestriction -> Bool
$c== :: DescribeIpRestriction -> DescribeIpRestriction -> Bool
Prelude.Eq, ReadPrec [DescribeIpRestriction]
ReadPrec DescribeIpRestriction
Int -> ReadS DescribeIpRestriction
ReadS [DescribeIpRestriction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeIpRestriction]
$creadListPrec :: ReadPrec [DescribeIpRestriction]
readPrec :: ReadPrec DescribeIpRestriction
$creadPrec :: ReadPrec DescribeIpRestriction
readList :: ReadS [DescribeIpRestriction]
$creadList :: ReadS [DescribeIpRestriction]
readsPrec :: Int -> ReadS DescribeIpRestriction
$creadsPrec :: Int -> ReadS DescribeIpRestriction
Prelude.Read, Int -> DescribeIpRestriction -> ShowS
[DescribeIpRestriction] -> ShowS
DescribeIpRestriction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeIpRestriction] -> ShowS
$cshowList :: [DescribeIpRestriction] -> ShowS
show :: DescribeIpRestriction -> String
$cshow :: DescribeIpRestriction -> String
showsPrec :: Int -> DescribeIpRestriction -> ShowS
$cshowsPrec :: Int -> DescribeIpRestriction -> ShowS
Prelude.Show, forall x. Rep DescribeIpRestriction x -> DescribeIpRestriction
forall x. DescribeIpRestriction -> Rep DescribeIpRestriction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeIpRestriction x -> DescribeIpRestriction
$cfrom :: forall x. DescribeIpRestriction -> Rep DescribeIpRestriction x
Prelude.Generic)
newDescribeIpRestriction ::
Prelude.Text ->
DescribeIpRestriction
newDescribeIpRestriction :: Text -> DescribeIpRestriction
newDescribeIpRestriction Text
pAwsAccountId_ =
DescribeIpRestriction'
{ $sel:awsAccountId:DescribeIpRestriction' :: Text
awsAccountId =
Text
pAwsAccountId_
}
describeIpRestriction_awsAccountId :: Lens.Lens' DescribeIpRestriction Prelude.Text
describeIpRestriction_awsAccountId :: Lens' DescribeIpRestriction Text
describeIpRestriction_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpRestriction' {Text
awsAccountId :: Text
$sel:awsAccountId:DescribeIpRestriction' :: DescribeIpRestriction -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DescribeIpRestriction
s@DescribeIpRestriction' {} Text
a -> DescribeIpRestriction
s {$sel:awsAccountId:DescribeIpRestriction' :: Text
awsAccountId = Text
a} :: DescribeIpRestriction)
instance Core.AWSRequest DescribeIpRestriction where
type
AWSResponse DescribeIpRestriction =
DescribeIpRestrictionResponse
request :: (Service -> Service)
-> DescribeIpRestriction -> Request DescribeIpRestriction
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeIpRestriction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeIpRestriction)))
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 Text
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Int
-> DescribeIpRestrictionResponse
DescribeIpRestrictionResponse'
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
"AwsAccountId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Enabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"IpRestrictionRuleMap"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RequestId")
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 DescribeIpRestriction where
hashWithSalt :: Int -> DescribeIpRestriction -> Int
hashWithSalt Int
_salt DescribeIpRestriction' {Text
awsAccountId :: Text
$sel:awsAccountId:DescribeIpRestriction' :: DescribeIpRestriction -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
instance Prelude.NFData DescribeIpRestriction where
rnf :: DescribeIpRestriction -> ()
rnf DescribeIpRestriction' {Text
awsAccountId :: Text
$sel:awsAccountId:DescribeIpRestriction' :: DescribeIpRestriction -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
instance Data.ToHeaders DescribeIpRestriction where
toHeaders :: DescribeIpRestriction -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DescribeIpRestriction where
toPath :: DescribeIpRestriction -> ByteString
toPath DescribeIpRestriction' {Text
awsAccountId :: Text
$sel:awsAccountId:DescribeIpRestriction' :: DescribeIpRestriction -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId,
ByteString
"/ip-restriction"
]
instance Data.ToQuery DescribeIpRestriction where
toQuery :: DescribeIpRestriction -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeIpRestrictionResponse = DescribeIpRestrictionResponse'
{
DescribeIpRestrictionResponse -> Maybe Text
awsAccountId :: Prelude.Maybe Prelude.Text,
DescribeIpRestrictionResponse -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
DescribeIpRestrictionResponse -> Maybe (HashMap Text Text)
ipRestrictionRuleMap :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DescribeIpRestrictionResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DescribeIpRestrictionResponse -> Int
status :: Prelude.Int
}
deriving (DescribeIpRestrictionResponse
-> DescribeIpRestrictionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeIpRestrictionResponse
-> DescribeIpRestrictionResponse -> Bool
$c/= :: DescribeIpRestrictionResponse
-> DescribeIpRestrictionResponse -> Bool
== :: DescribeIpRestrictionResponse
-> DescribeIpRestrictionResponse -> Bool
$c== :: DescribeIpRestrictionResponse
-> DescribeIpRestrictionResponse -> Bool
Prelude.Eq, ReadPrec [DescribeIpRestrictionResponse]
ReadPrec DescribeIpRestrictionResponse
Int -> ReadS DescribeIpRestrictionResponse
ReadS [DescribeIpRestrictionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeIpRestrictionResponse]
$creadListPrec :: ReadPrec [DescribeIpRestrictionResponse]
readPrec :: ReadPrec DescribeIpRestrictionResponse
$creadPrec :: ReadPrec DescribeIpRestrictionResponse
readList :: ReadS [DescribeIpRestrictionResponse]
$creadList :: ReadS [DescribeIpRestrictionResponse]
readsPrec :: Int -> ReadS DescribeIpRestrictionResponse
$creadsPrec :: Int -> ReadS DescribeIpRestrictionResponse
Prelude.Read, Int -> DescribeIpRestrictionResponse -> ShowS
[DescribeIpRestrictionResponse] -> ShowS
DescribeIpRestrictionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeIpRestrictionResponse] -> ShowS
$cshowList :: [DescribeIpRestrictionResponse] -> ShowS
show :: DescribeIpRestrictionResponse -> String
$cshow :: DescribeIpRestrictionResponse -> String
showsPrec :: Int -> DescribeIpRestrictionResponse -> ShowS
$cshowsPrec :: Int -> DescribeIpRestrictionResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeIpRestrictionResponse x
-> DescribeIpRestrictionResponse
forall x.
DescribeIpRestrictionResponse
-> Rep DescribeIpRestrictionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeIpRestrictionResponse x
-> DescribeIpRestrictionResponse
$cfrom :: forall x.
DescribeIpRestrictionResponse
-> Rep DescribeIpRestrictionResponse x
Prelude.Generic)
newDescribeIpRestrictionResponse ::
Prelude.Int ->
DescribeIpRestrictionResponse
newDescribeIpRestrictionResponse :: Int -> DescribeIpRestrictionResponse
newDescribeIpRestrictionResponse Int
pStatus_ =
DescribeIpRestrictionResponse'
{ $sel:awsAccountId:DescribeIpRestrictionResponse' :: Maybe Text
awsAccountId =
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:DescribeIpRestrictionResponse' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
$sel:ipRestrictionRuleMap:DescribeIpRestrictionResponse' :: Maybe (HashMap Text Text)
ipRestrictionRuleMap = forall a. Maybe a
Prelude.Nothing,
$sel:requestId:DescribeIpRestrictionResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
$sel:status:DescribeIpRestrictionResponse' :: Int
status = Int
pStatus_
}
describeIpRestrictionResponse_awsAccountId :: Lens.Lens' DescribeIpRestrictionResponse (Prelude.Maybe Prelude.Text)
describeIpRestrictionResponse_awsAccountId :: Lens' DescribeIpRestrictionResponse (Maybe Text)
describeIpRestrictionResponse_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpRestrictionResponse' {Maybe Text
awsAccountId :: Maybe Text
$sel:awsAccountId:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe Text
awsAccountId} -> Maybe Text
awsAccountId) (\s :: DescribeIpRestrictionResponse
s@DescribeIpRestrictionResponse' {} Maybe Text
a -> DescribeIpRestrictionResponse
s {$sel:awsAccountId:DescribeIpRestrictionResponse' :: Maybe Text
awsAccountId = Maybe Text
a} :: DescribeIpRestrictionResponse)
describeIpRestrictionResponse_enabled :: Lens.Lens' DescribeIpRestrictionResponse (Prelude.Maybe Prelude.Bool)
describeIpRestrictionResponse_enabled :: Lens' DescribeIpRestrictionResponse (Maybe Bool)
describeIpRestrictionResponse_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpRestrictionResponse' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: DescribeIpRestrictionResponse
s@DescribeIpRestrictionResponse' {} Maybe Bool
a -> DescribeIpRestrictionResponse
s {$sel:enabled:DescribeIpRestrictionResponse' :: Maybe Bool
enabled = Maybe Bool
a} :: DescribeIpRestrictionResponse)
describeIpRestrictionResponse_ipRestrictionRuleMap :: Lens.Lens' DescribeIpRestrictionResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
describeIpRestrictionResponse_ipRestrictionRuleMap :: Lens' DescribeIpRestrictionResponse (Maybe (HashMap Text Text))
describeIpRestrictionResponse_ipRestrictionRuleMap = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpRestrictionResponse' {Maybe (HashMap Text Text)
ipRestrictionRuleMap :: Maybe (HashMap Text Text)
$sel:ipRestrictionRuleMap:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe (HashMap Text Text)
ipRestrictionRuleMap} -> Maybe (HashMap Text Text)
ipRestrictionRuleMap) (\s :: DescribeIpRestrictionResponse
s@DescribeIpRestrictionResponse' {} Maybe (HashMap Text Text)
a -> DescribeIpRestrictionResponse
s {$sel:ipRestrictionRuleMap:DescribeIpRestrictionResponse' :: Maybe (HashMap Text Text)
ipRestrictionRuleMap = Maybe (HashMap Text Text)
a} :: DescribeIpRestrictionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeIpRestrictionResponse_requestId :: Lens.Lens' DescribeIpRestrictionResponse (Prelude.Maybe Prelude.Text)
describeIpRestrictionResponse_requestId :: Lens' DescribeIpRestrictionResponse (Maybe Text)
describeIpRestrictionResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpRestrictionResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DescribeIpRestrictionResponse
s@DescribeIpRestrictionResponse' {} Maybe Text
a -> DescribeIpRestrictionResponse
s {$sel:requestId:DescribeIpRestrictionResponse' :: Maybe Text
requestId = Maybe Text
a} :: DescribeIpRestrictionResponse)
describeIpRestrictionResponse_status :: Lens.Lens' DescribeIpRestrictionResponse Prelude.Int
describeIpRestrictionResponse_status :: Lens' DescribeIpRestrictionResponse Int
describeIpRestrictionResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIpRestrictionResponse' {Int
status :: Int
$sel:status:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Int
status} -> Int
status) (\s :: DescribeIpRestrictionResponse
s@DescribeIpRestrictionResponse' {} Int
a -> DescribeIpRestrictionResponse
s {$sel:status:DescribeIpRestrictionResponse' :: Int
status = Int
a} :: DescribeIpRestrictionResponse)
instance Prelude.NFData DescribeIpRestrictionResponse where
rnf :: DescribeIpRestrictionResponse -> ()
rnf DescribeIpRestrictionResponse' {Int
Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
status :: Int
requestId :: Maybe Text
ipRestrictionRuleMap :: Maybe (HashMap Text Text)
enabled :: Maybe Bool
awsAccountId :: Maybe Text
$sel:status:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Int
$sel:requestId:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe Text
$sel:ipRestrictionRuleMap:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe (HashMap Text Text)
$sel:enabled:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe Bool
$sel:awsAccountId:DescribeIpRestrictionResponse' :: DescribeIpRestrictionResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
awsAccountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
ipRestrictionRuleMap
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status