{-# 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.SageMaker.ListTrialComponents
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the trial components in your account. You can sort the list by
-- trial component name or creation time. You can filter the list to show
-- only components that were created in a specific time range. You can also
-- filter on one of the following:
--
-- -   @ExperimentName@
--
-- -   @SourceArn@
--
-- -   @TrialName@
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListTrialComponents
  ( -- * Creating a Request
    ListTrialComponents (..),
    newListTrialComponents,

    -- * Request Lenses
    listTrialComponents_createdAfter,
    listTrialComponents_createdBefore,
    listTrialComponents_experimentName,
    listTrialComponents_maxResults,
    listTrialComponents_nextToken,
    listTrialComponents_sortBy,
    listTrialComponents_sortOrder,
    listTrialComponents_sourceArn,
    listTrialComponents_trialName,

    -- * Destructuring the Response
    ListTrialComponentsResponse (..),
    newListTrialComponentsResponse,

    -- * Response Lenses
    listTrialComponentsResponse_nextToken,
    listTrialComponentsResponse_trialComponentSummaries,
    listTrialComponentsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newListTrialComponents' smart constructor.
data ListTrialComponents = ListTrialComponents'
  { -- | A filter that returns only components created after the specified time.
    ListTrialComponents -> Maybe POSIX
createdAfter :: Prelude.Maybe Data.POSIX,
    -- | A filter that returns only components created before the specified time.
    ListTrialComponents -> Maybe POSIX
createdBefore :: Prelude.Maybe Data.POSIX,
    -- | A filter that returns only components that are part of the specified
    -- experiment. If you specify @ExperimentName@, you can\'t filter by
    -- @SourceArn@ or @TrialName@.
    ListTrialComponents -> Maybe Text
experimentName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of components to return in the response. The default
    -- value is 10.
    ListTrialComponents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous call to @ListTrialComponents@ didn\'t return the full
    -- set of components, the call returns a token for getting the next set of
    -- components.
    ListTrialComponents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The property used to sort results. The default value is @CreationTime@.
    ListTrialComponents -> Maybe SortTrialComponentsBy
sortBy :: Prelude.Maybe SortTrialComponentsBy,
    -- | The sort order. The default value is @Descending@.
    ListTrialComponents -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | A filter that returns only components that have the specified source
    -- Amazon Resource Name (ARN). If you specify @SourceArn@, you can\'t
    -- filter by @ExperimentName@ or @TrialName@.
    ListTrialComponents -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | A filter that returns only components that are part of the specified
    -- trial. If you specify @TrialName@, you can\'t filter by @ExperimentName@
    -- or @SourceArn@.
    ListTrialComponents -> Maybe Text
trialName :: Prelude.Maybe Prelude.Text
  }
  deriving (ListTrialComponents -> ListTrialComponents -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrialComponents -> ListTrialComponents -> Bool
$c/= :: ListTrialComponents -> ListTrialComponents -> Bool
== :: ListTrialComponents -> ListTrialComponents -> Bool
$c== :: ListTrialComponents -> ListTrialComponents -> Bool
Prelude.Eq, ReadPrec [ListTrialComponents]
ReadPrec ListTrialComponents
Int -> ReadS ListTrialComponents
ReadS [ListTrialComponents]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrialComponents]
$creadListPrec :: ReadPrec [ListTrialComponents]
readPrec :: ReadPrec ListTrialComponents
$creadPrec :: ReadPrec ListTrialComponents
readList :: ReadS [ListTrialComponents]
$creadList :: ReadS [ListTrialComponents]
readsPrec :: Int -> ReadS ListTrialComponents
$creadsPrec :: Int -> ReadS ListTrialComponents
Prelude.Read, Int -> ListTrialComponents -> ShowS
[ListTrialComponents] -> ShowS
ListTrialComponents -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrialComponents] -> ShowS
$cshowList :: [ListTrialComponents] -> ShowS
show :: ListTrialComponents -> String
$cshow :: ListTrialComponents -> String
showsPrec :: Int -> ListTrialComponents -> ShowS
$cshowsPrec :: Int -> ListTrialComponents -> ShowS
Prelude.Show, forall x. Rep ListTrialComponents x -> ListTrialComponents
forall x. ListTrialComponents -> Rep ListTrialComponents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTrialComponents x -> ListTrialComponents
$cfrom :: forall x. ListTrialComponents -> Rep ListTrialComponents x
Prelude.Generic)

