{-# 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.WorkSpaces.DescribeAccount
(
DescribeAccount (..),
newDescribeAccount,
DescribeAccountResponse (..),
newDescribeAccountResponse,
describeAccountResponse_dedicatedTenancySupport,
describeAccountResponse_dedicatedTenancyManagementCidrRange,
describeAccountResponse_httpStatus,
)
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.WorkSpaces.Types
data DescribeAccount = DescribeAccount'
{
}
deriving (DescribeAccount -> DescribeAccount -> Bool
(DescribeAccount -> DescribeAccount -> Bool)
-> (DescribeAccount -> DescribeAccount -> Bool)
-> Eq DescribeAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAccount -> DescribeAccount -> Bool
$c/= :: DescribeAccount -> DescribeAccount -> Bool
== :: DescribeAccount -> DescribeAccount -> Bool
$c== :: DescribeAccount -> DescribeAccount -> Bool
Prelude.Eq, ReadPrec [DescribeAccount]
ReadPrec DescribeAccount
Int -> ReadS DescribeAccount
ReadS [DescribeAccount]
(Int -> ReadS DescribeAccount)
-> ReadS [DescribeAccount]
-> ReadPrec DescribeAccount
-> ReadPrec [DescribeAccount]
-> Read DescribeAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAccount]
$creadListPrec :: ReadPrec [DescribeAccount]
readPrec :: ReadPrec DescribeAccount
$creadPrec :: ReadPrec DescribeAccount
readList :: ReadS [DescribeAccount]
$creadList :: ReadS [DescribeAccount]
readsPrec :: Int -> ReadS DescribeAccount
$creadsPrec :: Int -> ReadS DescribeAccount
Prelude.Read, Int -> DescribeAccount -> ShowS
[DescribeAccount] -> ShowS
DescribeAccount -> String
(Int -> DescribeAccount -> ShowS)
-> (DescribeAccount -> String)
-> ([DescribeAccount] -> ShowS)
-> Show DescribeAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAccount] -> ShowS
$cshowList :: [DescribeAccount] -> ShowS
show :: DescribeAccount -> String
$cshow :: DescribeAccount -> String
showsPrec :: Int -> DescribeAccount -> ShowS
$cshowsPrec :: Int -> DescribeAccount -> ShowS
Prelude.Show, (forall x. DescribeAccount -> Rep DescribeAccount x)
-> (forall x. Rep DescribeAccount x -> DescribeAccount)
-> Generic DescribeAccount
forall x. Rep DescribeAccount x -> DescribeAccount
forall x. DescribeAccount -> Rep DescribeAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAccount x -> DescribeAccount
$cfrom :: forall x. DescribeAccount -> Rep DescribeAccount x
Prelude.Generic)
newDescribeAccount ::
DescribeAccount
newDescribeAccount :: DescribeAccount
newDescribeAccount = DescribeAccount
DescribeAccount'
instance Core.AWSRequest DescribeAccount where
type
AWSResponse DescribeAccount =
DescribeAccountResponse
request :: DescribeAccount -> Request DescribeAccount
request = Service -> DescribeAccount -> Request DescribeAccount
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeAccount)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeAccount))
-> Logger
-> Service
-> Proxy DescribeAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeAccount)))
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 DedicatedTenancySupportResultEnum
-> Maybe Text -> Int -> DescribeAccountResponse
DescribeAccountResponse'
(Maybe DedicatedTenancySupportResultEnum
-> Maybe Text -> Int -> DescribeAccountResponse)
-> Either String (Maybe DedicatedTenancySupportResultEnum)
-> Either String (Maybe Text -> Int -> DescribeAccountResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe DedicatedTenancySupportResultEnum)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DedicatedTenancySupport")
Either String (Maybe Text -> Int -> DescribeAccountResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeAccountResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DedicatedTenancyManagementCidrRange")
Either String (Int -> DescribeAccountResponse)
-> Either String Int -> Either String DescribeAccountResponse
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 DescribeAccount
instance Prelude.NFData DescribeAccount
instance Core.ToHeaders DescribeAccount where
toHeaders :: DescribeAccount -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeAccount -> 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
"WorkspacesService.DescribeAccount" ::
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 DescribeAccount where
toJSON :: DescribeAccount -> Value
toJSON = Value -> DescribeAccount -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DescribeAccount where
toPath :: DescribeAccount -> ByteString
toPath = ByteString -> DescribeAccount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeAccount where
toQuery :: DescribeAccount -> QueryString
toQuery = QueryString -> DescribeAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeAccountResponse = DescribeAccountResponse'
{
DescribeAccountResponse -> Maybe DedicatedTenancySupportResultEnum
dedicatedTenancySupport :: Prelude.Maybe DedicatedTenancySupportResultEnum,
DescribeAccountResponse -> Maybe Text
dedicatedTenancyManagementCidrRange :: Prelude.Maybe Prelude.Text,
DescribeAccountResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeAccountResponse -> DescribeAccountResponse -> Bool
(DescribeAccountResponse -> DescribeAccountResponse -> Bool)
-> (DescribeAccountResponse -> DescribeAccountResponse -> Bool)
-> Eq DescribeAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAccountResponse -> DescribeAccountResponse -> Bool
$c/= :: DescribeAccountResponse -> DescribeAccountResponse -> Bool
== :: DescribeAccountResponse -> DescribeAccountResponse -> Bool
$c== :: DescribeAccountResponse -> DescribeAccountResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAccountResponse]
ReadPrec DescribeAccountResponse
Int -> ReadS DescribeAccountResponse
ReadS [DescribeAccountResponse]
(Int -> ReadS DescribeAccountResponse)
-> ReadS [DescribeAccountResponse]
-> ReadPrec DescribeAccountResponse
-> ReadPrec [DescribeAccountResponse]
-> Read DescribeAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAccountResponse]
$creadListPrec :: ReadPrec [DescribeAccountResponse]
readPrec :: ReadPrec DescribeAccountResponse
$creadPrec :: ReadPrec DescribeAccountResponse
readList :: ReadS [DescribeAccountResponse]
$creadList :: ReadS [DescribeAccountResponse]
readsPrec :: Int -> ReadS DescribeAccountResponse
$creadsPrec :: Int -> ReadS DescribeAccountResponse
Prelude.Read, Int -> DescribeAccountResponse -> ShowS
[DescribeAccountResponse] -> ShowS
DescribeAccountResponse -> String
(Int -> DescribeAccountResponse -> ShowS)
-> (DescribeAccountResponse -> String)
-> ([DescribeAccountResponse] -> ShowS)
-> Show DescribeAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAccountResponse] -> ShowS
$cshowList :: [DescribeAccountResponse] -> ShowS
show :: DescribeAccountResponse -> String
$cshow :: DescribeAccountResponse -> String
showsPrec :: Int -> DescribeAccountResponse -> ShowS
$cshowsPrec :: Int -> DescribeAccountResponse -> ShowS
Prelude.Show, (forall x.
DescribeAccountResponse -> Rep DescribeAccountResponse x)
-> (forall x.
Rep DescribeAccountResponse x -> DescribeAccountResponse)
-> Generic DescribeAccountResponse
forall x. Rep DescribeAccountResponse x -> DescribeAccountResponse
forall x. DescribeAccountResponse -> Rep DescribeAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAccountResponse x -> DescribeAccountResponse
$cfrom :: forall x. DescribeAccountResponse -> Rep DescribeAccountResponse x
Prelude.Generic)
newDescribeAccountResponse ::
Prelude.Int ->
DescribeAccountResponse
newDescribeAccountResponse :: Int -> DescribeAccountResponse
newDescribeAccountResponse Int
pHttpStatus_ =
DescribeAccountResponse' :: Maybe DedicatedTenancySupportResultEnum
-> Maybe Text -> Int -> DescribeAccountResponse
DescribeAccountResponse'
{ $sel:dedicatedTenancySupport:DescribeAccountResponse' :: Maybe DedicatedTenancySupportResultEnum
dedicatedTenancySupport =
Maybe DedicatedTenancySupportResultEnum
forall a. Maybe a
Prelude.Nothing,
$sel:dedicatedTenancyManagementCidrRange:DescribeAccountResponse' :: Maybe Text
dedicatedTenancyManagementCidrRange =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeAccountResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeAccountResponse_dedicatedTenancySupport :: Lens.Lens' DescribeAccountResponse (Prelude.Maybe DedicatedTenancySupportResultEnum)
describeAccountResponse_dedicatedTenancySupport :: (Maybe DedicatedTenancySupportResultEnum
-> f (Maybe DedicatedTenancySupportResultEnum))
-> DescribeAccountResponse -> f DescribeAccountResponse
describeAccountResponse_dedicatedTenancySupport = (DescribeAccountResponse
-> Maybe DedicatedTenancySupportResultEnum)
-> (DescribeAccountResponse
-> Maybe DedicatedTenancySupportResultEnum
-> DescribeAccountResponse)
-> Lens
DescribeAccountResponse
DescribeAccountResponse
(Maybe DedicatedTenancySupportResultEnum)
(Maybe DedicatedTenancySupportResultEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccountResponse' {Maybe DedicatedTenancySupportResultEnum
dedicatedTenancySupport :: Maybe DedicatedTenancySupportResultEnum
$sel:dedicatedTenancySupport:DescribeAccountResponse' :: DescribeAccountResponse -> Maybe DedicatedTenancySupportResultEnum
dedicatedTenancySupport} -> Maybe DedicatedTenancySupportResultEnum
dedicatedTenancySupport) (\s :: DescribeAccountResponse
s@DescribeAccountResponse' {} Maybe DedicatedTenancySupportResultEnum
a -> DescribeAccountResponse
s {$sel:dedicatedTenancySupport:DescribeAccountResponse' :: Maybe DedicatedTenancySupportResultEnum
dedicatedTenancySupport = Maybe DedicatedTenancySupportResultEnum
a} :: DescribeAccountResponse)
describeAccountResponse_dedicatedTenancyManagementCidrRange :: Lens.Lens' DescribeAccountResponse (Prelude.Maybe Prelude.Text)
describeAccountResponse_dedicatedTenancyManagementCidrRange :: (Maybe Text -> f (Maybe Text))
-> DescribeAccountResponse -> f DescribeAccountResponse
describeAccountResponse_dedicatedTenancyManagementCidrRange = (DescribeAccountResponse -> Maybe Text)
-> (DescribeAccountResponse
-> Maybe Text -> DescribeAccountResponse)
-> Lens
DescribeAccountResponse
DescribeAccountResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccountResponse' {Maybe Text
dedicatedTenancyManagementCidrRange :: Maybe Text
$sel:dedicatedTenancyManagementCidrRange:DescribeAccountResponse' :: DescribeAccountResponse -> Maybe Text
dedicatedTenancyManagementCidrRange} -> Maybe Text
dedicatedTenancyManagementCidrRange) (\s :: DescribeAccountResponse
s@DescribeAccountResponse' {} Maybe Text
a -> DescribeAccountResponse
s {$sel:dedicatedTenancyManagementCidrRange:DescribeAccountResponse' :: Maybe Text
dedicatedTenancyManagementCidrRange = Maybe Text
a} :: DescribeAccountResponse)
describeAccountResponse_httpStatus :: Lens.Lens' DescribeAccountResponse Prelude.Int
describeAccountResponse_httpStatus :: (Int -> f Int)
-> DescribeAccountResponse -> f DescribeAccountResponse
describeAccountResponse_httpStatus = (DescribeAccountResponse -> Int)
-> (DescribeAccountResponse -> Int -> DescribeAccountResponse)
-> Lens DescribeAccountResponse DescribeAccountResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAccountResponse' :: DescribeAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAccountResponse
s@DescribeAccountResponse' {} Int
a -> DescribeAccountResponse
s {$sel:httpStatus:DescribeAccountResponse' :: Int
httpStatus = Int
a} :: DescribeAccountResponse)
instance Prelude.NFData DescribeAccountResponse