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

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

-- | Contains a request to associate a client device with a core device. The
-- <https://docs.aws.amazon.com/greengrass/v2/APIReference/API_BatchAssociateClientDeviceWithCoreDevice.html BatchAssociateClientDeviceWithCoreDevice>
-- operation consumes a list of these requests.
--
-- /See:/ 'newAssociateClientDeviceWithCoreDeviceEntry' smart constructor.
data AssociateClientDeviceWithCoreDeviceEntry = AssociateClientDeviceWithCoreDeviceEntry'
  { -- | The name of the IoT thing that represents the client device to
    -- associate.
    AssociateClientDeviceWithCoreDeviceEntry -> Text
thingName :: Prelude.Text
  }
  deriving (AssociateClientDeviceWithCoreDeviceEntry
-> AssociateClientDeviceWithCoreDeviceEntry -> Bool
(AssociateClientDeviceWithCoreDeviceEntry
 -> AssociateClientDeviceWithCoreDeviceEntry -> Bool)
-> (AssociateClientDeviceWithCoreDeviceEntry
    -> AssociateClientDeviceWithCoreDeviceEntry -> Bool)
-> Eq AssociateClientDeviceWithCoreDeviceEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateClientDeviceWithCoreDeviceEntry
-> AssociateClientDeviceWithCoreDeviceEntry -> Bool
$c/= :: AssociateClientDeviceWithCoreDeviceEntry
-> AssociateClientDeviceWithCoreDeviceEntry -> Bool
== :: AssociateClientDeviceWithCoreDeviceEntry
-> AssociateClientDeviceWithCoreDeviceEntry -> Bool
$c== :: AssociateClientDeviceWithCoreDeviceEntry
-> AssociateClientDeviceWithCoreDeviceEntry -> Bool
Prelude.Eq, ReadPrec [AssociateClientDeviceWithCoreDeviceEntry]
ReadPrec AssociateClientDeviceWithCoreDeviceEntry
Int -> ReadS AssociateClientDeviceWithCoreDeviceEntry
ReadS [AssociateClientDeviceWithCoreDeviceEntry]
(Int -> ReadS AssociateClientDeviceWithCoreDeviceEntry)
-> ReadS [AssociateClientDeviceWithCoreDeviceEntry]
-> ReadPrec AssociateClientDeviceWithCoreDeviceEntry
-> ReadPrec [AssociateClientDeviceWithCoreDeviceEntry]
-> Read AssociateClientDeviceWithCoreDeviceEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateClientDeviceWithCoreDeviceEntry]
$creadListPrec :: ReadPrec [AssociateClientDeviceWithCoreDeviceEntry]
readPrec :: ReadPrec AssociateClientDeviceWithCoreDeviceEntry
$creadPrec :: ReadPrec AssociateClientDeviceWithCoreDeviceEntry
readList :: ReadS [AssociateClientDeviceWithCoreDeviceEntry]
$creadList :: ReadS [AssociateClientDeviceWithCoreDeviceEntry]
readsPrec :: Int -> ReadS AssociateClientDeviceWithCoreDeviceEntry
$creadsPrec :: Int -> ReadS AssociateClientDeviceWithCoreDeviceEntry
Prelude.Read, Int -> AssociateClientDeviceWithCoreDeviceEntry -> ShowS
[AssociateClientDeviceWithCoreDeviceEntry] -> ShowS
AssociateClientDeviceWithCoreDeviceEntry -> String
(Int -> AssociateClientDeviceWithCoreDeviceEntry -> ShowS)
-> (AssociateClientDeviceWithCoreDeviceEntry -> String)
-> ([AssociateClientDeviceWithCoreDeviceEntry] -> ShowS)
-> Show AssociateClientDeviceWithCoreDeviceEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateClientDeviceWithCoreDeviceEntry] -> ShowS
$cshowList :: [AssociateClientDeviceWithCoreDeviceEntry] -> ShowS
show :: AssociateClientDeviceWithCoreDeviceEntry -> String
$cshow :: AssociateClientDeviceWithCoreDeviceEntry -> String
showsPrec :: Int -> AssociateClientDeviceWithCoreDeviceEntry -> ShowS
$cshowsPrec :: Int -> AssociateClientDeviceWithCoreDeviceEntry -> ShowS
Prelude.Show, (forall x.
 AssociateClientDeviceWithCoreDeviceEntry
 -> Rep AssociateClientDeviceWithCoreDeviceEntry x)
-> (forall x.
    Rep AssociateClientDeviceWithCoreDeviceEntry x
    -> AssociateClientDeviceWithCoreDeviceEntry)
-> Generic AssociateClientDeviceWithCoreDeviceEntry
forall x.
Rep AssociateClientDeviceWithCoreDeviceEntry x
-> AssociateClientDeviceWithCoreDeviceEntry
forall x.
AssociateClientDeviceWithCoreDeviceEntry
-> Rep AssociateClientDeviceWithCoreDeviceEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateClientDeviceWithCoreDeviceEntry x
-> AssociateClientDeviceWithCoreDeviceEntry
$cfrom :: forall x.
AssociateClientDeviceWithCoreDeviceEntry
-> Rep AssociateClientDeviceWithCoreDeviceEntry x
Prelude.Generic)

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

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

instance
  Prelude.Hashable
    AssociateClientDeviceWithCoreDeviceEntry

instance
  Prelude.NFData
    AssociateClientDeviceWithCoreDeviceEntry

instance
  Core.ToJSON
    AssociateClientDeviceWithCoreDeviceEntry
  where
  toJSON :: AssociateClientDeviceWithCoreDeviceEntry -> Value
toJSON AssociateClientDeviceWithCoreDeviceEntry' {Text
thingName :: Text
$sel:thingName:AssociateClientDeviceWithCoreDeviceEntry' :: AssociateClientDeviceWithCoreDeviceEntry -> 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)]
      )