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

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

-- | Specifies summary information about a Git repository.
--
-- /See:/ 'newCodeRepositorySummary' smart constructor.
data CodeRepositorySummary = CodeRepositorySummary'
  { -- | Configuration details for the Git repository, including the URL where it
    -- is located and the ARN of the Amazon Web Services Secrets Manager secret
    -- that contains the credentials used to access the repository.
    CodeRepositorySummary -> Maybe GitConfig
gitConfig :: Prelude.Maybe GitConfig,
    -- | The name of the Git repository.
    CodeRepositorySummary -> Text
codeRepositoryName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Git repository.
    CodeRepositorySummary -> Text
codeRepositoryArn :: Prelude.Text,
    -- | The date and time that the Git repository was created.
    CodeRepositorySummary -> POSIX
creationTime :: Core.POSIX,
    -- | The date and time that the Git repository was last modified.
    CodeRepositorySummary -> POSIX
lastModifiedTime :: Core.POSIX
  }
  deriving (CodeRepositorySummary -> CodeRepositorySummary -> Bool
(CodeRepositorySummary -> CodeRepositorySummary -> Bool)
-> (CodeRepositorySummary -> CodeRepositorySummary -> Bool)
-> Eq CodeRepositorySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeRepositorySummary -> CodeRepositorySummary -> Bool
$c/= :: CodeRepositorySummary -> CodeRepositorySummary -> Bool
== :: CodeRepositorySummary -> CodeRepositorySummary -> Bool
$c== :: CodeRepositorySummary -> CodeRepositorySummary -> Bool
Prelude.Eq, ReadPrec [CodeRepositorySummary]
ReadPrec CodeRepositorySummary
Int -> ReadS CodeRepositorySummary
ReadS [CodeRepositorySummary]
(Int -> ReadS CodeRepositorySummary)
-> ReadS [CodeRepositorySummary]
-> ReadPrec CodeRepositorySummary
-> ReadPrec [CodeRepositorySummary]
-> Read CodeRepositorySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CodeRepositorySummary]
$creadListPrec :: ReadPrec [CodeRepositorySummary]
readPrec :: ReadPrec CodeRepositorySummary
$creadPrec :: ReadPrec CodeRepositorySummary
readList :: ReadS [CodeRepositorySummary]
$creadList :: ReadS [CodeRepositorySummary]
readsPrec :: Int -> ReadS CodeRepositorySummary
$creadsPrec :: Int -> ReadS CodeRepositorySummary
Prelude.Read, Int -> CodeRepositorySummary -> ShowS
[CodeRepositorySummary] -> ShowS
CodeRepositorySummary -> String
(Int -> CodeRepositorySummary -> ShowS)
-> (CodeRepositorySummary -> String)
-> ([CodeRepositorySummary] -> ShowS)
-> Show CodeRepositorySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeRepositorySummary] -> ShowS
$cshowList :: [CodeRepositorySummary] -> ShowS
show :: CodeRepositorySummary -> String
$cshow :: CodeRepositorySummary -> String
showsPrec :: Int -> CodeRepositorySummary -> ShowS
$cshowsPrec :: Int -> CodeRepositorySummary -> ShowS
Prelude.Show, (forall x. CodeRepositorySummary -> Rep CodeRepositorySummary x)
-> (forall x. Rep CodeRepositorySummary x -> CodeRepositorySummary)
-> Generic CodeRepositorySummary
forall x. Rep CodeRepositorySummary x -> CodeRepositorySummary
forall x. CodeRepositorySummary -> Rep CodeRepositorySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeRepositorySummary x -> CodeRepositorySummary
$cfrom :: forall x. CodeRepositorySummary -> Rep CodeRepositorySummary x
Prelude.Generic)

-- |
-- Create a value of 'CodeRepositorySummary' 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:
--
-- 'gitConfig', 'codeRepositorySummary_gitConfig' - Configuration details for the Git repository, including the URL where it
-- is located and the ARN of the Amazon Web Services Secrets Manager secret
-- that contains the credentials used to access the repository.
--
-- 'codeRepositoryName', 'codeRepositorySummary_codeRepositoryName' - The name of the Git repository.
--
-- 'codeRepositoryArn', 'codeRepositorySummary_codeRepositoryArn' - The Amazon Resource Name (ARN) of the Git repository.
--
-- 'creationTime', 'codeRepositorySummary_creationTime' - The date and time that the Git repository was created.
--
-- 'lastModifiedTime', 'codeRepositorySummary_lastModifiedTime' - The date and time that the Git repository was last modified.
newCodeRepositorySummary ::
  -- | 'codeRepositoryName'
  Prelude.Text ->
  -- | 'codeRepositoryArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'lastModifiedTime'
  Prelude.UTCTime ->
  CodeRepositorySummary
newCodeRepositorySummary :: Text -> Text -> UTCTime -> UTCTime -> CodeRepositorySummary
newCodeRepositorySummary
  Text
pCodeRepositoryName_
  Text
pCodeRepositoryArn_
  UTCTime
pCreationTime_
  UTCTime
pLastModifiedTime_ =
    CodeRepositorySummary' :: Maybe GitConfig
-> Text -> Text -> POSIX -> POSIX -> CodeRepositorySummary
CodeRepositorySummary'
      { $sel:gitConfig:CodeRepositorySummary' :: Maybe GitConfig
gitConfig = Maybe GitConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:codeRepositoryName:CodeRepositorySummary' :: Text
codeRepositoryName = Text
pCodeRepositoryName_,
        $sel:codeRepositoryArn:CodeRepositorySummary' :: Text
codeRepositoryArn = Text
pCodeRepositoryArn_,
        $sel:creationTime:CodeRepositorySummary' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastModifiedTime:CodeRepositorySummary' :: POSIX
lastModifiedTime =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_
      }

-- | Configuration details for the Git repository, including the URL where it
-- is located and the ARN of the Amazon Web Services Secrets Manager secret
-- that contains the credentials used to access the repository.
codeRepositorySummary_gitConfig :: Lens.Lens' CodeRepositorySummary (Prelude.Maybe GitConfig)
codeRepositorySummary_gitConfig :: (Maybe GitConfig -> f (Maybe GitConfig))
-> CodeRepositorySummary -> f CodeRepositorySummary
codeRepositorySummary_gitConfig = (CodeRepositorySummary -> Maybe GitConfig)
-> (CodeRepositorySummary
    -> Maybe GitConfig -> CodeRepositorySummary)
-> Lens
     CodeRepositorySummary
     CodeRepositorySummary
     (Maybe GitConfig)
     (Maybe GitConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeRepositorySummary' {Maybe GitConfig
gitConfig :: Maybe GitConfig
$sel:gitConfig:CodeRepositorySummary' :: CodeRepositorySummary -> Maybe GitConfig
gitConfig} -> Maybe GitConfig
gitConfig) (\s :: CodeRepositorySummary
s@CodeRepositorySummary' {} Maybe GitConfig
a -> CodeRepositorySummary
s {$sel:gitConfig:CodeRepositorySummary' :: Maybe GitConfig
gitConfig = Maybe GitConfig
a} :: CodeRepositorySummary)

-- | The name of the Git repository.
codeRepositorySummary_codeRepositoryName :: Lens.Lens' CodeRepositorySummary Prelude.Text
codeRepositorySummary_codeRepositoryName :: (Text -> f Text)
-> CodeRepositorySummary -> f CodeRepositorySummary
codeRepositorySummary_codeRepositoryName = (CodeRepositorySummary -> Text)
-> (CodeRepositorySummary -> Text -> CodeRepositorySummary)
-> Lens CodeRepositorySummary CodeRepositorySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeRepositorySummary' {Text
codeRepositoryName :: Text
$sel:codeRepositoryName:CodeRepositorySummary' :: CodeRepositorySummary -> Text
codeRepositoryName} -> Text
codeRepositoryName) (\s :: CodeRepositorySummary
s@CodeRepositorySummary' {} Text
a -> CodeRepositorySummary
s {$sel:codeRepositoryName:CodeRepositorySummary' :: Text
codeRepositoryName = Text
a} :: CodeRepositorySummary)

-- | The Amazon Resource Name (ARN) of the Git repository.
codeRepositorySummary_codeRepositoryArn :: Lens.Lens' CodeRepositorySummary Prelude.Text
codeRepositorySummary_codeRepositoryArn :: (Text -> f Text)
-> CodeRepositorySummary -> f CodeRepositorySummary
codeRepositorySummary_codeRepositoryArn = (CodeRepositorySummary -> Text)
-> (CodeRepositorySummary -> Text -> CodeRepositorySummary)
-> Lens CodeRepositorySummary CodeRepositorySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeRepositorySummary' {Text
codeRepositoryArn :: Text
$sel:codeRepositoryArn:CodeRepositorySummary' :: CodeRepositorySummary -> Text
codeRepositoryArn} -> Text
codeRepositoryArn) (\s :: CodeRepositorySummary
s@CodeRepositorySummary' {} Text
a -> CodeRepositorySummary
s {$sel:codeRepositoryArn:CodeRepositorySummary' :: Text
codeRepositoryArn = Text
a} :: CodeRepositorySummary)

-- | The date and time that the Git repository was created.
codeRepositorySummary_creationTime :: Lens.Lens' CodeRepositorySummary Prelude.UTCTime
codeRepositorySummary_creationTime :: (UTCTime -> f UTCTime)
-> CodeRepositorySummary -> f CodeRepositorySummary
codeRepositorySummary_creationTime = (CodeRepositorySummary -> POSIX)
-> (CodeRepositorySummary -> POSIX -> CodeRepositorySummary)
-> Lens CodeRepositorySummary CodeRepositorySummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeRepositorySummary' {POSIX
creationTime :: POSIX
$sel:creationTime:CodeRepositorySummary' :: CodeRepositorySummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: CodeRepositorySummary
s@CodeRepositorySummary' {} POSIX
a -> CodeRepositorySummary
s {$sel:creationTime:CodeRepositorySummary' :: POSIX
creationTime = POSIX
a} :: CodeRepositorySummary) ((POSIX -> f POSIX)
 -> CodeRepositorySummary -> f CodeRepositorySummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CodeRepositorySummary
-> f CodeRepositorySummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Core.FromJSON CodeRepositorySummary where
  parseJSON :: Value -> Parser CodeRepositorySummary
parseJSON =
    String
-> (Object -> Parser CodeRepositorySummary)
-> Value
-> Parser CodeRepositorySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CodeRepositorySummary"
      ( \Object
x ->
          Maybe GitConfig
-> Text -> Text -> POSIX -> POSIX -> CodeRepositorySummary
CodeRepositorySummary'
            (Maybe GitConfig
 -> Text -> Text -> POSIX -> POSIX -> CodeRepositorySummary)
-> Parser (Maybe GitConfig)
-> Parser (Text -> Text -> POSIX -> POSIX -> CodeRepositorySummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe GitConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GitConfig")
            Parser (Text -> Text -> POSIX -> POSIX -> CodeRepositorySummary)
-> Parser Text
-> Parser (Text -> POSIX -> POSIX -> CodeRepositorySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CodeRepositoryName")
            Parser (Text -> POSIX -> POSIX -> CodeRepositorySummary)
-> Parser Text -> Parser (POSIX -> POSIX -> CodeRepositorySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CodeRepositoryArn")
            Parser (POSIX -> POSIX -> CodeRepositorySummary)
-> Parser POSIX -> Parser (POSIX -> CodeRepositorySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationTime")
            Parser (POSIX -> CodeRepositorySummary)
-> Parser POSIX -> Parser CodeRepositorySummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LastModifiedTime")
      )

instance Prelude.Hashable CodeRepositorySummary

instance Prelude.NFData CodeRepositorySummary