{-# 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.IoTFleetWise.ListDecoderManifests
(
ListDecoderManifests (..),
newListDecoderManifests,
listDecoderManifests_maxResults,
listDecoderManifests_modelManifestArn,
listDecoderManifests_nextToken,
ListDecoderManifestsResponse (..),
newListDecoderManifestsResponse,
listDecoderManifestsResponse_nextToken,
listDecoderManifestsResponse_summaries,
listDecoderManifestsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTFleetWise.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListDecoderManifests = ListDecoderManifests'
{
ListDecoderManifests -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListDecoderManifests -> Maybe Text
modelManifestArn :: Prelude.Maybe Prelude.Text,
ListDecoderManifests -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListDecoderManifests -> ListDecoderManifests -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDecoderManifests -> ListDecoderManifests -> Bool
$c/= :: ListDecoderManifests -> ListDecoderManifests -> Bool
== :: ListDecoderManifests -> ListDecoderManifests -> Bool
$c== :: ListDecoderManifests -> ListDecoderManifests -> Bool
Prelude.Eq, ReadPrec [ListDecoderManifests]
ReadPrec ListDecoderManifests
Int -> ReadS ListDecoderManifests
ReadS [ListDecoderManifests]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDecoderManifests]
$creadListPrec :: ReadPrec [ListDecoderManifests]
readPrec :: ReadPrec ListDecoderManifests
$creadPrec :: ReadPrec ListDecoderManifests
readList :: ReadS [ListDecoderManifests]
$creadList :: ReadS [ListDecoderManifests]
readsPrec :: Int -> ReadS ListDecoderManifests
$creadsPrec :: Int -> ReadS ListDecoderManifests
Prelude.Read, Int -> ListDecoderManifests -> ShowS
[ListDecoderManifests] -> ShowS
ListDecoderManifests -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDecoderManifests] -> ShowS
$cshowList :: [ListDecoderManifests] -> ShowS
show :: ListDecoderManifests -> String
$cshow :: ListDecoderManifests -> String
showsPrec :: Int -> ListDecoderManifests -> ShowS
$cshowsPrec :: Int -> ListDecoderManifests -> ShowS
Prelude.Show, forall x. Rep ListDecoderManifests x -> ListDecoderManifests
forall x. ListDecoderManifests -> Rep ListDecoderManifests x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDecoderManifests x -> ListDecoderManifests
$cfrom :: forall x. ListDecoderManifests -> Rep ListDecoderManifests x
Prelude.Generic)
newListDecoderManifests ::
ListDecoderManifests
newListDecoderManifests :: ListDecoderManifests
newListDecoderManifests =
ListDecoderManifests'
{ $sel:maxResults:ListDecoderManifests' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:modelManifestArn:ListDecoderManifests' :: Maybe Text
modelManifestArn = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDecoderManifests' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listDecoderManifests_maxResults :: Lens.Lens' ListDecoderManifests (Prelude.Maybe Prelude.Natural)
listDecoderManifests_maxResults :: Lens' ListDecoderManifests (Maybe Natural)
listDecoderManifests_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDecoderManifests' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDecoderManifests' :: ListDecoderManifests -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDecoderManifests
s@ListDecoderManifests' {} Maybe Natural
a -> ListDecoderManifests
s {$sel:maxResults:ListDecoderManifests' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDecoderManifests)
listDecoderManifests_modelManifestArn :: Lens.Lens' ListDecoderManifests (Prelude.Maybe Prelude.Text)
listDecoderManifests_modelManifestArn :: Lens' ListDecoderManifests (Maybe Text)
listDecoderManifests_modelManifestArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDecoderManifests' {Maybe Text
modelManifestArn :: Maybe Text
$sel:modelManifestArn:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
modelManifestArn} -> Maybe Text
modelManifestArn) (\s :: ListDecoderManifests
s@ListDecoderManifests' {} Maybe Text
a -> ListDecoderManifests
s {$sel:modelManifestArn:ListDecoderManifests' :: Maybe Text
modelManifestArn = Maybe Text
a} :: ListDecoderManifests)
listDecoderManifests_nextToken :: Lens.Lens' ListDecoderManifests (Prelude.Maybe Prelude.Text)
listDecoderManifests_nextToken :: Lens' ListDecoderManifests (Maybe Text)
listDecoderManifests_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDecoderManifests' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDecoderManifests
s@ListDecoderManifests' {} Maybe Text
a -> ListDecoderManifests
s {$sel:nextToken:ListDecoderManifests' :: Maybe Text
nextToken = Maybe Text
a} :: ListDecoderManifests)
instance Core.AWSPager ListDecoderManifests where
page :: ListDecoderManifests
-> AWSResponse ListDecoderManifests -> Maybe ListDecoderManifests
page ListDecoderManifests
rq AWSResponse ListDecoderManifests
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDecoderManifests
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDecoderManifestsResponse (Maybe Text)
listDecoderManifestsResponse_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 ListDecoderManifests
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDecoderManifestsResponse (Maybe [DecoderManifestSummary])
listDecoderManifestsResponse_summaries
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.$ ListDecoderManifests
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDecoderManifests (Maybe Text)
listDecoderManifests_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDecoderManifests
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDecoderManifestsResponse (Maybe Text)
listDecoderManifestsResponse_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 ListDecoderManifests where
type
AWSResponse ListDecoderManifests =
ListDecoderManifestsResponse
request :: (Service -> Service)
-> ListDecoderManifests -> Request ListDecoderManifests
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListDecoderManifests
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDecoderManifests)))
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
-> Maybe [DecoderManifestSummary]
-> Int
-> ListDecoderManifestsResponse
ListDecoderManifestsResponse'
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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"summaries" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListDecoderManifests where
hashWithSalt :: Int -> ListDecoderManifests -> Int
hashWithSalt Int
_salt ListDecoderManifests' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
modelManifestArn :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
$sel:modelManifestArn:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
$sel:maxResults:ListDecoderManifests' :: ListDecoderManifests -> 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
modelManifestArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListDecoderManifests where
rnf :: ListDecoderManifests -> ()
rnf ListDecoderManifests' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
modelManifestArn :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
$sel:modelManifestArn:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
$sel:maxResults:ListDecoderManifests' :: ListDecoderManifests -> 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
modelManifestArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListDecoderManifests where
toHeaders :: ListDecoderManifests -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"IoTAutobahnControlPlane.ListDecoderManifests" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListDecoderManifests where
toJSON :: ListDecoderManifests -> Value
toJSON ListDecoderManifests' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
modelManifestArn :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
$sel:modelManifestArn:ListDecoderManifests' :: ListDecoderManifests -> Maybe Text
$sel:maxResults:ListDecoderManifests' :: ListDecoderManifests -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"modelManifestArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
modelManifestArn,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListDecoderManifests where
toPath :: ListDecoderManifests -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListDecoderManifests where
toQuery :: ListDecoderManifests -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListDecoderManifestsResponse = ListDecoderManifestsResponse'
{
ListDecoderManifestsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDecoderManifestsResponse -> Maybe [DecoderManifestSummary]
summaries :: Prelude.Maybe [DecoderManifestSummary],
ListDecoderManifestsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDecoderManifestsResponse
-> ListDecoderManifestsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDecoderManifestsResponse
-> ListDecoderManifestsResponse -> Bool
$c/= :: ListDecoderManifestsResponse
-> ListDecoderManifestsResponse -> Bool
== :: ListDecoderManifestsResponse
-> ListDecoderManifestsResponse -> Bool
$c== :: ListDecoderManifestsResponse
-> ListDecoderManifestsResponse -> Bool
Prelude.Eq, ReadPrec [ListDecoderManifestsResponse]
ReadPrec ListDecoderManifestsResponse
Int -> ReadS ListDecoderManifestsResponse
ReadS [ListDecoderManifestsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDecoderManifestsResponse]
$creadListPrec :: ReadPrec [ListDecoderManifestsResponse]
readPrec :: ReadPrec ListDecoderManifestsResponse
$creadPrec :: ReadPrec ListDecoderManifestsResponse
readList :: ReadS [ListDecoderManifestsResponse]
$creadList :: ReadS [ListDecoderManifestsResponse]
readsPrec :: Int -> ReadS ListDecoderManifestsResponse
$creadsPrec :: Int -> ReadS ListDecoderManifestsResponse
Prelude.Read, Int -> ListDecoderManifestsResponse -> ShowS
[ListDecoderManifestsResponse] -> ShowS
ListDecoderManifestsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDecoderManifestsResponse] -> ShowS
$cshowList :: [ListDecoderManifestsResponse] -> ShowS
show :: ListDecoderManifestsResponse -> String
$cshow :: ListDecoderManifestsResponse -> String
showsPrec :: Int -> ListDecoderManifestsResponse -> ShowS
$cshowsPrec :: Int -> ListDecoderManifestsResponse -> ShowS
Prelude.Show, forall x.
Rep ListDecoderManifestsResponse x -> ListDecoderManifestsResponse
forall x.
ListDecoderManifestsResponse -> Rep ListDecoderManifestsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDecoderManifestsResponse x -> ListDecoderManifestsResponse
$cfrom :: forall x.
ListDecoderManifestsResponse -> Rep ListDecoderManifestsResponse x
Prelude.Generic)
newListDecoderManifestsResponse ::
Prelude.Int ->
ListDecoderManifestsResponse
newListDecoderManifestsResponse :: Int -> ListDecoderManifestsResponse
newListDecoderManifestsResponse Int
pHttpStatus_ =
ListDecoderManifestsResponse'
{ $sel:nextToken:ListDecoderManifestsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:summaries:ListDecoderManifestsResponse' :: Maybe [DecoderManifestSummary]
summaries = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDecoderManifestsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDecoderManifestsResponse_nextToken :: Lens.Lens' ListDecoderManifestsResponse (Prelude.Maybe Prelude.Text)
listDecoderManifestsResponse_nextToken :: Lens' ListDecoderManifestsResponse (Maybe Text)
listDecoderManifestsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDecoderManifestsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDecoderManifestsResponse' :: ListDecoderManifestsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDecoderManifestsResponse
s@ListDecoderManifestsResponse' {} Maybe Text
a -> ListDecoderManifestsResponse
s {$sel:nextToken:ListDecoderManifestsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDecoderManifestsResponse)
listDecoderManifestsResponse_summaries :: Lens.Lens' ListDecoderManifestsResponse (Prelude.Maybe [DecoderManifestSummary])
listDecoderManifestsResponse_summaries :: Lens' ListDecoderManifestsResponse (Maybe [DecoderManifestSummary])
listDecoderManifestsResponse_summaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDecoderManifestsResponse' {Maybe [DecoderManifestSummary]
summaries :: Maybe [DecoderManifestSummary]
$sel:summaries:ListDecoderManifestsResponse' :: ListDecoderManifestsResponse -> Maybe [DecoderManifestSummary]
summaries} -> Maybe [DecoderManifestSummary]
summaries) (\s :: ListDecoderManifestsResponse
s@ListDecoderManifestsResponse' {} Maybe [DecoderManifestSummary]
a -> ListDecoderManifestsResponse
s {$sel:summaries:ListDecoderManifestsResponse' :: Maybe [DecoderManifestSummary]
summaries = Maybe [DecoderManifestSummary]
a} :: ListDecoderManifestsResponse) 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
listDecoderManifestsResponse_httpStatus :: Lens.Lens' ListDecoderManifestsResponse Prelude.Int
listDecoderManifestsResponse_httpStatus :: Lens' ListDecoderManifestsResponse Int
listDecoderManifestsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDecoderManifestsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDecoderManifestsResponse' :: ListDecoderManifestsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDecoderManifestsResponse
s@ListDecoderManifestsResponse' {} Int
a -> ListDecoderManifestsResponse
s {$sel:httpStatus:ListDecoderManifestsResponse' :: Int
httpStatus = Int
a} :: ListDecoderManifestsResponse)
instance Prelude.NFData ListDecoderManifestsResponse where
rnf :: ListDecoderManifestsResponse -> ()
rnf ListDecoderManifestsResponse' {Int
Maybe [DecoderManifestSummary]
Maybe Text
httpStatus :: Int
summaries :: Maybe [DecoderManifestSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListDecoderManifestsResponse' :: ListDecoderManifestsResponse -> Int
$sel:summaries:ListDecoderManifestsResponse' :: ListDecoderManifestsResponse -> Maybe [DecoderManifestSummary]
$sel:nextToken:ListDecoderManifestsResponse' :: ListDecoderManifestsResponse -> 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 Maybe [DecoderManifestSummary]
summaries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus