{-# 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.ContextSummary
-- 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.ContextSummary where

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

-- | Lists a summary of the properties of a context. A context provides a
-- logical grouping of other entities.
--
-- /See:/ 'newContextSummary' smart constructor.
data ContextSummary = ContextSummary'
  { -- | When the context was created.
    ContextSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | When the context was last modified.
    ContextSummary -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The type of the context.
    ContextSummary -> Maybe Text
contextType :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the context.
    ContextSummary -> Maybe Text
contextArn :: Prelude.Maybe Prelude.Text,
    -- | The source of the context.
    ContextSummary -> Maybe ContextSource
source :: Prelude.Maybe ContextSource,
    -- | The name of the context.
    ContextSummary -> Maybe Text
contextName :: Prelude.Maybe Prelude.Text
  }
  deriving (ContextSummary -> ContextSummary -> Bool
(ContextSummary -> ContextSummary -> Bool)
-> (ContextSummary -> ContextSummary -> Bool) -> Eq ContextSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContextSummary -> ContextSummary -> Bool
$c/= :: ContextSummary -> ContextSummary -> Bool
== :: ContextSummary -> ContextSummary -> Bool
$c== :: ContextSummary -> ContextSummary -> Bool
Prelude.Eq, ReadPrec [ContextSummary]
ReadPrec ContextSummary
Int -> ReadS ContextSummary
ReadS [ContextSummary]
(Int -> ReadS ContextSummary)
-> ReadS [ContextSummary]
-> ReadPrec ContextSummary
-> ReadPrec [ContextSummary]
-> Read ContextSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContextSummary]
$creadListPrec :: ReadPrec [ContextSummary]
readPrec :: ReadPrec ContextSummary
$creadPrec :: ReadPrec ContextSummary
readList :: ReadS [ContextSummary]
$creadList :: ReadS [ContextSummary]
readsPrec :: Int -> ReadS ContextSummary
$creadsPrec :: Int -> ReadS ContextSummary
Prelude.Read, Int -> ContextSummary -> ShowS
[ContextSummary] -> ShowS
ContextSummary -> String
(Int -> ContextSummary -> ShowS)
-> (ContextSummary -> String)
-> ([ContextSummary] -> ShowS)
-> Show ContextSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContextSummary] -> ShowS
$cshowList :: [ContextSummary] -> ShowS
show :: ContextSummary -> String
$cshow :: ContextSummary -> String
showsPrec :: Int -> ContextSummary -> ShowS
$cshowsPrec :: Int -> ContextSummary -> ShowS
Prelude.Show, (forall x. ContextSummary -> Rep ContextSummary x)
-> (forall x. Rep ContextSummary x -> ContextSummary)
-> Generic ContextSummary
forall x. Rep ContextSummary x -> ContextSummary
forall x. ContextSummary -> Rep ContextSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContextSummary x -> ContextSummary
$cfrom :: forall x. ContextSummary -> Rep ContextSummary x
Prelude.Generic)

-- |
-- Create a value of 'ContextSummary' 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', 'contextSummary_creationTime' - When the context was created.
--
-- 'lastModifiedTime', 'contextSummary_lastModifiedTime' - When the context was last modified.
--
-- 'contextType', 'contextSummary_contextType' - The type of the context.
--
-- 'contextArn', 'contextSummary_contextArn' - The Amazon Resource Name (ARN) of the context.
--
-- 'source', 'contextSummary_source' - The source of the context.
--
-- 'contextName', 'contextSummary_contextName' - The name of the context.
newContextSummary ::
  ContextSummary
newContextSummary :: ContextSummary
newContextSummary =
  ContextSummary' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ContextSource