-- |
-- Create a value of 'ListTrialComponents' 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:
--
-- 'createdAfter', 'listTrialComponents_createdAfter' - A filter that returns only components created after the specified time.
--
-- 'createdBefore', 'listTrialComponents_createdBefore' - A filter that returns only components created before the specified time.
--
-- 'experimentName', 'listTrialComponents_experimentName' - A filter that returns only components that are part of the specified
-- experiment. If you specify @ExperimentName@, you can\'t filter by
-- @SourceArn@ or @TrialName@.
--
-- 'maxResults', 'listTrialComponents_maxResults' - The maximum number of components to return in the response. The default
-- value is 10.
--
-- 'nextToken', 'listTrialComponents_nextToken' - If the previous call to @ListTrialComponents@ didn\'t return the full
-- set of components, the call returns a token for getting the next set of
-- components.
--
-- 'sortBy', 'listTrialComponents_sortBy' - The property used to sort results. The default value is @CreationTime@.
--
-- 'sortOrder', 'listTrialComponents_sortOrder' - The sort order. The default value is @Descending@.
--
-- 'sourceArn', 'listTrialComponents_sourceArn' - A filter that returns only components that have the specified source
-- Amazon Resource Name (ARN). If you specify @SourceArn@, you can\'t
-- filter by @ExperimentName@ or @TrialName@.
--
-- 'trialName', 'listTrialComponents_trialName' - A filter that returns only components that are part of the specified
-- trial. If you specify @TrialName@, you can\'t filter by @ExperimentName@
-- or @SourceArn@.
newListTrialComponents ::
  ListTrialComponents
newListTrialComponents :: ListTrialComponents
newListTrialComponents =
  ListTrialComponents'
    { $sel:createdAfter:ListTrialComponents' :: Maybe POSIX
createdAfter =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createdBefore:ListTrialComponents' :: Maybe POSIX
createdBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:experimentName:ListTrialComponents' :: Maybe Text
experimentName = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTrialComponents' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTrialComponents' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListTrialComponents' :: Maybe SortTrialComponentsBy
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListTrialComponents' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:ListTrialComponents' :: Maybe Text
sourceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:trialName:ListTrialComponents' :: Maybe Text
trialName = forall a. Maybe a
Prelude.Nothing
    }

-- | A filter that returns only components created after the specified time.
listTrialComponents_createdAfter :: Lens.Lens' ListTrialComponents (Prelude.Maybe Prelude.UTCTime)
listTrialComponents_createdAfter :: Lens' ListTrialComponents (Maybe UTCTime)
listTrialComponents_createdAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe POSIX
createdAfter :: Maybe POSIX
$sel:createdAfter:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
createdAfter} -> Maybe POSIX
createdAfter) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe POSIX
a -> ListTrialComponents
s {$sel:createdAfter:ListTrialComponents' :: Maybe POSIX
createdAfter = Maybe POSIX
a} :: ListTrialComponents) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A filter that returns only components created before the specified time.
listTrialComponents_createdBefore :: Lens.Lens' ListTrialComponents (Prelude.Maybe Prelude.UTCTime)
listTrialComponents_createdBefore :: Lens' ListTrialComponents (Maybe UTCTime)
listTrialComponents_createdBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe POSIX
createdBefore :: Maybe POSIX
$sel:createdBefore:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
createdBefore} -> Maybe POSIX
createdBefore) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe POSIX
a -> ListTrialComponents
s {$sel:createdBefore:ListTrialComponents' :: Maybe POSIX
createdBefore = Maybe POSIX
a} :: ListTrialComponents) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A filter that returns only components that are part of the specified
-- experiment. If you specify @ExperimentName@, you can\'t filter by
-- @SourceArn@ or @TrialName@.
listTrialComponents_experimentName :: Lens.Lens' ListTrialComponents (Prelude.Maybe Prelude.Text)
listTrialComponents_experimentName :: Lens' ListTrialComponents (Maybe Text)
listTrialComponents_experimentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe Text
experimentName :: Maybe Text
$sel:experimentName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
experimentName} -> Maybe Text
experimentName) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe Text
a -> ListTrialComponents
s {$sel:experimentName:ListTrialComponents' :: Maybe Text
experimentName = Maybe Text
a} :: ListTrialComponents)

-- | The maximum number of components to return in the response. The default
-- value is 10.
listTrialComponents_maxResults :: Lens.Lens' ListTrialComponents (Prelude.Maybe Prelude.Natural)
listTrialComponents_maxResults :: Lens' ListTrialComponents (Maybe Natural)
listTrialComponents_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTrialComponents' :: ListTrialComponents -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe Natural
a -> ListTrialComponents
s {$sel:maxResults:ListTrialComponents' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTrialComponents)

-- | If the previous call to @ListTrialComponents@ didn\'t return the full
-- set of components, the call returns a token for getting the next set of
-- components.
listTrialComponents_nextToken :: Lens.Lens' ListTrialComponents (Prelude.Maybe Prelude.Text)
listTrialComponents_nextToken :: Lens' ListTrialComponents (Maybe Text)
listTrialComponents_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTrialComponents' :: ListTrialComponents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe Text
a -> ListTrialComponents
s {$sel:nextToken:ListTrialComponents' :: Maybe Text
nextToken = Maybe Text
a} :: ListTrialComponents)

-- | The property used to sort results. The default value is @CreationTime@.
listTrialComponents_sortBy :: Lens.Lens' ListTrialComponents (Prelude.Maybe SortTrialComponentsBy)
listTrialComponents_sortBy :: Lens' ListTrialComponents (Maybe SortTrialComponentsBy)
listTrialComponents_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe SortTrialComponentsBy
sortBy :: Maybe SortTrialComponentsBy
$sel:sortBy:ListTrialComponents' :: ListTrialComponents -> Maybe SortTrialComponentsBy
sortBy} -> Maybe SortTrialComponentsBy
sortBy) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe SortTrialComponentsBy
a -> ListTrialComponents
s {$sel:sortBy:ListTrialComponents' :: Maybe SortTrialComponentsBy
sortBy = Maybe SortTrialComponentsBy
a} :: ListTrialComponents)

-- | The sort order. The default value is @Descending@.
listTrialComponents_sortOrder :: Lens.Lens' ListTrialComponents (Prelude.Maybe SortOrder)
listTrialComponents_sortOrder :: Lens' ListTrialComponents (Maybe SortOrder)
listTrialComponents_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListTrialComponents' :: ListTrialComponents -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe SortOrder
a -> ListTrialComponents
s {$sel:sortOrder:ListTrialComponents' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListTrialComponents)

-- | A filter that returns only components that have the specified source
-- Amazon Resource Name (ARN). If you specify @SourceArn@, you can\'t
-- filter by @ExperimentName@ or @TrialName@.
listTrialComponents_sourceArn :: Lens.Lens' ListTrialComponents (Prelude.Maybe Prelude.Text)
listTrialComponents_sourceArn :: Lens' ListTrialComponents (Maybe Text)
listTrialComponents_sourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:ListTrialComponents' :: ListTrialComponents -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe Text
a -> ListTrialComponents
s {$sel:sourceArn:ListTrialComponents' :: Maybe Text
sourceArn = Maybe Text
a} :: ListTrialComponents)

-- | A filter that returns only components that are part of the specified
-- trial. If you specify @TrialName@, you can\'t filter by @ExperimentName@
-- or @SourceArn@.
listTrialComponents_trialName :: Lens.Lens' ListTrialComponents (Prelude.Maybe Prelude.Text)
listTrialComponents_trialName :: Lens' ListTrialComponents (Maybe Text)
listTrialComponents_trialName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponents' {Maybe Text
trialName :: Maybe Text
$sel:trialName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
trialName} -> Maybe Text
trialName) (\s :: ListTrialComponents
s@ListTrialComponents' {} Maybe Text
a -> ListTrialComponents
s {$sel:trialName:ListTrialComponents' :: Maybe Text
trialName = Maybe Text
a} :: ListTrialComponents)

instance Core.AWSPager ListTrialComponents where
  page :: ListTrialComponents
-> AWSResponse ListTrialComponents -> Maybe ListTrialComponents
page ListTrialComponents
rq AWSResponse ListTrialComponents
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTrialComponents
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTrialComponentsResponse (Maybe Text)
listTrialComponentsResponse_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 ListTrialComponents
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTrialComponentsResponse (Maybe [TrialComponentSummary])
listTrialComponentsResponse_trialComponentSummaries
            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.$ ListTrialComponents
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListTrialComponents (Maybe Text)
listTrialComponents_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTrialComponents
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTrialComponentsResponse (Maybe Text)
listTrialComponentsResponse_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 ListTrialComponents where
  type
    AWSResponse ListTrialComponents =
      ListTrialComponentsResponse
  request :: (Service -> Service)
-> ListTrialComponents -> Request ListTrialComponents
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 ListTrialComponents
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTrialComponents)))
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 [TrialComponentSummary]
-> Int
-> ListTrialComponentsResponse
ListTrialComponentsResponse'
            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
"TrialComponentSummaries"
                            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 ListTrialComponents where
  hashWithSalt :: Int -> ListTrialComponents -> Int
hashWithSalt Int
_salt ListTrialComponents' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortOrder
Maybe SortTrialComponentsBy
trialName :: Maybe Text
sourceArn :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe SortTrialComponentsBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
experimentName :: Maybe Text
createdBefore :: Maybe POSIX
createdAfter :: Maybe POSIX
$sel:trialName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:sourceArn:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:sortOrder:ListTrialComponents' :: ListTrialComponents -> Maybe SortOrder
$sel:sortBy:ListTrialComponents' :: ListTrialComponents -> Maybe SortTrialComponentsBy
$sel:nextToken:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:maxResults:ListTrialComponents' :: ListTrialComponents -> Maybe Natural
$sel:experimentName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:createdBefore:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
$sel:createdAfter:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAfter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdBefore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
experimentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortTrialComponentsBy
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sortOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trialName

instance Prelude.NFData ListTrialComponents where
  rnf :: ListTrialComponents -> ()
rnf ListTrialComponents' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortOrder
Maybe SortTrialComponentsBy
trialName :: Maybe Text
sourceArn :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe SortTrialComponentsBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
experimentName :: Maybe Text
createdBefore :: Maybe POSIX
createdAfter :: Maybe POSIX
$sel:trialName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:sourceArn:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:sortOrder:ListTrialComponents' :: ListTrialComponents -> Maybe SortOrder
$sel:sortBy:ListTrialComponents' :: ListTrialComponents -> Maybe SortTrialComponentsBy
$sel:nextToken:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:maxResults:ListTrialComponents' :: ListTrialComponents -> Maybe Natural
$sel:experimentName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:createdBefore:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
$sel:createdAfter:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAfter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdBefore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
experimentName
      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
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortTrialComponentsBy
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrder
sortOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trialName

instance Data.ToHeaders ListTrialComponents where
  toHeaders :: ListTrialComponents -> 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
"SageMaker.ListTrialComponents" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListTrialComponents where
  toJSON :: ListTrialComponents -> Value
