{-# 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.DisassociateClientDeviceFromCoreDeviceEntry
-- 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.DisassociateClientDeviceFromCoreDeviceEntry where

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

-- | Contains 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 consumes a list of these requests.
--
-- /See:/ 'newDisassociateClientDeviceFromCoreDeviceEntry' smart constructor.
data DisassociateClientDeviceFromCoreDeviceEntry = DisassociateClientDeviceFromCoreDeviceEntry'
  { -- | The name of the IoT thing that represents the client device to
    -- disassociate.
    DisassociateClientDeviceFromCoreDeviceEntry -> Text
thingName :: Prelude.Text
  }
  deriving (DisassociateClientDeviceFromCoreDeviceEntry
-> DisassociateClientDeviceFromCoreDeviceEntry -> Bool
(DisassociateClientDeviceFromCoreDeviceEntry
 -> DisassociateClientDeviceFromCoreDeviceEntry -> Bool)
-> (DisassociateClientDeviceFromCoreDeviceEntry
    -> DisassociateClientDeviceFromCoreDeviceEntry -> Bool)
-> Eq DisassociateClientDeviceFromCoreDeviceEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateClientDeviceFromCoreDeviceEntry
-> DisassociateClientDeviceFromCoreDeviceEntry -> Bool
$c/= :: DisassociateClientDeviceFromCoreDeviceEntry
-> DisassociateClientDeviceFromCoreDeviceEntry -> Bool
== :: DisassociateClientDeviceFromCoreDeviceEntry
-> DisassociateClientDeviceFromCoreDeviceEntry -> Bool
$c== :: DisassociateClientDeviceFromCoreDeviceEntry
-> DisassociateClientDeviceFromCoreDeviceEntry -> Bool
Prelude.Eq, ReadPrec [DisassociateClientDeviceFromCoreDeviceEntry]
ReadPrec DisassociateClientDeviceFromCoreDeviceEntry
Int -> ReadS DisassociateClientDeviceFromCoreDeviceEntry
ReadS [DisassociateClientDeviceFromCoreDeviceEntry]
(Int -> ReadS DisassociateClientDeviceFromCoreDeviceEntry)
-> ReadS [DisassociateClientDeviceFromCoreDeviceEntry]
-> ReadPrec DisassociateClientDeviceFromCoreDeviceEntry
-> ReadPrec [DisassociateClientDeviceFromCoreDeviceEntry]
-> Read DisassociateClientDeviceFromCoreDeviceEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateClientDeviceFromCoreDeviceEntry]
$creadListPrec :: ReadPrec [DisassociateClientDeviceFromCoreDeviceEntry]
readPrec :: ReadPrec DisassociateClientDeviceFromCoreDeviceEntry
$creadPrec :: ReadPrec DisassociateClientDeviceFromCoreDeviceEntry
readList :: ReadS [DisassociateClientDeviceFromCoreDeviceEntry]
$creadList :: ReadS [DisassociateClientDeviceFromCoreDeviceEntry]
readsPrec :: Int -> ReadS DisassociateClientDeviceFromCoreDeviceEntry
$creadsPrec :: Int -> ReadS DisassociateClientDeviceFromCoreDeviceEntry
Prelude.Read, Int -> DisassociateClientDeviceFromCoreDeviceEntry -> ShowS
[DisassociateClientDeviceFromCoreDeviceEntry] -> ShowS
DisassociateClientDeviceFromCoreDeviceEntry -> String
(Int -> DisassociateClientDeviceFromCoreDeviceEntry -> ShowS)
-> (DisassociateClientDeviceFromCoreDeviceEntry -> String)
-> ([DisassociateClientDeviceFromCoreDeviceEntry] -> ShowS)
-> Show DisassociateClientDeviceFromCoreDeviceEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateClientDeviceFromCoreDeviceEntry] -> ShowS
$cshowList :: [DisassociateClientDeviceFromCoreDeviceEntry] -> ShowS
show :: DisassociateClientDeviceFromCoreDeviceEntry -> String
$cshow :: DisassociateClientDeviceFromCoreDeviceEntry -> String
showsPrec :: Int -> DisassociateClientDeviceFromCoreDeviceEntry -> ShowS
$cshowsPrec :: Int -> DisassociateClientDeviceFromCoreDeviceEntry -> ShowS
Prelude.Show, (forall x.
 DisassociateClientDeviceFromCoreDeviceEntry
 -> Rep DisassociateClientDeviceFromCoreDeviceEntry x)
-> (forall x.
    Rep DisassociateClientDeviceFromCoreDeviceEntry x
    -> DisassociateClientDeviceFromCoreDeviceEntry)
-> Generic DisassociateClientDeviceFromCoreDeviceEntry
forall x.
Rep DisassociateClientDeviceFromCoreDeviceEntry x
-> DisassociateClientDeviceFromCoreDeviceEntry
forall x.
DisassociateClientDeviceFromCoreDeviceEntry
-> Rep DisassociateClientDeviceFromCoreDeviceEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateClientDeviceFromCoreDeviceEntry x
-> DisassociateClientDeviceFromCoreDeviceEntry
$cfrom :: forall x.
DisassociateClientDeviceFromCoreDeviceEntry
-> Rep DisassociateClientDeviceFromCoreDeviceEntry x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateClientDeviceFromCoreDeviceEntry' 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:
--
-- 'thingName', 'disassociateClientDeviceFromCoreDeviceEntry_thingName' - The name of the IoT thing that represents the client device to
-- disassociate.
newDisassociateClientDeviceFromCoreDeviceEntry ::
  -- | 'thingName'
  Prelude.Text ->
  DisassociateClientDeviceFromCoreDeviceEntry
newDisassociateClientDeviceFromCoreDeviceEntry :: Text -> DisassociateClientDeviceFromCoreDeviceEntry
newDisassociateClientDeviceFromCoreDeviceEntry
  Text
pThingName_ =
    DisassociateClientDeviceFromCoreDeviceEntry' :: Text -> DisassociateClientDeviceFromCoreDeviceEntry
DisassociateClientDeviceFromCoreDeviceEntry'
      { $sel:thingName:DisassociateClientDeviceFromCoreDeviceEntry' :: Text
thingName =
          Text
pThingName_
      }

-- | The name of the IoT thing that represents the client device to
-- disassociate.
disassociateClientDeviceFromCoreDeviceEntry_thingName :: Lens.Lens' DisassociateClientDeviceFromCoreDeviceEntry Prelude.Text
disassociateClientDeviceFromCoreDeviceEntry_thingName :: (Text -> f Text)
-> DisassociateClientDeviceFromCoreDeviceEntry
-> f DisassociateClientDeviceFromCoreDeviceEntry
disassociateClientDeviceFromCoreDeviceEntry_thingName = (DisassociateClientDeviceFromCoreDeviceEntry -> Text)
-> (DisassociateClientDeviceFromCoreDeviceEntry
    -> Text -> DisassociateClientDeviceFromCoreDeviceEntry)
-> Lens
     DisassociateClientDeviceFromCoreDeviceEntry
     DisassociateClientDeviceFromCoreDeviceEntry
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateClientDeviceFromCoreDeviceEntry' {Text
thingName :: Text
$sel:thingName:DisassociateClientDeviceFromCoreDeviceEntry' :: DisassociateClientDeviceFromCoreDeviceEntry -> Text
thingName} -> Text
thingName) (\s :: DisassociateClientDeviceFromCoreDeviceEntry
s@DisassociateClientDeviceFromCoreDeviceEntry' {} Text
a -> DisassociateClientDeviceFromCoreDeviceEntry
s {$sel:thingName:DisassociateClientDeviceFromCoreDeviceEntry' :: Text
thingName = Text
a} :: DisassociateClientDeviceFromCoreDeviceEntry)

instance
  Prelude.Hashable
    DisassociateClientDeviceFromCoreDeviceEntry

instance
  Prelude.NFData
    DisassociateClientDeviceFromCoreDeviceEntry

instance
  Core.ToJSON
    DisassociateClientDeviceFromCoreDeviceEntry
  where
  toJSON :: DisassociateClientDeviceFromCoreDeviceEntry -> Value
toJSON
    DisassociateClientDeviceFromCoreDeviceEntry' {Text
thingName :: Text
$sel:thingName:DisassociateClientDeviceFromCoreDeviceEntry' :: DisassociateClientDeviceFromCoreDeviceEntry -> Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"thingName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
thingName)]
        )