-> Maybe Text
-> ContextSummary
ContextSummary'
    { $sel:creationTime:ContextSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:ContextSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:contextType:ContextSummary' :: Maybe Text
contextType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contextArn:ContextSummary' :: Maybe Text
contextArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:source:ContextSummary' :: Maybe ContextSource
source = Maybe ContextSource
forall a. Maybe a
Prelude.Nothing,
      $sel:contextName:ContextSummary' :: Maybe Text
contextName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | When the context was created.
contextSummary_creationTime :: Lens.Lens' ContextSummary (Prelude.Maybe Prelude.UTCTime)
contextSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ContextSummary -> f ContextSummary
contextSummary_creationTime = (ContextSummary -> Maybe POSIX)
-> (ContextSummary -> Maybe POSIX -> ContextSummary)
-> Lens ContextSummary ContextSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ContextSummary' :: ContextSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ContextSummary
s@ContextSummary' {} Maybe POSIX
a -> ContextSummary
s {$sel:creationTime:ContextSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ContextSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ContextSummary -> f ContextSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ContextSummary
-> f ContextSummary
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

-- | When the context was last modified.
contextSummary_lastModifiedTime :: Lens.Lens' ContextSummary (Prelude.Maybe Prelude.UTCTime)
contextSummary_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ContextSummary -> f ContextSummary
contextSummary_lastModifiedTime = (ContextSummary -> Maybe POSIX)
-> (ContextSummary -> Maybe POSIX -> ContextSummary)
-> Lens ContextSummary ContextSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextSummary' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:ContextSummary' :: ContextSummary -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: ContextSummary
s@ContextSummary' {} Maybe POSIX
a -> ContextSummary
s {$sel:lastModifiedTime:ContextSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: ContextSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ContextSummary -> f ContextSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ContextSummary
-> f ContextSummary
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 type of the context.
contextSummary_contextType :: Lens.Lens' ContextSummary (Prelude.Maybe Prelude.Text)
contextSummary_contextType :: (Maybe Text -> f (Maybe Text))
-> ContextSummary -> f ContextSummary
contextSummary_contextType = (ContextSummary -> Maybe Text)
-> (ContextSummary -> Maybe Text -> ContextSummary)
-> Lens ContextSummary ContextSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextSummary' {Maybe Text
contextType :: Maybe Text
$sel:contextType:ContextSummary' :: ContextSummary -> Maybe Text
contextType} -> Maybe Text
contextType) (\s :: ContextSummary
s@ContextSummary' {} Maybe Text
a -> ContextSummary
s {$sel:contextType:ContextSummary' :: Maybe Text
contextType = Maybe Text
a} :: ContextSummary)

-- | The Amazon Resource Name (ARN) of the context.
contextSummary_contextArn :: Lens.Lens' ContextSummary (Prelude.Maybe Prelude.Text)
contextSummary_contextArn :: (Maybe Text -> f (Maybe Text))
-> ContextSummary -> f ContextSummary
contextSummary_contextArn = (ContextSummary -> Maybe Text)
-> (ContextSummary -> Maybe Text -> ContextSummary)
-> Lens ContextSummary ContextSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextSummary' {Maybe Text
contextArn :: Maybe Text
$sel:contextArn:ContextSummary' :: ContextSummary -> Maybe Text
contextArn} -> Maybe Text
contextArn) (\s :: ContextSummary
s@ContextSummary' {} Maybe Text
a -> ContextSummary
s {$sel:contextArn:ContextSummary' :: Maybe Text
contextArn = Maybe Text
a} :: ContextSummary)

-- | The source of the context.
contextSummary_source :: Lens.Lens' ContextSummary (Prelude.Maybe ContextSource)
contextSummary_source :: (Maybe ContextSource -> f (Maybe ContextSource))
-> ContextSummary -> f ContextSummary
contextSummary_source = (ContextSummary -> Maybe ContextSource)
-> (ContextSummary -> Maybe ContextSource -> ContextSummary)
-> Lens
     ContextSummary
     ContextSummary
     (Maybe ContextSource)
     (Maybe ContextSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextSummary' {Maybe ContextSource
source :: Maybe ContextSource
$sel:source:ContextSummary' :: ContextSummary -> Maybe ContextSource
source} -> Maybe ContextSource
source) (\s :: ContextSummary
s@ContextSummary' {} Maybe ContextSource
a -> ContextSummary
s {$sel:source:ContextSummary' :: Maybe ContextSource
source = Maybe ContextSource
a} :: ContextSummary)

-- | The name of the context.
contextSummary_contextName :: Lens.Lens' ContextSummary (Prelude.Maybe Prelude.Text)
contextSummary_contextName :: (Maybe Text -> f (Maybe Text))
-> ContextSummary -> f ContextSummary
contextSummary_contextName = (ContextSummary -> Maybe Text)
-> (ContextSummary -> Maybe Text -> ContextSummary)
-> Lens ContextSummary ContextSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextSummary' {Maybe Text
contextName :: Maybe Text
$sel:contextName:ContextSummary' :: ContextSummary -> Maybe Text
contextName} -> Maybe Text
contextName) (\s :: ContextSummary
s@ContextSummary' {} Maybe Text
a -> ContextSummary
s {$sel:contextName:ContextSummary' :: Maybe Text
contextName = Maybe Text
a} :: ContextSummary)

instance Core.FromJSON ContextSummary where
  parseJSON :: Value -> Parser ContextSummary
parseJSON =
    String
-> (Object -> Parser ContextSummary)
-> Value
-> Parser ContextSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ContextSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ContextSource
-> Maybe Text
-> ContextSummary
ContextSummary'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe ContextSource
 -> Maybe Text
 -> ContextSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe ContextSource
      -> Maybe Text
      -> ContextSummary)
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 POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe ContextSource
   -> Maybe Text
   -> ContextSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ContextSource
      -> Maybe Text
      -> ContextSummary)
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
   -> Maybe ContextSource
   -> Maybe Text
   -> ContextSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe ContextSource -> Maybe Text -> ContextSummary)
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
"ContextType")
            Parser
  (Maybe Text -> Maybe ContextSource -> Maybe Text -> ContextSummary)
-> Parser (Maybe Text)
-> Parser (Maybe ContextSource -> Maybe Text -> ContextSummary)
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
"ContextArn")
            Parser (Maybe ContextSource -> Maybe Text -> ContextSummary)
-> Parser (Maybe ContextSource)
-> Parser (Maybe Text -> ContextSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContextSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Source")
            Parser (Maybe Text -> ContextSummary)
-> Parser (Maybe Text) -> Parser ContextSummary
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
"ContextName")
      )

instance Prelude.Hashable ContextSummary

instance Prelude.NFData ContextSummary