{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.HubInfo
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.HubInfo 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 Amazonka.SageMaker.Types.HubStatus

-- | Information about a hub.
--
-- /See:/ 'newHubInfo' smart constructor.
data HubInfo = HubInfo'
  { -- | A description of the hub.
    HubInfo -> Maybe Text
hubDescription :: Prelude.Maybe Prelude.Text,
    -- | The display name of the hub.
    HubInfo -> Maybe Text
hubDisplayName :: Prelude.Maybe Prelude.Text,
    -- | The searchable keywords for the hub.
    HubInfo -> Maybe [Text]
hubSearchKeywords :: Prelude.Maybe [Prelude.Text],
    -- | The name of the hub.
    HubInfo -> Text
hubName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the hub.
    HubInfo -> Text
hubArn :: Prelude.Text,
    -- | The status of the hub.
    HubInfo -> HubStatus
hubStatus :: HubStatus,
    -- | The date and time that the hub was created.
    HubInfo -> POSIX
creationTime :: Data.POSIX,
    -- | The date and time that the hub was last modified.
    HubInfo -> POSIX
lastModifiedTime :: Data.POSIX
  }
  deriving (HubInfo -> HubInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HubInfo -> HubInfo -> Bool
$c/= :: HubInfo -> HubInfo -> Bool
== :: HubInfo -> HubInfo -> Bool
$c== :: HubInfo -> HubInfo -> Bool
Prelude.Eq, ReadPrec [HubInfo]
ReadPrec HubInfo
Int -> ReadS HubInfo
ReadS [HubInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HubInfo]
$creadListPrec :: ReadPrec [HubInfo]
readPrec :: ReadPrec HubInfo
$creadPrec :: ReadPrec HubInfo
readList :: ReadS [HubInfo]
$creadList :: ReadS [HubInfo]
readsPrec :: Int -> ReadS HubInfo
$creadsPrec :: Int -> ReadS HubInfo
Prelude.Read, Int -> HubInfo -> ShowS
[HubInfo] -> ShowS
HubInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HubInfo] -> ShowS
$cshowList :: [HubInfo] -> ShowS
show :: HubInfo -> String
$cshow :: HubInfo -> String
showsPrec :: Int -> HubInfo -> ShowS
$cshowsPrec :: Int -> HubInfo -> ShowS
Prelude.Show, forall x. Rep HubInfo x -> HubInfo
forall x. HubInfo -> Rep HubInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HubInfo x -> HubInfo
$cfrom :: forall x. HubInfo -> Rep HubInfo x
Prelude.Generic)

-- |
-- Create a value of 'HubInfo' 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:
--
-- 'hubDescription', 'hubInfo_hubDescription' - A description of the hub.
--
-- 'hubDisplayName', 'hubInfo_hubDisplayName' - The display name of the hub.
--
-- 'hubSearchKeywords', 'hubInfo_hubSearchKeywords' - The searchable keywords for the hub.
--
-- 'hubName', 'hubInfo_hubName' - The name of the hub.
--
-- 'hubArn', 'hubInfo_hubArn' - The Amazon Resource Name (ARN) of the hub.
--
-- 'hubStatus', 'hubInfo_hubStatus' - The status of the hub.
--
-- 'creationTime', 'hubInfo_creationTime' - The date and time that the hub was created.
--
-- 'lastModifiedTime', 'hubInfo_lastModifiedTime' - The date and time that the hub was last modified.
newHubInfo ::
  -- | 'hubName'
  Prelude.Text ->
  -- | 'hubArn'
  Prelude.Text ->
  -- | 'hubStatus'
  HubStatus ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'lastModifiedTime'
  Prelude.UTCTime ->
  HubInfo
newHubInfo :: Text -> Text -> HubStatus -> UTCTime -> UTCTime -> HubInfo
newHubInfo
  Text
pHubName_
  Text
pHubArn_
  HubStatus
pHubStatus_
  UTCTime
pCreationTime_
  UTCTime
pLastModifiedTime_ =
    HubInfo'
      { $sel:hubDescription:HubInfo' :: Maybe Text
hubDescription = forall a. Maybe a
Prelude.Nothing,
        $sel:hubDisplayName:HubInfo' :: Maybe Text
hubDisplayName = forall a. Maybe a
Prelude.Nothing,
        $sel:hubSearchKeywords:HubInfo' :: Maybe [Text]
hubSearchKeywords = forall a. Maybe a
Prelude.Nothing,
        $sel:hubName:HubInfo' :: Text
hubName = Text
pHubName_,
        $sel:hubArn:HubInfo' :: Text
hubArn = Text
pHubArn_,
        $sel:hubStatus:HubInfo' :: HubStatus
hubStatus = HubStatus
pHubStatus_,
        $sel:creationTime:HubInfo' :: POSIX
creationTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastModifiedTime:HubInfo' :: POSIX
lastModifiedTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_
      }

-- | A description of the hub.
hubInfo_hubDescription :: Lens.Lens' HubInfo (Prelude.Maybe Prelude.Text)
hubInfo_hubDescription :: Lens' HubInfo (Maybe Text)
hubInfo_hubDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {Maybe Text
hubDescription :: Maybe Text
$sel:hubDescription:HubInfo' :: HubInfo -> Maybe Text
hubDescription} -> Maybe Text
hubDescription) (\s :: HubInfo
s@HubInfo' {} Maybe Text
a -> HubInfo
s {$sel:hubDescription:HubInfo' :: Maybe Text
hubDescription = Maybe Text
a} :: HubInfo)

-- | The display name of the hub.
hubInfo_hubDisplayName :: Lens.Lens' HubInfo (Prelude.Maybe Prelude.Text)
hubInfo_hubDisplayName :: Lens' HubInfo (Maybe Text)
hubInfo_hubDisplayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {Maybe Text
hubDisplayName :: Maybe Text
$sel:hubDisplayName:HubInfo' :: HubInfo -> Maybe Text
hubDisplayName} -> Maybe Text
hubDisplayName) (\s :: HubInfo
s@HubInfo' {} Maybe Text
a -> HubInfo
s {$sel:hubDisplayName:HubInfo' :: Maybe Text
hubDisplayName = Maybe Text
a} :: HubInfo)

-- | The searchable keywords for the hub.
hubInfo_hubSearchKeywords :: Lens.Lens' HubInfo (Prelude.Maybe [Prelude.Text])
hubInfo_hubSearchKeywords :: Lens' HubInfo (Maybe [Text])
hubInfo_hubSearchKeywords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {Maybe [Text]
hubSearchKeywords :: Maybe [Text]
$sel:hubSearchKeywords:HubInfo' :: HubInfo -> Maybe [Text]
hubSearchKeywords} -> Maybe [Text]
hubSearchKeywords) (\s :: HubInfo
s@HubInfo' {} Maybe [Text]
a -> HubInfo
s {$sel:hubSearchKeywords:HubInfo' :: Maybe [Text]
hubSearchKeywords = Maybe [Text]
a} :: HubInfo) 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 name of the hub.
hubInfo_hubName :: Lens.Lens' HubInfo Prelude.Text
hubInfo_hubName :: Lens' HubInfo Text
hubInfo_hubName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {Text
hubName :: Text
$sel:hubName:HubInfo' :: HubInfo -> Text
hubName} -> Text
hubName) (\s :: HubInfo
s@HubInfo' {} Text
a -> HubInfo
s {$sel:hubName:HubInfo' :: Text
hubName = Text
a} :: HubInfo)

-- | The Amazon Resource Name (ARN) of the hub.
hubInfo_hubArn :: Lens.Lens' HubInfo Prelude.Text
hubInfo_hubArn :: Lens' HubInfo Text
hubInfo_hubArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {Text
hubArn :: Text
$sel:hubArn:HubInfo' :: HubInfo -> Text
hubArn} -> Text
hubArn) (\s :: HubInfo
s@HubInfo' {} Text
a -> HubInfo
s {$sel:hubArn:HubInfo' :: Text
hubArn = Text
a} :: HubInfo)

-- | The status of the hub.
hubInfo_hubStatus :: Lens.Lens' HubInfo HubStatus
hubInfo_hubStatus :: Lens' HubInfo HubStatus
hubInfo_hubStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {HubStatus
hubStatus :: HubStatus
$sel:hubStatus:HubInfo' :: HubInfo -> HubStatus
hubStatus} -> HubStatus
hubStatus) (\s :: HubInfo
s@HubInfo' {} HubStatus
a -> HubInfo
s {$sel:hubStatus:HubInfo' :: HubStatus
hubStatus = HubStatus
a} :: HubInfo)

-- | The date and time that the hub was created.
hubInfo_creationTime :: Lens.Lens' HubInfo Prelude.UTCTime
hubInfo_creationTime :: Lens' HubInfo UTCTime
hubInfo_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {POSIX
creationTime :: POSIX
$sel:creationTime:HubInfo' :: HubInfo -> POSIX
creationTime} -> POSIX
creationTime) (\s :: HubInfo
s@HubInfo' {} POSIX
a -> HubInfo
s {$sel:creationTime:HubInfo' :: POSIX
creationTime = POSIX
a} :: HubInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time that the hub was last modified.
hubInfo_lastModifiedTime :: Lens.Lens' HubInfo Prelude.UTCTime
hubInfo_lastModifiedTime :: Lens' HubInfo UTCTime
hubInfo_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubInfo' {POSIX
lastModifiedTime :: POSIX
$sel:lastModifiedTime:HubInfo' :: HubInfo -> POSIX
lastModifiedTime} -> POSIX
lastModifiedTime) (\s :: HubInfo
s@HubInfo' {} POSIX
a -> HubInfo
s {$sel:lastModifiedTime:HubInfo' :: POSIX
lastModifiedTime = POSIX
a} :: HubInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON HubInfo where
  parseJSON :: Value -> Parser HubInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HubInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Text
-> Text
-> HubStatus
-> POSIX
-> POSIX
-> HubInfo
HubInfo'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HubDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HubDisplayName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HubSearchKeywords"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"HubName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"HubArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"HubStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LastModifiedTime")
      )

instance Prelude.Hashable HubInfo where
  hashWithSalt :: Int -> HubInfo -> Int
hashWithSalt Int
_salt HubInfo' {Maybe [Text]
Maybe Text
Text
POSIX
HubStatus
lastModifiedTime :: POSIX
creationTime :: POSIX
hubStatus :: HubStatus
hubArn :: Text
hubName :: Text
hubSearchKeywords :: Maybe [Text]
hubDisplayName :: Maybe Text
hubDescription :: Maybe Text
$sel:lastModifiedTime:HubInfo' :: HubInfo -> POSIX
$sel:creationTime:HubInfo' :: HubInfo -> POSIX
$sel:hubStatus:HubInfo' :: HubInfo -> HubStatus
$sel:hubArn:HubInfo' :: HubInfo -> Text
$sel:hubName:HubInfo' :: HubInfo -> Text
$sel:hubSearchKeywords:HubInfo' :: HubInfo -> Maybe [Text]
$sel:hubDisplayName:HubInfo' :: HubInfo -> Maybe Text
$sel:hubDescription:HubInfo' :: HubInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hubDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hubDisplayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
hubSearchKeywords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hubName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hubArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HubStatus
hubStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastModifiedTime

instance Prelude.NFData HubInfo where
  rnf :: HubInfo -> ()
rnf HubInfo' {Maybe [Text]
Maybe Text
Text
POSIX
HubStatus
lastModifiedTime :: POSIX
creationTime :: POSIX
hubStatus :: HubStatus
hubArn :: Text
hubName :: Text
hubSearchKeywords :: Maybe [Text]
hubDisplayName :: Maybe Text
hubDescription :: Maybe Text
$sel:lastModifiedTime:HubInfo' :: HubInfo -> POSIX
$sel:creationTime:HubInfo' :: HubInfo -> POSIX
$sel:hubStatus:HubInfo' :: HubInfo -> HubStatus
$sel:hubArn:HubInfo' :: HubInfo -> Text
$sel:hubName:HubInfo' :: HubInfo -> Text
$sel:hubSearchKeywords:HubInfo' :: HubInfo -> Maybe [Text]
$sel:hubDisplayName:HubInfo' :: HubInfo -> Maybe Text
$sel:hubDescription:HubInfo' :: HubInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hubDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hubDisplayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
hubSearchKeywords
      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 Text
hubArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HubStatus
hubStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastModifiedTime