{-# 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.OpsWorks.Types.OperatingSystemConfigurationManager
-- 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.OpsWorks.Types.OperatingSystemConfigurationManager where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A block that contains information about the configuration manager (Chef)
-- and the versions of the configuration manager that are supported for an
-- operating system.
--
-- /See:/ 'newOperatingSystemConfigurationManager' smart constructor.
data OperatingSystemConfigurationManager = OperatingSystemConfigurationManager'
  { -- | The name of the configuration manager, which is Chef.
    OperatingSystemConfigurationManager -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The versions of the configuration manager that are supported by an
    -- operating system.
    OperatingSystemConfigurationManager -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (OperatingSystemConfigurationManager
-> OperatingSystemConfigurationManager -> Bool
(OperatingSystemConfigurationManager
 -> OperatingSystemConfigurationManager -> Bool)
-> (OperatingSystemConfigurationManager
    -> OperatingSystemConfigurationManager -> Bool)
-> Eq OperatingSystemConfigurationManager
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OperatingSystemConfigurationManager
-> OperatingSystemConfigurationManager -> Bool
$c/= :: OperatingSystemConfigurationManager
-> OperatingSystemConfigurationManager -> Bool
== :: OperatingSystemConfigurationManager
-> OperatingSystemConfigurationManager -> Bool
$c== :: OperatingSystemConfigurationManager
-> OperatingSystemConfigurationManager -> Bool
Prelude.Eq, ReadPrec [OperatingSystemConfigurationManager]
ReadPrec OperatingSystemConfigurationManager
Int -> ReadS OperatingSystemConfigurationManager
ReadS [OperatingSystemConfigurationManager]
(Int -> ReadS OperatingSystemConfigurationManager)
-> ReadS [OperatingSystemConfigurationManager]
-> ReadPrec OperatingSystemConfigurationManager
-> ReadPrec [OperatingSystemConfigurationManager]
-> Read OperatingSystemConfigurationManager
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OperatingSystemConfigurationManager]
$creadListPrec :: ReadPrec [OperatingSystemConfigurationManager]
readPrec :: ReadPrec OperatingSystemConfigurationManager
$creadPrec :: ReadPrec OperatingSystemConfigurationManager
readList :: ReadS [OperatingSystemConfigurationManager]
$creadList :: ReadS [OperatingSystemConfigurationManager]
readsPrec :: Int -> ReadS OperatingSystemConfigurationManager
$creadsPrec :: Int -> ReadS OperatingSystemConfigurationManager
Prelude.Read, Int -> OperatingSystemConfigurationManager -> ShowS
[OperatingSystemConfigurationManager] -> ShowS
OperatingSystemConfigurationManager -> String
(Int -> OperatingSystemConfigurationManager -> ShowS)
-> (OperatingSystemConfigurationManager -> String)
-> ([OperatingSystemConfigurationManager] -> ShowS)
-> Show OperatingSystemConfigurationManager
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OperatingSystemConfigurationManager] -> ShowS
$cshowList :: [OperatingSystemConfigurationManager] -> ShowS
show :: OperatingSystemConfigurationManager -> String
$cshow :: OperatingSystemConfigurationManager -> String
showsPrec :: Int -> OperatingSystemConfigurationManager -> ShowS
$cshowsPrec :: Int -> OperatingSystemConfigurationManager -> ShowS
Prelude.Show, (forall x.
 OperatingSystemConfigurationManager
 -> Rep OperatingSystemConfigurationManager x)
-> (forall x.
    Rep OperatingSystemConfigurationManager x
    -> OperatingSystemConfigurationManager)
-> Generic OperatingSystemConfigurationManager
forall x.
Rep OperatingSystemConfigurationManager x
-> OperatingSystemConfigurationManager
forall x.
OperatingSystemConfigurationManager
-> Rep OperatingSystemConfigurationManager x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OperatingSystemConfigurationManager x
-> OperatingSystemConfigurationManager
$cfrom :: forall x.
OperatingSystemConfigurationManager
-> Rep OperatingSystemConfigurationManager x
Prelude.Generic)

-- |
-- Create a value of 'OperatingSystemConfigurationManager' 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:
--
-- 'name', 'operatingSystemConfigurationManager_name' - The name of the configuration manager, which is Chef.
--
-- 'version', 'operatingSystemConfigurationManager_version' - The versions of the configuration manager that are supported by an
-- operating system.
newOperatingSystemConfigurationManager ::
  OperatingSystemConfigurationManager
newOperatingSystemConfigurationManager :: OperatingSystemConfigurationManager
newOperatingSystemConfigurationManager =
  OperatingSystemConfigurationManager' :: Maybe Text -> Maybe Text -> OperatingSystemConfigurationManager
OperatingSystemConfigurationManager'
    { $sel:name:OperatingSystemConfigurationManager' :: Maybe Text
name =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:OperatingSystemConfigurationManager' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the configuration manager, which is Chef.
operatingSystemConfigurationManager_name :: Lens.Lens' OperatingSystemConfigurationManager (Prelude.Maybe Prelude.Text)
operatingSystemConfigurationManager_name :: (Maybe Text -> f (Maybe Text))
-> OperatingSystemConfigurationManager
-> f OperatingSystemConfigurationManager
operatingSystemConfigurationManager_name = (OperatingSystemConfigurationManager -> Maybe Text)
-> (OperatingSystemConfigurationManager
    -> Maybe Text -> OperatingSystemConfigurationManager)
-> Lens
     OperatingSystemConfigurationManager
     OperatingSystemConfigurationManager
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OperatingSystemConfigurationManager' {Maybe Text
name :: Maybe Text
$sel:name:OperatingSystemConfigurationManager' :: OperatingSystemConfigurationManager -> Maybe Text
name} -> Maybe Text
name) (\s :: OperatingSystemConfigurationManager
s@OperatingSystemConfigurationManager' {} Maybe Text
a -> OperatingSystemConfigurationManager
s {$sel:name:OperatingSystemConfigurationManager' :: Maybe Text
name = Maybe Text
a} :: OperatingSystemConfigurationManager)

-- | The versions of the configuration manager that are supported by an
-- operating system.
operatingSystemConfigurationManager_version :: Lens.Lens' OperatingSystemConfigurationManager (Prelude.Maybe Prelude.Text)
operatingSystemConfigurationManager_version :: (Maybe Text -> f (Maybe Text))
-> OperatingSystemConfigurationManager
-> f OperatingSystemConfigurationManager
operatingSystemConfigurationManager_version = (OperatingSystemConfigurationManager -> Maybe Text)
-> (OperatingSystemConfigurationManager
    -> Maybe Text -> OperatingSystemConfigurationManager)
-> Lens
     OperatingSystemConfigurationManager
     OperatingSystemConfigurationManager
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OperatingSystemConfigurationManager' {Maybe Text
version :: Maybe Text
$sel:version:OperatingSystemConfigurationManager' :: OperatingSystemConfigurationManager -> Maybe Text
version} -> Maybe Text
version) (\s :: OperatingSystemConfigurationManager
s@OperatingSystemConfigurationManager' {} Maybe Text
a -> OperatingSystemConfigurationManager
s {$sel:version:OperatingSystemConfigurationManager' :: Maybe Text
version = Maybe Text
a} :: OperatingSystemConfigurationManager)

instance
  Core.FromJSON
    OperatingSystemConfigurationManager
  where
  parseJSON :: Value -> Parser OperatingSystemConfigurationManager
parseJSON =
    String
-> (Object -> Parser OperatingSystemConfigurationManager)
-> Value
-> Parser OperatingSystemConfigurationManager
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OperatingSystemConfigurationManager"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> OperatingSystemConfigurationManager
OperatingSystemConfigurationManager'
            (Maybe Text -> Maybe Text -> OperatingSystemConfigurationManager)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> OperatingSystemConfigurationManager)
forall (f :: * -> *) a b. Functor 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
"Name")
            Parser (Maybe Text -> OperatingSystemConfigurationManager)
-> Parser (Maybe Text)
-> Parser OperatingSystemConfigurationManager
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
"Version")
      )

instance
  Prelude.Hashable
    OperatingSystemConfigurationManager

instance
  Prelude.NFData
    OperatingSystemConfigurationManager