{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LookoutEquipment.ListInferenceExecutions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all inference executions that have been performed by the specified
-- inference scheduler.
module Amazonka.LookoutEquipment.ListInferenceExecutions
  ( -- * Creating a Request
    ListInferenceExecutions (..),
    newListInferenceExecutions,

    -- * Request Lenses
    listInferenceExecutions_status,
    listInferenceExecutions_dataEndTimeBefore,
    listInferenceExecutions_nextToken,
    listInferenceExecutions_maxResults,
    listInferenceExecutions_dataStartTimeAfter,
    listInferenceExecutions_inferenceSchedulerName,

    -- * Destructuring the Response
    ListInferenceExecutionsResponse (..),
    newListInferenceExecutionsResponse,

    -- * Response Lenses
    listInferenceExecutionsResponse_nextToken,
    listInferenceExecutionsResponse_inferenceExecutionSummaries,
    listInferenceExecutionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutEquipment.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListInferenceExecutions' smart constructor.
data ListInferenceExecutions = ListInferenceExecutions'
  { -- | The status of the inference execution.
    ListInferenceExecutions -> Maybe InferenceExecutionStatus
status :: Prelude.Maybe InferenceExecutionStatus,
    -- | The time reference in the inferenced dataset before which Amazon Lookout
    -- for Equipment stopped the inference execution.
    ListInferenceExecutions -> Maybe POSIX
dataEndTimeBefore :: Prelude.Maybe Core.POSIX,
    -- | An opaque pagination token indicating where to continue the listing of
    -- inference executions.
    ListInferenceExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the maximum number of inference executions to list.
    ListInferenceExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The time reference in the inferenced dataset after which Amazon Lookout
    -- for Equipment started the inference execution.
    ListInferenceExecutions -> Maybe POSIX
dataStartTimeAfter :: Prelude.Maybe Core.POSIX,
    -- | The name of the inference scheduler for the inference execution listed.
    ListInferenceExecutions -> Text
inferenceSchedulerName :: Prelude.Text
  }
  deriving (ListInferenceExecutions -> ListInferenceExecutions -> Bool
(ListInferenceExecutions -> ListInferenceExecutions -> Bool)
-> (ListInferenceExecutions -> ListInferenceExecutions -> Bool)
-> Eq ListInferenceExecutions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInferenceExecutions -> ListInferenceExecutions -> Bool
$c/= :: ListInferenceExecutions -> ListInferenceExecutions -> Bool
== :: ListInferenceExecutions -> ListInferenceExecutions -> Bool
$c== :: ListInferenceExecutions -> ListInferenceExecutions -> Bool
Prelude.Eq, ReadPrec [ListInferenceExecutions]
ReadPrec ListInferenceExecutions
Int -> ReadS ListInferenceExecutions
ReadS [ListInferenceExecutions]
(Int -> ReadS ListInferenceExecutions)
-> ReadS [ListInferenceExecutions]
-> ReadPrec ListInferenceExecutions
-> ReadPrec [ListInferenceExecutions]
-> Read ListInferenceExecutions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInferenceExecutions]
$creadListPrec :: ReadPrec [ListInferenceExecutions]
readPrec :: ReadPrec ListInferenceExecutions
$creadPrec :: ReadPrec ListInferenceExecutions
readList :: ReadS [ListInferenceExecutions]
$creadList :: ReadS [ListInferenceExecutions]
readsPrec :: Int -> ReadS ListInferenceExecutions
$creadsPrec :: Int -> ReadS ListInferenceExecutions
Prelude.Read, Int -> ListInferenceExecutions -> ShowS
[ListInferenceExecutions] -> ShowS
ListInferenceExecutions -> String
(Int -> ListInferenceExecutions -> ShowS)
-> (ListInferenceExecutions -> String)
-> ([ListInferenceExecutions] -> ShowS)
-> Show ListInferenceExecutions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInferenceExecutions] -> ShowS
$cshowList :: [ListInferenceExecutions] -> ShowS
show :: ListInferenceExecutions -> String
$cshow :: ListInferenceExecutions -> String
showsPrec :: Int -> ListInferenceExecutions -> ShowS
$cshowsPrec :: Int -> ListInferenceExecutions -> ShowS
Prelude.Show, (forall x.
 ListInferenceExecutions -> Rep ListInferenceExecutions x)
-> (forall x.
    Rep ListInferenceExecutions x -> ListInferenceExecutions)
-> Generic ListInferenceExecutions
forall x. Rep ListInferenceExecutions x -> ListInferenceExecutions
forall x. ListInferenceExecutions -> Rep ListInferenceExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInferenceExecutions x -> ListInferenceExecutions
$cfrom :: forall x. ListInferenceExecutions -> Rep ListInferenceExecutions x
Prelude.Generic)

-- |
-- Create a value of 'ListInferenceExecutions' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'listInferenceExecutions_status' - The status of the inference execution.
--
-- 'dataEndTimeBefore', 'listInferenceExecutions_dataEndTimeBefore' - The time reference in the inferenced dataset before which Amazon Lookout
-- for Equipment stopped the inference execution.
--
-- 'nextToken', 'listInferenceExecutions_nextToken' - An opaque pagination token indicating where to continue the listing of
-- inference executions.
--
-- 'maxResults', 'listInferenceExecutions_maxResults' - Specifies the maximum number of inference executions to list.
--
-- 'dataStartTimeAfter', 'listInferenceExecutions_dataStartTimeAfter' - The time reference in the inferenced dataset after which Amazon Lookout
-- for Equipment started the inference execution.
--
-- 'inferenceSchedulerName', 'listInferenceExecutions_inferenceSchedulerName' - The name of the inference scheduler for the inference execution listed.
newListInferenceExecutions ::
  -- | 'inferenceSchedulerName'
  Prelude.Text ->
  ListInferenceExecutions
newListInferenceExecutions :: Text -> ListInferenceExecutions
newListInferenceExecutions Text
pInferenceSchedulerName_ =
  ListInferenceExecutions' :: Maybe InferenceExecutionStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Text
-> ListInferenceExecutions
ListInferenceExecutions'
    { $sel:status:ListInferenceExecutions' :: Maybe InferenceExecutionStatus
status = Maybe InferenceExecutionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:dataEndTimeBefore:ListInferenceExecutions' :: Maybe POSIX
dataEndTimeBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListInferenceExecutions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListInferenceExecutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:dataStartTimeAfter:ListInferenceExecutions' :: Maybe POSIX
dataStartTimeAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:inferenceSchedulerName:ListInferenceExecutions' :: Text
inferenceSchedulerName = Text
pInferenceSchedulerName_
    }

-- | The status of the inference execution.
listInferenceExecutions_status :: Lens.Lens' ListInferenceExecutions (Prelude.Maybe InferenceExecutionStatus)
listInferenceExecutions_status :: (Maybe InferenceExecutionStatus
 -> f (Maybe InferenceExecutionStatus))
-> ListInferenceExecutions -> f ListInferenceExecutions
listInferenceExecutions_status = (ListInferenceExecutions -> Maybe InferenceExecutionStatus)
-> (ListInferenceExecutions
    -> Maybe InferenceExecutionStatus -> ListInferenceExecutions)
-> Lens
     ListInferenceExecutions
     ListInferenceExecutions
     (Maybe InferenceExecutionStatus)
     (Maybe InferenceExecutionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutions' {Maybe InferenceExecutionStatus
status :: Maybe InferenceExecutionStatus
$sel:status:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe InferenceExecutionStatus
status} -> Maybe InferenceExecutionStatus
status) (\s :: ListInferenceExecutions
s@ListInferenceExecutions' {} Maybe InferenceExecutionStatus
a -> ListInferenceExecutions
s {$sel:status:ListInferenceExecutions' :: Maybe InferenceExecutionStatus
status = Maybe InferenceExecutionStatus
a} :: ListInferenceExecutions)

-- | The time reference in the inferenced dataset before which Amazon Lookout
-- for Equipment stopped the inference execution.
listInferenceExecutions_dataEndTimeBefore :: Lens.Lens' ListInferenceExecutions (Prelude.Maybe Prelude.UTCTime)
listInferenceExecutions_dataEndTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListInferenceExecutions -> f ListInferenceExecutions
listInferenceExecutions_dataEndTimeBefore = (ListInferenceExecutions -> Maybe POSIX)
-> (ListInferenceExecutions
    -> Maybe POSIX -> ListInferenceExecutions)
-> Lens
     ListInferenceExecutions
     ListInferenceExecutions
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutions' {Maybe POSIX
dataEndTimeBefore :: Maybe POSIX
$sel:dataEndTimeBefore:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe POSIX
dataEndTimeBefore} -> Maybe POSIX
dataEndTimeBefore) (\s :: ListInferenceExecutions
s@ListInferenceExecutions' {} Maybe POSIX
a -> ListInferenceExecutions
s {$sel:dataEndTimeBefore:ListInferenceExecutions' :: Maybe POSIX
dataEndTimeBefore = Maybe POSIX
a} :: ListInferenceExecutions) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListInferenceExecutions -> f ListInferenceExecutions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListInferenceExecutions
-> f ListInferenceExecutions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | An opaque pagination token indicating where to continue the listing of
-- inference executions.
listInferenceExecutions_nextToken :: Lens.Lens' ListInferenceExecutions (Prelude.Maybe Prelude.Text)
listInferenceExecutions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInferenceExecutions -> f ListInferenceExecutions
listInferenceExecutions_nextToken = (ListInferenceExecutions -> Maybe Text)
-> (ListInferenceExecutions
    -> Maybe Text -> ListInferenceExecutions)
-> Lens
     ListInferenceExecutions
     ListInferenceExecutions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInferenceExecutions
s@ListInferenceExecutions' {} Maybe Text
a -> ListInferenceExecutions
s {$sel:nextToken:ListInferenceExecutions' :: Maybe Text
nextToken = Maybe Text
a} :: ListInferenceExecutions)

-- | Specifies the maximum number of inference executions to list.
listInferenceExecutions_maxResults :: Lens.Lens' ListInferenceExecutions (Prelude.Maybe Prelude.Natural)
listInferenceExecutions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListInferenceExecutions -> f ListInferenceExecutions
listInferenceExecutions_maxResults = (ListInferenceExecutions -> Maybe Natural)
-> (ListInferenceExecutions
    -> Maybe Natural -> ListInferenceExecutions)
-> Lens
     ListInferenceExecutions
     ListInferenceExecutions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListInferenceExecutions
s@ListInferenceExecutions' {} Maybe Natural
a -> ListInferenceExecutions
s {$sel:maxResults:ListInferenceExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListInferenceExecutions)

-- | The time reference in the inferenced dataset after which Amazon Lookout
-- for Equipment started the inference execution.
listInferenceExecutions_dataStartTimeAfter :: Lens.Lens' ListInferenceExecutions (Prelude.Maybe Prelude.UTCTime)
listInferenceExecutions_dataStartTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListInferenceExecutions -> f ListInferenceExecutions
listInferenceExecutions_dataStartTimeAfter = (ListInferenceExecutions -> Maybe POSIX)
-> (ListInferenceExecutions
    -> Maybe POSIX -> ListInferenceExecutions)
-> Lens
     ListInferenceExecutions
     ListInferenceExecutions
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutions' {Maybe POSIX
dataStartTimeAfter :: Maybe POSIX
$sel:dataStartTimeAfter:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe POSIX
dataStartTimeAfter} -> Maybe POSIX
dataStartTimeAfter) (\s :: ListInferenceExecutions
s@ListInferenceExecutions' {} Maybe POSIX
a -> ListInferenceExecutions
s {$sel:dataStartTimeAfter:ListInferenceExecutions' :: Maybe POSIX
dataStartTimeAfter = Maybe POSIX
a} :: ListInferenceExecutions) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListInferenceExecutions -> f ListInferenceExecutions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListInferenceExecutions
-> f ListInferenceExecutions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the inference scheduler for the inference execution listed.
listInferenceExecutions_inferenceSchedulerName :: Lens.Lens' ListInferenceExecutions Prelude.Text
listInferenceExecutions_inferenceSchedulerName :: (Text -> f Text)
-> ListInferenceExecutions -> f ListInferenceExecutions
listInferenceExecutions_inferenceSchedulerName = (ListInferenceExecutions -> Text)
-> (ListInferenceExecutions -> Text -> ListInferenceExecutions)
-> Lens ListInferenceExecutions ListInferenceExecutions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutions' {Text
inferenceSchedulerName :: Text
$sel:inferenceSchedulerName:ListInferenceExecutions' :: ListInferenceExecutions -> Text
inferenceSchedulerName} -> Text
inferenceSchedulerName) (\s :: ListInferenceExecutions
s@ListInferenceExecutions' {} Text
a -> ListInferenceExecutions
s {$sel:inferenceSchedulerName:ListInferenceExecutions' :: Text
inferenceSchedulerName = Text
a} :: ListInferenceExecutions)

instance Core.AWSRequest ListInferenceExecutions where
  type
    AWSResponse ListInferenceExecutions =
      ListInferenceExecutionsResponse
  request :: ListInferenceExecutions -> Request ListInferenceExecutions
request = Service
-> ListInferenceExecutions -> Request ListInferenceExecutions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListInferenceExecutions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListInferenceExecutions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListInferenceExecutions))
-> Logger
-> Service
-> Proxy ListInferenceExecutions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListInferenceExecutions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [InferenceExecutionSummary]
-> Int
-> ListInferenceExecutionsResponse
ListInferenceExecutionsResponse'
            (Maybe Text
 -> Maybe [InferenceExecutionSummary]
 -> Int
 -> ListInferenceExecutionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [InferenceExecutionSummary]
      -> Int -> ListInferenceExecutionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [InferenceExecutionSummary]
   -> Int -> ListInferenceExecutionsResponse)
-> Either String (Maybe [InferenceExecutionSummary])
-> Either String (Int -> ListInferenceExecutionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [InferenceExecutionSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InferenceExecutionSummaries"
                            Either String (Maybe (Maybe [InferenceExecutionSummary]))
-> Maybe [InferenceExecutionSummary]
-> Either String (Maybe [InferenceExecutionSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [InferenceExecutionSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListInferenceExecutionsResponse)
-> Either String Int
-> Either String ListInferenceExecutionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListInferenceExecutions

instance Prelude.NFData ListInferenceExecutions

instance Core.ToHeaders ListInferenceExecutions where
  toHeaders :: ListInferenceExecutions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListInferenceExecutions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSLookoutEquipmentFrontendService.ListInferenceExecutions" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListInferenceExecutions where
  toJSON :: ListInferenceExecutions -> Value
toJSON ListInferenceExecutions' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe InferenceExecutionStatus
Text
inferenceSchedulerName :: Text
dataStartTimeAfter :: Maybe POSIX
maxResults :: Maybe Natural
nextToken :: Maybe Text
dataEndTimeBefore :: Maybe POSIX
status :: Maybe InferenceExecutionStatus
$sel:inferenceSchedulerName:ListInferenceExecutions' :: ListInferenceExecutions -> Text
$sel:dataStartTimeAfter:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe POSIX
$sel:maxResults:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe Natural
$sel:nextToken:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe Text
$sel:dataEndTimeBefore:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe POSIX
$sel:status:ListInferenceExecutions' :: ListInferenceExecutions -> Maybe InferenceExecutionStatus
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" Text -> InferenceExecutionStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (InferenceExecutionStatus -> Pair)
-> Maybe InferenceExecutionStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InferenceExecutionStatus
status,
            (Text
"DataEndTimeBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
dataEndTimeBefore,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Text
"DataStartTimeAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
dataStartTimeAfter,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"InferenceSchedulerName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
inferenceSchedulerName
              )
          ]
      )

instance Core.ToPath ListInferenceExecutions where
  toPath :: ListInferenceExecutions -> ByteString
toPath = ByteString -> ListInferenceExecutions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListInferenceExecutions where
  toQuery :: ListInferenceExecutions -> QueryString
toQuery = QueryString -> ListInferenceExecutions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListInferenceExecutionsResponse' smart constructor.
data ListInferenceExecutionsResponse = ListInferenceExecutionsResponse'
  { -- | An opaque pagination token indicating where to continue the listing of
    -- inference executions.
    ListInferenceExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Provides an array of information about the individual inference
    -- executions returned from the @ListInferenceExecutions@ operation,
    -- including model used, inference scheduler, data configuration, and so
    -- on.
    ListInferenceExecutionsResponse
-> Maybe [InferenceExecutionSummary]
inferenceExecutionSummaries :: Prelude.Maybe [InferenceExecutionSummary],
    -- | The response's http status code.
    ListInferenceExecutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListInferenceExecutionsResponse
-> ListInferenceExecutionsResponse -> Bool
(ListInferenceExecutionsResponse
 -> ListInferenceExecutionsResponse -> Bool)
-> (ListInferenceExecutionsResponse
    -> ListInferenceExecutionsResponse -> Bool)
-> Eq ListInferenceExecutionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInferenceExecutionsResponse
-> ListInferenceExecutionsResponse -> Bool
$c/= :: ListInferenceExecutionsResponse
-> ListInferenceExecutionsResponse -> Bool
== :: ListInferenceExecutionsResponse
-> ListInferenceExecutionsResponse -> Bool
$c== :: ListInferenceExecutionsResponse
-> ListInferenceExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListInferenceExecutionsResponse]
ReadPrec ListInferenceExecutionsResponse
Int -> ReadS ListInferenceExecutionsResponse
ReadS [ListInferenceExecutionsResponse]
(Int -> ReadS ListInferenceExecutionsResponse)
-> ReadS [ListInferenceExecutionsResponse]
-> ReadPrec ListInferenceExecutionsResponse
-> ReadPrec [ListInferenceExecutionsResponse]
-> Read ListInferenceExecutionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInferenceExecutionsResponse]
$creadListPrec :: ReadPrec [ListInferenceExecutionsResponse]
readPrec :: ReadPrec ListInferenceExecutionsResponse
$creadPrec :: ReadPrec ListInferenceExecutionsResponse
readList :: ReadS [ListInferenceExecutionsResponse]
$creadList :: ReadS [ListInferenceExecutionsResponse]
readsPrec :: Int -> ReadS ListInferenceExecutionsResponse
$creadsPrec :: Int -> ReadS ListInferenceExecutionsResponse
Prelude.Read, Int -> ListInferenceExecutionsResponse -> ShowS
[ListInferenceExecutionsResponse] -> ShowS
ListInferenceExecutionsResponse -> String
(Int -> ListInferenceExecutionsResponse -> ShowS)
-> (ListInferenceExecutionsResponse -> String)
-> ([ListInferenceExecutionsResponse] -> ShowS)
-> Show ListInferenceExecutionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInferenceExecutionsResponse] -> ShowS
$cshowList :: [ListInferenceExecutionsResponse] -> ShowS
show :: ListInferenceExecutionsResponse -> String
$cshow :: ListInferenceExecutionsResponse -> String
showsPrec :: Int -> ListInferenceExecutionsResponse -> ShowS
$cshowsPrec :: Int -> ListInferenceExecutionsResponse -> ShowS
Prelude.Show, (forall x.
 ListInferenceExecutionsResponse
 -> Rep ListInferenceExecutionsResponse x)
-> (forall x.
    Rep ListInferenceExecutionsResponse x
    -> ListInferenceExecutionsResponse)
-> Generic ListInferenceExecutionsResponse
forall x.
Rep ListInferenceExecutionsResponse x
-> ListInferenceExecutionsResponse
forall x.
ListInferenceExecutionsResponse
-> Rep ListInferenceExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInferenceExecutionsResponse x
-> ListInferenceExecutionsResponse
$cfrom :: forall x.
ListInferenceExecutionsResponse
-> Rep ListInferenceExecutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListInferenceExecutionsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listInferenceExecutionsResponse_nextToken' - An opaque pagination token indicating where to continue the listing of
-- inference executions.
--
-- 'inferenceExecutionSummaries', 'listInferenceExecutionsResponse_inferenceExecutionSummaries' - Provides an array of information about the individual inference
-- executions returned from the @ListInferenceExecutions@ operation,
-- including model used, inference scheduler, data configuration, and so
-- on.
--
-- 'httpStatus', 'listInferenceExecutionsResponse_httpStatus' - The response's http status code.
newListInferenceExecutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInferenceExecutionsResponse
newListInferenceExecutionsResponse :: Int -> ListInferenceExecutionsResponse
newListInferenceExecutionsResponse Int
pHttpStatus_ =
  ListInferenceExecutionsResponse' :: Maybe Text
-> Maybe [InferenceExecutionSummary]
-> Int
-> ListInferenceExecutionsResponse
ListInferenceExecutionsResponse'
    { $sel:nextToken:ListInferenceExecutionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inferenceExecutionSummaries:ListInferenceExecutionsResponse' :: Maybe [InferenceExecutionSummary]
inferenceExecutionSummaries =
        Maybe [InferenceExecutionSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInferenceExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An opaque pagination token indicating where to continue the listing of
-- inference executions.
listInferenceExecutionsResponse_nextToken :: Lens.Lens' ListInferenceExecutionsResponse (Prelude.Maybe Prelude.Text)
listInferenceExecutionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInferenceExecutionsResponse
-> f ListInferenceExecutionsResponse
listInferenceExecutionsResponse_nextToken = (ListInferenceExecutionsResponse -> Maybe Text)
-> (ListInferenceExecutionsResponse
    -> Maybe Text -> ListInferenceExecutionsResponse)
-> Lens
     ListInferenceExecutionsResponse
     ListInferenceExecutionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInferenceExecutionsResponse' :: ListInferenceExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInferenceExecutionsResponse
s@ListInferenceExecutionsResponse' {} Maybe Text
a -> ListInferenceExecutionsResponse
s {$sel:nextToken:ListInferenceExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListInferenceExecutionsResponse)

-- | Provides an array of information about the individual inference
-- executions returned from the @ListInferenceExecutions@ operation,
-- including model used, inference scheduler, data configuration, and so
-- on.
listInferenceExecutionsResponse_inferenceExecutionSummaries :: Lens.Lens' ListInferenceExecutionsResponse (Prelude.Maybe [InferenceExecutionSummary])
listInferenceExecutionsResponse_inferenceExecutionSummaries :: (Maybe [InferenceExecutionSummary]
 -> f (Maybe [InferenceExecutionSummary]))
-> ListInferenceExecutionsResponse
-> f ListInferenceExecutionsResponse
listInferenceExecutionsResponse_inferenceExecutionSummaries = (ListInferenceExecutionsResponse
 -> Maybe [InferenceExecutionSummary])
-> (ListInferenceExecutionsResponse
    -> Maybe [InferenceExecutionSummary]
    -> ListInferenceExecutionsResponse)
-> Lens
     ListInferenceExecutionsResponse
     ListInferenceExecutionsResponse
     (Maybe [InferenceExecutionSummary])
     (Maybe [InferenceExecutionSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutionsResponse' {Maybe [InferenceExecutionSummary]
inferenceExecutionSummaries :: Maybe [InferenceExecutionSummary]
$sel:inferenceExecutionSummaries:ListInferenceExecutionsResponse' :: ListInferenceExecutionsResponse
-> Maybe [InferenceExecutionSummary]
inferenceExecutionSummaries} -> Maybe [InferenceExecutionSummary]
inferenceExecutionSummaries) (\s :: ListInferenceExecutionsResponse
s@ListInferenceExecutionsResponse' {} Maybe [InferenceExecutionSummary]
a -> ListInferenceExecutionsResponse
s {$sel:inferenceExecutionSummaries:ListInferenceExecutionsResponse' :: Maybe [InferenceExecutionSummary]
inferenceExecutionSummaries = Maybe [InferenceExecutionSummary]
a} :: ListInferenceExecutionsResponse) ((Maybe [InferenceExecutionSummary]
  -> f (Maybe [InferenceExecutionSummary]))
 -> ListInferenceExecutionsResponse
 -> f ListInferenceExecutionsResponse)
-> ((Maybe [InferenceExecutionSummary]
     -> f (Maybe [InferenceExecutionSummary]))
    -> Maybe [InferenceExecutionSummary]
    -> f (Maybe [InferenceExecutionSummary]))
-> (Maybe [InferenceExecutionSummary]
    -> f (Maybe [InferenceExecutionSummary]))
-> ListInferenceExecutionsResponse
-> f ListInferenceExecutionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InferenceExecutionSummary]
  [InferenceExecutionSummary]
  [InferenceExecutionSummary]
  [InferenceExecutionSummary]
-> Iso
     (Maybe [InferenceExecutionSummary])
     (Maybe [InferenceExecutionSummary])
     (Maybe [InferenceExecutionSummary])
     (Maybe [InferenceExecutionSummary])
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 AnIso
  [InferenceExecutionSummary]
  [InferenceExecutionSummary]
  [InferenceExecutionSummary]
  [InferenceExecutionSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listInferenceExecutionsResponse_httpStatus :: Lens.Lens' ListInferenceExecutionsResponse Prelude.Int
listInferenceExecutionsResponse_httpStatus :: (Int -> f Int)
-> ListInferenceExecutionsResponse
-> f ListInferenceExecutionsResponse
listInferenceExecutionsResponse_httpStatus = (ListInferenceExecutionsResponse -> Int)
-> (ListInferenceExecutionsResponse
    -> Int -> ListInferenceExecutionsResponse)
-> Lens
     ListInferenceExecutionsResponse
     ListInferenceExecutionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInferenceExecutionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListInferenceExecutionsResponse' :: ListInferenceExecutionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListInferenceExecutionsResponse
s@ListInferenceExecutionsResponse' {} Int
a -> ListInferenceExecutionsResponse
s {$sel:httpStatus:ListInferenceExecutionsResponse' :: Int
httpStatus = Int
a} :: ListInferenceExecutionsResponse)

instance
  Prelude.NFData
    ListInferenceExecutionsResponse