{-# 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.IoTJobsData.GetPendingJobExecutions
(
GetPendingJobExecutions (..),
newGetPendingJobExecutions,
getPendingJobExecutions_thingName,
GetPendingJobExecutionsResponse (..),
newGetPendingJobExecutionsResponse,
getPendingJobExecutionsResponse_inProgressJobs,
getPendingJobExecutionsResponse_queuedJobs,
getPendingJobExecutionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTJobsData.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetPendingJobExecutions = GetPendingJobExecutions'
{
GetPendingJobExecutions -> Text
thingName :: Prelude.Text
}
deriving (GetPendingJobExecutions -> GetPendingJobExecutions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPendingJobExecutions -> GetPendingJobExecutions -> Bool
$c/= :: GetPendingJobExecutions -> GetPendingJobExecutions -> Bool
== :: GetPendingJobExecutions -> GetPendingJobExecutions -> Bool
$c== :: GetPendingJobExecutions -> GetPendingJobExecutions -> Bool
Prelude.Eq, ReadPrec [GetPendingJobExecutions]
ReadPrec GetPendingJobExecutions
Int -> ReadS GetPendingJobExecutions
ReadS [GetPendingJobExecutions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPendingJobExecutions]
$creadListPrec :: ReadPrec [GetPendingJobExecutions]
readPrec :: ReadPrec GetPendingJobExecutions
$creadPrec :: ReadPrec GetPendingJobExecutions
readList :: ReadS [GetPendingJobExecutions]
$creadList :: ReadS [GetPendingJobExecutions]
readsPrec :: Int -> ReadS GetPendingJobExecutions
$creadsPrec :: Int -> ReadS GetPendingJobExecutions
Prelude.Read, Int -> GetPendingJobExecutions -> ShowS
[GetPendingJobExecutions] -> ShowS
GetPendingJobExecutions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPendingJobExecutions] -> ShowS
$cshowList :: [GetPendingJobExecutions] -> ShowS
show :: GetPendingJobExecutions -> String
$cshow :: GetPendingJobExecutions -> String
showsPrec :: Int -> GetPendingJobExecutions -> ShowS
$cshowsPrec :: Int -> GetPendingJobExecutions -> ShowS
Prelude.Show, forall x. Rep GetPendingJobExecutions x -> GetPendingJobExecutions
forall x. GetPendingJobExecutions -> Rep GetPendingJobExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetPendingJobExecutions x -> GetPendingJobExecutions
$cfrom :: forall x. GetPendingJobExecutions -> Rep GetPendingJobExecutions x
Prelude.Generic)
newGetPendingJobExecutions ::
Prelude.Text ->
GetPendingJobExecutions
newGetPendingJobExecutions :: Text -> GetPendingJobExecutions
newGetPendingJobExecutions Text
pThingName_ =
GetPendingJobExecutions' {$sel:thingName:GetPendingJobExecutions' :: Text
thingName = Text
pThingName_}
getPendingJobExecutions_thingName :: Lens.Lens' GetPendingJobExecutions Prelude.Text
getPendingJobExecutions_thingName :: Lens' GetPendingJobExecutions Text
getPendingJobExecutions_thingName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPendingJobExecutions' {Text
thingName :: Text
$sel:thingName:GetPendingJobExecutions' :: GetPendingJobExecutions -> Text
thingName} -> Text
thingName) (\s :: GetPendingJobExecutions
s@GetPendingJobExecutions' {} Text
a -> GetPendingJobExecutions
s {$sel:thingName:GetPendingJobExecutions' :: Text
thingName = Text
a} :: GetPendingJobExecutions)
instance Core.AWSRequest GetPendingJobExecutions where
type
AWSResponse GetPendingJobExecutions =
GetPendingJobExecutionsResponse
request :: (Service -> Service)
-> GetPendingJobExecutions -> Request GetPendingJobExecutions
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 GetPendingJobExecutions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetPendingJobExecutions)))
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 [JobExecutionSummary]
-> Maybe [JobExecutionSummary]
-> Int
-> GetPendingJobExecutionsResponse
GetPendingJobExecutionsResponse'
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
"inProgressJobs" 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
"queuedJobs" 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 GetPendingJobExecutions where
hashWithSalt :: Int -> GetPendingJobExecutions -> Int
hashWithSalt Int
_salt GetPendingJobExecutions' {Text
thingName :: Text
$sel:thingName:GetPendingJobExecutions' :: GetPendingJobExecutions -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
thingName
instance Prelude.NFData GetPendingJobExecutions where
rnf :: GetPendingJobExecutions -> ()
rnf GetPendingJobExecutions' {Text
thingName :: Text
$sel:thingName:GetPendingJobExecutions' :: GetPendingJobExecutions -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
thingName
instance Data.ToHeaders GetPendingJobExecutions where
toHeaders :: GetPendingJobExecutions -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetPendingJobExecutions where
toPath :: GetPendingJobExecutions -> ByteString
toPath GetPendingJobExecutions' {Text
thingName :: Text
$sel:thingName:GetPendingJobExecutions' :: GetPendingJobExecutions -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/things/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
thingName, ByteString
"/jobs"]
instance Data.ToQuery GetPendingJobExecutions where
toQuery :: GetPendingJobExecutions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetPendingJobExecutionsResponse = GetPendingJobExecutionsResponse'
{
GetPendingJobExecutionsResponse -> Maybe [JobExecutionSummary]
inProgressJobs :: Prelude.Maybe [JobExecutionSummary],
GetPendingJobExecutionsResponse -> Maybe [JobExecutionSummary]
queuedJobs :: Prelude.Maybe [JobExecutionSummary],
GetPendingJobExecutionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetPendingJobExecutionsResponse
-> GetPendingJobExecutionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPendingJobExecutionsResponse
-> GetPendingJobExecutionsResponse -> Bool
$c/= :: GetPendingJobExecutionsResponse
-> GetPendingJobExecutionsResponse -> Bool
== :: GetPendingJobExecutionsResponse
-> GetPendingJobExecutionsResponse -> Bool
$c== :: GetPendingJobExecutionsResponse
-> GetPendingJobExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [GetPendingJobExecutionsResponse]
ReadPrec GetPendingJobExecutionsResponse
Int -> ReadS GetPendingJobExecutionsResponse
ReadS [GetPendingJobExecutionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPendingJobExecutionsResponse]
$creadListPrec :: ReadPrec [GetPendingJobExecutionsResponse]
readPrec :: ReadPrec GetPendingJobExecutionsResponse
$creadPrec :: ReadPrec GetPendingJobExecutionsResponse
readList :: ReadS [GetPendingJobExecutionsResponse]
$creadList :: ReadS [GetPendingJobExecutionsResponse]
readsPrec :: Int -> ReadS GetPendingJobExecutionsResponse
$creadsPrec :: Int -> ReadS GetPendingJobExecutionsResponse
Prelude.Read, Int -> GetPendingJobExecutionsResponse -> ShowS
[GetPendingJobExecutionsResponse] -> ShowS
GetPendingJobExecutionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPendingJobExecutionsResponse] -> ShowS
$cshowList :: [GetPendingJobExecutionsResponse] -> ShowS
show :: GetPendingJobExecutionsResponse -> String
$cshow :: GetPendingJobExecutionsResponse -> String
showsPrec :: Int -> GetPendingJobExecutionsResponse -> ShowS
$cshowsPrec :: Int -> GetPendingJobExecutionsResponse -> ShowS
Prelude.Show, forall x.
Rep GetPendingJobExecutionsResponse x
-> GetPendingJobExecutionsResponse
forall x.
GetPendingJobExecutionsResponse
-> Rep GetPendingJobExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPendingJobExecutionsResponse x
-> GetPendingJobExecutionsResponse
$cfrom :: forall x.
GetPendingJobExecutionsResponse
-> Rep GetPendingJobExecutionsResponse x
Prelude.Generic)
newGetPendingJobExecutionsResponse ::
Prelude.Int ->
GetPendingJobExecutionsResponse
newGetPendingJobExecutionsResponse :: Int -> GetPendingJobExecutionsResponse
newGetPendingJobExecutionsResponse Int
pHttpStatus_ =
GetPendingJobExecutionsResponse'
{ $sel:inProgressJobs:GetPendingJobExecutionsResponse' :: Maybe [JobExecutionSummary]
inProgressJobs =
forall a. Maybe a
Prelude.Nothing,
$sel:queuedJobs:GetPendingJobExecutionsResponse' :: Maybe [JobExecutionSummary]
queuedJobs = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetPendingJobExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getPendingJobExecutionsResponse_inProgressJobs :: Lens.Lens' GetPendingJobExecutionsResponse (Prelude.Maybe [JobExecutionSummary])
getPendingJobExecutionsResponse_inProgressJobs :: Lens' GetPendingJobExecutionsResponse (Maybe [JobExecutionSummary])
getPendingJobExecutionsResponse_inProgressJobs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPendingJobExecutionsResponse' {Maybe [JobExecutionSummary]
inProgressJobs :: Maybe [JobExecutionSummary]
$sel:inProgressJobs:GetPendingJobExecutionsResponse' :: GetPendingJobExecutionsResponse -> Maybe [JobExecutionSummary]
inProgressJobs} -> Maybe [JobExecutionSummary]
inProgressJobs) (\s :: GetPendingJobExecutionsResponse
s@GetPendingJobExecutionsResponse' {} Maybe [JobExecutionSummary]
a -> GetPendingJobExecutionsResponse
s {$sel:inProgressJobs:GetPendingJobExecutionsResponse' :: Maybe [JobExecutionSummary]
inProgressJobs = Maybe [JobExecutionSummary]
a} :: GetPendingJobExecutionsResponse) 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
getPendingJobExecutionsResponse_queuedJobs :: Lens.Lens' GetPendingJobExecutionsResponse (Prelude.Maybe [JobExecutionSummary])
getPendingJobExecutionsResponse_queuedJobs :: Lens' GetPendingJobExecutionsResponse (Maybe [JobExecutionSummary])
getPendingJobExecutionsResponse_queuedJobs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPendingJobExecutionsResponse' {Maybe [JobExecutionSummary]
queuedJobs :: Maybe [JobExecutionSummary]
$sel:queuedJobs:GetPendingJobExecutionsResponse' :: GetPendingJobExecutionsResponse -> Maybe [JobExecutionSummary]
queuedJobs} -> Maybe [JobExecutionSummary]
queuedJobs) (\s :: GetPendingJobExecutionsResponse
s@GetPendingJobExecutionsResponse' {} Maybe [JobExecutionSummary]
a -> GetPendingJobExecutionsResponse
s {$sel:queuedJobs:GetPendingJobExecutionsResponse' :: Maybe [JobExecutionSummary]
queuedJobs = Maybe [JobExecutionSummary]
a} :: GetPendingJobExecutionsResponse) 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
getPendingJobExecutionsResponse_httpStatus :: Lens.Lens' GetPendingJobExecutionsResponse Prelude.Int
getPendingJobExecutionsResponse_httpStatus :: Lens' GetPendingJobExecutionsResponse Int
getPendingJobExecutionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPendingJobExecutionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetPendingJobExecutionsResponse' :: GetPendingJobExecutionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetPendingJobExecutionsResponse
s@GetPendingJobExecutionsResponse' {} Int
a -> GetPendingJobExecutionsResponse
s {$sel:httpStatus:GetPendingJobExecutionsResponse' :: Int
httpStatus = Int
a} :: GetPendingJobExecutionsResponse)
instance
Prelude.NFData
GetPendingJobExecutionsResponse
where
rnf :: GetPendingJobExecutionsResponse -> ()
rnf GetPendingJobExecutionsResponse' {Int
Maybe [JobExecutionSummary]
httpStatus :: Int
queuedJobs :: Maybe [JobExecutionSummary]
inProgressJobs :: Maybe [JobExecutionSummary]
$sel:httpStatus:GetPendingJobExecutionsResponse' :: GetPendingJobExecutionsResponse -> Int
$sel:queuedJobs:GetPendingJobExecutionsResponse' :: GetPendingJobExecutionsResponse -> Maybe [JobExecutionSummary]
$sel:inProgressJobs:GetPendingJobExecutionsResponse' :: GetPendingJobExecutionsResponse -> Maybe [JobExecutionSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [JobExecutionSummary]
inProgressJobs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [JobExecutionSummary]
queuedJobs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus