{-# 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.IoT.Types.OTAUpdateInfo
-- 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.IoT.Types.OTAUpdateInfo where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.AwsJobExecutionsRolloutConfig
import Amazonka.IoT.Types.AwsJobPresignedUrlConfig
import Amazonka.IoT.Types.ErrorInfo
import Amazonka.IoT.Types.OTAUpdateFile
import Amazonka.IoT.Types.OTAUpdateStatus
import Amazonka.IoT.Types.Protocol
import Amazonka.IoT.Types.TargetSelection
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about an OTA update.
--
-- /See:/ 'newOTAUpdateInfo' smart constructor.
data OTAUpdateInfo = OTAUpdateInfo'
  { -- | The date when the OTA update was last updated.
    OTAUpdateInfo -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | Configuration for the rollout of OTA updates.
    OTAUpdateInfo -> Maybe AwsJobExecutionsRolloutConfig
awsJobExecutionsRolloutConfig :: Prelude.Maybe AwsJobExecutionsRolloutConfig,
    -- | The IoT job ID associated with the OTA update.
    OTAUpdateInfo -> Maybe Text
awsIotJobId :: Prelude.Maybe Prelude.Text,
    -- | The protocol used to transfer the OTA update image. Valid values are
    -- [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the
    -- target device can choose the protocol.
    OTAUpdateInfo -> Maybe (NonEmpty Protocol)
protocols :: Prelude.Maybe (Prelude.NonEmpty Protocol),
    -- | Configuration information for pre-signed URLs. Valid when @protocols@
    -- contains HTTP.
    OTAUpdateInfo -> Maybe AwsJobPresignedUrlConfig
awsJobPresignedUrlConfig :: Prelude.Maybe AwsJobPresignedUrlConfig,
    -- | A list of files associated with the OTA update.
    OTAUpdateInfo -> Maybe (NonEmpty OTAUpdateFile)
otaUpdateFiles :: Prelude.Maybe (Prelude.NonEmpty OTAUpdateFile),
    -- | The status of the OTA update.
    OTAUpdateInfo -> Maybe OTAUpdateStatus
otaUpdateStatus :: Prelude.Maybe OTAUpdateStatus,
    -- | The targets of the OTA update.
    OTAUpdateInfo -> Maybe (NonEmpty Text)
targets :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The IoT job ARN associated with the OTA update.
    OTAUpdateInfo -> Maybe Text
awsIotJobArn :: Prelude.Maybe Prelude.Text,
    -- | The date when the OTA update was created.
    OTAUpdateInfo -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | A collection of name\/value pairs
    OTAUpdateInfo -> Maybe (HashMap Text Text)
additionalParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The OTA update ID.
    OTAUpdateInfo -> Maybe Text
otaUpdateId :: Prelude.Maybe Prelude.Text,
    -- | Error information associated with the OTA update.
    OTAUpdateInfo -> Maybe ErrorInfo
errorInfo :: Prelude.Maybe ErrorInfo,
    -- | The OTA update ARN.
    OTAUpdateInfo -> Maybe Text
otaUpdateArn :: Prelude.Maybe Prelude.Text,
    -- | A description of the OTA update.
    OTAUpdateInfo -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the OTA update will continue to run (CONTINUOUS), or
    -- will be complete after all those things specified as targets have
    -- completed the OTA update (SNAPSHOT). If continuous, the OTA update may
    -- also be run on a thing when a change is detected in a target. For
    -- example, an OTA update will run on a thing when the thing is added to a
    -- target group, even after the OTA update was completed by all things
    -- originally in the group.
    OTAUpdateInfo -> Maybe TargetSelection
targetSelection :: Prelude.Maybe TargetSelection
  }
  deriving (OTAUpdateInfo -> OTAUpdateInfo -> Bool
(OTAUpdateInfo -> OTAUpdateInfo -> Bool)
-> (OTAUpdateInfo -> OTAUpdateInfo -> Bool) -> Eq OTAUpdateInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OTAUpdateInfo -> OTAUpdateInfo -> Bool
$c/= :: OTAUpdateInfo -> OTAUpdateInfo -> Bool
== :: OTAUpdateInfo -> OTAUpdateInfo -> Bool
$c== :: OTAUpdateInfo -> OTAUpdateInfo -> Bool
Prelude.Eq, ReadPrec [OTAUpdateInfo]
ReadPrec OTAUpdateInfo
Int -> ReadS OTAUpdateInfo
ReadS [OTAUpdateInfo]
(Int -> ReadS OTAUpdateInfo)
-> ReadS [OTAUpdateInfo]
-> ReadPrec OTAUpdateInfo
-> ReadPrec [OTAUpdateInfo]
-> Read OTAUpdateInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OTAUpdateInfo]
$creadListPrec :: ReadPrec [OTAUpdateInfo]
readPrec :: ReadPrec OTAUpdateInfo
$creadPrec :: ReadPrec OTAUpdateInfo
readList :: ReadS [OTAUpdateInfo]
$creadList :: ReadS [OTAUpdateInfo]
readsPrec :: Int -> ReadS OTAUpdateInfo
$creadsPrec :: Int -> ReadS OTAUpdateInfo
Prelude.Read, Int -> OTAUpdateInfo -> ShowS
[OTAUpdateInfo] -> ShowS
OTAUpdateInfo -> String
(Int -> OTAUpdateInfo -> ShowS)
-> (OTAUpdateInfo -> String)
-> ([OTAUpdateInfo] -> ShowS)
-> Show OTAUpdateInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OTAUpdateInfo] -> ShowS
$cshowList :: [OTAUpdateInfo] -> ShowS
show :: OTAUpdateInfo -> String
$cshow :: OTAUpdateInfo -> String
showsPrec :: Int -> OTAUpdateInfo -> ShowS
$cshowsPrec :: Int -> OTAUpdateInfo -> ShowS
Prelude.Show, (forall x. OTAUpdateInfo -> Rep OTAUpdateInfo x)
-> (forall x. Rep OTAUpdateInfo x -> OTAUpdateInfo)
-> Generic OTAUpdateInfo
forall x. Rep OTAUpdateInfo x -> OTAUpdateInfo
forall x. OTAUpdateInfo -> Rep OTAUpdateInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OTAUpdateInfo x -> OTAUpdateInfo
$cfrom :: forall x. OTAUpdateInfo -> Rep OTAUpdateInfo x
Prelude.Generic)

-- |
-- Create a value of 'OTAUpdateInfo' 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:
--
-- 'lastModifiedDate', 'oTAUpdateInfo_lastModifiedDate' - The date when the OTA update was last updated.
--
-- 'awsJobExecutionsRolloutConfig', 'oTAUpdateInfo_awsJobExecutionsRolloutConfig' - Configuration for the rollout of OTA updates.
--
-- 'awsIotJobId', 'oTAUpdateInfo_awsIotJobId' - The IoT job ID associated with the OTA update.
--
-- 'protocols', 'oTAUpdateInfo_protocols' - The protocol used to transfer the OTA update image. Valid values are
-- [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the
-- target device can choose the protocol.
--
-- 'awsJobPresignedUrlConfig', 'oTAUpdateInfo_awsJobPresignedUrlConfig' - Configuration information for pre-signed URLs. Valid when @protocols@
-- contains HTTP.
--
-- 'otaUpdateFiles', 'oTAUpdateInfo_otaUpdateFiles' - A list of files associated with the OTA update.
--
-- 'otaUpdateStatus', 'oTAUpdateInfo_otaUpdateStatus' - The status of the OTA update.
--
-- 'targets', 'oTAUpdateInfo_targets' - The targets of the OTA update.
--
-- 'awsIotJobArn', 'oTAUpdateInfo_awsIotJobArn' - The IoT job ARN associated with the OTA update.
--
-- 'creationDate', 'oTAUpdateInfo_creationDate' - The date when the OTA update was created.
--
-- 'additionalParameters', 'oTAUpdateInfo_additionalParameters' - A collection of name\/value pairs
--
-- 'otaUpdateId', 'oTAUpdateInfo_otaUpdateId' - The OTA update ID.
--
-- 'errorInfo', 'oTAUpdateInfo_errorInfo' - Error information associated with the OTA update.
--
-- 'otaUpdateArn', 'oTAUpdateInfo_otaUpdateArn' - The OTA update ARN.
--
-- 'description', 'oTAUpdateInfo_description' - A description of the OTA update.
--
-- 'targetSelection', 'oTAUpdateInfo_targetSelection' - Specifies whether the OTA update will continue to run (CONTINUOUS), or
-- will be complete after all those things specified as targets have
-- completed the OTA update (SNAPSHOT). If continuous, the OTA update may
-- also be run on a thing when a change is detected in a target. For
-- example, an OTA update will run on a thing when the thing is added to a
-- target group, even after the OTA update was completed by all things
-- originally in the group.
newOTAUpdateInfo ::
  OTAUpdateInfo
newOTAUpdateInfo :: OTAUpdateInfo
newOTAUpdateInfo =
  OTAUpdateInfo' :: Maybe POSIX
-> Maybe AwsJobExecutionsRolloutConfig
-> Maybe Text
-> Maybe (NonEmpty Protocol)
-> Maybe AwsJobPresignedUrlConfig
-> Maybe (NonEmpty OTAUpdateFile)
-> Maybe OTAUpdateStatus
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe ErrorInfo
-> Maybe Text
-> Maybe Text
-> Maybe TargetSelection
-> OTAUpdateInfo
OTAUpdateInfo'
    { $sel:lastModifiedDate:OTAUpdateInfo' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:awsJobExecutionsRolloutConfig:OTAUpdateInfo' :: Maybe AwsJobExecutionsRolloutConfig
awsJobExecutionsRolloutConfig = Maybe AwsJobExecutionsRolloutConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:awsIotJobId:OTAUpdateInfo' :: Maybe Text
awsIotJobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocols:OTAUpdateInfo' :: Maybe (NonEmpty Protocol)
protocols = Maybe (NonEmpty Protocol)
forall a. Maybe a
Prelude.Nothing,
      $sel:awsJobPresignedUrlConfig:OTAUpdateInfo' :: Maybe AwsJobPresignedUrlConfig
awsJobPresignedUrlConfig = Maybe AwsJobPresignedUrlConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:otaUpdateFiles:OTAUpdateInfo' :: Maybe (NonEmpty OTAUpdateFile)
otaUpdateFiles = Maybe (NonEmpty OTAUpdateFile)
forall a. Maybe a
Prelude.Nothing,
      $sel:otaUpdateStatus:OTAUpdateInfo' :: Maybe OTAUpdateStatus
otaUpdateStatus = Maybe OTAUpdateStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:OTAUpdateInfo' :: Maybe (NonEmpty Text)
targets = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:awsIotJobArn:OTAUpdateInfo' :: Maybe Text
awsIotJobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:OTAUpdateInfo' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalParameters:OTAUpdateInfo' :: Maybe (HashMap Text Text)
additionalParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:otaUpdateId:OTAUpdateInfo' :: Maybe Text
otaUpdateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorInfo:OTAUpdateInfo' :: Maybe ErrorInfo
errorInfo = Maybe ErrorInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:otaUpdateArn:OTAUpdateInfo' :: Maybe Text
otaUpdateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:OTAUpdateInfo' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetSelection:OTAUpdateInfo' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
forall a. Maybe a
Prelude.Nothing
    }

-- | The date when the OTA update was last updated.
oTAUpdateInfo_lastModifiedDate :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe Prelude.UTCTime)
oTAUpdateInfo_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_lastModifiedDate = (OTAUpdateInfo -> Maybe POSIX)
-> (OTAUpdateInfo -> Maybe POSIX -> OTAUpdateInfo)
-> Lens OTAUpdateInfo OTAUpdateInfo (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe POSIX
a -> OTAUpdateInfo
s {$sel:lastModifiedDate:OTAUpdateInfo' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: OTAUpdateInfo) ((Maybe POSIX -> f (Maybe POSIX))
 -> OTAUpdateInfo -> f OTAUpdateInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> OTAUpdateInfo
-> f OTAUpdateInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Configuration for the rollout of OTA updates.
oTAUpdateInfo_awsJobExecutionsRolloutConfig :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe AwsJobExecutionsRolloutConfig)
oTAUpdateInfo_awsJobExecutionsRolloutConfig :: (Maybe AwsJobExecutionsRolloutConfig
 -> f (Maybe AwsJobExecutionsRolloutConfig))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_awsJobExecutionsRolloutConfig = (OTAUpdateInfo -> Maybe AwsJobExecutionsRolloutConfig)
-> (OTAUpdateInfo
    -> Maybe AwsJobExecutionsRolloutConfig -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe AwsJobExecutionsRolloutConfig)
     (Maybe AwsJobExecutionsRolloutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe AwsJobExecutionsRolloutConfig
awsJobExecutionsRolloutConfig :: Maybe AwsJobExecutionsRolloutConfig
$sel:awsJobExecutionsRolloutConfig:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe AwsJobExecutionsRolloutConfig
awsJobExecutionsRolloutConfig} -> Maybe AwsJobExecutionsRolloutConfig
awsJobExecutionsRolloutConfig) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe AwsJobExecutionsRolloutConfig
a -> OTAUpdateInfo
s {$sel:awsJobExecutionsRolloutConfig:OTAUpdateInfo' :: Maybe AwsJobExecutionsRolloutConfig
awsJobExecutionsRolloutConfig = Maybe AwsJobExecutionsRolloutConfig
a} :: OTAUpdateInfo)

-- | The IoT job ID associated with the OTA update.
oTAUpdateInfo_awsIotJobId :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe Prelude.Text)
oTAUpdateInfo_awsIotJobId :: (Maybe Text -> f (Maybe Text)) -> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_awsIotJobId = (OTAUpdateInfo -> Maybe Text)
-> (OTAUpdateInfo -> Maybe Text -> OTAUpdateInfo)
-> Lens OTAUpdateInfo OTAUpdateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe Text
awsIotJobId :: Maybe Text
$sel:awsIotJobId:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe Text
awsIotJobId} -> Maybe Text
awsIotJobId) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe Text
a -> OTAUpdateInfo
s {$sel:awsIotJobId:OTAUpdateInfo' :: Maybe Text
awsIotJobId = Maybe Text
a} :: OTAUpdateInfo)

-- | The protocol used to transfer the OTA update image. Valid values are
-- [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the
-- target device can choose the protocol.
oTAUpdateInfo_protocols :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe (Prelude.NonEmpty Protocol))
oTAUpdateInfo_protocols :: (Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_protocols = (OTAUpdateInfo -> Maybe (NonEmpty Protocol))
-> (OTAUpdateInfo -> Maybe (NonEmpty Protocol) -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe (NonEmpty Protocol)
protocols :: Maybe (NonEmpty Protocol)
$sel:protocols:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe (NonEmpty Protocol)
protocols} -> Maybe (NonEmpty Protocol)
protocols) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe (NonEmpty Protocol)
a -> OTAUpdateInfo
s {$sel:protocols:OTAUpdateInfo' :: Maybe (NonEmpty Protocol)
protocols = Maybe (NonEmpty Protocol)
a} :: OTAUpdateInfo) ((Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
 -> OTAUpdateInfo -> f OTAUpdateInfo)
-> ((Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
    -> Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> (Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> OTAUpdateInfo
-> f OTAUpdateInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
-> Iso
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Configuration information for pre-signed URLs. Valid when @protocols@
-- contains HTTP.
oTAUpdateInfo_awsJobPresignedUrlConfig :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe AwsJobPresignedUrlConfig)
oTAUpdateInfo_awsJobPresignedUrlConfig :: (Maybe AwsJobPresignedUrlConfig
 -> f (Maybe AwsJobPresignedUrlConfig))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_awsJobPresignedUrlConfig = (OTAUpdateInfo -> Maybe AwsJobPresignedUrlConfig)
-> (OTAUpdateInfo
    -> Maybe AwsJobPresignedUrlConfig -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe AwsJobPresignedUrlConfig)
     (Maybe AwsJobPresignedUrlConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe AwsJobPresignedUrlConfig
awsJobPresignedUrlConfig :: Maybe AwsJobPresignedUrlConfig
$sel:awsJobPresignedUrlConfig:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe AwsJobPresignedUrlConfig
awsJobPresignedUrlConfig} -> Maybe AwsJobPresignedUrlConfig
awsJobPresignedUrlConfig) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe AwsJobPresignedUrlConfig
a -> OTAUpdateInfo
s {$sel:awsJobPresignedUrlConfig:OTAUpdateInfo' :: Maybe AwsJobPresignedUrlConfig
awsJobPresignedUrlConfig = Maybe AwsJobPresignedUrlConfig
a} :: OTAUpdateInfo)

-- | A list of files associated with the OTA update.
oTAUpdateInfo_otaUpdateFiles :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe (Prelude.NonEmpty OTAUpdateFile))
oTAUpdateInfo_otaUpdateFiles :: (Maybe (NonEmpty OTAUpdateFile)
 -> f (Maybe (NonEmpty OTAUpdateFile)))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_otaUpdateFiles = (OTAUpdateInfo -> Maybe (NonEmpty OTAUpdateFile))
-> (OTAUpdateInfo
    -> Maybe (NonEmpty OTAUpdateFile) -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe (NonEmpty OTAUpdateFile))
     (Maybe (NonEmpty OTAUpdateFile))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe (NonEmpty OTAUpdateFile)
otaUpdateFiles :: Maybe (NonEmpty OTAUpdateFile)
$sel:otaUpdateFiles:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe (NonEmpty OTAUpdateFile)
otaUpdateFiles} -> Maybe (NonEmpty OTAUpdateFile)
otaUpdateFiles) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe (NonEmpty OTAUpdateFile)
a -> OTAUpdateInfo
s {$sel:otaUpdateFiles:OTAUpdateInfo' :: Maybe (NonEmpty OTAUpdateFile)
otaUpdateFiles = Maybe (NonEmpty OTAUpdateFile)
a} :: OTAUpdateInfo) ((Maybe (NonEmpty OTAUpdateFile)
  -> f (Maybe (NonEmpty OTAUpdateFile)))
 -> OTAUpdateInfo -> f OTAUpdateInfo)
-> ((Maybe (NonEmpty OTAUpdateFile)
     -> f (Maybe (NonEmpty OTAUpdateFile)))
    -> Maybe (NonEmpty OTAUpdateFile)
    -> f (Maybe (NonEmpty OTAUpdateFile)))
