{-# 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.IoTAnalytics.Types.BatchPutMessageErrorEntry -- 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.IoTAnalytics.Types.BatchPutMessageErrorEntry 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 -- | Contains informations about errors. -- -- /See:/ 'newBatchPutMessageErrorEntry' smart constructor. data BatchPutMessageErrorEntry = BatchPutMessageErrorEntry' { -- | The code associated with the error. errorCode :: Prelude.Maybe Prelude.Text, -- | The message associated with the error. errorMessage :: Prelude.Maybe Prelude.Text, -- | The ID of the message that caused the error. See the value corresponding -- to the @messageId@ key in the message object. messageId :: Prelude.Maybe Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'BatchPutMessageErrorEntry' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'errorCode', 'batchPutMessageErrorEntry_errorCode' - The code associated with the error. -- -- 'errorMessage', 'batchPutMessageErrorEntry_errorMessage' - The message associated with the error. -- -- 'messageId', 'batchPutMessageErrorEntry_messageId' - The ID of the message that caused the error. See the value corresponding -- to the @messageId@ key in the message object. newBatchPutMessageErrorEntry :: BatchPutMessageErrorEntry newBatchPutMessageErrorEntry = BatchPutMessageErrorEntry' { errorCode = Prelude.Nothing, errorMessage = Prelude.Nothing, messageId = Prelude.Nothing } -- | The code associated with the error. batchPutMessageErrorEntry_errorCode :: Lens.Lens' BatchPutMessageErrorEntry (Prelude.Maybe Prelude.Text) batchPutMessageErrorEntry_errorCode = Lens.lens (\BatchPutMessageErrorEntry' {errorCode} -> errorCode) (\s@BatchPutMessageErrorEntry' {} a -> s {errorCode = a} :: BatchPutMessageErrorEntry) -- | The message associated with the error. batchPutMessageErrorEntry_errorMessage :: Lens.Lens' BatchPutMessageErrorEntry (Prelude.Maybe Prelude.Text) batchPutMessageErrorEntry_errorMessage = Lens.lens (\BatchPutMessageErrorEntry' {errorMessage} -> errorMessage) (\s@BatchPutMessageErrorEntry' {} a -> s {errorMessage = a} :: BatchPutMessageErrorEntry) -- | The ID of the message that caused the error. See the value corresponding -- to the @messageId@ key in the message object. batchPutMessageErrorEntry_messageId :: Lens.Lens' BatchPutMessageErrorEntry (Prelude.Maybe Prelude.Text) batchPutMessageErrorEntry_messageId = Lens.lens (\BatchPutMessageErrorEntry' {messageId} -> messageId) (\s@BatchPutMessageErrorEntry' {} a -> s {messageId = a} :: BatchPutMessageErrorEntry) instance Data.FromJSON BatchPutMessageErrorEntry where parseJSON = Data.withObject "BatchPutMessageErrorEntry" ( \x -> BatchPutMessageErrorEntry' Prelude.<$> (x Data..:? "errorCode") Prelude.<*> (x Data..:? "errorMessage") Prelude.<*> (x Data..:? "messageId") ) instance Prelude.Hashable BatchPutMessageErrorEntry where hashWithSalt _salt BatchPutMessageErrorEntry' {..} = _salt `Prelude.hashWithSalt` errorCode `Prelude.hashWithSalt` errorMessage `Prelude.hashWithSalt` messageId instance Prelude.NFData BatchPutMessageErrorEntry where rnf BatchPutMessageErrorEntry' {..} = Prelude.rnf errorCode `Prelude.seq` Prelude.rnf errorMessage `Prelude.seq` Prelude.rnf messageId