{-# 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.Amplify.ListDomainAssociations
(
ListDomainAssociations (..),
newListDomainAssociations,
listDomainAssociations_maxResults,
listDomainAssociations_nextToken,
listDomainAssociations_appId,
ListDomainAssociationsResponse (..),
newListDomainAssociationsResponse,
listDomainAssociationsResponse_nextToken,
listDomainAssociationsResponse_httpStatus,
listDomainAssociationsResponse_domainAssociations,
)
where
import Amazonka.Amplify.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListDomainAssociations = ListDomainAssociations'
{
ListDomainAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListDomainAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDomainAssociations -> Text
appId :: Prelude.Text
}
deriving (ListDomainAssociations -> ListDomainAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainAssociations -> ListDomainAssociations -> Bool
$c/= :: ListDomainAssociations -> ListDomainAssociations -> Bool
== :: ListDomainAssociations -> ListDomainAssociations -> Bool
$c== :: ListDomainAssociations -> ListDomainAssociations -> Bool
Prelude.Eq, ReadPrec [ListDomainAssociations]
ReadPrec ListDomainAssociations
Int -> ReadS ListDomainAssociations
ReadS [ListDomainAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainAssociations]
$creadListPrec :: ReadPrec [ListDomainAssociations]
readPrec :: ReadPrec ListDomainAssociations
$creadPrec :: ReadPrec ListDomainAssociations
readList :: ReadS [ListDomainAssociations]
$creadList :: ReadS [ListDomainAssociations]
readsPrec :: Int -> ReadS ListDomainAssociations
$creadsPrec :: Int -> ReadS ListDomainAssociations
Prelude.Read, Int -> ListDomainAssociations -> ShowS
[ListDomainAssociations] -> ShowS
ListDomainAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainAssociations] -> ShowS
$cshowList :: [ListDomainAssociations] -> ShowS
show :: ListDomainAssociations -> String
$cshow :: ListDomainAssociations -> String
showsPrec :: Int -> ListDomainAssociations -> ShowS
$cshowsPrec :: Int -> ListDomainAssociations -> ShowS
Prelude.Show, forall x. Rep ListDomainAssociations x -> ListDomainAssociations
forall x. ListDomainAssociations -> Rep ListDomainAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDomainAssociations x -> ListDomainAssociations
$cfrom :: forall x. ListDomainAssociations -> Rep ListDomainAssociations x
Prelude.Generic)
newListDomainAssociations ::
Prelude.Text ->
ListDomainAssociations
newListDomainAssociations :: Text -> ListDomainAssociations
newListDomainAssociations Text
pAppId_ =
ListDomainAssociations'
{ $sel:maxResults:ListDomainAssociations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDomainAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:appId:ListDomainAssociations' :: Text
appId = Text
pAppId_
}
listDomainAssociations_maxResults :: Lens.Lens' ListDomainAssociations (Prelude.Maybe Prelude.Natural)
listDomainAssociations_maxResults :: Lens' ListDomainAssociations (Maybe Natural)
listDomainAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDomainAssociations' :: ListDomainAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDomainAssociations
s@ListDomainAssociations' {} Maybe Natural
a -> ListDomainAssociations
s {$sel:maxResults:ListDomainAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDomainAssociations)
listDomainAssociations_nextToken :: Lens.Lens' ListDomainAssociations (Prelude.Maybe Prelude.Text)
listDomainAssociations_nextToken :: Lens' ListDomainAssociations (Maybe Text)
listDomainAssociations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDomainAssociations' :: ListDomainAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDomainAssociations
s@ListDomainAssociations' {} Maybe Text
a -> ListDomainAssociations
s {$sel:nextToken:ListDomainAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: ListDomainAssociations)
listDomainAssociations_appId :: Lens.Lens' ListDomainAssociations Prelude.Text
listDomainAssociations_appId :: Lens' ListDomainAssociations Text
listDomainAssociations_appId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociations' {Text
appId :: Text
$sel:appId:ListDomainAssociations' :: ListDomainAssociations -> Text
appId} -> Text
appId) (\s :: ListDomainAssociations
s@ListDomainAssociations' {} Text
a -> ListDomainAssociations
s {$sel:appId:ListDomainAssociations' :: Text
appId = Text
a} :: ListDomainAssociations)
instance Core.AWSPager ListDomainAssociations where
page :: ListDomainAssociations
-> AWSResponse ListDomainAssociations
-> Maybe ListDomainAssociations
page ListDomainAssociations
rq AWSResponse ListDomainAssociations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDomainAssociations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDomainAssociationsResponse (Maybe Text)
listDomainAssociationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDomainAssociations
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListDomainAssociationsResponse [DomainAssociation]
listDomainAssociationsResponse_domainAssociations
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListDomainAssociations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDomainAssociations (Maybe Text)
listDomainAssociations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDomainAssociations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDomainAssociationsResponse (Maybe Text)
listDomainAssociationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListDomainAssociations where
type
AWSResponse ListDomainAssociations =
ListDomainAssociationsResponse
request :: (Service -> Service)
-> ListDomainAssociations -> Request ListDomainAssociations
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 ListDomainAssociations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDomainAssociations)))
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
-> Int -> [DomainAssociation] -> ListDomainAssociationsResponse
ListDomainAssociationsResponse'
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
"nextToken")
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))
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
"domainAssociations"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListDomainAssociations where
hashWithSalt :: Int -> ListDomainAssociations -> Int
hashWithSalt Int
_salt ListDomainAssociations' {Maybe Natural
Maybe Text
Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:appId:ListDomainAssociations' :: ListDomainAssociations -> Text
$sel:nextToken:ListDomainAssociations' :: ListDomainAssociations -> Maybe Text
$sel:maxResults:ListDomainAssociations' :: ListDomainAssociations -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appId
instance Prelude.NFData ListDomainAssociations where
rnf :: ListDomainAssociations -> ()
rnf ListDomainAssociations' {Maybe Natural
Maybe Text
Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:appId:ListDomainAssociations' :: ListDomainAssociations -> Text
$sel:nextToken:ListDomainAssociations' :: ListDomainAssociations -> Maybe Text
$sel:maxResults:ListDomainAssociations' :: ListDomainAssociations -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appId
instance Data.ToHeaders ListDomainAssociations where
toHeaders :: ListDomainAssociations -> 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.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListDomainAssociations where
toPath :: ListDomainAssociations -> ByteString
toPath ListDomainAssociations' {Maybe Natural
Maybe Text
Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:appId:ListDomainAssociations' :: ListDomainAssociations -> Text
$sel:nextToken:ListDomainAssociations' :: ListDomainAssociations -> Maybe Text
$sel:maxResults:ListDomainAssociations' :: ListDomainAssociations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/apps/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
appId, ByteString
"/domains"]
instance Data.ToQuery ListDomainAssociations where
toQuery :: ListDomainAssociations -> QueryString
toQuery ListDomainAssociations' {Maybe Natural
Maybe Text
Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:appId:ListDomainAssociations' :: ListDomainAssociations -> Text
$sel:nextToken:ListDomainAssociations' :: ListDomainAssociations -> Maybe Text
$sel:maxResults:ListDomainAssociations' :: ListDomainAssociations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListDomainAssociationsResponse = ListDomainAssociationsResponse'
{
ListDomainAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDomainAssociationsResponse -> Int
httpStatus :: Prelude.Int,
ListDomainAssociationsResponse -> [DomainAssociation]
domainAssociations :: [DomainAssociation]
}
deriving (ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
$c/= :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
== :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
$c== :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [ListDomainAssociationsResponse]
ReadPrec ListDomainAssociationsResponse
Int -> ReadS ListDomainAssociationsResponse
ReadS [ListDomainAssociationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainAssociationsResponse]
$creadListPrec :: ReadPrec [ListDomainAssociationsResponse]
readPrec :: ReadPrec ListDomainAssociationsResponse
$creadPrec :: ReadPrec ListDomainAssociationsResponse
readList :: ReadS [ListDomainAssociationsResponse]
$creadList :: ReadS [ListDomainAssociationsResponse]
readsPrec :: Int -> ReadS ListDomainAssociationsResponse
$creadsPrec :: Int -> ReadS ListDomainAssociationsResponse
Prelude.Read, Int -> ListDomainAssociationsResponse -> ShowS
[ListDomainAssociationsResponse] -> ShowS
ListDomainAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainAssociationsResponse] -> ShowS
$cshowList :: [ListDomainAssociationsResponse] -> ShowS
show :: ListDomainAssociationsResponse -> String
$cshow :: ListDomainAssociationsResponse -> String
showsPrec :: Int -> ListDomainAssociationsResponse -> ShowS
$cshowsPrec :: Int -> ListDomainAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListDomainAssociationsResponse x
-> ListDomainAssociationsResponse
forall x.
ListDomainAssociationsResponse
-> Rep ListDomainAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDomainAssociationsResponse x
-> ListDomainAssociationsResponse
$cfrom :: forall x.
ListDomainAssociationsResponse
-> Rep ListDomainAssociationsResponse x
Prelude.Generic)
newListDomainAssociationsResponse ::
Prelude.Int ->
ListDomainAssociationsResponse
newListDomainAssociationsResponse :: Int -> ListDomainAssociationsResponse
newListDomainAssociationsResponse Int
pHttpStatus_ =
ListDomainAssociationsResponse'
{ $sel:nextToken:ListDomainAssociationsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDomainAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:domainAssociations:ListDomainAssociationsResponse' :: [DomainAssociation]
domainAssociations = forall a. Monoid a => a
Prelude.mempty
}
listDomainAssociationsResponse_nextToken :: Lens.Lens' ListDomainAssociationsResponse (Prelude.Maybe Prelude.Text)
listDomainAssociationsResponse_nextToken :: Lens' ListDomainAssociationsResponse (Maybe Text)
listDomainAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDomainAssociationsResponse
s@ListDomainAssociationsResponse' {} Maybe Text
a -> ListDomainAssociationsResponse
s {$sel:nextToken:ListDomainAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDomainAssociationsResponse)
listDomainAssociationsResponse_httpStatus :: Lens.Lens' ListDomainAssociationsResponse Prelude.Int
listDomainAssociationsResponse_httpStatus :: Lens' ListDomainAssociationsResponse Int
listDomainAssociationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDomainAssociationsResponse
s@ListDomainAssociationsResponse' {} Int
a -> ListDomainAssociationsResponse
s {$sel:httpStatus:ListDomainAssociationsResponse' :: Int
httpStatus = Int
a} :: ListDomainAssociationsResponse)
listDomainAssociationsResponse_domainAssociations :: Lens.Lens' ListDomainAssociationsResponse [DomainAssociation]
listDomainAssociationsResponse_domainAssociations :: Lens' ListDomainAssociationsResponse [DomainAssociation]
listDomainAssociationsResponse_domainAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociationsResponse' {[DomainAssociation]
domainAssociations :: [DomainAssociation]
$sel:domainAssociations:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> [DomainAssociation]
domainAssociations} -> [DomainAssociation]
domainAssociations) (\s :: ListDomainAssociationsResponse
s@ListDomainAssociationsResponse' {} [DomainAssociation]
a -> ListDomainAssociationsResponse
s {$sel:domainAssociations:ListDomainAssociationsResponse' :: [DomainAssociation]
domainAssociations = [DomainAssociation]
a} :: ListDomainAssociationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
ListDomainAssociationsResponse
where
rnf :: ListDomainAssociationsResponse -> ()
rnf ListDomainAssociationsResponse' {Int
[DomainAssociation]
Maybe Text
domainAssociations :: [DomainAssociation]
httpStatus :: Int
nextToken :: Maybe Text
$sel:domainAssociations:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> [DomainAssociation]
$sel:httpStatus:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> Int
$sel:nextToken:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [DomainAssociation]
domainAssociations