{-# 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.GreengrassV2.Types.DisassociateClientDeviceFromCoreDeviceErrorEntry
-- 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.GreengrassV2.Types.DisassociateClientDeviceFromCoreDeviceErrorEntry where

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

-- | Contains an error that occurs from a request to disassociate a client
-- device from a core device. The
-- <https://docs.aws.amazon.com/greengrass/v2/APIReference/API_BatchDisassociateClientDeviceWithCoreDevice.html BatchDisassociateClientDeviceWithCoreDevice>
-- operation returns a list of these errors.
--
-- /See:/ 'newDisassociateClientDeviceFromCoreDeviceErrorEntry' smart constructor.
data DisassociateClientDeviceFromCoreDeviceErrorEntry = DisassociateClientDeviceFromCoreDeviceErrorEntry'
  { -- | The error code for the request.
    DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
    -- | A message that provides additional information about the error.
    DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The name of the IoT thing whose disassociate request failed.
    DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
thingName :: Prelude.Maybe Prelude.Text
  }
  deriving (DisassociateClientDeviceFromCoreDeviceErrorEntry
-> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Bool
(DisassociateClientDeviceFromCoreDeviceErrorEntry
 -> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Bool)
-> (DisassociateClientDeviceFromCoreDeviceErrorEntry
    -> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Bool)
-> Eq DisassociateClientDeviceFromCoreDeviceErrorEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateClientDeviceFromCoreDeviceErrorEntry
-> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Bool
$c/= :: DisassociateClientDeviceFromCoreDeviceErrorEntry
-> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Bool
== :: DisassociateClientDeviceFromCoreDeviceErrorEntry
-> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Bool
$c== :: DisassociateClientDeviceFromCoreDeviceErrorEntry
-> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Bool
Prelude.Eq, ReadPrec [DisassociateClientDeviceFromCoreDeviceErrorEntry]
ReadPrec DisassociateClientDeviceFromCoreDeviceErrorEntry
Int -> ReadS DisassociateClientDeviceFromCoreDeviceErrorEntry
ReadS [DisassociateClientDeviceFromCoreDeviceErrorEntry]
(Int -> ReadS DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> ReadS [DisassociateClientDeviceFromCoreDeviceErrorEntry]
-> ReadPrec DisassociateClientDeviceFromCoreDeviceErrorEntry
-> ReadPrec [DisassociateClientDeviceFromCoreDeviceErrorEntry]
-> Read DisassociateClientDeviceFromCoreDeviceErrorEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateClientDeviceFromCoreDeviceErrorEntry]
$creadListPrec :: ReadPrec [DisassociateClientDeviceFromCoreDeviceErrorEntry]
readPrec :: ReadPrec DisassociateClientDeviceFromCoreDeviceErrorEntry
$creadPrec :: ReadPrec DisassociateClientDeviceFromCoreDeviceErrorEntry
readList :: ReadS [DisassociateClientDeviceFromCoreDeviceErrorEntry]
$creadList :: ReadS [DisassociateClientDeviceFromCoreDeviceErrorEntry]
readsPrec :: Int -> ReadS DisassociateClientDeviceFromCoreDeviceErrorEntry
$creadsPrec :: Int -> ReadS DisassociateClientDeviceFromCoreDeviceErrorEntry
Prelude.Read, Int -> DisassociateClientDeviceFromCoreDeviceErrorEntry -> ShowS
[DisassociateClientDeviceFromCoreDeviceErrorEntry] -> ShowS
DisassociateClientDeviceFromCoreDeviceErrorEntry -> String
(Int -> DisassociateClientDeviceFromCoreDeviceErrorEntry -> ShowS)
-> (DisassociateClientDeviceFromCoreDeviceErrorEntry -> String)
-> ([DisassociateClientDeviceFromCoreDeviceErrorEntry] -> ShowS)
-> Show DisassociateClientDeviceFromCoreDeviceErrorEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateClientDeviceFromCoreDeviceErrorEntry] -> ShowS
$cshowList :: [DisassociateClientDeviceFromCoreDeviceErrorEntry] -> ShowS
show :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> String
$cshow :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> String
showsPrec :: Int -> DisassociateClientDeviceFromCoreDeviceErrorEntry -> ShowS
$cshowsPrec :: Int -> DisassociateClientDeviceFromCoreDeviceErrorEntry -> ShowS
Prelude.Show, (forall x.
 DisassociateClientDeviceFromCoreDeviceErrorEntry
 -> Rep DisassociateClientDeviceFromCoreDeviceErrorEntry x)
-> (forall x.
    Rep DisassociateClientDeviceFromCoreDeviceErrorEntry x
    -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Generic DisassociateClientDeviceFromCoreDeviceErrorEntry
forall x.
Rep DisassociateClientDeviceFromCoreDeviceErrorEntry x
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
forall x.
DisassociateClientDeviceFromCoreDeviceErrorEntry
-> Rep DisassociateClientDeviceFromCoreDeviceErrorEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateClientDeviceFromCoreDeviceErrorEntry x
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
$cfrom :: forall x.
DisassociateClientDeviceFromCoreDeviceErrorEntry
-> Rep DisassociateClientDeviceFromCoreDeviceErrorEntry x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateClientDeviceFromCoreDeviceErrorEntry' 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:
--
-- 'code', 'disassociateClientDeviceFromCoreDeviceErrorEntry_code' - The error code for the request.
--
-- 'message', 'disassociateClientDeviceFromCoreDeviceErrorEntry_message' - A message that provides additional information about the error.
--
-- 'thingName', 'disassociateClientDeviceFromCoreDeviceErrorEntry_thingName' - The name of the IoT thing whose disassociate request failed.
newDisassociateClientDeviceFromCoreDeviceErrorEntry ::
  DisassociateClientDeviceFromCoreDeviceErrorEntry
newDisassociateClientDeviceFromCoreDeviceErrorEntry :: DisassociateClientDeviceFromCoreDeviceErrorEntry
newDisassociateClientDeviceFromCoreDeviceErrorEntry =
  DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
DisassociateClientDeviceFromCoreDeviceErrorEntry'
    { $sel:code:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
code =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:message:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:thingName:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
thingName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The error code for the request.
disassociateClientDeviceFromCoreDeviceErrorEntry_code :: Lens.Lens' DisassociateClientDeviceFromCoreDeviceErrorEntry (Prelude.Maybe Prelude.Text)
disassociateClientDeviceFromCoreDeviceErrorEntry_code :: (Maybe Text -> f (Maybe Text))
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
-> f DisassociateClientDeviceFromCoreDeviceErrorEntry
disassociateClientDeviceFromCoreDeviceErrorEntry_code = (DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text)
-> (DisassociateClientDeviceFromCoreDeviceErrorEntry
    -> Maybe Text -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Lens
     DisassociateClientDeviceFromCoreDeviceErrorEntry
     DisassociateClientDeviceFromCoreDeviceErrorEntry
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateClientDeviceFromCoreDeviceErrorEntry' {Maybe Text
code :: Maybe Text
$sel:code:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
code} -> Maybe Text
code) (\s :: DisassociateClientDeviceFromCoreDeviceErrorEntry
s@DisassociateClientDeviceFromCoreDeviceErrorEntry' {} Maybe Text
a -> DisassociateClientDeviceFromCoreDeviceErrorEntry
s {$sel:code:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
code = Maybe Text
a} :: DisassociateClientDeviceFromCoreDeviceErrorEntry)

-- | A message that provides additional information about the error.
disassociateClientDeviceFromCoreDeviceErrorEntry_message :: Lens.Lens' DisassociateClientDeviceFromCoreDeviceErrorEntry (Prelude.Maybe Prelude.Text)
disassociateClientDeviceFromCoreDeviceErrorEntry_message :: (Maybe Text -> f (Maybe Text))
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
-> f DisassociateClientDeviceFromCoreDeviceErrorEntry
disassociateClientDeviceFromCoreDeviceErrorEntry_message = (DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text)
-> (DisassociateClientDeviceFromCoreDeviceErrorEntry
    -> Maybe Text -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Lens
     DisassociateClientDeviceFromCoreDeviceErrorEntry
     DisassociateClientDeviceFromCoreDeviceErrorEntry
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateClientDeviceFromCoreDeviceErrorEntry' {Maybe Text
message :: Maybe Text
$sel:message:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
message} -> Maybe Text
message) (\s :: DisassociateClientDeviceFromCoreDeviceErrorEntry
s@DisassociateClientDeviceFromCoreDeviceErrorEntry' {} Maybe Text
a -> DisassociateClientDeviceFromCoreDeviceErrorEntry
s {$sel:message:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
message = Maybe Text
a} :: DisassociateClientDeviceFromCoreDeviceErrorEntry)

-- | The name of the IoT thing whose disassociate request failed.
disassociateClientDeviceFromCoreDeviceErrorEntry_thingName :: Lens.Lens' DisassociateClientDeviceFromCoreDeviceErrorEntry (Prelude.Maybe Prelude.Text)
disassociateClientDeviceFromCoreDeviceErrorEntry_thingName :: (Maybe Text -> f (Maybe Text))
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
-> f DisassociateClientDeviceFromCoreDeviceErrorEntry
disassociateClientDeviceFromCoreDeviceErrorEntry_thingName = (DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text)
-> (DisassociateClientDeviceFromCoreDeviceErrorEntry
    -> Maybe Text -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Lens
     DisassociateClientDeviceFromCoreDeviceErrorEntry
     DisassociateClientDeviceFromCoreDeviceErrorEntry
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateClientDeviceFromCoreDeviceErrorEntry' {Maybe Text
thingName :: Maybe Text
$sel:thingName:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
thingName} -> Maybe Text
thingName) (\s :: DisassociateClientDeviceFromCoreDeviceErrorEntry
s@DisassociateClientDeviceFromCoreDeviceErrorEntry' {} Maybe Text
a -> DisassociateClientDeviceFromCoreDeviceErrorEntry
s {$sel:thingName:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
thingName = Maybe Text
a} :: DisassociateClientDeviceFromCoreDeviceErrorEntry)

instance
  Core.FromJSON
    DisassociateClientDeviceFromCoreDeviceErrorEntry
  where
  parseJSON :: Value -> Parser DisassociateClientDeviceFromCoreDeviceErrorEntry
parseJSON =
    String
-> (Object
    -> Parser DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Value
-> Parser DisassociateClientDeviceFromCoreDeviceErrorEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DisassociateClientDeviceFromCoreDeviceErrorEntry"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
DisassociateClientDeviceFromCoreDeviceErrorEntry'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
forall (f :: * -> *) a b. Functor 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
"code")
              Parser
  (Maybe Text
   -> Maybe Text -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
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
"message")
              Parser
  (Maybe Text -> DisassociateClientDeviceFromCoreDeviceErrorEntry)
-> Parser (Maybe Text)
-> Parser DisassociateClientDeviceFromCoreDeviceErrorEntry
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
"thingName")
      )

instance
  Prelude.Hashable
    DisassociateClientDeviceFromCoreDeviceErrorEntry

instance
  Prelude.NFData
    DisassociateClientDeviceFromCoreDeviceErrorEntry