{-# 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.Panorama.Types.OTAJobConfig
-- 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.Panorama.Types.OTAJobConfig where

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

-- | An over-the-air update (OTA) job configuration.
--
-- /See:/ 'newOTAJobConfig' smart constructor.
data OTAJobConfig = OTAJobConfig'
  { -- | The target version of the device software.
    OTAJobConfig -> Text
imageVersion :: Prelude.Text
  }
  deriving (OTAJobConfig -> OTAJobConfig -> Bool
(OTAJobConfig -> OTAJobConfig -> Bool)
-> (OTAJobConfig -> OTAJobConfig -> Bool) -> Eq OTAJobConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OTAJobConfig -> OTAJobConfig -> Bool
$c/= :: OTAJobConfig -> OTAJobConfig -> Bool
== :: OTAJobConfig -> OTAJobConfig -> Bool
$c== :: OTAJobConfig -> OTAJobConfig -> Bool
Prelude.Eq, ReadPrec [OTAJobConfig]
ReadPrec OTAJobConfig
Int -> ReadS OTAJobConfig
ReadS [OTAJobConfig]
(Int -> ReadS OTAJobConfig)
-> ReadS [OTAJobConfig]
-> ReadPrec OTAJobConfig
-> ReadPrec [OTAJobConfig]
-> Read OTAJobConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OTAJobConfig]
$creadListPrec :: ReadPrec [OTAJobConfig]
readPrec :: ReadPrec OTAJobConfig
$creadPrec :: ReadPrec OTAJobConfig
readList :: ReadS [OTAJobConfig]
$creadList :: ReadS [OTAJobConfig]
readsPrec :: Int -> ReadS OTAJobConfig
$creadsPrec :: Int -> ReadS OTAJobConfig
Prelude.Read, Int -> OTAJobConfig -> ShowS
[OTAJobConfig] -> ShowS
OTAJobConfig -> String
(Int -> OTAJobConfig -> ShowS)
-> (OTAJobConfig -> String)
-> ([OTAJobConfig] -> ShowS)
-> Show OTAJobConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OTAJobConfig] -> ShowS
$cshowList :: [OTAJobConfig] -> ShowS
show :: OTAJobConfig -> String
$cshow :: OTAJobConfig -> String
showsPrec :: Int -> OTAJobConfig -> ShowS
$cshowsPrec :: Int -> OTAJobConfig -> ShowS
Prelude.Show, (forall x. OTAJobConfig -> Rep OTAJobConfig x)
-> (forall x. Rep OTAJobConfig x -> OTAJobConfig)
-> Generic OTAJobConfig
forall x. Rep OTAJobConfig x -> OTAJobConfig
forall x. OTAJobConfig -> Rep OTAJobConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OTAJobConfig x -> OTAJobConfig
$cfrom :: forall x. OTAJobConfig -> Rep OTAJobConfig x
Prelude.Generic)

-- |
-- Create a value of 'OTAJobConfig' 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:
--
-- 'imageVersion', 'oTAJobConfig_imageVersion' - The target version of the device software.
newOTAJobConfig ::
  -- | 'imageVersion'
  Prelude.Text ->
  OTAJobConfig
newOTAJobConfig :: Text -> OTAJobConfig
newOTAJobConfig Text
pImageVersion_ =
  OTAJobConfig' :: Text -> OTAJobConfig
OTAJobConfig' {$sel:imageVersion:OTAJobConfig' :: Text
imageVersion = Text
pImageVersion_}

-- | The target version of the device software.
oTAJobConfig_imageVersion :: Lens.Lens' OTAJobConfig Prelude.Text
oTAJobConfig_imageVersion :: (Text -> f Text) -> OTAJobConfig -> f OTAJobConfig
oTAJobConfig_imageVersion = (OTAJobConfig -> Text)
-> (OTAJobConfig -> Text -> OTAJobConfig)
-> Lens OTAJobConfig OTAJobConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAJobConfig' {Text
imageVersion :: Text
$sel:imageVersion:OTAJobConfig' :: OTAJobConfig -> Text
imageVersion} -> Text
imageVersion) (\s :: OTAJobConfig
s@OTAJobConfig' {} Text
a -> OTAJobConfig
s {$sel:imageVersion:OTAJobConfig' :: Text
imageVersion = Text
a} :: OTAJobConfig)

instance Prelude.Hashable OTAJobConfig

instance Prelude.NFData OTAJobConfig

instance Core.ToJSON OTAJobConfig where
  toJSON :: OTAJobConfig -> Value
toJSON OTAJobConfig' {Text
imageVersion :: Text
$sel:imageVersion:OTAJobConfig' :: OTAJobConfig -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ImageVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imageVersion)]
      )