{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SnowDeviceManagement.Types.SoftwareInformation 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

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

-- | 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 :: Lens' SoftwareInformation (Maybe Text)
softwareInformation_installState = 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 currently installed on the device.
softwareInformation_installedVersion :: Lens.Lens' SoftwareInformation (Prelude.Maybe Prelude.Text)
softwareInformation_installedVersion :: Lens' SoftwareInformation (Maybe Text)
softwareInformation_installedVersion = 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 version of the software being installed on the device.
softwareInformation_installingVersion :: Lens.Lens' SoftwareInformation (Prelude.Maybe Prelude.Text)
softwareInformation_installingVersion :: Lens' SoftwareInformation (Maybe Text)
softwareInformation_installingVersion = 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 Data.FromJSON SoftwareInformation where
  parseJSON :: Value -> Parser SoftwareInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SoftwareInformation"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> SoftwareInformation
SoftwareInformation'
            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
"installState")
            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
"installedVersion")
            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
"installingVersion")
      )

instance Prelude.Hashable SoftwareInformation where
  hashWithSalt :: Int -> SoftwareInformation -> Int
hashWithSalt Int
_salt SoftwareInformation' {Maybe Text
installingVersion :: Maybe Text
installedVersion :: Maybe Text
installState :: Maybe Text
$sel:installingVersion:SoftwareInformation' :: SoftwareInformation -> Maybe Text
$sel:installedVersion:SoftwareInformation' :: SoftwareInformation -> Maybe Text
$sel:installState:SoftwareInformation' :: SoftwareInformation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
installState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
installedVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
installingVersion

instance Prelude.NFData SoftwareInformation where
  rnf :: SoftwareInformation -> ()
rnf SoftwareInformation' {Maybe Text
installingVersion :: Maybe Text
installedVersion :: Maybe Text
installState :: Maybe Text
$sel:installingVersion:SoftwareInformation' :: SoftwareInformation -> Maybe Text
$sel:installedVersion:SoftwareInformation' :: SoftwareInformation -> Maybe Text
$sel:installState:SoftwareInformation' :: SoftwareInformation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
installState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
installedVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
installingVersion