{-# 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.IoT.ListDomainConfigurations
(
ListDomainConfigurations (..),
newListDomainConfigurations,
listDomainConfigurations_marker,
listDomainConfigurations_pageSize,
listDomainConfigurations_serviceType,
ListDomainConfigurationsResponse (..),
newListDomainConfigurationsResponse,
listDomainConfigurationsResponse_domainConfigurations,
listDomainConfigurationsResponse_nextMarker,
listDomainConfigurationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListDomainConfigurations = ListDomainConfigurations'
{
ListDomainConfigurations -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListDomainConfigurations -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
ListDomainConfigurations -> Maybe ServiceType
serviceType :: Prelude.Maybe ServiceType
}
deriving (ListDomainConfigurations -> ListDomainConfigurations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainConfigurations -> ListDomainConfigurations -> Bool
$c/= :: ListDomainConfigurations -> ListDomainConfigurations -> Bool
== :: ListDomainConfigurations -> ListDomainConfigurations -> Bool
$c== :: ListDomainConfigurations -> ListDomainConfigurations -> Bool
Prelude.Eq, ReadPrec [ListDomainConfigurations]
ReadPrec ListDomainConfigurations
Int -> ReadS ListDomainConfigurations
ReadS [ListDomainConfigurations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainConfigurations]
$creadListPrec :: ReadPrec [ListDomainConfigurations]
readPrec :: ReadPrec ListDomainConfigurations
$creadPrec :: ReadPrec ListDomainConfigurations
readList :: ReadS [ListDomainConfigurations]
$creadList :: ReadS [ListDomainConfigurations]
readsPrec :: Int -> ReadS ListDomainConfigurations
$creadsPrec :: Int -> ReadS ListDomainConfigurations
Prelude.Read, Int -> ListDomainConfigurations -> ShowS
[ListDomainConfigurations] -> ShowS
ListDomainConfigurations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainConfigurations] -> ShowS
$cshowList :: [ListDomainConfigurations] -> ShowS
show :: ListDomainConfigurations -> String
$cshow :: ListDomainConfigurations -> String
showsPrec :: Int -> ListDomainConfigurations -> ShowS
$cshowsPrec :: Int -> ListDomainConfigurations -> ShowS
Prelude.Show, forall x.
Rep ListDomainConfigurations x -> ListDomainConfigurations
forall x.
ListDomainConfigurations -> Rep ListDomainConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDomainConfigurations x -> ListDomainConfigurations
$cfrom :: forall x.
ListDomainConfigurations -> Rep ListDomainConfigurations x
Prelude.Generic)
newListDomainConfigurations ::
ListDomainConfigurations
newListDomainConfigurations :: ListDomainConfigurations
newListDomainConfigurations =
ListDomainConfigurations'
{ $sel:marker:ListDomainConfigurations' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListDomainConfigurations' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
$sel:serviceType:ListDomainConfigurations' :: Maybe ServiceType
serviceType = forall a. Maybe a
Prelude.Nothing
}
listDomainConfigurations_marker :: Lens.Lens' ListDomainConfigurations (Prelude.Maybe Prelude.Text)
listDomainConfigurations_marker :: Lens' ListDomainConfigurations (Maybe Text)
listDomainConfigurations_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainConfigurations' {Maybe Text
marker :: Maybe Text
$sel:marker:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListDomainConfigurations
s@ListDomainConfigurations' {} Maybe Text
a -> ListDomainConfigurations
s {$sel:marker:ListDomainConfigurations' :: Maybe Text
marker = Maybe Text
a} :: ListDomainConfigurations)
listDomainConfigurations_pageSize :: Lens.Lens' ListDomainConfigurations (Prelude.Maybe Prelude.Natural)
listDomainConfigurations_pageSize :: Lens' ListDomainConfigurations (Maybe Natural)
listDomainConfigurations_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainConfigurations' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListDomainConfigurations
s@ListDomainConfigurations' {} Maybe Natural
a -> ListDomainConfigurations
s {$sel:pageSize:ListDomainConfigurations' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListDomainConfigurations)
listDomainConfigurations_serviceType :: Lens.Lens' ListDomainConfigurations (Prelude.Maybe ServiceType)
listDomainConfigurations_serviceType :: Lens' ListDomainConfigurations (Maybe ServiceType)
listDomainConfigurations_serviceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainConfigurations' {Maybe ServiceType
serviceType :: Maybe ServiceType
$sel:serviceType:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe ServiceType
serviceType} -> Maybe ServiceType
serviceType) (\s :: ListDomainConfigurations
s@ListDomainConfigurations' {} Maybe ServiceType
a -> ListDomainConfigurations
s {$sel:serviceType:ListDomainConfigurations' :: Maybe ServiceType
serviceType = Maybe ServiceType
a} :: ListDomainConfigurations)
instance Core.AWSPager ListDomainConfigurations where
page :: ListDomainConfigurations
-> AWSResponse ListDomainConfigurations
-> Maybe ListDomainConfigurations
page ListDomainConfigurations
rq AWSResponse ListDomainConfigurations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDomainConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDomainConfigurationsResponse (Maybe Text)
listDomainConfigurationsResponse_nextMarker
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 ListDomainConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListDomainConfigurationsResponse
(Maybe [DomainConfigurationSummary])
listDomainConfigurationsResponse_domainConfigurations
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
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListDomainConfigurations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDomainConfigurations (Maybe Text)
listDomainConfigurations_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDomainConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDomainConfigurationsResponse (Maybe Text)
listDomainConfigurationsResponse_nextMarker
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 ListDomainConfigurations where
type
AWSResponse ListDomainConfigurations =
ListDomainConfigurationsResponse
request :: (Service -> Service)
-> ListDomainConfigurations -> Request ListDomainConfigurations
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 ListDomainConfigurations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDomainConfigurations)))
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 [DomainConfigurationSummary]
-> Maybe Text -> Int -> ListDomainConfigurationsResponse
ListDomainConfigurationsResponse'
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
"domainConfigurations"
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
"nextMarker")
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 ListDomainConfigurations where
hashWithSalt :: Int -> ListDomainConfigurations -> Int
hashWithSalt Int
_salt ListDomainConfigurations' {Maybe Natural
Maybe Text
Maybe ServiceType
serviceType :: Maybe ServiceType
pageSize :: Maybe Natural
marker :: Maybe Text
$sel:serviceType:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe ServiceType
$sel:pageSize:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Natural
$sel:marker:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceType
serviceType
instance Prelude.NFData ListDomainConfigurations where
rnf :: ListDomainConfigurations -> ()
rnf ListDomainConfigurations' {Maybe Natural
Maybe Text
Maybe ServiceType
serviceType :: Maybe ServiceType
pageSize :: Maybe Natural
marker :: Maybe Text
$sel:serviceType:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe ServiceType
$sel:pageSize:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Natural
$sel:marker:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pageSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceType
serviceType
instance Data.ToHeaders ListDomainConfigurations where
toHeaders :: ListDomainConfigurations -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListDomainConfigurations where
toPath :: ListDomainConfigurations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/domainConfigurations"
instance Data.ToQuery ListDomainConfigurations where
toQuery :: ListDomainConfigurations -> QueryString
toQuery ListDomainConfigurations' {Maybe Natural
Maybe Text
Maybe ServiceType
serviceType :: Maybe ServiceType
pageSize :: Maybe Natural
marker :: Maybe Text
$sel:serviceType:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe ServiceType
$sel:pageSize:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Natural
$sel:marker:ListDomainConfigurations' :: ListDomainConfigurations -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"pageSize" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
pageSize,
ByteString
"serviceType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ServiceType
serviceType
]
data ListDomainConfigurationsResponse = ListDomainConfigurationsResponse'
{
ListDomainConfigurationsResponse
-> Maybe [DomainConfigurationSummary]
domainConfigurations :: Prelude.Maybe [DomainConfigurationSummary],
ListDomainConfigurationsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListDomainConfigurationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDomainConfigurationsResponse
-> ListDomainConfigurationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainConfigurationsResponse
-> ListDomainConfigurationsResponse -> Bool
$c/= :: ListDomainConfigurationsResponse
-> ListDomainConfigurationsResponse -> Bool
== :: ListDomainConfigurationsResponse
-> ListDomainConfigurationsResponse -> Bool
$c== :: ListDomainConfigurationsResponse
-> ListDomainConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListDomainConfigurationsResponse]
ReadPrec ListDomainConfigurationsResponse
Int -> ReadS ListDomainConfigurationsResponse
ReadS [ListDomainConfigurationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainConfigurationsResponse]
$creadListPrec :: ReadPrec [ListDomainConfigurationsResponse]
readPrec :: ReadPrec ListDomainConfigurationsResponse
$creadPrec :: ReadPrec ListDomainConfigurationsResponse
readList :: ReadS [ListDomainConfigurationsResponse]
$creadList :: ReadS [ListDomainConfigurationsResponse]
readsPrec :: Int -> ReadS ListDomainConfigurationsResponse
$creadsPrec :: Int -> ReadS ListDomainConfigurationsResponse
Prelude.Read, Int -> ListDomainConfigurationsResponse -> ShowS
[ListDomainConfigurationsResponse] -> ShowS
ListDomainConfigurationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainConfigurationsResponse] -> ShowS
$cshowList :: [ListDomainConfigurationsResponse] -> ShowS
show :: ListDomainConfigurationsResponse -> String
$cshow :: ListDomainConfigurationsResponse -> String
showsPrec :: Int -> ListDomainConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListDomainConfigurationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListDomainConfigurationsResponse x
-> ListDomainConfigurationsResponse
forall x.
ListDomainConfigurationsResponse
-> Rep ListDomainConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDomainConfigurationsResponse x
-> ListDomainConfigurationsResponse
$cfrom :: forall x.
ListDomainConfigurationsResponse
-> Rep ListDomainConfigurationsResponse x
Prelude.Generic)
newListDomainConfigurationsResponse ::
Prelude.Int ->
ListDomainConfigurationsResponse
newListDomainConfigurationsResponse :: Int -> ListDomainConfigurationsResponse
newListDomainConfigurationsResponse Int
pHttpStatus_ =
ListDomainConfigurationsResponse'
{ $sel:domainConfigurations:ListDomainConfigurationsResponse' :: Maybe [DomainConfigurationSummary]
domainConfigurations =
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListDomainConfigurationsResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDomainConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDomainConfigurationsResponse_domainConfigurations :: Lens.Lens' ListDomainConfigurationsResponse (Prelude.Maybe [DomainConfigurationSummary])
listDomainConfigurationsResponse_domainConfigurations :: Lens'
ListDomainConfigurationsResponse
(Maybe [DomainConfigurationSummary])
listDomainConfigurationsResponse_domainConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainConfigurationsResponse' {Maybe [DomainConfigurationSummary]
domainConfigurations :: Maybe [DomainConfigurationSummary]
$sel:domainConfigurations:ListDomainConfigurationsResponse' :: ListDomainConfigurationsResponse
-> Maybe [DomainConfigurationSummary]
domainConfigurations} -> Maybe [DomainConfigurationSummary]
domainConfigurations) (\s :: ListDomainConfigurationsResponse
s@ListDomainConfigurationsResponse' {} Maybe [DomainConfigurationSummary]
a -> ListDomainConfigurationsResponse
s {$sel:domainConfigurations:ListDomainConfigurationsResponse' :: Maybe [DomainConfigurationSummary]
domainConfigurations = Maybe [DomainConfigurationSummary]
a} :: ListDomainConfigurationsResponse) 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
listDomainConfigurationsResponse_nextMarker :: Lens.Lens' ListDomainConfigurationsResponse (Prelude.Maybe Prelude.Text)
listDomainConfigurationsResponse_nextMarker :: Lens' ListDomainConfigurationsResponse (Maybe Text)
listDomainConfigurationsResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainConfigurationsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListDomainConfigurationsResponse' :: ListDomainConfigurationsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListDomainConfigurationsResponse
s@ListDomainConfigurationsResponse' {} Maybe Text
a -> ListDomainConfigurationsResponse
s {$sel:nextMarker:ListDomainConfigurationsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListDomainConfigurationsResponse)
listDomainConfigurationsResponse_httpStatus :: Lens.Lens' ListDomainConfigurationsResponse Prelude.Int
listDomainConfigurationsResponse_httpStatus :: Lens' ListDomainConfigurationsResponse Int
listDomainConfigurationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainConfigurationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDomainConfigurationsResponse' :: ListDomainConfigurationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDomainConfigurationsResponse
s@ListDomainConfigurationsResponse' {} Int
a -> ListDomainConfigurationsResponse
s {$sel:httpStatus:ListDomainConfigurationsResponse' :: Int
httpStatus = Int
a} :: ListDomainConfigurationsResponse)
instance
Prelude.NFData
ListDomainConfigurationsResponse
where
rnf :: ListDomainConfigurationsResponse -> ()
rnf ListDomainConfigurationsResponse' {Int
Maybe [DomainConfigurationSummary]
Maybe Text
httpStatus :: Int
nextMarker :: Maybe Text
domainConfigurations :: Maybe [DomainConfigurationSummary]
$sel:httpStatus:ListDomainConfigurationsResponse' :: ListDomainConfigurationsResponse -> Int
$sel:nextMarker:ListDomainConfigurationsResponse' :: ListDomainConfigurationsResponse -> Maybe Text
$sel:domainConfigurations:ListDomainConfigurationsResponse' :: ListDomainConfigurationsResponse
-> Maybe [DomainConfigurationSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [DomainConfigurationSummary]
domainConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus