{-# 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.DomainDetails
-- 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)
module Amazonka.SageMaker.Types.DomainDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.DomainStatus

-- | The domain\'s details.
--
-- /See:/ 'newDomainDetails' smart constructor.
data DomainDetails = DomainDetails'
  { -- | The creation time.
    DomainDetails -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status.
    DomainDetails -> Maybe DomainStatus
status :: Prelude.Maybe DomainStatus,
    -- | The domain\'s Amazon Resource Name (ARN).
    DomainDetails -> Maybe Text
domainArn :: Prelude.Maybe Prelude.Text,
    -- | The domain\'s URL.
    DomainDetails -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The last modified time.
    DomainDetails -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The domain name.
    DomainDetails -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The domain ID.
    DomainDetails -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text
  }
  deriving (DomainDetails -> DomainDetails -> Bool
(DomainDetails -> DomainDetails -> Bool)
-> (DomainDetails -> DomainDetails -> Bool) -> Eq DomainDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainDetails -> DomainDetails -> Bool
$c/= :: DomainDetails -> DomainDetails -> Bool
== :: DomainDetails -> DomainDetails -> Bool
$c== :: DomainDetails -> DomainDetails -> Bool
Prelude.Eq, ReadPrec [DomainDetails]
ReadPrec DomainDetails
Int -> ReadS DomainDetails
ReadS [DomainDetails]
(Int -> ReadS DomainDetails)
-> ReadS [DomainDetails]
-> ReadPrec DomainDetails
-> ReadPrec [DomainDetails]
-> Read DomainDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainDetails]
$creadListPrec :: ReadPrec [DomainDetails]
readPrec :: ReadPrec DomainDetails
$creadPrec :: ReadPrec DomainDetails
readList :: ReadS [DomainDetails]
$creadList :: ReadS [DomainDetails]
readsPrec :: Int -> ReadS DomainDetails
$creadsPrec :: Int -> ReadS DomainDetails
Prelude.Read, Int -> DomainDetails -> ShowS
[DomainDetails] -> ShowS
DomainDetails -> String
(Int -> DomainDetails -> ShowS)
-> (DomainDetails -> String)
-> ([DomainDetails] -> ShowS)
-> Show DomainDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainDetails] -> ShowS
$cshowList :: [DomainDetails] -> ShowS
show :: DomainDetails -> String
$cshow :: DomainDetails -> String
showsPrec :: Int -> DomainDetails -> ShowS
$cshowsPrec :: Int -> DomainDetails -> ShowS
Prelude.Show, (forall x. DomainDetails -> Rep DomainDetails x)
-> (forall x. Rep DomainDetails x -> DomainDetails)
-> Generic DomainDetails
forall x. Rep DomainDetails x -> DomainDetails
forall x. DomainDetails -> Rep DomainDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainDetails x -> DomainDetails
$cfrom :: forall x. DomainDetails -> Rep DomainDetails x
Prelude.Generic)

-- |
-- Create a value of 'DomainDetails' 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:
--
-- 'creationTime', 'domainDetails_creationTime' - The creation time.
--
-- 'status', 'domainDetails_status' - The status.
--
-- 'domainArn', 'domainDetails_domainArn' - The domain\'s Amazon Resource Name (ARN).
--
-- 'url', 'domainDetails_url' - The domain\'s URL.
--
-- 'lastModifiedTime', 'domainDetails_lastModifiedTime' - The last modified time.
--
-- 'domainName', 'domainDetails_domainName' - The domain name.
--
-- 'domainId', 'domainDetails_domainId' - The domain ID.
newDomainDetails ::
  DomainDetails
newDomainDetails :: DomainDetails
newDomainDetails =
  DomainDetails' :: Maybe POSIX
-> Maybe DomainStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> DomainDetails
DomainDetails'
    { $sel:creationTime:DomainDetails' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DomainDetails' :: Maybe DomainStatus
status = Maybe DomainStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:domainArn:DomainDetails' :: Maybe Text
domainArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:url:DomainDetails' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:DomainDetails' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:DomainDetails' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainId:DomainDetails' :: Maybe Text
domainId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The creation time.
domainDetails_creationTime :: Lens.Lens' DomainDetails (Prelude.Maybe Prelude.UTCTime)
domainDetails_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DomainDetails -> f DomainDetails
domainDetails_creationTime = (DomainDetails -> Maybe POSIX)
-> (DomainDetails -> Maybe POSIX -> DomainDetails)
-> Lens DomainDetails DomainDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DomainDetails' :: DomainDetails -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DomainDetails
s@DomainDetails' {} Maybe POSIX
a -> DomainDetails
s {$sel:creationTime:DomainDetails' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DomainDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> DomainDetails -> f DomainDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DomainDetails
-> f DomainDetails
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 status.
domainDetails_status :: Lens.Lens' DomainDetails (Prelude.Maybe DomainStatus)
domainDetails_status :: (Maybe DomainStatus -> f (Maybe DomainStatus))
-> DomainDetails -> f DomainDetails
domainDetails_status = (DomainDetails -> Maybe DomainStatus)
-> (DomainDetails -> Maybe DomainStatus -> DomainDetails)
-> Lens
     DomainDetails
     DomainDetails
     (Maybe DomainStatus)
     (Maybe DomainStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe DomainStatus
status :: Maybe DomainStatus
$sel:status:DomainDetails' :: DomainDetails -> Maybe DomainStatus
status} -> Maybe DomainStatus
status) (\s :: DomainDetails
s@DomainDetails' {} Maybe DomainStatus
a -> DomainDetails
s {$sel:status:DomainDetails' :: Maybe DomainStatus
status = Maybe DomainStatus
a} :: DomainDetails)

-- | The domain\'s Amazon Resource Name (ARN).
domainDetails_domainArn :: Lens.Lens' DomainDetails (Prelude.Maybe Prelude.Text)
domainDetails_domainArn :: (Maybe Text -> f (Maybe Text)) -> DomainDetails -> f DomainDetails
domainDetails_domainArn = (DomainDetails -> Maybe Text)
-> (DomainDetails -> Maybe Text -> DomainDetails)
-> Lens DomainDetails DomainDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe Text
domainArn :: Maybe Text
$sel:domainArn:DomainDetails' :: DomainDetails -> Maybe Text
domainArn} -> Maybe Text
domainArn) (\s :: DomainDetails
s@DomainDetails' {} Maybe Text
a -> DomainDetails
s {$sel:domainArn:DomainDetails' :: Maybe Text
domainArn = Maybe Text
a} :: DomainDetails)

-- | The domain\'s URL.
domainDetails_url :: Lens.Lens' DomainDetails (Prelude.Maybe Prelude.Text)
domainDetails_url :: (Maybe Text -> f (Maybe Text)) -> DomainDetails -> f DomainDetails
domainDetails_url = (DomainDetails -> Maybe Text)
-> (DomainDetails -> Maybe Text -> DomainDetails)
-> Lens DomainDetails DomainDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe Text
url :: Maybe Text
$sel:url:DomainDetails' :: DomainDetails -> Maybe Text
url} -> Maybe Text
url) (\s :: DomainDetails
s@DomainDetails' {} Maybe Text
a -> DomainDetails
s {$sel:url:DomainDetails' :: Maybe Text
url = Maybe Text
a} :: DomainDetails)

-- | The last modified time.
domainDetails_lastModifiedTime :: Lens.Lens' DomainDetails (Prelude.Maybe Prelude.UTCTime)
domainDetails_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DomainDetails -> f DomainDetails
domainDetails_lastModifiedTime = (DomainDetails -> Maybe POSIX)
-> (DomainDetails -> Maybe POSIX -> DomainDetails)
-> Lens DomainDetails DomainDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:DomainDetails' :: DomainDetails -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: DomainDetails
s@DomainDetails' {} Maybe POSIX
a -> DomainDetails
s {$sel:lastModifiedTime:DomainDetails' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: DomainDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> DomainDetails -> f DomainDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DomainDetails
-> f DomainDetails
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 domain name.
domainDetails_domainName :: Lens.Lens' DomainDetails (Prelude.Maybe Prelude.Text)
domainDetails_domainName :: (Maybe Text -> f (Maybe Text)) -> DomainDetails -> f DomainDetails
domainDetails_domainName = (DomainDetails -> Maybe Text)
-> (DomainDetails -> Maybe Text -> DomainDetails)
-> Lens DomainDetails DomainDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe Text
domainName :: Maybe Text
$sel:domainName:DomainDetails' :: DomainDetails -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: DomainDetails
s@DomainDetails' {} Maybe Text
a -> DomainDetails
s {$sel:domainName:DomainDetails' :: Maybe Text
domainName = Maybe Text
a} :: DomainDetails)

-- | The domain ID.
domainDetails_domainId :: Lens.Lens' DomainDetails (Prelude.Maybe Prelude.Text)
domainDetails_domainId :: (Maybe Text -> f (Maybe Text)) -> DomainDetails -> f DomainDetails
domainDetails_domainId = (DomainDetails -> Maybe Text)
-> (DomainDetails -> Maybe Text -> DomainDetails)
-> Lens DomainDetails DomainDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe Text
domainId :: Maybe Text
$sel:domainId:DomainDetails' :: DomainDetails -> Maybe Text
domainId} -> Maybe Text
domainId) (\s :: DomainDetails
s@DomainDetails' {} Maybe Text
a -> DomainDetails
s {$sel:domainId:DomainDetails' :: Maybe Text
domainId = Maybe Text
a} :: DomainDetails)

instance Core.FromJSON DomainDetails where
  parseJSON :: Value -> Parser DomainDetails
parseJSON =
    String
-> (Object -> Parser DomainDetails)
-> Value
-> Parser DomainDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DomainDetails"
      ( \Object
x ->
          Maybe POSIX
-> Maybe DomainStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> DomainDetails
DomainDetails'
            (Maybe POSIX
 -> Maybe DomainStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> DomainDetails)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe DomainStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> DomainDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe DomainStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> DomainDetails)
-> Parser (Maybe DomainStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> DomainDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DomainStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> DomainDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Maybe Text -> DomainDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DomainArn")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Maybe Text -> DomainDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe Text -> DomainDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Url")
            Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> DomainDetails)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> DomainDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedTime")
            Parser (Maybe Text -> Maybe Text -> DomainDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DomainDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DomainName")
            Parser (Maybe Text -> DomainDetails)
-> Parser (Maybe Text) -> Parser DomainDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DomainId")
      )

instance Prelude.Hashable DomainDetails

instance Prelude.NFData DomainDetails