module Aws.SimpleDb.Commands.Domain where
import Aws.Core
import Aws.SimpleDb.Core
import Control.Applicative
import Data.Maybe
import Data.Time
import Data.Time.Clock.POSIX
import Prelude
import Text.XML.Cursor (($//), (&|))
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
data CreateDomain
= CreateDomain {
CreateDomain -> Text
cdDomainName :: T.Text
}
deriving (Int -> CreateDomain -> ShowS
[CreateDomain] -> ShowS
CreateDomain -> String
(Int -> CreateDomain -> ShowS)
-> (CreateDomain -> String)
-> ([CreateDomain] -> ShowS)
-> Show CreateDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDomain] -> ShowS
$cshowList :: [CreateDomain] -> ShowS
show :: CreateDomain -> String
$cshow :: CreateDomain -> String
showsPrec :: Int -> CreateDomain -> ShowS
$cshowsPrec :: Int -> CreateDomain -> ShowS
Show)
data CreateDomainResponse
= CreateDomainResponse
deriving (Int -> CreateDomainResponse -> ShowS
[CreateDomainResponse] -> ShowS
CreateDomainResponse -> String
(Int -> CreateDomainResponse -> ShowS)
-> (CreateDomainResponse -> String)
-> ([CreateDomainResponse] -> ShowS)
-> Show CreateDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDomainResponse] -> ShowS
$cshowList :: [CreateDomainResponse] -> ShowS
show :: CreateDomainResponse -> String
$cshow :: CreateDomainResponse -> String
showsPrec :: Int -> CreateDomainResponse -> ShowS
$cshowsPrec :: Int -> CreateDomainResponse -> ShowS
Show)
createDomain :: T.Text -> CreateDomain
createDomain :: Text -> CreateDomain
createDomain Text
name = CreateDomain :: Text -> CreateDomain
CreateDomain { cdDomainName :: Text
cdDomainName = Text
name }
instance SignQuery CreateDomain where
type ServiceConfiguration CreateDomain = SdbConfiguration
signQuery :: CreateDomain
-> ServiceConfiguration CreateDomain queryType
-> SignatureData
-> SignedQuery
signQuery CreateDomain{Text
cdDomainName :: Text
cdDomainName :: CreateDomain -> Text
..} = [(ByteString, ByteString)]
-> SdbConfiguration queryType -> SignatureData -> SignedQuery
forall qt.
[(ByteString, ByteString)]
-> SdbConfiguration qt -> SignatureData -> SignedQuery
sdbSignQuery [(ByteString
"Action", ByteString
"CreateDomain"), (ByteString
"DomainName", Text -> ByteString
T.encodeUtf8 Text
cdDomainName)]
instance ResponseConsumer r CreateDomainResponse where
type ResponseMetadata CreateDomainResponse = SdbMetadata
responseConsumer :: Request
-> r
-> IORef (ResponseMetadata CreateDomainResponse)
-> HTTPResponseConsumer CreateDomainResponse
responseConsumer Request
_ r
_
= (Cursor -> Response SdbMetadata CreateDomainResponse)
-> IORef SdbMetadata -> HTTPResponseConsumer CreateDomainResponse
forall a.
(Cursor -> Response SdbMetadata a)
-> IORef SdbMetadata -> HTTPResponseConsumer a
sdbResponseConsumer ((Cursor -> Response SdbMetadata CreateDomainResponse)
-> IORef SdbMetadata -> HTTPResponseConsumer CreateDomainResponse)
-> (Cursor -> Response SdbMetadata CreateDomainResponse)
-> IORef SdbMetadata
-> HTTPResponseConsumer CreateDomainResponse
forall a b. (a -> b) -> a -> b
$ CreateDomainResponse
-> Text -> Cursor -> Response SdbMetadata CreateDomainResponse
forall (m :: * -> *) a. MonadThrow m => a -> Text -> Cursor -> m a
sdbCheckResponseType CreateDomainResponse
CreateDomainResponse Text
"CreateDomainResponse"
instance Transaction CreateDomain CreateDomainResponse
instance AsMemoryResponse CreateDomainResponse where
type MemoryResponse CreateDomainResponse = CreateDomainResponse
loadToMemory :: CreateDomainResponse
-> ResourceT IO (MemoryResponse CreateDomainResponse)
loadToMemory = CreateDomainResponse
-> ResourceT IO (MemoryResponse CreateDomainResponse)
forall (m :: * -> *) a. Monad m => a -> m a
return
data DeleteDomain
= DeleteDomain {
DeleteDomain -> Text
ddDomainName :: T.Text
}
deriving (Int -> DeleteDomain -> ShowS
[DeleteDomain] -> ShowS
DeleteDomain -> String
(Int -> DeleteDomain -> ShowS)
-> (DeleteDomain -> String)
-> ([DeleteDomain] -> ShowS)
-> Show DeleteDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDomain] -> ShowS
$cshowList :: [DeleteDomain] -> ShowS
show :: DeleteDomain -> String
$cshow :: DeleteDomain -> String
showsPrec :: Int -> DeleteDomain -> ShowS
$cshowsPrec :: Int -> DeleteDomain -> ShowS
Show)
data DeleteDomainResponse
= DeleteDomainResponse
deriving (Int -> DeleteDomainResponse -> ShowS
[DeleteDomainResponse] -> ShowS
DeleteDomainResponse -> String
(Int -> DeleteDomainResponse -> ShowS)
-> (DeleteDomainResponse -> String)
-> ([DeleteDomainResponse] -> ShowS)
-> Show DeleteDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDomainResponse] -> ShowS
$cshowList :: [DeleteDomainResponse] -> ShowS
show :: DeleteDomainResponse -> String
$cshow :: DeleteDomainResponse -> String
showsPrec :: Int -> DeleteDomainResponse -> ShowS
$cshowsPrec :: Int -> DeleteDomainResponse -> ShowS
Show)
deleteDomain :: T.Text -> DeleteDomain
deleteDomain :: Text -> DeleteDomain
deleteDomain Text
name = DeleteDomain :: Text -> DeleteDomain
DeleteDomain { ddDomainName :: Text
ddDomainName = Text
name }
instance SignQuery DeleteDomain where
type ServiceConfiguration DeleteDomain = SdbConfiguration
signQuery :: DeleteDomain
-> ServiceConfiguration DeleteDomain queryType
-> SignatureData
-> SignedQuery
signQuery DeleteDomain{Text
ddDomainName :: Text
ddDomainName :: DeleteDomain -> Text
..} = [(ByteString, ByteString)]
-> SdbConfiguration queryType -> SignatureData -> SignedQuery
forall qt.
[(ByteString, ByteString)]
-> SdbConfiguration qt -> SignatureData -> SignedQuery
sdbSignQuery [(ByteString
"Action", ByteString
"DeleteDomain"), (ByteString
"DomainName", Text -> ByteString
T.encodeUtf8 Text
ddDomainName)]
instance ResponseConsumer r DeleteDomainResponse where
type ResponseMetadata DeleteDomainResponse = SdbMetadata
responseConsumer :: Request
-> r
-> IORef (ResponseMetadata DeleteDomainResponse)
-> HTTPResponseConsumer DeleteDomainResponse
responseConsumer Request
_ r
_
= (Cursor -> Response SdbMetadata DeleteDomainResponse)
-> IORef SdbMetadata -> HTTPResponseConsumer DeleteDomainResponse
forall a.
(Cursor -> Response SdbMetadata a)
-> IORef SdbMetadata -> HTTPResponseConsumer a
sdbResponseConsumer ((Cursor -> Response SdbMetadata DeleteDomainResponse)
-> IORef SdbMetadata -> HTTPResponseConsumer DeleteDomainResponse)
-> (Cursor -> Response SdbMetadata DeleteDomainResponse)
-> IORef SdbMetadata
-> HTTPResponseConsumer DeleteDomainResponse
forall a b. (a -> b) -> a -> b
$ DeleteDomainResponse
-> Text -> Cursor -> Response SdbMetadata DeleteDomainResponse
forall (m :: * -> *) a. MonadThrow m => a -> Text -> Cursor -> m a
sdbCheckResponseType DeleteDomainResponse
DeleteDomainResponse Text
"DeleteDomainResponse"
instance Transaction DeleteDomain DeleteDomainResponse
instance AsMemoryResponse DeleteDomainResponse where
type MemoryResponse DeleteDomainResponse = DeleteDomainResponse
loadToMemory :: DeleteDomainResponse
-> ResourceT IO (MemoryResponse DeleteDomainResponse)
loadToMemory = DeleteDomainResponse
-> ResourceT IO (MemoryResponse DeleteDomainResponse)
forall (m :: * -> *) a. Monad m => a -> m a
return
data DomainMetadata
= DomainMetadata {
DomainMetadata -> Text
dmDomainName :: T.Text
}
deriving (Int -> DomainMetadata -> ShowS
[DomainMetadata] -> ShowS
DomainMetadata -> String
(Int -> DomainMetadata -> ShowS)
-> (DomainMetadata -> String)
-> ([DomainMetadata] -> ShowS)
-> Show DomainMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainMetadata] -> ShowS
$cshowList :: [DomainMetadata] -> ShowS
show :: DomainMetadata -> String
$cshow :: DomainMetadata -> String
showsPrec :: Int -> DomainMetadata -> ShowS
$cshowsPrec :: Int -> DomainMetadata -> ShowS
Show)
data DomainMetadataResponse
= DomainMetadataResponse {
DomainMetadataResponse -> UTCTime
dmrTimestamp :: UTCTime
, DomainMetadataResponse -> Integer
dmrItemCount :: Integer
, DomainMetadataResponse -> Integer
dmrAttributeValueCount :: Integer
, DomainMetadataResponse -> Integer
dmrAttributeNameCount :: Integer
, DomainMetadataResponse -> Integer
dmrItemNamesSizeBytes :: Integer
, DomainMetadataResponse -> Integer
dmrAttributeValuesSizeBytes :: Integer
, DomainMetadataResponse -> Integer
dmrAttributeNamesSizeBytes :: Integer
}
deriving (Int -> DomainMetadataResponse -> ShowS
[DomainMetadataResponse] -> ShowS
DomainMetadataResponse -> String
(Int -> DomainMetadataResponse -> ShowS)
-> (DomainMetadataResponse -> String)
-> ([DomainMetadataResponse] -> ShowS)
-> Show DomainMetadataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainMetadataResponse] -> ShowS
$cshowList :: [DomainMetadataResponse] -> ShowS
show :: DomainMetadataResponse -> String
$cshow :: DomainMetadataResponse -> String
showsPrec :: Int -> DomainMetadataResponse -> ShowS
$cshowsPrec :: Int -> DomainMetadataResponse -> ShowS
Show)
domainMetadata :: T.Text -> DomainMetadata
domainMetadata :: Text -> DomainMetadata
domainMetadata Text
name = DomainMetadata :: Text -> DomainMetadata
DomainMetadata { dmDomainName :: Text
dmDomainName = Text
name }
instance SignQuery DomainMetadata where
type ServiceConfiguration DomainMetadata = SdbConfiguration
signQuery :: DomainMetadata
-> ServiceConfiguration DomainMetadata queryType
-> SignatureData
-> SignedQuery
signQuery DomainMetadata{Text
dmDomainName :: Text
dmDomainName :: DomainMetadata -> Text
..} = [(ByteString, ByteString)]
-> SdbConfiguration queryType -> SignatureData -> SignedQuery
forall qt.
[(ByteString, ByteString)]
-> SdbConfiguration qt -> SignatureData -> SignedQuery
sdbSignQuery [(ByteString
"Action", ByteString
"DomainMetadata"), (ByteString
"DomainName", Text -> ByteString
T.encodeUtf8 Text
dmDomainName)]
instance ResponseConsumer r DomainMetadataResponse where
type ResponseMetadata DomainMetadataResponse = SdbMetadata
responseConsumer :: Request
-> r
-> IORef (ResponseMetadata DomainMetadataResponse)
-> HTTPResponseConsumer DomainMetadataResponse
responseConsumer Request
_ r
_
= (Cursor -> Response SdbMetadata DomainMetadataResponse)
-> IORef SdbMetadata -> HTTPResponseConsumer DomainMetadataResponse
forall a.
(Cursor -> Response SdbMetadata a)
-> IORef SdbMetadata -> HTTPResponseConsumer a
sdbResponseConsumer Cursor -> Response SdbMetadata DomainMetadataResponse
forall (m :: * -> *).
MonadThrow m =>
Cursor -> m DomainMetadataResponse
parse
where parse :: Cursor -> m DomainMetadataResponse
parse Cursor
cursor = do
() -> Text -> Cursor -> m ()
forall (m :: * -> *) a. MonadThrow m => a -> Text -> Cursor -> m a
sdbCheckResponseType () Text
"DomainMetadataResponse" Cursor
cursor
UTCTime
dmrTimestamp <- String -> [m UTCTime] -> m UTCTime
forall (m :: * -> *) a. MonadThrow m => String -> [m a] -> m a
forceM String
"Timestamp expected" ([m UTCTime] -> m UTCTime) -> [m UTCTime] -> m UTCTime
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [m UTCTime]) -> [m UTCTime]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [String]
elCont Text
"Timestamp" (Cursor -> [String])
-> (String -> m UTCTime) -> Cursor -> [m UTCTime]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| ((POSIXTime -> UTCTime) -> m POSIXTime -> m UTCTime
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap POSIXTime -> UTCTime
posixSecondsToUTCTime (m POSIXTime -> m UTCTime)
-> (String -> m POSIXTime) -> String -> m UTCTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> m POSIXTime
forall (m :: * -> *) a. (MonadThrow m, Num a) => String -> m a
readInt)
Integer
dmrItemCount <- String -> [m Integer] -> m Integer
forall (m :: * -> *) a. MonadThrow m => String -> [m a] -> m a
forceM String
"ItemCount expected" ([m Integer] -> m Integer) -> [m Integer] -> m Integer
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [m Integer]) -> [m Integer]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [String]
elCont Text
"ItemCount" (Cursor -> [String])
-> (String -> m Integer) -> Cursor -> [m Integer]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| String -> m Integer
forall (m :: * -> *) a. (MonadThrow m, Num a) => String -> m a
readInt
Integer
dmrAttributeValueCount <- String -> [m Integer] -> m Integer
forall (m :: * -> *) a. MonadThrow m => String -> [m a] -> m a
forceM String
"AttributeValueCount expected" ([m Integer] -> m Integer) -> [m Integer] -> m Integer
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [m Integer]) -> [m Integer]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [String]
elCont Text
"AttributeValueCount" (Cursor -> [String])
-> (String -> m Integer) -> Cursor -> [m Integer]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| String -> m Integer
forall (m :: * -> *) a. (MonadThrow m, Num a) => String -> m a
readInt
Integer
dmrAttributeNameCount <- String -> [m Integer] -> m Integer
forall (m :: * -> *) a. MonadThrow m => String -> [m a] -> m a
forceM String
"AttributeNameCount expected" ([m Integer] -> m Integer) -> [m Integer] -> m Integer
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [m Integer]) -> [m Integer]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [String]
elCont Text
"AttributeNameCount" (Cursor -> [String])
-> (String -> m Integer) -> Cursor -> [m Integer]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| String -> m Integer
forall (m :: * -> *) a. (MonadThrow m, Num a) => String -> m a
readInt
Integer
dmrItemNamesSizeBytes <- String -> [m Integer] -> m Integer
forall (m :: * -> *) a. MonadThrow m => String -> [m a] -> m a
forceM String
"ItemNamesSizeBytes expected" ([m Integer] -> m Integer) -> [m Integer] -> m Integer
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [m Integer]) -> [m Integer]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [String]
elCont Text
"ItemNamesSizeBytes" (Cursor -> [String])
-> (String -> m Integer) -> Cursor -> [m Integer]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| String -> m Integer
forall (m :: * -> *) a. (MonadThrow m, Num a) => String -> m a
readInt
Integer
dmrAttributeValuesSizeBytes <- String -> [m Integer] -> m Integer
forall (m :: * -> *) a. MonadThrow m => String -> [m a] -> m a
forceM String
"AttributeValuesSizeBytes expected" ([m Integer] -> m Integer) -> [m Integer] -> m Integer
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [m Integer]) -> [m Integer]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [String]
elCont Text
"AttributeValuesSizeBytes" (Cursor -> [String])
-> (String -> m Integer) -> Cursor -> [m Integer]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| String -> m Integer
forall (m :: * -> *) a. (MonadThrow m, Num a) => String -> m a
readInt
Integer
dmrAttributeNamesSizeBytes <- String -> [m Integer] -> m Integer
forall (m :: * -> *) a. MonadThrow m => String -> [m a] -> m a
forceM String
"AttributeNamesSizeBytes expected" ([m Integer] -> m Integer) -> [m Integer] -> m Integer
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [m Integer]) -> [m Integer]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [String]
elCont Text
"AttributeNamesSizeBytes" (Cursor -> [String])
-> (String -> m Integer) -> Cursor -> [m Integer]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| String -> m Integer
forall (m :: * -> *) a. (MonadThrow m, Num a) => String -> m a
readInt
DomainMetadataResponse -> m DomainMetadataResponse
forall (m :: * -> *) a. Monad m => a -> m a
return DomainMetadataResponse :: UTCTime
-> Integer
-> Integer
-> Integer
-> Integer
-> Integer
-> Integer
-> DomainMetadataResponse
DomainMetadataResponse{Integer
UTCTime
dmrAttributeNamesSizeBytes :: Integer
dmrAttributeValuesSizeBytes :: Integer
dmrItemNamesSizeBytes :: Integer
dmrAttributeNameCount :: Integer
dmrAttributeValueCount :: Integer
dmrItemCount :: Integer
dmrTimestamp :: UTCTime
dmrAttributeNamesSizeBytes :: Integer
dmrAttributeValuesSizeBytes :: Integer
dmrItemNamesSizeBytes :: Integer
dmrAttributeNameCount :: Integer
dmrAttributeValueCount :: Integer
dmrItemCount :: Integer
dmrTimestamp :: UTCTime
..}
instance Transaction DomainMetadata DomainMetadataResponse
instance AsMemoryResponse DomainMetadataResponse where
type MemoryResponse DomainMetadataResponse = DomainMetadataResponse
loadToMemory :: DomainMetadataResponse
-> ResourceT IO (MemoryResponse DomainMetadataResponse)
loadToMemory = DomainMetadataResponse
-> ResourceT IO (MemoryResponse DomainMetadataResponse)
forall (m :: * -> *) a. Monad m => a -> m a
return
data ListDomains
= ListDomains {
ListDomains -> Maybe Int
ldMaxNumberOfDomains :: Maybe Int
, ListDomains -> Maybe Text
ldNextToken :: Maybe T.Text
}
deriving (Int -> ListDomains -> ShowS
[ListDomains] -> ShowS
ListDomains -> String
(Int -> ListDomains -> ShowS)
-> (ListDomains -> String)
-> ([ListDomains] -> ShowS)
-> Show ListDomains
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomains] -> ShowS
$cshowList :: [ListDomains] -> ShowS
show :: ListDomains -> String
$cshow :: ListDomains -> String
showsPrec :: Int -> ListDomains -> ShowS
$cshowsPrec :: Int -> ListDomains -> ShowS
Show)
data ListDomainsResponse
= ListDomainsResponse {
ListDomainsResponse -> [Text]
ldrDomainNames :: [T.Text]
, ListDomainsResponse -> Maybe Text
ldrNextToken :: Maybe T.Text
}
deriving (Int -> ListDomainsResponse -> ShowS
[ListDomainsResponse] -> ShowS
ListDomainsResponse -> String
(Int -> ListDomainsResponse -> ShowS)
-> (ListDomainsResponse -> String)
-> ([ListDomainsResponse] -> ShowS)
-> Show ListDomainsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainsResponse] -> ShowS
$cshowList :: [ListDomainsResponse] -> ShowS
show :: ListDomainsResponse -> String
$cshow :: ListDomainsResponse -> String
showsPrec :: Int -> ListDomainsResponse -> ShowS
$cshowsPrec :: Int -> ListDomainsResponse -> ShowS
Show)
listDomains :: ListDomains
listDomains :: ListDomains
listDomains = ListDomains :: Maybe Int -> Maybe Text -> ListDomains
ListDomains { ldMaxNumberOfDomains :: Maybe Int
ldMaxNumberOfDomains = Maybe Int
forall a. Maybe a
Nothing, ldNextToken :: Maybe Text
ldNextToken = Maybe Text
forall a. Maybe a
Nothing }
instance SignQuery ListDomains where
type ServiceConfiguration ListDomains = SdbConfiguration
signQuery :: ListDomains
-> ServiceConfiguration ListDomains queryType
-> SignatureData
-> SignedQuery
signQuery ListDomains{Maybe Int
Maybe Text
ldNextToken :: Maybe Text
ldMaxNumberOfDomains :: Maybe Int
ldNextToken :: ListDomains -> Maybe Text
ldMaxNumberOfDomains :: ListDomains -> Maybe Int
..} = [(ByteString, ByteString)]
-> SdbConfiguration queryType -> SignatureData -> SignedQuery
forall qt.
[(ByteString, ByteString)]
-> SdbConfiguration qt -> SignatureData -> SignedQuery
sdbSignQuery ([(ByteString, ByteString)]
-> SdbConfiguration queryType -> SignatureData -> SignedQuery)
-> [(ByteString, ByteString)]
-> SdbConfiguration queryType
-> SignatureData
-> SignedQuery
forall a b. (a -> b) -> a -> b
$ [Maybe (ByteString, ByteString)] -> [(ByteString, ByteString)]
forall a. [Maybe a] -> [a]
catMaybes [
(ByteString, ByteString) -> Maybe (ByteString, ByteString)
forall a. a -> Maybe a
Just (ByteString
"Action", ByteString
"ListDomains")
, (ByteString
"MaxNumberOfDomains",) (ByteString -> (ByteString, ByteString))
-> (Int -> ByteString) -> Int -> (ByteString, ByteString)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> ByteString
T.encodeUtf8 (Text -> ByteString) -> (Int -> Text) -> Int -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
T.pack (String -> Text) -> (Int -> String) -> Int -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String
forall a. Show a => a -> String
show (Int -> (ByteString, ByteString))
-> Maybe Int -> Maybe (ByteString, ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Int
ldMaxNumberOfDomains
, (ByteString
"NextToken",) (ByteString -> (ByteString, ByteString))
-> (Text -> ByteString) -> Text -> (ByteString, ByteString)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> ByteString
T.encodeUtf8 (Text -> (ByteString, ByteString))
-> Maybe Text -> Maybe (ByteString, ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
ldNextToken
]
instance ResponseConsumer r ListDomainsResponse where
type ResponseMetadata ListDomainsResponse = SdbMetadata
responseConsumer :: Request
-> r
-> IORef (ResponseMetadata ListDomainsResponse)
-> HTTPResponseConsumer ListDomainsResponse
responseConsumer Request
_ r
_ = (Cursor -> Response SdbMetadata ListDomainsResponse)
-> IORef SdbMetadata -> HTTPResponseConsumer ListDomainsResponse
forall a.
(Cursor -> Response SdbMetadata a)
-> IORef SdbMetadata -> HTTPResponseConsumer a
sdbResponseConsumer Cursor -> Response SdbMetadata ListDomainsResponse
forall (m :: * -> *).
MonadThrow m =>
Cursor -> m ListDomainsResponse
parse
where parse :: Cursor -> m ListDomainsResponse
parse Cursor
cursor = do
() -> Text -> Cursor -> m ()
forall (m :: * -> *) a. MonadThrow m => a -> Text -> Cursor -> m a
sdbCheckResponseType () Text
"ListDomainsResponse" Cursor
cursor
let names :: [Text]
names = Cursor
cursor Cursor -> (Cursor -> [Text]) -> [Text]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [Text]
elContent Text
"DomainName"
let nextToken :: Maybe Text
nextToken = [Text] -> Maybe Text
forall a. [a] -> Maybe a
listToMaybe ([Text] -> Maybe Text) -> [Text] -> Maybe Text
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor -> (Cursor -> [Text]) -> [Text]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [Text]
elContent Text
"NextToken"
ListDomainsResponse -> m ListDomainsResponse
forall (m :: * -> *) a. Monad m => a -> m a
return (ListDomainsResponse -> m ListDomainsResponse)
-> ListDomainsResponse -> m ListDomainsResponse
forall a b. (a -> b) -> a -> b
$ [Text] -> Maybe Text -> ListDomainsResponse
ListDomainsResponse [Text]
names Maybe Text
nextToken
instance Transaction ListDomains ListDomainsResponse
instance AsMemoryResponse ListDomainsResponse where
type MemoryResponse ListDomainsResponse = ListDomainsResponse
loadToMemory :: ListDomainsResponse
-> ResourceT IO (MemoryResponse ListDomainsResponse)
loadToMemory = ListDomainsResponse
-> ResourceT IO (MemoryResponse ListDomainsResponse)
forall (m :: * -> *) a. Monad m => a -> m a
return
instance ListResponse ListDomainsResponse T.Text where
listResponse :: ListDomainsResponse -> [Text]
listResponse = ListDomainsResponse -> [Text]
ldrDomainNames
instance IteratedTransaction ListDomains ListDomainsResponse where
nextIteratedRequest :: ListDomains -> ListDomainsResponse -> Maybe ListDomains
nextIteratedRequest ListDomains
req ListDomainsResponse{ldrNextToken :: ListDomainsResponse -> Maybe Text
ldrNextToken=Maybe Text
nt} = ListDomains
req{ldNextToken :: Maybe Text
ldNextToken=Maybe Text
nt} ListDomains -> Maybe Text -> Maybe ListDomains
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Maybe Text
nt