{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTFleetWise.UpdateDecoderManifest
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a decoder manifest.
--
-- A decoder manifest can only be updated when the status is @DRAFT@. Only
-- @ACTIVE@ decoder manifests can be associated with vehicles.
module Amazonka.IoTFleetWise.UpdateDecoderManifest
  ( -- * Creating a Request
    UpdateDecoderManifest (..),
    newUpdateDecoderManifest,

    -- * Request Lenses
    updateDecoderManifest_description,
    updateDecoderManifest_networkInterfacesToAdd,
    updateDecoderManifest_networkInterfacesToRemove,
    updateDecoderManifest_networkInterfacesToUpdate,
    updateDecoderManifest_signalDecodersToAdd,
    updateDecoderManifest_signalDecodersToRemove,
    updateDecoderManifest_signalDecodersToUpdate,
    updateDecoderManifest_status,
    updateDecoderManifest_name,

    -- * Destructuring the Response
    UpdateDecoderManifestResponse (..),
    newUpdateDecoderManifestResponse,

    -- * Response Lenses
    updateDecoderManifestResponse_httpStatus,
    updateDecoderManifestResponse_name,
    updateDecoderManifestResponse_arn,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTFleetWise.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateDecoderManifest' smart constructor.
data UpdateDecoderManifest = UpdateDecoderManifest'
  { -- | A brief description of the decoder manifest to update.
    UpdateDecoderManifest -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A list of information about the network interfaces to add to the decoder
    -- manifest.
    UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd :: Prelude.Maybe (Prelude.NonEmpty NetworkInterface),
    -- | A list of network interfaces to remove from the decoder manifest.
    UpdateDecoderManifest -> Maybe (NonEmpty Text)
networkInterfacesToRemove :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A list of information about the network interfaces to update in the
    -- decoder manifest.
    UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate :: Prelude.Maybe (Prelude.NonEmpty NetworkInterface),
    -- | A list of information about decoding additional signals to add to the
    -- decoder manifest.
    UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd :: Prelude.Maybe (Prelude.NonEmpty SignalDecoder),
    -- | A list of signal decoders to remove from the decoder manifest.
    UpdateDecoderManifest -> Maybe (NonEmpty Text)
signalDecodersToRemove :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A list of updated information about decoding signals to update in the
    -- decoder manifest.
    UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate :: Prelude.Maybe (Prelude.NonEmpty SignalDecoder),
    -- | The state of the decoder manifest. If the status is @ACTIVE@, the
    -- decoder manifest can\'t be edited. If the status is @DRAFT@, you can
    -- edit the decoder manifest.
    UpdateDecoderManifest -> Maybe ManifestStatus
status :: Prelude.Maybe ManifestStatus,
    -- | The name of the decoder manifest to update.
    UpdateDecoderManifest -> Text
name :: Prelude.Text
  }
  deriving (UpdateDecoderManifest -> UpdateDecoderManifest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDecoderManifest -> UpdateDecoderManifest -> Bool
$c/= :: UpdateDecoderManifest -> UpdateDecoderManifest -> Bool
== :: UpdateDecoderManifest -> UpdateDecoderManifest -> Bool
$c== :: UpdateDecoderManifest -> UpdateDecoderManifest -> Bool
Prelude.Eq, ReadPrec [UpdateDecoderManifest]
ReadPrec UpdateDecoderManifest
Int -> ReadS UpdateDecoderManifest
ReadS [UpdateDecoderManifest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDecoderManifest]
$creadListPrec :: ReadPrec [UpdateDecoderManifest]
readPrec :: ReadPrec UpdateDecoderManifest
$creadPrec :: ReadPrec UpdateDecoderManifest
readList :: ReadS [UpdateDecoderManifest]
$creadList :: ReadS [UpdateDecoderManifest]
readsPrec :: Int -> ReadS UpdateDecoderManifest
$creadsPrec :: Int -> ReadS UpdateDecoderManifest
Prelude.Read, Int -> UpdateDecoderManifest -> ShowS
[UpdateDecoderManifest] -> ShowS
UpdateDecoderManifest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDecoderManifest] -> ShowS
$cshowList :: [UpdateDecoderManifest] -> ShowS
show :: UpdateDecoderManifest -> String
$cshow :: UpdateDecoderManifest -> String
showsPrec :: Int -> UpdateDecoderManifest -> ShowS
$cshowsPrec :: Int -> UpdateDecoderManifest -> ShowS
Prelude.Show, forall x. Rep UpdateDecoderManifest x -> UpdateDecoderManifest
forall x. UpdateDecoderManifest -> Rep UpdateDecoderManifest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDecoderManifest x -> UpdateDecoderManifest
$cfrom :: forall x. UpdateDecoderManifest -> Rep UpdateDecoderManifest x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDecoderManifest' 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:
--
-- 'description', 'updateDecoderManifest_description' - A brief description of the decoder manifest to update.
--
-- 'networkInterfacesToAdd', 'updateDecoderManifest_networkInterfacesToAdd' - A list of information about the network interfaces to add to the decoder
-- manifest.
--
-- 'networkInterfacesToRemove', 'updateDecoderManifest_networkInterfacesToRemove' - A list of network interfaces to remove from the decoder manifest.
--
-- 'networkInterfacesToUpdate', 'updateDecoderManifest_networkInterfacesToUpdate' - A list of information about the network interfaces to update in the
-- decoder manifest.
--
-- 'signalDecodersToAdd', 'updateDecoderManifest_signalDecodersToAdd' - A list of information about decoding additional signals to add to the
-- decoder manifest.
--
-- 'signalDecodersToRemove', 'updateDecoderManifest_signalDecodersToRemove' - A list of signal decoders to remove from the decoder manifest.
--
-- 'signalDecodersToUpdate', 'updateDecoderManifest_signalDecodersToUpdate' - A list of updated information about decoding signals to update in the
-- decoder manifest.
--
-- 'status', 'updateDecoderManifest_status' - The state of the decoder manifest. If the status is @ACTIVE@, the
-- decoder manifest can\'t be edited. If the status is @DRAFT@, you can
-- edit the decoder manifest.
--
-- 'name', 'updateDecoderManifest_name' - The name of the decoder manifest to update.
newUpdateDecoderManifest ::
  -- | 'name'
  Prelude.Text ->
  UpdateDecoderManifest
newUpdateDecoderManifest :: Text -> UpdateDecoderManifest
newUpdateDecoderManifest Text
pName_ =
  UpdateDecoderManifest'
    { $sel:description:UpdateDecoderManifest' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfacesToAdd:UpdateDecoderManifest' :: Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfacesToRemove:UpdateDecoderManifest' :: Maybe (NonEmpty Text)
networkInterfacesToRemove = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfacesToUpdate:UpdateDecoderManifest' :: Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate = forall a. Maybe a
Prelude.Nothing,
      $sel:signalDecodersToAdd:UpdateDecoderManifest' :: Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd = forall a. Maybe a
Prelude.Nothing,
      $sel:signalDecodersToRemove:UpdateDecoderManifest' :: Maybe (NonEmpty Text)
signalDecodersToRemove = forall a. Maybe a
Prelude.Nothing,
      $sel:signalDecodersToUpdate:UpdateDecoderManifest' :: Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateDecoderManifest' :: Maybe ManifestStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateDecoderManifest' :: Text
name = Text
pName_
    }

-- | A brief description of the decoder manifest to update.
updateDecoderManifest_description :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe Prelude.Text)
updateDecoderManifest_description :: Lens' UpdateDecoderManifest (Maybe Text)
updateDecoderManifest_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe Text
a -> UpdateDecoderManifest
s {$sel:description:UpdateDecoderManifest' :: Maybe Text
description = Maybe Text
a} :: UpdateDecoderManifest)

-- | A list of information about the network interfaces to add to the decoder
-- manifest.
updateDecoderManifest_networkInterfacesToAdd :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe (Prelude.NonEmpty NetworkInterface))
updateDecoderManifest_networkInterfacesToAdd :: Lens' UpdateDecoderManifest (Maybe (NonEmpty NetworkInterface))
updateDecoderManifest_networkInterfacesToAdd = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd :: Maybe (NonEmpty NetworkInterface)
$sel:networkInterfacesToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd} -> Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe (NonEmpty NetworkInterface)
a -> UpdateDecoderManifest
s {$sel:networkInterfacesToAdd:UpdateDecoderManifest' :: Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd = Maybe (NonEmpty NetworkInterface)
a} :: UpdateDecoderManifest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of network interfaces to remove from the decoder manifest.
updateDecoderManifest_networkInterfacesToRemove :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateDecoderManifest_networkInterfacesToRemove :: Lens' UpdateDecoderManifest (Maybe (NonEmpty Text))
updateDecoderManifest_networkInterfacesToRemove = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe (NonEmpty Text)
networkInterfacesToRemove :: Maybe (NonEmpty Text)
$sel:networkInterfacesToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
networkInterfacesToRemove} -> Maybe (NonEmpty Text)
networkInterfacesToRemove) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe (NonEmpty Text)
a -> UpdateDecoderManifest
s {$sel:networkInterfacesToRemove:UpdateDecoderManifest' :: Maybe (NonEmpty Text)
networkInterfacesToRemove = Maybe (NonEmpty Text)
a} :: UpdateDecoderManifest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of information about the network interfaces to update in the
-- decoder manifest.
updateDecoderManifest_networkInterfacesToUpdate :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe (Prelude.NonEmpty NetworkInterface))
updateDecoderManifest_networkInterfacesToUpdate :: Lens' UpdateDecoderManifest (Maybe (NonEmpty NetworkInterface))
updateDecoderManifest_networkInterfacesToUpdate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate :: Maybe (NonEmpty NetworkInterface)
$sel:networkInterfacesToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate} -> Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe (NonEmpty NetworkInterface)
a -> UpdateDecoderManifest
s {$sel:networkInterfacesToUpdate:UpdateDecoderManifest' :: Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate = Maybe (NonEmpty NetworkInterface)
a} :: UpdateDecoderManifest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of information about decoding additional signals to add to the
-- decoder manifest.
updateDecoderManifest_signalDecodersToAdd :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe (Prelude.NonEmpty SignalDecoder))
updateDecoderManifest_signalDecodersToAdd :: Lens' UpdateDecoderManifest (Maybe (NonEmpty SignalDecoder))
updateDecoderManifest_signalDecodersToAdd = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd :: Maybe (NonEmpty SignalDecoder)
$sel:signalDecodersToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd} -> Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe (NonEmpty SignalDecoder)
a -> UpdateDecoderManifest
s {$sel:signalDecodersToAdd:UpdateDecoderManifest' :: Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd = Maybe (NonEmpty SignalDecoder)
a} :: UpdateDecoderManifest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of signal decoders to remove from the decoder manifest.
updateDecoderManifest_signalDecodersToRemove :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateDecoderManifest_signalDecodersToRemove :: Lens' UpdateDecoderManifest (Maybe (NonEmpty Text))
updateDecoderManifest_signalDecodersToRemove = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe (NonEmpty Text)
signalDecodersToRemove :: Maybe (NonEmpty Text)
$sel:signalDecodersToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
signalDecodersToRemove} -> Maybe (NonEmpty Text)
signalDecodersToRemove) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe (NonEmpty Text)
a -> UpdateDecoderManifest
s {$sel:signalDecodersToRemove:UpdateDecoderManifest' :: Maybe (NonEmpty Text)
signalDecodersToRemove = Maybe (NonEmpty Text)
a} :: UpdateDecoderManifest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of updated information about decoding signals to update in the
-- decoder manifest.
updateDecoderManifest_signalDecodersToUpdate :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe (Prelude.NonEmpty SignalDecoder))
updateDecoderManifest_signalDecodersToUpdate :: Lens' UpdateDecoderManifest (Maybe (NonEmpty SignalDecoder))
updateDecoderManifest_signalDecodersToUpdate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate :: Maybe (NonEmpty SignalDecoder)
$sel:signalDecodersToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate} -> Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe (NonEmpty SignalDecoder)
a -> UpdateDecoderManifest
s {$sel:signalDecodersToUpdate:UpdateDecoderManifest' :: Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate = Maybe (NonEmpty SignalDecoder)
a} :: UpdateDecoderManifest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The state of the decoder manifest. If the status is @ACTIVE@, the
-- decoder manifest can\'t be edited. If the status is @DRAFT@, you can
-- edit the decoder manifest.
updateDecoderManifest_status :: Lens.Lens' UpdateDecoderManifest (Prelude.Maybe ManifestStatus)
updateDecoderManifest_status :: Lens' UpdateDecoderManifest (Maybe ManifestStatus)
updateDecoderManifest_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Maybe ManifestStatus
status :: Maybe ManifestStatus
$sel:status:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe ManifestStatus
status} -> Maybe ManifestStatus
status) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Maybe ManifestStatus
a -> UpdateDecoderManifest
s {$sel:status:UpdateDecoderManifest' :: Maybe ManifestStatus
status = Maybe ManifestStatus
a} :: UpdateDecoderManifest)

-- | The name of the decoder manifest to update.
updateDecoderManifest_name :: Lens.Lens' UpdateDecoderManifest Prelude.Text
updateDecoderManifest_name :: Lens' UpdateDecoderManifest Text
updateDecoderManifest_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifest' {Text
name :: Text
$sel:name:UpdateDecoderManifest' :: UpdateDecoderManifest -> Text
name} -> Text
name) (\s :: UpdateDecoderManifest
s@UpdateDecoderManifest' {} Text
a -> UpdateDecoderManifest
s {$sel:name:UpdateDecoderManifest' :: Text
name = Text
a} :: UpdateDecoderManifest)

instance Core.AWSRequest UpdateDecoderManifest where
  type
    AWSResponse UpdateDecoderManifest =
      UpdateDecoderManifestResponse
  request :: (Service -> Service)
-> UpdateDecoderManifest -> Request UpdateDecoderManifest
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateDecoderManifest
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateDecoderManifest)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> Text -> UpdateDecoderManifestResponse
UpdateDecoderManifestResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"arn")
      )

instance Prelude.Hashable UpdateDecoderManifest where
  hashWithSalt :: Int -> UpdateDecoderManifest -> Int
hashWithSalt Int
_salt UpdateDecoderManifest' {Maybe (NonEmpty Text)
Maybe (NonEmpty NetworkInterface)
Maybe (NonEmpty SignalDecoder)
Maybe Text
Maybe ManifestStatus
Text
name :: Text
status :: Maybe ManifestStatus
signalDecodersToUpdate :: Maybe (NonEmpty SignalDecoder)
signalDecodersToRemove :: Maybe (NonEmpty Text)
signalDecodersToAdd :: Maybe (NonEmpty SignalDecoder)
networkInterfacesToUpdate :: Maybe (NonEmpty NetworkInterface)
networkInterfacesToRemove :: Maybe (NonEmpty Text)
networkInterfacesToAdd :: Maybe (NonEmpty NetworkInterface)
description :: Maybe Text
$sel:name:UpdateDecoderManifest' :: UpdateDecoderManifest -> Text
$sel:status:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe ManifestStatus
$sel:signalDecodersToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
$sel:signalDecodersToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
$sel:signalDecodersToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
$sel:networkInterfacesToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
$sel:networkInterfacesToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
$sel:networkInterfacesToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
$sel:description:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
networkInterfacesToRemove
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
signalDecodersToRemove
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ManifestStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData UpdateDecoderManifest where
  rnf :: UpdateDecoderManifest -> ()
rnf UpdateDecoderManifest' {Maybe (NonEmpty Text)
Maybe (NonEmpty NetworkInterface)
Maybe (NonEmpty SignalDecoder)
Maybe Text
Maybe ManifestStatus
Text
name :: Text
status :: Maybe ManifestStatus
signalDecodersToUpdate :: Maybe (NonEmpty SignalDecoder)
signalDecodersToRemove :: Maybe (NonEmpty Text)
signalDecodersToAdd :: Maybe (NonEmpty SignalDecoder)
networkInterfacesToUpdate :: Maybe (NonEmpty NetworkInterface)
networkInterfacesToRemove :: Maybe (NonEmpty Text)
networkInterfacesToAdd :: Maybe (NonEmpty NetworkInterface)
description :: Maybe Text
$sel:name:UpdateDecoderManifest' :: UpdateDecoderManifest -> Text
$sel:status:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe ManifestStatus
$sel:signalDecodersToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
$sel:signalDecodersToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
$sel:signalDecodersToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
$sel:networkInterfacesToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
$sel:networkInterfacesToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
$sel:networkInterfacesToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
$sel:description:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
networkInterfacesToRemove
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
signalDecodersToRemove
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ManifestStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders UpdateDecoderManifest where
  toHeaders :: UpdateDecoderManifest -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"IoTAutobahnControlPlane.UpdateDecoderManifest" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateDecoderManifest where
  toJSON :: UpdateDecoderManifest -> Value
toJSON UpdateDecoderManifest' {Maybe (NonEmpty Text)
Maybe (NonEmpty NetworkInterface)
Maybe (NonEmpty SignalDecoder)
Maybe Text
Maybe ManifestStatus
Text
name :: Text
status :: Maybe ManifestStatus
signalDecodersToUpdate :: Maybe (NonEmpty SignalDecoder)
signalDecodersToRemove :: Maybe (NonEmpty Text)
signalDecodersToAdd :: Maybe (NonEmpty SignalDecoder)
networkInterfacesToUpdate :: Maybe (NonEmpty NetworkInterface)
networkInterfacesToRemove :: Maybe (NonEmpty Text)
networkInterfacesToAdd :: Maybe (NonEmpty NetworkInterface)
description :: Maybe Text
$sel:name:UpdateDecoderManifest' :: UpdateDecoderManifest -> Text
$sel:status:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe ManifestStatus
$sel:signalDecodersToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
$sel:signalDecodersToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
$sel:signalDecodersToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty SignalDecoder)
$sel:networkInterfacesToUpdate:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
$sel:networkInterfacesToRemove:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty Text)
$sel:networkInterfacesToAdd:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe (NonEmpty NetworkInterface)
$sel:description:UpdateDecoderManifest' :: UpdateDecoderManifest -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"networkInterfacesToAdd" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty NetworkInterface)
networkInterfacesToAdd,
            (Key
"networkInterfacesToRemove" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
networkInterfacesToRemove,
            (Key
"networkInterfacesToUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty NetworkInterface)
networkInterfacesToUpdate,
            (Key
"signalDecodersToAdd" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SignalDecoder)
signalDecodersToAdd,
            (Key
"signalDecodersToRemove" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
signalDecodersToRemove,
            (Key
"signalDecodersToUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SignalDecoder)
signalDecodersToUpdate,
            (Key
"status" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ManifestStatus
status,
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath UpdateDecoderManifest where
  toPath :: UpdateDecoderManifest -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery UpdateDecoderManifest where
  toQuery :: UpdateDecoderManifest -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateDecoderManifestResponse' smart constructor.
data UpdateDecoderManifestResponse = UpdateDecoderManifestResponse'
  { -- | The response's http status code.
    UpdateDecoderManifestResponse -> Int
httpStatus :: Prelude.Int,
    -- | The name of the updated decoder manifest.
    UpdateDecoderManifestResponse -> Text
name :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the updated decoder manifest.
    UpdateDecoderManifestResponse -> Text
arn :: Prelude.Text
  }
  deriving (UpdateDecoderManifestResponse
-> UpdateDecoderManifestResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDecoderManifestResponse
-> UpdateDecoderManifestResponse -> Bool
$c/= :: UpdateDecoderManifestResponse
-> UpdateDecoderManifestResponse -> Bool
== :: UpdateDecoderManifestResponse
-> UpdateDecoderManifestResponse -> Bool
$c== :: UpdateDecoderManifestResponse
-> UpdateDecoderManifestResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDecoderManifestResponse]
ReadPrec UpdateDecoderManifestResponse
Int -> ReadS UpdateDecoderManifestResponse
ReadS [UpdateDecoderManifestResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDecoderManifestResponse]
$creadListPrec :: ReadPrec [UpdateDecoderManifestResponse]
readPrec :: ReadPrec UpdateDecoderManifestResponse
$creadPrec :: ReadPrec UpdateDecoderManifestResponse
readList :: ReadS [UpdateDecoderManifestResponse]
$creadList :: ReadS [UpdateDecoderManifestResponse]
readsPrec :: Int -> ReadS UpdateDecoderManifestResponse
$creadsPrec :: Int -> ReadS UpdateDecoderManifestResponse
Prelude.Read, Int -> UpdateDecoderManifestResponse -> ShowS
[UpdateDecoderManifestResponse] -> ShowS
UpdateDecoderManifestResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDecoderManifestResponse] -> ShowS
$cshowList :: [UpdateDecoderManifestResponse] -> ShowS
show :: UpdateDecoderManifestResponse -> String
$cshow :: UpdateDecoderManifestResponse -> String
showsPrec :: Int -> UpdateDecoderManifestResponse -> ShowS
$cshowsPrec :: Int -> UpdateDecoderManifestResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateDecoderManifestResponse x
-> UpdateDecoderManifestResponse
forall x.
UpdateDecoderManifestResponse
-> Rep UpdateDecoderManifestResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDecoderManifestResponse x
-> UpdateDecoderManifestResponse
$cfrom :: forall x.
UpdateDecoderManifestResponse
-> Rep UpdateDecoderManifestResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDecoderManifestResponse' 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:
--
-- 'httpStatus', 'updateDecoderManifestResponse_httpStatus' - The response's http status code.
--
-- 'name', 'updateDecoderManifestResponse_name' - The name of the updated decoder manifest.
--
-- 'arn', 'updateDecoderManifestResponse_arn' - The Amazon Resource Name (ARN) of the updated decoder manifest.
newUpdateDecoderManifestResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  UpdateDecoderManifestResponse
newUpdateDecoderManifestResponse :: Int -> Text -> Text -> UpdateDecoderManifestResponse
newUpdateDecoderManifestResponse
  Int
pHttpStatus_
  Text
pName_
  Text
pArn_ =
    UpdateDecoderManifestResponse'
      { $sel:httpStatus:UpdateDecoderManifestResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:name:UpdateDecoderManifestResponse' :: Text
name = Text
pName_,
        $sel:arn:UpdateDecoderManifestResponse' :: Text
arn = Text
pArn_
      }

-- | The response's http status code.
updateDecoderManifestResponse_httpStatus :: Lens.Lens' UpdateDecoderManifestResponse Prelude.Int
updateDecoderManifestResponse_httpStatus :: Lens' UpdateDecoderManifestResponse Int
updateDecoderManifestResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifestResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDecoderManifestResponse' :: UpdateDecoderManifestResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDecoderManifestResponse
s@UpdateDecoderManifestResponse' {} Int
a -> UpdateDecoderManifestResponse
s {$sel:httpStatus:UpdateDecoderManifestResponse' :: Int
httpStatus = Int
a} :: UpdateDecoderManifestResponse)

-- | The name of the updated decoder manifest.
updateDecoderManifestResponse_name :: Lens.Lens' UpdateDecoderManifestResponse Prelude.Text
updateDecoderManifestResponse_name :: Lens' UpdateDecoderManifestResponse Text
updateDecoderManifestResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifestResponse' {Text
name :: Text
$sel:name:UpdateDecoderManifestResponse' :: UpdateDecoderManifestResponse -> Text
name} -> Text
name) (\s :: UpdateDecoderManifestResponse
s@UpdateDecoderManifestResponse' {} Text
a -> UpdateDecoderManifestResponse
s {$sel:name:UpdateDecoderManifestResponse' :: Text
name = Text
a} :: UpdateDecoderManifestResponse)

-- | The Amazon Resource Name (ARN) of the updated decoder manifest.
updateDecoderManifestResponse_arn :: Lens.Lens' UpdateDecoderManifestResponse Prelude.Text
updateDecoderManifestResponse_arn :: Lens' UpdateDecoderManifestResponse Text
updateDecoderManifestResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDecoderManifestResponse' {Text
arn :: Text
$sel:arn:UpdateDecoderManifestResponse' :: UpdateDecoderManifestResponse -> Text
arn} -> Text
arn) (\s :: UpdateDecoderManifestResponse
s@UpdateDecoderManifestResponse' {} Text
a -> UpdateDecoderManifestResponse
s {$sel:arn:UpdateDecoderManifestResponse' :: Text
arn = Text
a} :: UpdateDecoderManifestResponse)

instance Prelude.NFData UpdateDecoderManifestResponse where
  rnf :: UpdateDecoderManifestResponse -> ()
rnf UpdateDecoderManifestResponse' {Int
Text
arn :: Text
name :: Text
httpStatus :: Int
$sel:arn:UpdateDecoderManifestResponse' :: UpdateDecoderManifestResponse -> Text
$sel:name:UpdateDecoderManifestResponse' :: UpdateDecoderManifestResponse -> Text
$sel:httpStatus:UpdateDecoderManifestResponse' :: UpdateDecoderManifestResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn