{-# 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.SnowDeviceManagement.Types.SoftwareInformation
-- 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.SnowDeviceManagement.Types.SoftwareInformation where

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

-- | Information about the software on the device.
--
-- /See:/ 'newSoftwareInformation' smart constructor.
data SoftwareInformation = SoftwareInformation'
  { -- | The version of the software currently installed on the device.
    SoftwareInformation -> Maybe Text
installedVersion :: Prelude.Maybe Prelude.Text,
    -- | The state of the software that is installed or that is being installed
    -- on the device.
    SoftwareInformation -> Maybe Text
installState :: Prelude.Maybe Prelude.Text,
    -- | The version of the software being installed on the device.
    SoftwareInformation -> Maybe Text
installingVersion :: Prelude.Maybe Prelude.Text
  }
  deriving (SoftwareInformation -> SoftwareInformation -> Bool
(SoftwareInformation -> SoftwareInformation -> Bool)
-> (SoftwareInformation -> SoftwareInformation -> Bool)
-> Eq SoftwareInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SoftwareInformation -> SoftwareInformation -> Bool
$c/= :: SoftwareInformation -> SoftwareInformation -> Bool
== :: SoftwareInformation -> SoftwareInformation -> Bool
$c== :: SoftwareInformation -> SoftwareInformation -> Bool
Prelude.Eq, ReadPrec [SoftwareInformation]
ReadPrec SoftwareInformation
Int -> ReadS SoftwareInformation
ReadS [SoftwareInformation]
(Int -> ReadS SoftwareInformation)
-> ReadS [SoftwareInformation]
-> ReadPrec SoftwareInformation
-> ReadPrec [SoftwareInformation]
-> Read SoftwareInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SoftwareInformation]
$creadListPrec :: ReadPrec [SoftwareInformation]
readPrec :: ReadPrec SoftwareInformation
$creadPrec :: ReadPrec SoftwareInformation
readList :: ReadS [SoftwareInformation]
$creadList :: ReadS [SoftwareInformation]
readsPrec :: Int -> ReadS SoftwareInformation
$creadsPrec :: Int -> ReadS SoftwareInformation
Prelude.Read, Int -> SoftwareInformation -> ShowS
[SoftwareInformation] -> ShowS
SoftwareInformation -> String
(Int -> SoftwareInformation -> ShowS)
-> (SoftwareInformation -> String)
-> ([SoftwareInformation] -> ShowS)
-> Show SoftwareInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SoftwareInformation] -> ShowS
$cshowList :: [SoftwareInformation] -> ShowS
show :: SoftwareInformation -> String
$cshow :: SoftwareInformation -> String
showsPrec :: Int -> SoftwareInformation -> ShowS
$cshowsPrec :: Int -> SoftwareInformation -> ShowS
Prelude.Show, (forall x. SoftwareInformation -> Rep SoftwareInformation x)
-> (forall x. Rep SoftwareInformation x -> SoftwareInformation)
-> Generic SoftwareInformation
forall x. Rep SoftwareInformation x -> SoftwareInformation
forall x. SoftwareInformation -> Rep SoftwareInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SoftwareInformation x -> SoftwareInformation
$cfrom :: forall x. SoftwareInformation -> Rep SoftwareInformation x
Prelude.Generic)

-- |
-- Create a value of 'SoftwareInformation' 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:
--
-- 'installedVersion', 'softwareInformation_installedVersion' - The version of the software currently installed on the device.
--
-- 'installState', 'softwareInformation_installState' - The state of the software that is installed or that is being installed
-- on the device.
--
-- 'installingVersion', 'softwareInformation_installingVersion' - The version of the software being installed on the device.
newSoftwareInformation ::
  SoftwareInformation
newSoftwareInformation :: SoftwareInformation
newSoftwareInformation =
  SoftwareInformation' :: Maybe Text -> Maybe Text -> Maybe Text -> SoftwareInformation
SoftwareInformation'
    { $sel:installedVersion:SoftwareInformation' :: Maybe Text
installedVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:installState:SoftwareInformation' :: Maybe Text
installState = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:installingVersion:SoftwareInformation' :: Maybe Text
installingVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The version of the software currently installed on the device.
softwareInformation_installedVersion :: Lens.Lens' SoftwareInformation (Prelude.Maybe Prelude.Text)
softwareInformation_installedVersion :: (Maybe Text -> f (Maybe Text))
-> SoftwareInformation -> f SoftwareInformation
softwareInformation_installedVersion = (SoftwareInformation -> Maybe Text)
-> (SoftwareInformation -> Maybe Text -> SoftwareInformation)
-> Lens
     SoftwareInformation SoftwareInformation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwareInformation' {Maybe Text
installedVersion :: Maybe Text
$sel:installedVersion:SoftwareInformation' :: SoftwareInformation -> Maybe Text
installedVersion} -> Maybe Text
installedVersion) (\s :: SoftwareInformation
s@SoftwareInformation' {} Maybe Text
a -> SoftwareInformation
s {$sel:installedVersion:SoftwareInformation' :: Maybe Text
installedVersion = Maybe Text
a} :: SoftwareInformation)

-- | The state of the software that is installed or that is being installed
-- on the device.
softwareInformation_installState :: Lens.Lens' SoftwareInformation (Prelude.Maybe Prelude.Text)
softwareInformation_installState :: (Maybe Text -> f (Maybe Text))
-> SoftwareInformation -> f SoftwareInformation
softwareInformation_installState = (SoftwareInformation -> Maybe Text)
-> (SoftwareInformation -> Maybe Text -> SoftwareInformation)
-> Lens
     SoftwareInformation SoftwareInformation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwareInformation' {Maybe Text
installState :: Maybe Text
$sel:installState:SoftwareInformation' :: SoftwareInformation -> Maybe Text
installState} -> Maybe Text
installState) (\s :: SoftwareInformation
s@SoftwareInformation' {} Maybe Text
a -> SoftwareInformation
s {$sel:installState:SoftwareInformation' :: Maybe Text
installState = Maybe Text
a} :: SoftwareInformation)

-- | The version of the software being installed on the device.
softwareInformation_installingVersion :: Lens.Lens' SoftwareInformation (Prelude.Maybe Prelude.Text)
softwareInformation_installingVersion :: (Maybe Text -> f (Maybe Text))
-> SoftwareInformation -> f SoftwareInformation
softwareInformation_installingVersion = (SoftwareInformation -> Maybe Text)
-> (SoftwareInformation -> Maybe Text -> SoftwareInformation)
-> Lens
     SoftwareInformation SoftwareInformation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SoftwareInformation' {Maybe Text
installingVersion :: Maybe Text
$sel:installingVersion:SoftwareInformation' :: SoftwareInformation -> Maybe Text
installingVersion} -> Maybe Text
installingVersion) (\s :: SoftwareInformation
s@SoftwareInformation' {} Maybe Text
a -> SoftwareInformation
s {$sel:installingVersion:SoftwareInformation' :: Maybe Text
installingVersion = Maybe Text
a} :: SoftwareInformation)

instance Core.FromJSON SoftwareInformation where
  parseJSON :: Value -> Parser SoftwareInformation
parseJSON =
    String
-> (Object -> Parser SoftwareInformation)
-> Value
-> Parser SoftwareInformation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SoftwareInformation"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> SoftwareInformation
SoftwareInformation'
            (Maybe Text -> Maybe Text -> Maybe Text -> SoftwareInformation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SoftwareInformation)
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
"installedVersion")
            Parser (Maybe Text -> Maybe Text -> SoftwareInformation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SoftwareInformation)
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
"installState")
            Parser (Maybe Text -> SoftwareInformation)
-> Parser (Maybe Text) -> Parser SoftwareInformation
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
"installingVersion")
      )

instance Prelude.Hashable SoftwareInformation

instance Prelude.NFData SoftwareInformation