{-# 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-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.CodeRepositorySummary 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.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 :: Data.POSIX,
    -- | The date and time that the Git repository was last modified.
    CodeRepositorySummary -> POSIX
lastModifiedTime :: Data.POSIX
  }
  deriving (CodeRepositorySummary -> CodeRepositorySummary -> Bool
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]
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
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. 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'
      { $sel:gitConfig:CodeRepositorySummary' :: Maybe GitConfig
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 = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastModifiedTime:CodeRepositorySummary' :: POSIX
lastModifiedTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' CodeRepositorySummary (Maybe GitConfig)
codeRepositorySummary_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 :: Lens' CodeRepositorySummary Text
codeRepositorySummary_codeRepositoryName = 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 :: Lens' CodeRepositorySummary Text
codeRepositorySummary_codeRepositoryArn = 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 :: Lens' CodeRepositorySummary UTCTime
codeRepositorySummary_creationTime = 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) 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 Git repository was last modified.
codeRepositorySummary_lastModifiedTime :: Lens.Lens' CodeRepositorySummary Prelude.UTCTime
codeRepositorySummary_lastModifiedTime :: Lens' CodeRepositorySummary UTCTime
codeRepositorySummary_lastModifiedTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON CodeRepositorySummary where
  parseJSON :: Value -> Parser CodeRepositorySummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CodeRepositorySummary"
      ( \Object
x ->
          Maybe GitConfig
-> Text -> Text -> POSIX -> POSIX -> CodeRepositorySummary
CodeRepositorySummary'
            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
"GitConfig")
            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
"CodeRepositoryName")
            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
"CodeRepositoryArn")
            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 CodeRepositorySummary where
  hashWithSalt :: Int -> CodeRepositorySummary -> Int
hashWithSalt Int
_salt CodeRepositorySummary' {Maybe GitConfig
Text
POSIX
lastModifiedTime :: POSIX
creationTime :: POSIX
codeRepositoryArn :: Text
codeRepositoryName :: Text
gitConfig :: Maybe GitConfig
$sel:lastModifiedTime:CodeRepositorySummary' :: CodeRepositorySummary -> POSIX
$sel:creationTime:CodeRepositorySummary' :: CodeRepositorySummary -> POSIX
$sel:codeRepositoryArn:CodeRepositorySummary' :: CodeRepositorySummary -> Text
$sel:codeRepositoryName:CodeRepositorySummary' :: CodeRepositorySummary -> Text
$sel:gitConfig:CodeRepositorySummary' :: CodeRepositorySummary -> Maybe GitConfig
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GitConfig
gitConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
codeRepositoryName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
codeRepositoryArn
      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 CodeRepositorySummary where
  rnf :: CodeRepositorySummary -> ()
rnf CodeRepositorySummary' {Maybe GitConfig
Text
POSIX
lastModifiedTime :: POSIX
creationTime :: POSIX
codeRepositoryArn :: Text
codeRepositoryName :: Text
gitConfig :: Maybe GitConfig
$sel:lastModifiedTime:CodeRepositorySummary' :: CodeRepositorySummary -> POSIX
$sel:creationTime:CodeRepositorySummary' :: CodeRepositorySummary -> POSIX
$sel:codeRepositoryArn:CodeRepositorySummary' :: CodeRepositorySummary -> Text
$sel:codeRepositoryName:CodeRepositorySummary' :: CodeRepositorySummary -> Text
$sel:gitConfig:CodeRepositorySummary' :: CodeRepositorySummary -> Maybe GitConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe GitConfig
gitConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
codeRepositoryName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
codeRepositoryArn
      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