toJSON ListTrialComponents' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortOrder
Maybe SortTrialComponentsBy
trialName :: Maybe Text
sourceArn :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe SortTrialComponentsBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
experimentName :: Maybe Text
createdBefore :: Maybe POSIX
createdAfter :: Maybe POSIX
$sel:trialName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:sourceArn:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:sortOrder:ListTrialComponents' :: ListTrialComponents -> Maybe SortOrder
$sel:sortBy:ListTrialComponents' :: ListTrialComponents -> Maybe SortTrialComponentsBy
$sel:nextToken:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:maxResults:ListTrialComponents' :: ListTrialComponents -> Maybe Natural
$sel:experimentName:ListTrialComponents' :: ListTrialComponents -> Maybe Text
$sel:createdBefore:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
$sel:createdAfter:ListTrialComponents' :: ListTrialComponents -> Maybe POSIX
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CreatedAfter" 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 POSIX
createdAfter,
            (Key
"CreatedBefore" 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 POSIX
createdBefore,
            (Key
"ExperimentName" 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
experimentName,
            (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
"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,
            (Key
"SortBy" 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 SortTrialComponentsBy
sortBy,
            (Key
"SortOrder" 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 SortOrder
sortOrder,
            (Key
"SourceArn" 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
sourceArn,
            (Key
"TrialName" 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
trialName
          ]
      )

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

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

-- | /See:/ 'newListTrialComponentsResponse' smart constructor.
data ListTrialComponentsResponse = ListTrialComponentsResponse'
  { -- | A token for getting the next set of components, if there are any.
    ListTrialComponentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the summaries of your trial components.
    ListTrialComponentsResponse -> Maybe [TrialComponentSummary]
trialComponentSummaries :: Prelude.Maybe [TrialComponentSummary],
    -- | The response's http status code.
    ListTrialComponentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTrialComponentsResponse -> ListTrialComponentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrialComponentsResponse -> ListTrialComponentsResponse -> Bool
$c/= :: ListTrialComponentsResponse -> ListTrialComponentsResponse -> Bool
== :: ListTrialComponentsResponse -> ListTrialComponentsResponse -> Bool
$c== :: ListTrialComponentsResponse -> ListTrialComponentsResponse -> Bool
Prelude.Eq, ReadPrec [ListTrialComponentsResponse]
ReadPrec ListTrialComponentsResponse
Int -> ReadS ListTrialComponentsResponse
ReadS [ListTrialComponentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrialComponentsResponse]
$creadListPrec :: ReadPrec [ListTrialComponentsResponse]
readPrec :: ReadPrec ListTrialComponentsResponse
$creadPrec :: ReadPrec ListTrialComponentsResponse
readList :: ReadS [ListTrialComponentsResponse]
$creadList :: ReadS [ListTrialComponentsResponse]
readsPrec :: Int -> ReadS ListTrialComponentsResponse
$creadsPrec :: Int -> ReadS ListTrialComponentsResponse
Prelude.Read, Int -> ListTrialComponentsResponse -> ShowS
[ListTrialComponentsResponse] -> ShowS
ListTrialComponentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrialComponentsResponse] -> ShowS
$cshowList :: [ListTrialComponentsResponse] -> ShowS
show :: ListTrialComponentsResponse -> String
$cshow :: ListTrialComponentsResponse -> String
showsPrec :: Int -> ListTrialComponentsResponse -> ShowS
$cshowsPrec :: Int -> ListTrialComponentsResponse -> ShowS
Prelude.Show, forall x.
Rep ListTrialComponentsResponse x -> ListTrialComponentsResponse
forall x.
ListTrialComponentsResponse -> Rep ListTrialComponentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTrialComponentsResponse x -> ListTrialComponentsResponse
$cfrom :: forall x.
ListTrialComponentsResponse -> Rep ListTrialComponentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTrialComponentsResponse' 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', 'listTrialComponentsResponse_nextToken' - A token for getting the next set of components, if there are any.
--
-- 'trialComponentSummaries', 'listTrialComponentsResponse_trialComponentSummaries' - A list of the summaries of your trial components.
--
-- 'httpStatus', 'listTrialComponentsResponse_httpStatus' - The response's http status code.
newListTrialComponentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTrialComponentsResponse
newListTrialComponentsResponse :: Int -> ListTrialComponentsResponse
newListTrialComponentsResponse Int
pHttpStatus_ =
  ListTrialComponentsResponse'
    { $sel:nextToken:ListTrialComponentsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:trialComponentSummaries:ListTrialComponentsResponse' :: Maybe [TrialComponentSummary]
trialComponentSummaries = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTrialComponentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token for getting the next set of components, if there are any.
listTrialComponentsResponse_nextToken :: Lens.Lens' ListTrialComponentsResponse (Prelude.Maybe Prelude.Text)
listTrialComponentsResponse_nextToken :: Lens' ListTrialComponentsResponse (Maybe Text)
listTrialComponentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTrialComponentsResponse' :: ListTrialComponentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTrialComponentsResponse
s@ListTrialComponentsResponse' {} Maybe Text
a -> ListTrialComponentsResponse
s {$sel:nextToken:ListTrialComponentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTrialComponentsResponse)

-- | A list of the summaries of your trial components.
listTrialComponentsResponse_trialComponentSummaries :: Lens.Lens' ListTrialComponentsResponse (Prelude.Maybe [TrialComponentSummary])
listTrialComponentsResponse_trialComponentSummaries :: Lens' ListTrialComponentsResponse (Maybe [TrialComponentSummary])
listTrialComponentsResponse_trialComponentSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrialComponentsResponse' {Maybe [TrialComponentSummary]
trialComponentSummaries :: Maybe [TrialComponentSummary]
$sel:trialComponentSummaries:ListTrialComponentsResponse' :: ListTrialComponentsResponse -> Maybe [TrialComponentSummary]
trialComponentSummaries} -> Maybe [TrialComponentSummary]
trialComponentSummaries) (\s :: ListTrialComponentsResponse
s@ListTrialComponentsResponse' {} Maybe [TrialComponentSummary]
a -> ListTrialComponentsResponse
s {$sel:trialComponentSummaries:ListTrialComponentsResponse' :: Maybe [TrialComponentSummary]
trialComponentSummaries = Maybe [TrialComponentSummary]
a} :: ListTrialComponentsResponse) 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

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

instance Prelude.NFData ListTrialComponentsResponse where
  rnf :: ListTrialComponentsResponse -> ()
rnf ListTrialComponentsResponse' {Int
Maybe [TrialComponentSummary]
Maybe Text
httpStatus :: Int
trialComponentSummaries :: Maybe [TrialComponentSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListTrialComponentsResponse' :: ListTrialComponentsResponse -> Int
$sel:trialComponentSummaries:ListTrialComponentsResponse' :: ListTrialComponentsResponse -> Maybe [TrialComponentSummary]
$sel:nextToken:ListTrialComponentsResponse' :: ListTrialComponentsResponse -> 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 [TrialComponentSummary]
trialComponentSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus