{-# 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.Panorama.ListDevices
(
ListDevices (..),
newListDevices,
listDevices_deviceAggregatedStatusFilter,
listDevices_maxResults,
listDevices_nameFilter,
listDevices_nextToken,
listDevices_sortBy,
listDevices_sortOrder,
ListDevicesResponse (..),
newListDevicesResponse,
listDevicesResponse_nextToken,
listDevicesResponse_httpStatus,
listDevicesResponse_devices,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Panorama.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListDevices = ListDevices'
{
ListDevices -> Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter :: Prelude.Maybe DeviceAggregatedStatus,
ListDevices -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListDevices -> Maybe Text
nameFilter :: Prelude.Maybe Prelude.Text,
ListDevices -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDevices -> Maybe ListDevicesSortBy
sortBy :: Prelude.Maybe ListDevicesSortBy,
ListDevices -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder
}
deriving (ListDevices -> ListDevices -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevices -> ListDevices -> Bool
$c/= :: ListDevices -> ListDevices -> Bool
== :: ListDevices -> ListDevices -> Bool
$c== :: ListDevices -> ListDevices -> Bool
Prelude.Eq, ReadPrec [ListDevices]
ReadPrec ListDevices
Int -> ReadS ListDevices
ReadS [ListDevices]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDevices]
$creadListPrec :: ReadPrec [ListDevices]
readPrec :: ReadPrec ListDevices
$creadPrec :: ReadPrec ListDevices
readList :: ReadS [ListDevices]
$creadList :: ReadS [ListDevices]
readsPrec :: Int -> ReadS ListDevices
$creadsPrec :: Int -> ReadS ListDevices
Prelude.Read, Int -> ListDevices -> ShowS
[ListDevices] -> ShowS
ListDevices -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevices] -> ShowS
$cshowList :: [ListDevices] -> ShowS
show :: ListDevices -> String
$cshow :: ListDevices -> String
showsPrec :: Int -> ListDevices -> ShowS
$cshowsPrec :: Int -> ListDevices -> ShowS
Prelude.Show, forall x. Rep ListDevices x -> ListDevices
forall x. ListDevices -> Rep ListDevices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDevices x -> ListDevices
$cfrom :: forall x. ListDevices -> Rep ListDevices x
Prelude.Generic)
newListDevices ::
ListDevices
newListDevices :: ListDevices
newListDevices =
ListDevices'
{ $sel:deviceAggregatedStatusFilter:ListDevices' :: Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter =
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListDevices' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nameFilter:ListDevices' :: Maybe Text
nameFilter = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDevices' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:ListDevices' :: Maybe ListDevicesSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
$sel:sortOrder:ListDevices' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing
}
listDevices_deviceAggregatedStatusFilter :: Lens.Lens' ListDevices (Prelude.Maybe DeviceAggregatedStatus)
listDevices_deviceAggregatedStatusFilter :: Lens' ListDevices (Maybe DeviceAggregatedStatus)
listDevices_deviceAggregatedStatusFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter :: Maybe DeviceAggregatedStatus
$sel:deviceAggregatedStatusFilter:ListDevices' :: ListDevices -> Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter} -> Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter) (\s :: ListDevices
s@ListDevices' {} Maybe DeviceAggregatedStatus
a -> ListDevices
s {$sel:deviceAggregatedStatusFilter:ListDevices' :: Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter = Maybe DeviceAggregatedStatus
a} :: ListDevices)
listDevices_maxResults :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Natural)
listDevices_maxResults :: Lens' ListDevices (Maybe Natural)
listDevices_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDevices' :: ListDevices -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDevices
s@ListDevices' {} Maybe Natural
a -> ListDevices
s {$sel:maxResults:ListDevices' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDevices)
listDevices_nameFilter :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Text)
listDevices_nameFilter :: Lens' ListDevices (Maybe Text)
listDevices_nameFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe Text
nameFilter :: Maybe Text
$sel:nameFilter:ListDevices' :: ListDevices -> Maybe Text
nameFilter} -> Maybe Text
nameFilter) (\s :: ListDevices
s@ListDevices' {} Maybe Text
a -> ListDevices
s {$sel:nameFilter:ListDevices' :: Maybe Text
nameFilter = Maybe Text
a} :: ListDevices)
listDevices_nextToken :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Text)
listDevices_nextToken :: Lens' ListDevices (Maybe Text)
listDevices_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevices
s@ListDevices' {} Maybe Text
a -> ListDevices
s {$sel:nextToken:ListDevices' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevices)
listDevices_sortBy :: Lens.Lens' ListDevices (Prelude.Maybe ListDevicesSortBy)
listDevices_sortBy :: Lens' ListDevices (Maybe ListDevicesSortBy)
listDevices_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe ListDevicesSortBy
sortBy :: Maybe ListDevicesSortBy
$sel:sortBy:ListDevices' :: ListDevices -> Maybe ListDevicesSortBy
sortBy} -> Maybe ListDevicesSortBy
sortBy) (\s :: ListDevices
s@ListDevices' {} Maybe ListDevicesSortBy
a -> ListDevices
s {$sel:sortBy:ListDevices' :: Maybe ListDevicesSortBy
sortBy = Maybe ListDevicesSortBy
a} :: ListDevices)
listDevices_sortOrder :: Lens.Lens' ListDevices (Prelude.Maybe SortOrder)
listDevices_sortOrder :: Lens' ListDevices (Maybe SortOrder)
listDevices_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListDevices' :: ListDevices -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListDevices
s@ListDevices' {} Maybe SortOrder
a -> ListDevices
s {$sel:sortOrder:ListDevices' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListDevices)
instance Core.AWSRequest ListDevices where
type AWSResponse ListDevices = ListDevicesResponse
request :: (Service -> Service) -> ListDevices -> Request ListDevices
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 ListDevices
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDevices)))
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 -> [Device] -> ListDevicesResponse
ListDevicesResponse'
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
"Devices" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListDevices where
hashWithSalt :: Int -> ListDevices -> Int
hashWithSalt Int
_salt ListDevices' {Maybe Natural
Maybe Text
Maybe DeviceAggregatedStatus
Maybe ListDevicesSortBy
Maybe SortOrder
sortOrder :: Maybe SortOrder
sortBy :: Maybe ListDevicesSortBy
nextToken :: Maybe Text
nameFilter :: Maybe Text
maxResults :: Maybe Natural
deviceAggregatedStatusFilter :: Maybe DeviceAggregatedStatus
$sel:sortOrder:ListDevices' :: ListDevices -> Maybe SortOrder
$sel:sortBy:ListDevices' :: ListDevices -> Maybe ListDevicesSortBy
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
$sel:nameFilter:ListDevices' :: ListDevices -> Maybe Text
$sel:maxResults:ListDevices' :: ListDevices -> Maybe Natural
$sel:deviceAggregatedStatusFilter:ListDevices' :: ListDevices -> Maybe DeviceAggregatedStatus
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ListDevicesSortBy
sortBy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sortOrder
instance Prelude.NFData ListDevices where
rnf :: ListDevices -> ()
rnf ListDevices' {Maybe Natural
Maybe Text
Maybe DeviceAggregatedStatus
Maybe ListDevicesSortBy
Maybe SortOrder
sortOrder :: Maybe SortOrder
sortBy :: Maybe ListDevicesSortBy
nextToken :: Maybe Text
nameFilter :: Maybe Text
maxResults :: Maybe Natural
deviceAggregatedStatusFilter :: Maybe DeviceAggregatedStatus
$sel:sortOrder:ListDevices' :: ListDevices -> Maybe SortOrder
$sel:sortBy:ListDevices' :: ListDevices -> Maybe ListDevicesSortBy
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
$sel:nameFilter:ListDevices' :: ListDevices -> Maybe Text
$sel:maxResults:ListDevices' :: ListDevices -> Maybe Natural
$sel:deviceAggregatedStatusFilter:ListDevices' :: ListDevices -> Maybe DeviceAggregatedStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
nameFilter
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 Maybe ListDevicesSortBy
sortBy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrder
sortOrder
instance Data.ToHeaders ListDevices where
toHeaders :: ListDevices -> 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 ListDevices where
toPath :: ListDevices -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/devices"
instance Data.ToQuery ListDevices where
toQuery :: ListDevices -> QueryString
toQuery ListDevices' {Maybe Natural
Maybe Text
Maybe DeviceAggregatedStatus
Maybe ListDevicesSortBy
Maybe SortOrder
sortOrder :: Maybe SortOrder
sortBy :: Maybe ListDevicesSortBy
nextToken :: Maybe Text
nameFilter :: Maybe Text
maxResults :: Maybe Natural
deviceAggregatedStatusFilter :: Maybe DeviceAggregatedStatus
$sel:sortOrder:ListDevices' :: ListDevices -> Maybe SortOrder
$sel:sortBy:ListDevices' :: ListDevices -> Maybe ListDevicesSortBy
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
$sel:nameFilter:ListDevices' :: ListDevices -> Maybe Text
$sel:maxResults:ListDevices' :: ListDevices -> Maybe Natural
$sel:deviceAggregatedStatusFilter:ListDevices' :: ListDevices -> Maybe DeviceAggregatedStatus
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"DeviceAggregatedStatusFilter"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe DeviceAggregatedStatus
deviceAggregatedStatusFilter,
ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"NameFilter" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nameFilter,
ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"SortBy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ListDevicesSortBy
sortBy,
ByteString
"SortOrder" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe SortOrder
sortOrder
]
data ListDevicesResponse = ListDevicesResponse'
{
ListDevicesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDevicesResponse -> Int
httpStatus :: Prelude.Int,
ListDevicesResponse -> [Device]
devices :: [Device]
}
deriving (ListDevicesResponse -> ListDevicesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevicesResponse -> ListDevicesResponse -> Bool
$c/= :: ListDevicesResponse -> ListDevicesResponse -> Bool
== :: ListDevicesResponse -> ListDevicesResponse -> Bool
$c== :: ListDevicesResponse -> ListDevicesResponse -> Bool
Prelude.Eq, ReadPrec [ListDevicesResponse]
ReadPrec ListDevicesResponse
Int -> ReadS ListDevicesResponse
ReadS [ListDevicesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDevicesResponse]
$creadListPrec :: ReadPrec [ListDevicesResponse]
readPrec :: ReadPrec ListDevicesResponse
$creadPrec :: ReadPrec ListDevicesResponse
readList :: ReadS [ListDevicesResponse]
$creadList :: ReadS [ListDevicesResponse]
readsPrec :: Int -> ReadS ListDevicesResponse
$creadsPrec :: Int -> ReadS ListDevicesResponse
Prelude.Read, Int -> ListDevicesResponse -> ShowS
[ListDevicesResponse] -> ShowS
ListDevicesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevicesResponse] -> ShowS
$cshowList :: [ListDevicesResponse] -> ShowS
show :: ListDevicesResponse -> String
$cshow :: ListDevicesResponse -> String
showsPrec :: Int -> ListDevicesResponse -> ShowS
$cshowsPrec :: Int -> ListDevicesResponse -> ShowS
Prelude.Show, forall x. Rep ListDevicesResponse x -> ListDevicesResponse
forall x. ListDevicesResponse -> Rep ListDevicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDevicesResponse x -> ListDevicesResponse
$cfrom :: forall x. ListDevicesResponse -> Rep ListDevicesResponse x
Prelude.Generic)
newListDevicesResponse ::
Prelude.Int ->
ListDevicesResponse
newListDevicesResponse :: Int -> ListDevicesResponse
newListDevicesResponse Int
pHttpStatus_ =
ListDevicesResponse'
{ $sel:nextToken:ListDevicesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDevicesResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:devices:ListDevicesResponse' :: [Device]
devices = forall a. Monoid a => a
Prelude.mempty
}
listDevicesResponse_nextToken :: Lens.Lens' ListDevicesResponse (Prelude.Maybe Prelude.Text)
listDevicesResponse_nextToken :: Lens' ListDevicesResponse (Maybe Text)
listDevicesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevicesResponse' :: ListDevicesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevicesResponse
s@ListDevicesResponse' {} Maybe Text
a -> ListDevicesResponse
s {$sel:nextToken:ListDevicesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevicesResponse)
listDevicesResponse_httpStatus :: Lens.Lens' ListDevicesResponse Prelude.Int
listDevicesResponse_httpStatus :: Lens' ListDevicesResponse Int
listDevicesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDevicesResponse' :: ListDevicesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDevicesResponse
s@ListDevicesResponse' {} Int
a -> ListDevicesResponse
s {$sel:httpStatus:ListDevicesResponse' :: Int
httpStatus = Int
a} :: ListDevicesResponse)
listDevicesResponse_devices :: Lens.Lens' ListDevicesResponse [Device]
listDevicesResponse_devices :: Lens' ListDevicesResponse [Device]
listDevicesResponse_devices = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicesResponse' {[Device]
devices :: [Device]
$sel:devices:ListDevicesResponse' :: ListDevicesResponse -> [Device]
devices} -> [Device]
devices) (\s :: ListDevicesResponse
s@ListDevicesResponse' {} [Device]
a -> ListDevicesResponse
s {$sel:devices:ListDevicesResponse' :: [Device]
devices = [Device]
a} :: ListDevicesResponse) 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 ListDevicesResponse where
rnf :: ListDevicesResponse -> ()
rnf ListDevicesResponse' {Int
[Device]
Maybe Text
devices :: [Device]
httpStatus :: Int
nextToken :: Maybe Text
$sel:devices:ListDevicesResponse' :: ListDevicesResponse -> [Device]
$sel:httpStatus:ListDevicesResponse' :: ListDevicesResponse -> Int
$sel:nextToken:ListDevicesResponse' :: ListDevicesResponse -> 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 [Device]
devices