{-# 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.MigrationHubStrategy.Types.VersionControlInfo
-- 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.MigrationHubStrategy.Types.VersionControlInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types.VersionControlType
import qualified Amazonka.Prelude as Prelude

-- | Details about the version control configuration.
--
-- /See:/ 'newVersionControlInfo' smart constructor.
data VersionControlInfo = VersionControlInfo'
  { -- | The time when the version control system was last configured.
    VersionControlInfo -> Maybe Text
versionControlConfigurationTimeStamp :: Prelude.Maybe Prelude.Text,
    -- | The type of version control.
    VersionControlInfo -> Maybe VersionControlType
versionControlType :: Prelude.Maybe VersionControlType
  }
  deriving (VersionControlInfo -> VersionControlInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VersionControlInfo -> VersionControlInfo -> Bool
$c/= :: VersionControlInfo -> VersionControlInfo -> Bool
== :: VersionControlInfo -> VersionControlInfo -> Bool
$c== :: VersionControlInfo -> VersionControlInfo -> Bool
Prelude.Eq, ReadPrec [VersionControlInfo]
ReadPrec VersionControlInfo
Int -> ReadS VersionControlInfo
ReadS [VersionControlInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VersionControlInfo]
$creadListPrec :: ReadPrec [VersionControlInfo]
readPrec :: ReadPrec VersionControlInfo
$creadPrec :: ReadPrec VersionControlInfo
readList :: ReadS [VersionControlInfo]
$creadList :: ReadS [VersionControlInfo]
readsPrec :: Int -> ReadS VersionControlInfo
$creadsPrec :: Int -> ReadS VersionControlInfo
Prelude.Read, Int -> VersionControlInfo -> ShowS
[VersionControlInfo] -> ShowS
VersionControlInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VersionControlInfo] -> ShowS
$cshowList :: [VersionControlInfo] -> ShowS
show :: VersionControlInfo -> String
$cshow :: VersionControlInfo -> String
showsPrec :: Int -> VersionControlInfo -> ShowS
$cshowsPrec :: Int -> VersionControlInfo -> ShowS
Prelude.Show, forall x. Rep VersionControlInfo x -> VersionControlInfo
forall x. VersionControlInfo -> Rep VersionControlInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VersionControlInfo x -> VersionControlInfo
$cfrom :: forall x. VersionControlInfo -> Rep VersionControlInfo x
Prelude.Generic)

-- |
-- Create a value of 'VersionControlInfo' 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:
--
-- 'versionControlConfigurationTimeStamp', 'versionControlInfo_versionControlConfigurationTimeStamp' - The time when the version control system was last configured.
--
-- 'versionControlType', 'versionControlInfo_versionControlType' - The type of version control.
newVersionControlInfo ::
  VersionControlInfo
newVersionControlInfo :: VersionControlInfo
newVersionControlInfo =
  VersionControlInfo'
    { $sel:versionControlConfigurationTimeStamp:VersionControlInfo' :: Maybe Text
versionControlConfigurationTimeStamp =
        forall a. Maybe a
Prelude.Nothing,
      $sel:versionControlType:VersionControlInfo' :: Maybe VersionControlType
versionControlType = forall a. Maybe a
Prelude.Nothing
    }

-- | The time when the version control system was last configured.
versionControlInfo_versionControlConfigurationTimeStamp :: Lens.Lens' VersionControlInfo (Prelude.Maybe Prelude.Text)
versionControlInfo_versionControlConfigurationTimeStamp :: Lens' VersionControlInfo (Maybe Text)
versionControlInfo_versionControlConfigurationTimeStamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VersionControlInfo' {Maybe Text
versionControlConfigurationTimeStamp :: Maybe Text
$sel:versionControlConfigurationTimeStamp:VersionControlInfo' :: VersionControlInfo -> Maybe Text
versionControlConfigurationTimeStamp} -> Maybe Text
versionControlConfigurationTimeStamp) (\s :: VersionControlInfo
s@VersionControlInfo' {} Maybe Text
a -> VersionControlInfo
s {$sel:versionControlConfigurationTimeStamp:VersionControlInfo' :: Maybe Text
versionControlConfigurationTimeStamp = Maybe Text
a} :: VersionControlInfo)

-- | The type of version control.
versionControlInfo_versionControlType :: Lens.Lens' VersionControlInfo (Prelude.Maybe VersionControlType)
versionControlInfo_versionControlType :: Lens' VersionControlInfo (Maybe VersionControlType)
versionControlInfo_versionControlType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VersionControlInfo' {Maybe VersionControlType
versionControlType :: Maybe VersionControlType
$sel:versionControlType:VersionControlInfo' :: VersionControlInfo -> Maybe VersionControlType
versionControlType} -> Maybe VersionControlType
versionControlType) (\s :: VersionControlInfo
s@VersionControlInfo' {} Maybe VersionControlType
a -> VersionControlInfo
s {$sel:versionControlType:VersionControlInfo' :: Maybe VersionControlType
versionControlType = Maybe VersionControlType
a} :: VersionControlInfo)

instance Data.FromJSON VersionControlInfo where
  parseJSON :: Value -> Parser VersionControlInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VersionControlInfo"
      ( \Object
x ->
          Maybe Text -> Maybe VersionControlType -> VersionControlInfo
VersionControlInfo'
            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
"versionControlConfigurationTimeStamp")
            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
"versionControlType")
      )

instance Prelude.Hashable VersionControlInfo where
  hashWithSalt :: Int -> VersionControlInfo -> Int
hashWithSalt Int
_salt VersionControlInfo' {Maybe Text
Maybe VersionControlType
versionControlType :: Maybe VersionControlType
versionControlConfigurationTimeStamp :: Maybe Text
$sel:versionControlType:VersionControlInfo' :: VersionControlInfo -> Maybe VersionControlType
$sel:versionControlConfigurationTimeStamp:VersionControlInfo' :: VersionControlInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionControlConfigurationTimeStamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VersionControlType
versionControlType

instance Prelude.NFData VersionControlInfo where
  rnf :: VersionControlInfo -> ()
rnf VersionControlInfo' {Maybe Text
Maybe VersionControlType
versionControlType :: Maybe VersionControlType
versionControlConfigurationTimeStamp :: Maybe Text
$sel:versionControlType:VersionControlInfo' :: VersionControlInfo -> Maybe VersionControlType
$sel:versionControlConfigurationTimeStamp:VersionControlInfo' :: VersionControlInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionControlConfigurationTimeStamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VersionControlType
versionControlType