{-# 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.ListHubContents
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- List the contents of a hub.
module Amazonka.SageMaker.ListHubContents
  ( -- * Creating a Request
    ListHubContents (..),
    newListHubContents,

    -- * Request Lenses
    listHubContents_creationTimeAfter,
    listHubContents_creationTimeBefore,
    listHubContents_maxResults,
    listHubContents_maxSchemaVersion,
    listHubContents_nameContains,
    listHubContents_nextToken,
    listHubContents_sortBy,
    listHubContents_sortOrder,
    listHubContents_hubName,
    listHubContents_hubContentType,

    -- * Destructuring the Response
    ListHubContentsResponse (..),
    newListHubContentsResponse,

    -- * Response Lenses
    listHubContentsResponse_nextToken,
    listHubContentsResponse_httpStatus,
    listHubContentsResponse_hubContentSummaries,
  )
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:/ 'newListHubContents' smart constructor.
data ListHubContents = ListHubContents'
  { -- | Only list hub content that was created after the time specified.
    ListHubContents -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Data.POSIX,
    -- | Only list hub content that was created before the time specified.
    ListHubContents -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Data.POSIX,
    -- | The maximum amount of hub content to list.
    ListHubContents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The upper bound of the hub content schema verion.
    ListHubContents -> Maybe Text
maxSchemaVersion :: Prelude.Maybe Prelude.Text,
    -- | Only list hub content if the name contains the specified string.
    ListHubContents -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | If the response to a previous @ListHubContents@ request was truncated,
    -- the response includes a @NextToken@. To retrieve the next set of hub
    -- content, use the token in the next request.
    ListHubContents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Sort hub content versions by either name or creation time.
    ListHubContents -> Maybe HubContentSortBy
sortBy :: Prelude.Maybe HubContentSortBy,
    -- | Sort hubs by ascending or descending order.
    ListHubContents -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | The name of the hub to list the contents of.
    ListHubContents -> Text
hubName :: Prelude.Text,
    -- | The type of hub content to list.
    ListHubContents -> HubContentType
hubContentType :: HubContentType
  }
  deriving (ListHubContents -> ListHubContents -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHubContents -> ListHubContents -> Bool
$c/= :: ListHubContents -> ListHubContents -> Bool
== :: ListHubContents -> ListHubContents -> Bool
$c== :: ListHubContents -> ListHubContents -> Bool
Prelude.Eq, ReadPrec [ListHubContents]
ReadPrec ListHubContents
Int -> ReadS ListHubContents
ReadS [ListHubContents]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHubContents]
$creadListPrec :: ReadPrec [ListHubContents]
readPrec :: ReadPrec ListHubContents
$creadPrec :: ReadPrec ListHubContents
readList :: ReadS [ListHubContents]
$creadList :: ReadS [ListHubContents]
readsPrec :: Int -> ReadS ListHubContents
$creadsPrec :: Int -> ReadS ListHubContents
Prelude.Read, Int -> ListHubContents -> ShowS
[ListHubContents] -> ShowS
ListHubContents -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHubContents] -> ShowS
$cshowList :: [ListHubContents] -> ShowS
show :: ListHubContents -> String
$cshow :: ListHubContents -> String
showsPrec :: Int -> ListHubContents -> ShowS
$cshowsPrec :: Int -> ListHubContents -> ShowS
Prelude.Show, forall x. Rep ListHubContents x -> ListHubContents
forall x. ListHubContents -> Rep ListHubContents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListHubContents x -> ListHubContents
$cfrom :: forall x. ListHubContents -> Rep ListHubContents x
Prelude.Generic)

-- |
-- Create a value of 'ListHubContents' 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:
--
-- 'creationTimeAfter', 'listHubContents_creationTimeAfter' - Only list hub content that was created after the time specified.
--
-- 'creationTimeBefore', 'listHubContents_creationTimeBefore' - Only list hub content that was created before the time specified.
--
-- 'maxResults', 'listHubContents_maxResults' - The maximum amount of hub content to list.
--
-- 'maxSchemaVersion', 'listHubContents_maxSchemaVersion' - The upper bound of the hub content schema verion.
--
-- 'nameContains', 'listHubContents_nameContains' - Only list hub content if the name contains the specified string.
--
-- 'nextToken', 'listHubContents_nextToken' - If the response to a previous @ListHubContents@ request was truncated,
-- the response includes a @NextToken@. To retrieve the next set of hub
-- content, use the token in the next request.
--
-- 'sortBy', 'listHubContents_sortBy' - Sort hub content versions by either name or creation time.
--
-- 'sortOrder', 'listHubContents_sortOrder' - Sort hubs by ascending or descending order.
--
-- 'hubName', 'listHubContents_hubName' - The name of the hub to list the contents of.
--
-- 'hubContentType', 'listHubContents_hubContentType' - The type of hub content to list.
newListHubContents ::
  -- | 'hubName'
  Prelude.Text ->
  -- | 'hubContentType'
  HubContentType ->
  ListHubContents
newListHubContents :: Text -> HubContentType -> ListHubContents
newListHubContents Text
pHubName_ HubContentType
pHubContentType_ =
  ListHubContents'
    { $sel:creationTimeAfter:ListHubContents' :: Maybe POSIX
creationTimeAfter =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeBefore:ListHubContents' :: Maybe POSIX
creationTimeBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListHubContents' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:maxSchemaVersion:ListHubContents' :: Maybe Text
maxSchemaVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:nameContains:ListHubContents' :: Maybe Text
nameContains = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListHubContents' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListHubContents' :: Maybe HubContentSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListHubContents' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:hubName:ListHubContents' :: Text
hubName = Text
pHubName_,
      $sel:hubContentType:ListHubContents' :: HubContentType
hubContentType = HubContentType
pHubContentType_
    }

-- | Only list hub content that was created after the time specified.
listHubContents_creationTimeAfter :: Lens.Lens' ListHubContents (Prelude.Maybe Prelude.UTCTime)
listHubContents_creationTimeAfter :: Lens' ListHubContents (Maybe UTCTime)
listHubContents_creationTimeAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListHubContents' :: ListHubContents -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListHubContents
s@ListHubContents' {} Maybe POSIX
a -> ListHubContents
s {$sel:creationTimeAfter:ListHubContents' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListHubContents) 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

-- | Only list hub content that was created before the time specified.
listHubContents_creationTimeBefore :: Lens.Lens' ListHubContents (Prelude.Maybe Prelude.UTCTime)
listHubContents_creationTimeBefore :: Lens' ListHubContents (Maybe UTCTime)
listHubContents_creationTimeBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListHubContents' :: ListHubContents -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListHubContents
s@ListHubContents' {} Maybe POSIX
a -> ListHubContents
s {$sel:creationTimeBefore:ListHubContents' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListHubContents) 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

-- | The maximum amount of hub content to list.
listHubContents_maxResults :: Lens.Lens' ListHubContents (Prelude.Maybe Prelude.Natural)
listHubContents_maxResults :: Lens' ListHubContents (Maybe Natural)
listHubContents_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListHubContents' :: ListHubContents -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListHubContents
s@ListHubContents' {} Maybe Natural
a -> ListHubContents
s {$sel:maxResults:ListHubContents' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListHubContents)

-- | The upper bound of the hub content schema verion.
listHubContents_maxSchemaVersion :: Lens.Lens' ListHubContents (Prelude.Maybe Prelude.Text)
listHubContents_maxSchemaVersion :: Lens' ListHubContents (Maybe Text)
listHubContents_maxSchemaVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe Text
maxSchemaVersion :: Maybe Text
$sel:maxSchemaVersion:ListHubContents' :: ListHubContents -> Maybe Text
maxSchemaVersion} -> Maybe Text
maxSchemaVersion) (\s :: ListHubContents
s@ListHubContents' {} Maybe Text
a -> ListHubContents
s {$sel:maxSchemaVersion:ListHubContents' :: Maybe Text
maxSchemaVersion = Maybe Text
a} :: ListHubContents)

-- | Only list hub content if the name contains the specified string.
listHubContents_nameContains :: Lens.Lens' ListHubContents (Prelude.Maybe Prelude.Text)
listHubContents_nameContains :: Lens' ListHubContents (Maybe Text)
listHubContents_nameContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListHubContents' :: ListHubContents -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListHubContents
s@ListHubContents' {} Maybe Text
a -> ListHubContents
s {$sel:nameContains:ListHubContents' :: Maybe Text
nameContains = Maybe Text
a} :: ListHubContents)

-- | If the response to a previous @ListHubContents@ request was truncated,
-- the response includes a @NextToken@. To retrieve the next set of hub
-- content, use the token in the next request.
listHubContents_nextToken :: Lens.Lens' ListHubContents (Prelude.Maybe Prelude.Text)
listHubContents_nextToken :: Lens' ListHubContents (Maybe Text)
listHubContents_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHubContents' :: ListHubContents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHubContents
s@ListHubContents' {} Maybe Text
a -> ListHubContents
s {$sel:nextToken:ListHubContents' :: Maybe Text
nextToken = Maybe Text
a} :: ListHubContents)

-- | Sort hub content versions by either name or creation time.
listHubContents_sortBy :: Lens.Lens' ListHubContents (Prelude.Maybe HubContentSortBy)
listHubContents_sortBy :: Lens' ListHubContents (Maybe HubContentSortBy)
listHubContents_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe HubContentSortBy
sortBy :: Maybe HubContentSortBy
$sel:sortBy:ListHubContents' :: ListHubContents -> Maybe HubContentSortBy
sortBy} -> Maybe HubContentSortBy
sortBy) (\s :: ListHubContents
s@ListHubContents' {} Maybe HubContentSortBy
a -> ListHubContents
s {$sel:sortBy:ListHubContents' :: Maybe HubContentSortBy
sortBy = Maybe HubContentSortBy
a} :: ListHubContents)

-- | Sort hubs by ascending or descending order.
listHubContents_sortOrder :: Lens.Lens' ListHubContents (Prelude.Maybe SortOrder)
listHubContents_sortOrder :: Lens' ListHubContents (Maybe SortOrder)
listHubContents_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListHubContents' :: ListHubContents -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListHubContents
s@ListHubContents' {} Maybe SortOrder
a -> ListHubContents
s {$sel:sortOrder:ListHubContents' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListHubContents)

-- | The name of the hub to list the contents of.
listHubContents_hubName :: Lens.Lens' ListHubContents Prelude.Text
listHubContents_hubName :: Lens' ListHubContents Text
listHubContents_hubName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {Text
hubName :: Text
$sel:hubName:ListHubContents' :: ListHubContents -> Text
hubName} -> Text
hubName) (\s :: ListHubContents
s@ListHubContents' {} Text
a -> ListHubContents
s {$sel:hubName:ListHubContents' :: Text
hubName = Text
a} :: ListHubContents)

-- | The type of hub content to list.
listHubContents_hubContentType :: Lens.Lens' ListHubContents HubContentType
listHubContents_hubContentType :: Lens' ListHubContents HubContentType
listHubContents_hubContentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContents' {HubContentType
hubContentType :: HubContentType
$sel:hubContentType:ListHubContents' :: ListHubContents -> HubContentType
hubContentType} -> HubContentType
hubContentType) (\s :: ListHubContents
s@ListHubContents' {} HubContentType
a -> ListHubContents
s {$sel:hubContentType:ListHubContents' :: HubContentType
hubContentType = HubContentType
a} :: ListHubContents)

instance Core.AWSRequest ListHubContents where
  type
    AWSResponse ListHubContents =
      ListHubContentsResponse
  request :: (Service -> Service) -> ListHubContents -> Request ListHubContents
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 ListHubContents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListHubContents)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> [HubContentInfo] -> ListHubContentsResponse
ListHubContentsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"HubContentSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListHubContents where
  hashWithSalt :: Int -> ListHubContents -> Int
hashWithSalt Int
_salt ListHubContents' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe HubContentSortBy
Maybe SortOrder
Text
HubContentType
hubContentType :: HubContentType
hubName :: Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe HubContentSortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxSchemaVersion :: Maybe Text
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:hubContentType:ListHubContents' :: ListHubContents -> HubContentType
$sel:hubName:ListHubContents' :: ListHubContents -> Text
$sel:sortOrder:ListHubContents' :: ListHubContents -> Maybe SortOrder
$sel:sortBy:ListHubContents' :: ListHubContents -> Maybe HubContentSortBy
$sel:nextToken:ListHubContents' :: ListHubContents -> Maybe Text
$sel:nameContains:ListHubContents' :: ListHubContents -> Maybe Text
$sel:maxSchemaVersion:ListHubContents' :: ListHubContents -> Maybe Text
$sel:maxResults:ListHubContents' :: ListHubContents -> Maybe Natural
$sel:creationTimeBefore:ListHubContents' :: ListHubContents -> Maybe POSIX
$sel:creationTimeAfter:ListHubContents' :: ListHubContents -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeAfter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeBefore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxSchemaVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameContains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HubContentSortBy
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sortOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hubName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HubContentType
hubContentType

instance Prelude.NFData ListHubContents where
  rnf :: ListHubContents -> ()
rnf ListHubContents' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe HubContentSortBy
Maybe SortOrder
Text
HubContentType
hubContentType :: HubContentType
hubName :: Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe HubContentSortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxSchemaVersion :: Maybe Text
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:hubContentType:ListHubContents' :: ListHubContents -> HubContentType
$sel:hubName:ListHubContents' :: ListHubContents -> Text
$sel:sortOrder:ListHubContents' :: ListHubContents -> Maybe SortOrder
$sel:sortBy:ListHubContents' :: ListHubContents -> Maybe HubContentSortBy
$sel:nextToken:ListHubContents' :: ListHubContents -> Maybe Text
$sel:nameContains:ListHubContents' :: ListHubContents -> Maybe Text
$sel:maxSchemaVersion:ListHubContents' :: ListHubContents -> Maybe Text
$sel:maxResults:ListHubContents' :: ListHubContents -> Maybe Natural
$sel:creationTimeBefore:ListHubContents' :: ListHubContents -> Maybe POSIX
$sel:creationTimeAfter:ListHubContents' :: ListHubContents -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeAfter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeBefore
      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
maxSchemaVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameContains
      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 HubContentSortBy
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 Text
hubName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HubContentType
hubContentType

instance Data.ToHeaders ListHubContents where
  toHeaders :: ListHubContents -> 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.ListHubContents" :: 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 ListHubContents where
  toJSON :: ListHubContents -> Value
toJSON ListHubContents' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe HubContentSortBy
Maybe SortOrder
Text
HubContentType
hubContentType :: HubContentType
hubName :: Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe HubContentSortBy
nextToken :: Maybe Text
nameContains :: Maybe Text
maxSchemaVersion :: Maybe Text
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:hubContentType:ListHubContents' :: ListHubContents -> HubContentType
$sel:hubName:ListHubContents' :: ListHubContents -> Text
$sel:sortOrder:ListHubContents' :: ListHubContents -> Maybe SortOrder
$sel:sortBy:ListHubContents' :: ListHubContents -> Maybe HubContentSortBy
$sel:nextToken:ListHubContents' :: ListHubContents -> Maybe Text
$sel:nameContains:ListHubContents' :: ListHubContents -> Maybe Text
$sel:maxSchemaVersion:ListHubContents' :: ListHubContents -> Maybe Text
$sel:maxResults:ListHubContents' :: ListHubContents -> Maybe Natural
$sel:creationTimeBefore:ListHubContents' :: ListHubContents -> Maybe POSIX
$sel:creationTimeAfter:ListHubContents' :: ListHubContents -> Maybe POSIX
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CreationTimeAfter" 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
creationTimeAfter,
            (Key
"CreationTimeBefore" 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
creationTimeBefore,
            (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
"MaxSchemaVersion" 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
maxSchemaVersion,
            (Key
"NameContains" 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
nameContains,
            (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 HubContentSortBy
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,
            forall a. a -> Maybe a
Prelude.Just (Key
"HubName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
hubName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"HubContentType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HubContentType
hubContentType)
          ]
      )

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

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

-- | /See:/ 'newListHubContentsResponse' smart constructor.
data ListHubContentsResponse = ListHubContentsResponse'
  { -- | If the response is truncated, SageMaker returns this token. To retrieve
    -- the next set of hub content, use it in the subsequent request.
    ListHubContentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListHubContentsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The summaries of the listed hub content.
    ListHubContentsResponse -> [HubContentInfo]
hubContentSummaries :: [HubContentInfo]
  }
  deriving (ListHubContentsResponse -> ListHubContentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHubContentsResponse -> ListHubContentsResponse -> Bool
$c/= :: ListHubContentsResponse -> ListHubContentsResponse -> Bool
== :: ListHubContentsResponse -> ListHubContentsResponse -> Bool
$c== :: ListHubContentsResponse -> ListHubContentsResponse -> Bool
Prelude.Eq, ReadPrec [ListHubContentsResponse]
ReadPrec ListHubContentsResponse
Int -> ReadS ListHubContentsResponse
ReadS [ListHubContentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHubContentsResponse]
$creadListPrec :: ReadPrec [ListHubContentsResponse]
readPrec :: ReadPrec ListHubContentsResponse
$creadPrec :: ReadPrec ListHubContentsResponse
readList :: ReadS [ListHubContentsResponse]
$creadList :: ReadS [ListHubContentsResponse]
readsPrec :: Int -> ReadS ListHubContentsResponse
$creadsPrec :: Int -> ReadS ListHubContentsResponse
Prelude.Read, Int -> ListHubContentsResponse -> ShowS
[ListHubContentsResponse] -> ShowS
ListHubContentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHubContentsResponse] -> ShowS
$cshowList :: [ListHubContentsResponse] -> ShowS
show :: ListHubContentsResponse -> String
$cshow :: ListHubContentsResponse -> String
showsPrec :: Int -> ListHubContentsResponse -> ShowS
$cshowsPrec :: Int -> ListHubContentsResponse -> ShowS
Prelude.Show, forall x. Rep ListHubContentsResponse x -> ListHubContentsResponse
forall x. ListHubContentsResponse -> Rep ListHubContentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListHubContentsResponse x -> ListHubContentsResponse
$cfrom :: forall x. ListHubContentsResponse -> Rep ListHubContentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListHubContentsResponse' 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', 'listHubContentsResponse_nextToken' - If the response is truncated, SageMaker returns this token. To retrieve
-- the next set of hub content, use it in the subsequent request.
--
-- 'httpStatus', 'listHubContentsResponse_httpStatus' - The response's http status code.
--
-- 'hubContentSummaries', 'listHubContentsResponse_hubContentSummaries' - The summaries of the listed hub content.
newListHubContentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListHubContentsResponse
newListHubContentsResponse :: Int -> ListHubContentsResponse
newListHubContentsResponse Int
pHttpStatus_ =
  ListHubContentsResponse'
    { $sel:nextToken:ListHubContentsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListHubContentsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:hubContentSummaries:ListHubContentsResponse' :: [HubContentInfo]
hubContentSummaries = forall a. Monoid a => a
Prelude.mempty
    }

-- | If the response is truncated, SageMaker returns this token. To retrieve
-- the next set of hub content, use it in the subsequent request.
listHubContentsResponse_nextToken :: Lens.Lens' ListHubContentsResponse (Prelude.Maybe Prelude.Text)
listHubContentsResponse_nextToken :: Lens' ListHubContentsResponse (Maybe Text)
listHubContentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHubContentsResponse' :: ListHubContentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHubContentsResponse
s@ListHubContentsResponse' {} Maybe Text
a -> ListHubContentsResponse
s {$sel:nextToken:ListHubContentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListHubContentsResponse)

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

-- | The summaries of the listed hub content.
listHubContentsResponse_hubContentSummaries :: Lens.Lens' ListHubContentsResponse [HubContentInfo]
listHubContentsResponse_hubContentSummaries :: Lens' ListHubContentsResponse [HubContentInfo]
listHubContentsResponse_hubContentSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHubContentsResponse' {[HubContentInfo]
hubContentSummaries :: [HubContentInfo]
$sel:hubContentSummaries:ListHubContentsResponse' :: ListHubContentsResponse -> [HubContentInfo]
hubContentSummaries} -> [HubContentInfo]
hubContentSummaries) (\s :: ListHubContentsResponse
s@ListHubContentsResponse' {} [HubContentInfo]
a -> ListHubContentsResponse
s {$sel:hubContentSummaries:ListHubContentsResponse' :: [HubContentInfo]
hubContentSummaries = [HubContentInfo]
a} :: ListHubContentsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListHubContentsResponse where
  rnf :: ListHubContentsResponse -> ()
rnf ListHubContentsResponse' {Int
[HubContentInfo]
Maybe Text
hubContentSummaries :: [HubContentInfo]
httpStatus :: Int
nextToken :: Maybe Text
$sel:hubContentSummaries:ListHubContentsResponse' :: ListHubContentsResponse -> [HubContentInfo]
$sel:httpStatus:ListHubContentsResponse' :: ListHubContentsResponse -> Int
$sel:nextToken:ListHubContentsResponse' :: ListHubContentsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [HubContentInfo]
hubContentSummaries