-> (Maybe (NonEmpty OTAUpdateFile)
    -> f (Maybe (NonEmpty OTAUpdateFile)))
-> OTAUpdateInfo
-> f OTAUpdateInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty OTAUpdateFile)
  (NonEmpty OTAUpdateFile)
  (NonEmpty OTAUpdateFile)
  (NonEmpty OTAUpdateFile)
-> Iso
     (Maybe (NonEmpty OTAUpdateFile))
     (Maybe (NonEmpty OTAUpdateFile))
     (Maybe (NonEmpty OTAUpdateFile))
     (Maybe (NonEmpty OTAUpdateFile))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty OTAUpdateFile)
  (NonEmpty OTAUpdateFile)
  (NonEmpty OTAUpdateFile)
  (NonEmpty OTAUpdateFile)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The status of the OTA update.
oTAUpdateInfo_otaUpdateStatus :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe OTAUpdateStatus)
oTAUpdateInfo_otaUpdateStatus :: (Maybe OTAUpdateStatus -> f (Maybe OTAUpdateStatus))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_otaUpdateStatus = (OTAUpdateInfo -> Maybe OTAUpdateStatus)
-> (OTAUpdateInfo -> Maybe OTAUpdateStatus -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe OTAUpdateStatus)
     (Maybe OTAUpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe OTAUpdateStatus
otaUpdateStatus :: Maybe OTAUpdateStatus
$sel:otaUpdateStatus:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe OTAUpdateStatus
otaUpdateStatus} -> Maybe OTAUpdateStatus
otaUpdateStatus) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe OTAUpdateStatus
a -> OTAUpdateInfo
s {$sel:otaUpdateStatus:OTAUpdateInfo' :: Maybe OTAUpdateStatus
otaUpdateStatus = Maybe OTAUpdateStatus
a} :: OTAUpdateInfo)

-- | The targets of the OTA update.
oTAUpdateInfo_targets :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
oTAUpdateInfo_targets :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_targets = (OTAUpdateInfo -> Maybe (NonEmpty Text))
-> (OTAUpdateInfo -> Maybe (NonEmpty Text) -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe (NonEmpty Text)
targets :: Maybe (NonEmpty Text)
$sel:targets:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe (NonEmpty Text)
targets} -> Maybe (NonEmpty Text)
targets) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe (NonEmpty Text)
a -> OTAUpdateInfo
s {$sel:targets:OTAUpdateInfo' :: Maybe (NonEmpty Text)
targets = Maybe (NonEmpty Text)
a} :: OTAUpdateInfo) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> OTAUpdateInfo -> f OTAUpdateInfo)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> OTAUpdateInfo
-> f OTAUpdateInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IoT job ARN associated with the OTA update.
oTAUpdateInfo_awsIotJobArn :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe Prelude.Text)
oTAUpdateInfo_awsIotJobArn :: (Maybe Text -> f (Maybe Text)) -> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_awsIotJobArn = (OTAUpdateInfo -> Maybe Text)
-> (OTAUpdateInfo -> Maybe Text -> OTAUpdateInfo)
-> Lens OTAUpdateInfo OTAUpdateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe Text
awsIotJobArn :: Maybe Text
$sel:awsIotJobArn:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe Text
awsIotJobArn} -> Maybe Text
awsIotJobArn) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe Text
a -> OTAUpdateInfo
s {$sel:awsIotJobArn:OTAUpdateInfo' :: Maybe Text
awsIotJobArn = Maybe Text
a} :: OTAUpdateInfo)

-- | The date when the OTA update was created.
oTAUpdateInfo_creationDate :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe Prelude.UTCTime)
oTAUpdateInfo_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_creationDate = (OTAUpdateInfo -> Maybe POSIX)
-> (OTAUpdateInfo -> Maybe POSIX -> OTAUpdateInfo)
-> Lens OTAUpdateInfo OTAUpdateInfo (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe POSIX
a -> OTAUpdateInfo
s {$sel:creationDate:OTAUpdateInfo' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: OTAUpdateInfo) ((Maybe POSIX -> f (Maybe POSIX))
 -> OTAUpdateInfo -> f OTAUpdateInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> OTAUpdateInfo
-> f OTAUpdateInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A collection of name\/value pairs
oTAUpdateInfo_additionalParameters :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
oTAUpdateInfo_additionalParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_additionalParameters = (OTAUpdateInfo -> Maybe (HashMap Text Text))
-> (OTAUpdateInfo -> Maybe (HashMap Text Text) -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe (HashMap Text Text)
additionalParameters :: Maybe (HashMap Text Text)
$sel:additionalParameters:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe (HashMap Text Text)
additionalParameters} -> Maybe (HashMap Text Text)
additionalParameters) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe (HashMap Text Text)
a -> OTAUpdateInfo
s {$sel:additionalParameters:OTAUpdateInfo' :: Maybe (HashMap Text Text)
additionalParameters = Maybe (HashMap Text Text)
a} :: OTAUpdateInfo) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> OTAUpdateInfo -> f OTAUpdateInfo)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> OTAUpdateInfo
-> f OTAUpdateInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The OTA update ID.
oTAUpdateInfo_otaUpdateId :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe Prelude.Text)
oTAUpdateInfo_otaUpdateId :: (Maybe Text -> f (Maybe Text)) -> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_otaUpdateId = (OTAUpdateInfo -> Maybe Text)
-> (OTAUpdateInfo -> Maybe Text -> OTAUpdateInfo)
-> Lens OTAUpdateInfo OTAUpdateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe Text
otaUpdateId :: Maybe Text
$sel:otaUpdateId:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe Text
otaUpdateId} -> Maybe Text
otaUpdateId) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe Text
a -> OTAUpdateInfo
s {$sel:otaUpdateId:OTAUpdateInfo' :: Maybe Text
otaUpdateId = Maybe Text
a} :: OTAUpdateInfo)

-- | Error information associated with the OTA update.
oTAUpdateInfo_errorInfo :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe ErrorInfo)
oTAUpdateInfo_errorInfo :: (Maybe ErrorInfo -> f (Maybe ErrorInfo))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_errorInfo = (OTAUpdateInfo -> Maybe ErrorInfo)
-> (OTAUpdateInfo -> Maybe ErrorInfo -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo OTAUpdateInfo (Maybe ErrorInfo) (Maybe ErrorInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe ErrorInfo
errorInfo :: Maybe ErrorInfo
$sel:errorInfo:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe ErrorInfo
errorInfo} -> Maybe ErrorInfo
errorInfo) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe ErrorInfo
a -> OTAUpdateInfo
s {$sel:errorInfo:OTAUpdateInfo' :: Maybe ErrorInfo
errorInfo = Maybe ErrorInfo
a} :: OTAUpdateInfo)

-- | The OTA update ARN.
oTAUpdateInfo_otaUpdateArn :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe Prelude.Text)
oTAUpdateInfo_otaUpdateArn :: (Maybe Text -> f (Maybe Text)) -> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_otaUpdateArn = (OTAUpdateInfo -> Maybe Text)
-> (OTAUpdateInfo -> Maybe Text -> OTAUpdateInfo)
-> Lens OTAUpdateInfo OTAUpdateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe Text
otaUpdateArn :: Maybe Text
$sel:otaUpdateArn:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe Text
otaUpdateArn} -> Maybe Text
otaUpdateArn) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe Text
a -> OTAUpdateInfo
s {$sel:otaUpdateArn:OTAUpdateInfo' :: Maybe Text
otaUpdateArn = Maybe Text
a} :: OTAUpdateInfo)

-- | A description of the OTA update.
oTAUpdateInfo_description :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe Prelude.Text)
oTAUpdateInfo_description :: (Maybe Text -> f (Maybe Text)) -> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_description = (OTAUpdateInfo -> Maybe Text)
-> (OTAUpdateInfo -> Maybe Text -> OTAUpdateInfo)
-> Lens OTAUpdateInfo OTAUpdateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe Text
description :: Maybe Text
$sel:description:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe Text
description} -> Maybe Text
description) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe Text
a -> OTAUpdateInfo
s {$sel:description:OTAUpdateInfo' :: Maybe Text
description = Maybe Text
a} :: OTAUpdateInfo)

-- | Specifies whether the OTA update will continue to run (CONTINUOUS), or
-- will be complete after all those things specified as targets have
-- completed the OTA update (SNAPSHOT). If continuous, the OTA update may
-- also be run on a thing when a change is detected in a target. For
-- example, an OTA update will run on a thing when the thing is added to a
-- target group, even after the OTA update was completed by all things
-- originally in the group.
oTAUpdateInfo_targetSelection :: Lens.Lens' OTAUpdateInfo (Prelude.Maybe TargetSelection)
oTAUpdateInfo_targetSelection :: (Maybe TargetSelection -> f (Maybe TargetSelection))
-> OTAUpdateInfo -> f OTAUpdateInfo
oTAUpdateInfo_targetSelection = (OTAUpdateInfo -> Maybe TargetSelection)
-> (OTAUpdateInfo -> Maybe TargetSelection -> OTAUpdateInfo)
-> Lens
     OTAUpdateInfo
     OTAUpdateInfo
     (Maybe TargetSelection)
     (Maybe TargetSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OTAUpdateInfo' {Maybe TargetSelection
targetSelection :: Maybe TargetSelection
$sel:targetSelection:OTAUpdateInfo' :: OTAUpdateInfo -> Maybe TargetSelection
targetSelection} -> Maybe TargetSelection
targetSelection) (\s :: OTAUpdateInfo
s@OTAUpdateInfo' {} Maybe TargetSelection
a -> OTAUpdateInfo
s {$sel:targetSelection:OTAUpdateInfo' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
a} :: OTAUpdateInfo)

instance Core.FromJSON OTAUpdateInfo where
  parseJSON :: Value -> Parser OTAUpdateInfo
parseJSON =
    String
-> (Object -> Parser OTAUpdateInfo)
-> Value
-> Parser OTAUpdateInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OTAUpdateInfo"
      ( \Object
x ->
          Maybe POSIX
-> Maybe AwsJobExecutionsRolloutConfig
-> Maybe Text
-> Maybe (NonEmpty Protocol)
-> Maybe AwsJobPresignedUrlConfig
-> Maybe (NonEmpty OTAUpdateFile)
-> Maybe OTAUpdateStatus
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe ErrorInfo
-> Maybe Text
-> Maybe Text
-> Maybe TargetSelection
-> OTAUpdateInfo
OTAUpdateInfo'
            (Maybe POSIX
 -> Maybe AwsJobExecutionsRolloutConfig
 -> Maybe Text
 -> Maybe (NonEmpty Protocol)
 -> Maybe AwsJobPresignedUrlConfig
 -> Maybe (NonEmpty OTAUpdateFile)
 -> Maybe OTAUpdateStatus
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe ErrorInfo
 -> Maybe Text
 -> Maybe Text
 -> Maybe TargetSelection
 -> OTAUpdateInfo)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe AwsJobExecutionsRolloutConfig
      -> Maybe Text
      -> Maybe (NonEmpty Protocol)
      -> Maybe AwsJobPresignedUrlConfig
      -> Maybe (NonEmpty OTAUpdateFile)
      -> Maybe OTAUpdateStatus
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastModifiedDate")
            Parser
  (Maybe AwsJobExecutionsRolloutConfig
   -> Maybe Text
   -> Maybe (NonEmpty Protocol)
   -> Maybe AwsJobPresignedUrlConfig
   -> Maybe (NonEmpty OTAUpdateFile)
   -> Maybe OTAUpdateStatus
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe AwsJobExecutionsRolloutConfig)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Protocol)
      -> Maybe AwsJobPresignedUrlConfig
      -> Maybe (NonEmpty OTAUpdateFile)
      -> Maybe OTAUpdateStatus
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsJobExecutionsRolloutConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"awsJobExecutionsRolloutConfig")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Protocol)
   -> Maybe AwsJobPresignedUrlConfig
   -> Maybe (NonEmpty OTAUpdateFile)
   -> Maybe OTAUpdateStatus
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Protocol)
      -> Maybe AwsJobPresignedUrlConfig
      -> Maybe (NonEmpty OTAUpdateFile)
      -> Maybe OTAUpdateStatus
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
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
"awsIotJobId")
            Parser
  (Maybe (NonEmpty Protocol)
   -> Maybe AwsJobPresignedUrlConfig
   -> Maybe (NonEmpty OTAUpdateFile)
   -> Maybe OTAUpdateStatus
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe (NonEmpty Protocol))
-> Parser
     (Maybe AwsJobPresignedUrlConfig
      -> Maybe (NonEmpty OTAUpdateFile)
      -> Maybe OTAUpdateStatus
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Protocol))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"protocols")
            Parser
  (Maybe AwsJobPresignedUrlConfig
   -> Maybe (NonEmpty OTAUpdateFile)
   -> Maybe OTAUpdateStatus
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe AwsJobPresignedUrlConfig)
-> Parser
     (Maybe (NonEmpty OTAUpdateFile)
      -> Maybe OTAUpdateStatus
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsJobPresignedUrlConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"awsJobPresignedUrlConfig")
            Parser
  (Maybe (NonEmpty OTAUpdateFile)
   -> Maybe OTAUpdateStatus
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe (NonEmpty OTAUpdateFile))
-> Parser
     (Maybe OTAUpdateStatus
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty OTAUpdateFile))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"otaUpdateFiles")
            Parser
  (Maybe OTAUpdateStatus
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe OTAUpdateStatus)
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OTAUpdateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"otaUpdateStatus")
            Parser
  (Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targets")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
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
"awsIotJobArn")
            Parser
  (Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationDate")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"additionalParameters"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe ErrorInfo
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> OTAUpdateInfo)
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
"otaUpdateId")
            Parser
  (Maybe ErrorInfo
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> OTAUpdateInfo)
-> Parser (Maybe ErrorInfo)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe TargetSelection -> OTAUpdateInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ErrorInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorInfo")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe TargetSelection -> OTAUpdateInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe TargetSelection -> OTAUpdateInfo)
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
"otaUpdateArn")
            Parser (Maybe Text -> Maybe TargetSelection -> OTAUpdateInfo)
-> Parser (Maybe Text)
-> Parser (Maybe TargetSelection -> OTAUpdateInfo)
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
"description")
            Parser (Maybe TargetSelection -> OTAUpdateInfo)
-> Parser (Maybe TargetSelection) -> Parser OTAUpdateInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TargetSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targetSelection")
      )

instance Prelude.Hashable OTAUpdateInfo

instance Prelude.NFData OTAUpdateInfo