{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GreengrassV2.Types.DisassociateClientDeviceFromCoreDeviceErrorEntry 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 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
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]
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
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.
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'
    { $sel:code:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
code =
        forall a. Maybe a
Prelude.Nothing,
      $sel:message:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:thingName:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: Maybe Text
thingName =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The error code for the request.
disassociateClientDeviceFromCoreDeviceErrorEntry_code :: Lens.Lens' DisassociateClientDeviceFromCoreDeviceErrorEntry (Prelude.Maybe Prelude.Text)
disassociateClientDeviceFromCoreDeviceErrorEntry_code :: Lens' DisassociateClientDeviceFromCoreDeviceErrorEntry (Maybe Text)
disassociateClientDeviceFromCoreDeviceErrorEntry_code = 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 :: Lens' DisassociateClientDeviceFromCoreDeviceErrorEntry (Maybe Text)
disassociateClientDeviceFromCoreDeviceErrorEntry_message = 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 :: Lens' DisassociateClientDeviceFromCoreDeviceErrorEntry (Maybe Text)
disassociateClientDeviceFromCoreDeviceErrorEntry_thingName = 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
  Data.FromJSON
    DisassociateClientDeviceFromCoreDeviceErrorEntry
  where
  parseJSON :: Value -> Parser DisassociateClientDeviceFromCoreDeviceErrorEntry
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DisassociateClientDeviceFromCoreDeviceErrorEntry"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> DisassociateClientDeviceFromCoreDeviceErrorEntry
DisassociateClientDeviceFromCoreDeviceErrorEntry'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"code")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"message")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"thingName")
      )

instance
  Prelude.Hashable
    DisassociateClientDeviceFromCoreDeviceErrorEntry
  where
  hashWithSalt :: Int -> DisassociateClientDeviceFromCoreDeviceErrorEntry -> Int
hashWithSalt
    Int
_salt
    DisassociateClientDeviceFromCoreDeviceErrorEntry' {Maybe Text
thingName :: Maybe Text
message :: Maybe Text
code :: Maybe Text
$sel:thingName:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
$sel:message:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
$sel:code:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
code
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
thingName

instance
  Prelude.NFData
    DisassociateClientDeviceFromCoreDeviceErrorEntry
  where
  rnf :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> ()
rnf
    DisassociateClientDeviceFromCoreDeviceErrorEntry' {Maybe Text
thingName :: Maybe Text
message :: Maybe Text
code :: Maybe Text
$sel:thingName:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
$sel:message:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
$sel:code:DisassociateClientDeviceFromCoreDeviceErrorEntry' :: DisassociateClientDeviceFromCoreDeviceErrorEntry -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
code
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
thingName