{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.BatchAssociateClientDeviceWithCoreDevice
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Associates a list of client devices with a core device. Use this API
-- operation to specify which client devices can discover a core device
-- through cloud discovery. With cloud discovery, client devices connect to
-- IoT Greengrass to retrieve associated core devices\' connectivity
-- information and certificates. For more information, see
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/configure-cloud-discovery.html Configure cloud discovery>
-- in the /IoT Greengrass V2 Developer Guide/.
--
-- Client devices are local IoT devices that connect to and communicate
-- with an IoT Greengrass core device over MQTT. You can connect client
-- devices to a core device to sync MQTT messages and data to Amazon Web
-- Services IoT Core and interact with client devices in Greengrass
-- components. For more information, see
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/interact-with-local-iot-devices.html Interact with local IoT devices>
-- in the /IoT Greengrass V2 Developer Guide/.
module Amazonka.GreengrassV2.BatchAssociateClientDeviceWithCoreDevice
  ( -- * Creating a Request
    BatchAssociateClientDeviceWithCoreDevice (..),
    newBatchAssociateClientDeviceWithCoreDevice,

    -- * Request Lenses
    batchAssociateClientDeviceWithCoreDevice_entries,
    batchAssociateClientDeviceWithCoreDevice_coreDeviceThingName,

    -- * Destructuring the Response
    BatchAssociateClientDeviceWithCoreDeviceResponse (..),
    newBatchAssociateClientDeviceWithCoreDeviceResponse,

    -- * Response Lenses
    batchAssociateClientDeviceWithCoreDeviceResponse_errorEntries,
    batchAssociateClientDeviceWithCoreDeviceResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GreengrassV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newBatchAssociateClientDeviceWithCoreDevice' smart constructor.
data BatchAssociateClientDeviceWithCoreDevice = BatchAssociateClientDeviceWithCoreDevice'
  { -- | The list of client devices to associate.
    BatchAssociateClientDeviceWithCoreDevice
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries :: Prelude.Maybe (Prelude.NonEmpty AssociateClientDeviceWithCoreDeviceEntry),
    -- | The name of the core device. This is also the name of the IoT thing.
    BatchAssociateClientDeviceWithCoreDevice -> Text
coreDeviceThingName :: Prelude.Text
  }
  deriving (BatchAssociateClientDeviceWithCoreDevice
-> BatchAssociateClientDeviceWithCoreDevice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAssociateClientDeviceWithCoreDevice
-> BatchAssociateClientDeviceWithCoreDevice -> Bool
$c/= :: BatchAssociateClientDeviceWithCoreDevice
-> BatchAssociateClientDeviceWithCoreDevice -> Bool
== :: BatchAssociateClientDeviceWithCoreDevice
-> BatchAssociateClientDeviceWithCoreDevice -> Bool
$c== :: BatchAssociateClientDeviceWithCoreDevice
-> BatchAssociateClientDeviceWithCoreDevice -> Bool
Prelude.Eq, ReadPrec [BatchAssociateClientDeviceWithCoreDevice]
ReadPrec BatchAssociateClientDeviceWithCoreDevice
Int -> ReadS BatchAssociateClientDeviceWithCoreDevice
ReadS [BatchAssociateClientDeviceWithCoreDevice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAssociateClientDeviceWithCoreDevice]
$creadListPrec :: ReadPrec [BatchAssociateClientDeviceWithCoreDevice]
readPrec :: ReadPrec BatchAssociateClientDeviceWithCoreDevice
$creadPrec :: ReadPrec BatchAssociateClientDeviceWithCoreDevice
readList :: ReadS [BatchAssociateClientDeviceWithCoreDevice]
$creadList :: ReadS [BatchAssociateClientDeviceWithCoreDevice]
readsPrec :: Int -> ReadS BatchAssociateClientDeviceWithCoreDevice
$creadsPrec :: Int -> ReadS BatchAssociateClientDeviceWithCoreDevice
Prelude.Read, Int -> BatchAssociateClientDeviceWithCoreDevice -> ShowS
[BatchAssociateClientDeviceWithCoreDevice] -> ShowS
BatchAssociateClientDeviceWithCoreDevice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAssociateClientDeviceWithCoreDevice] -> ShowS
$cshowList :: [BatchAssociateClientDeviceWithCoreDevice] -> ShowS
show :: BatchAssociateClientDeviceWithCoreDevice -> String
$cshow :: BatchAssociateClientDeviceWithCoreDevice -> String
showsPrec :: Int -> BatchAssociateClientDeviceWithCoreDevice -> ShowS
$cshowsPrec :: Int -> BatchAssociateClientDeviceWithCoreDevice -> ShowS
Prelude.Show, forall x.
Rep BatchAssociateClientDeviceWithCoreDevice x
-> BatchAssociateClientDeviceWithCoreDevice
forall x.
BatchAssociateClientDeviceWithCoreDevice
-> Rep BatchAssociateClientDeviceWithCoreDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchAssociateClientDeviceWithCoreDevice x
-> BatchAssociateClientDeviceWithCoreDevice
$cfrom :: forall x.
BatchAssociateClientDeviceWithCoreDevice
-> Rep BatchAssociateClientDeviceWithCoreDevice x
Prelude.Generic)

-- |
-- Create a value of 'BatchAssociateClientDeviceWithCoreDevice' 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:
--
-- 'entries', 'batchAssociateClientDeviceWithCoreDevice_entries' - The list of client devices to associate.
--
-- 'coreDeviceThingName', 'batchAssociateClientDeviceWithCoreDevice_coreDeviceThingName' - The name of the core device. This is also the name of the IoT thing.
newBatchAssociateClientDeviceWithCoreDevice ::
  -- | 'coreDeviceThingName'
  Prelude.Text ->
  BatchAssociateClientDeviceWithCoreDevice
newBatchAssociateClientDeviceWithCoreDevice :: Text -> BatchAssociateClientDeviceWithCoreDevice
newBatchAssociateClientDeviceWithCoreDevice
  Text
pCoreDeviceThingName_ =
    BatchAssociateClientDeviceWithCoreDevice'
      { $sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries =
          forall a. Maybe a
Prelude.Nothing,
        $sel:coreDeviceThingName:BatchAssociateClientDeviceWithCoreDevice' :: Text
coreDeviceThingName =
          Text
pCoreDeviceThingName_
      }

-- | The list of client devices to associate.
batchAssociateClientDeviceWithCoreDevice_entries :: Lens.Lens' BatchAssociateClientDeviceWithCoreDevice (Prelude.Maybe (Prelude.NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
batchAssociateClientDeviceWithCoreDevice_entries :: Lens'
  BatchAssociateClientDeviceWithCoreDevice
  (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
batchAssociateClientDeviceWithCoreDevice_entries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateClientDeviceWithCoreDevice' {Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
$sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries} -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries) (\s :: BatchAssociateClientDeviceWithCoreDevice
s@BatchAssociateClientDeviceWithCoreDevice' {} Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
a -> BatchAssociateClientDeviceWithCoreDevice
s {$sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries = Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
a} :: BatchAssociateClientDeviceWithCoreDevice) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the core device. This is also the name of the IoT thing.
batchAssociateClientDeviceWithCoreDevice_coreDeviceThingName :: Lens.Lens' BatchAssociateClientDeviceWithCoreDevice Prelude.Text
batchAssociateClientDeviceWithCoreDevice_coreDeviceThingName :: Lens' BatchAssociateClientDeviceWithCoreDevice Text
batchAssociateClientDeviceWithCoreDevice_coreDeviceThingName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateClientDeviceWithCoreDevice' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice -> Text
coreDeviceThingName} -> Text
coreDeviceThingName) (\s :: BatchAssociateClientDeviceWithCoreDevice
s@BatchAssociateClientDeviceWithCoreDevice' {} Text
a -> BatchAssociateClientDeviceWithCoreDevice
s {$sel:coreDeviceThingName:BatchAssociateClientDeviceWithCoreDevice' :: Text
coreDeviceThingName = Text
a} :: BatchAssociateClientDeviceWithCoreDevice)

instance
  Core.AWSRequest
    BatchAssociateClientDeviceWithCoreDevice
  where
  type
    AWSResponse
      BatchAssociateClientDeviceWithCoreDevice =
      BatchAssociateClientDeviceWithCoreDeviceResponse
  request :: (Service -> Service)
-> BatchAssociateClientDeviceWithCoreDevice
-> Request BatchAssociateClientDeviceWithCoreDevice
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy BatchAssociateClientDeviceWithCoreDevice
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse BatchAssociateClientDeviceWithCoreDevice)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
-> Int -> BatchAssociateClientDeviceWithCoreDeviceResponse
BatchAssociateClientDeviceWithCoreDeviceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"errorEntries" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    BatchAssociateClientDeviceWithCoreDevice
  where
  hashWithSalt :: Int -> BatchAssociateClientDeviceWithCoreDevice -> Int
hashWithSalt
    Int
_salt
    BatchAssociateClientDeviceWithCoreDevice' {Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
Text
coreDeviceThingName :: Text
entries :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
$sel:coreDeviceThingName:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice -> Text
$sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
coreDeviceThingName

instance
  Prelude.NFData
    BatchAssociateClientDeviceWithCoreDevice
  where
  rnf :: BatchAssociateClientDeviceWithCoreDevice -> ()
rnf BatchAssociateClientDeviceWithCoreDevice' {Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
Text
coreDeviceThingName :: Text
entries :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
$sel:coreDeviceThingName:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice -> Text
$sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
coreDeviceThingName

instance
  Data.ToHeaders
    BatchAssociateClientDeviceWithCoreDevice
  where
  toHeaders :: BatchAssociateClientDeviceWithCoreDevice -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance
  Data.ToJSON
    BatchAssociateClientDeviceWithCoreDevice
  where
  toJSON :: BatchAssociateClientDeviceWithCoreDevice -> Value
toJSON BatchAssociateClientDeviceWithCoreDevice' {Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
Text
coreDeviceThingName :: Text
entries :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
$sel:coreDeviceThingName:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice -> Text
$sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"entries" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries]
      )

instance
  Data.ToPath
    BatchAssociateClientDeviceWithCoreDevice
  where
  toPath :: BatchAssociateClientDeviceWithCoreDevice -> ByteString
toPath BatchAssociateClientDeviceWithCoreDevice' {Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
Text
coreDeviceThingName :: Text
entries :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
$sel:coreDeviceThingName:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice -> Text
$sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: BatchAssociateClientDeviceWithCoreDevice
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/coreDevices/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
coreDeviceThingName,
        ByteString
"/associateClientDevices"
      ]

instance
  Data.ToQuery
    BatchAssociateClientDeviceWithCoreDevice
  where
  toQuery :: BatchAssociateClientDeviceWithCoreDevice -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchAssociateClientDeviceWithCoreDeviceResponse' smart constructor.
data BatchAssociateClientDeviceWithCoreDeviceResponse = BatchAssociateClientDeviceWithCoreDeviceResponse'
  { -- | The list of any errors for the entries in the request. Each error entry
    -- contains the name of the IoT thing that failed to associate.
    BatchAssociateClientDeviceWithCoreDeviceResponse
-> Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
errorEntries :: Prelude.Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry],
    -- | The response's http status code.
    BatchAssociateClientDeviceWithCoreDeviceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchAssociateClientDeviceWithCoreDeviceResponse
-> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAssociateClientDeviceWithCoreDeviceResponse
-> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool
$c/= :: BatchAssociateClientDeviceWithCoreDeviceResponse
-> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool
== :: BatchAssociateClientDeviceWithCoreDeviceResponse
-> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool
$c== :: BatchAssociateClientDeviceWithCoreDeviceResponse
-> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool
Prelude.Eq, ReadPrec [BatchAssociateClientDeviceWithCoreDeviceResponse]
ReadPrec BatchAssociateClientDeviceWithCoreDeviceResponse
Int -> ReadS BatchAssociateClientDeviceWithCoreDeviceResponse
ReadS [BatchAssociateClientDeviceWithCoreDeviceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAssociateClientDeviceWithCoreDeviceResponse]
$creadListPrec :: ReadPrec [BatchAssociateClientDeviceWithCoreDeviceResponse]
readPrec :: ReadPrec BatchAssociateClientDeviceWithCoreDeviceResponse
$creadPrec :: ReadPrec BatchAssociateClientDeviceWithCoreDeviceResponse
readList :: ReadS [BatchAssociateClientDeviceWithCoreDeviceResponse]
$creadList :: ReadS [BatchAssociateClientDeviceWithCoreDeviceResponse]
readsPrec :: Int -> ReadS BatchAssociateClientDeviceWithCoreDeviceResponse
$creadsPrec :: Int -> ReadS BatchAssociateClientDeviceWithCoreDeviceResponse
Prelude.Read, Int -> BatchAssociateClientDeviceWithCoreDeviceResponse -> ShowS
[BatchAssociateClientDeviceWithCoreDeviceResponse] -> ShowS
BatchAssociateClientDeviceWithCoreDeviceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAssociateClientDeviceWithCoreDeviceResponse] -> ShowS
$cshowList :: [BatchAssociateClientDeviceWithCoreDeviceResponse] -> ShowS
show :: BatchAssociateClientDeviceWithCoreDeviceResponse -> String
$cshow :: BatchAssociateClientDeviceWithCoreDeviceResponse -> String
showsPrec :: Int -> BatchAssociateClientDeviceWithCoreDeviceResponse -> ShowS
$cshowsPrec :: Int -> BatchAssociateClientDeviceWithCoreDeviceResponse -> ShowS
Prelude.Show, forall x.
Rep BatchAssociateClientDeviceWithCoreDeviceResponse x
-> BatchAssociateClientDeviceWithCoreDeviceResponse
forall x.
BatchAssociateClientDeviceWithCoreDeviceResponse
-> Rep BatchAssociateClientDeviceWithCoreDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchAssociateClientDeviceWithCoreDeviceResponse x
-> BatchAssociateClientDeviceWithCoreDeviceResponse
$cfrom :: forall x.
BatchAssociateClientDeviceWithCoreDeviceResponse
-> Rep BatchAssociateClientDeviceWithCoreDeviceResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchAssociateClientDeviceWithCoreDeviceResponse' 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:
--
-- 'errorEntries', 'batchAssociateClientDeviceWithCoreDeviceResponse_errorEntries' - The list of any errors for the entries in the request. Each error entry
-- contains the name of the IoT thing that failed to associate.
--
-- 'httpStatus', 'batchAssociateClientDeviceWithCoreDeviceResponse_httpStatus' - The response's http status code.
newBatchAssociateClientDeviceWithCoreDeviceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchAssociateClientDeviceWithCoreDeviceResponse
newBatchAssociateClientDeviceWithCoreDeviceResponse :: Int -> BatchAssociateClientDeviceWithCoreDeviceResponse
newBatchAssociateClientDeviceWithCoreDeviceResponse
  Int
pHttpStatus_ =
    BatchAssociateClientDeviceWithCoreDeviceResponse'
      { $sel:errorEntries:BatchAssociateClientDeviceWithCoreDeviceResponse' :: Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
errorEntries =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchAssociateClientDeviceWithCoreDeviceResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The list of any errors for the entries in the request. Each error entry
-- contains the name of the IoT thing that failed to associate.
batchAssociateClientDeviceWithCoreDeviceResponse_errorEntries :: Lens.Lens' BatchAssociateClientDeviceWithCoreDeviceResponse (Prelude.Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry])
batchAssociateClientDeviceWithCoreDeviceResponse_errorEntries :: Lens'
  BatchAssociateClientDeviceWithCoreDeviceResponse
  (Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry])
batchAssociateClientDeviceWithCoreDeviceResponse_errorEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateClientDeviceWithCoreDeviceResponse' {Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
errorEntries :: Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
$sel:errorEntries:BatchAssociateClientDeviceWithCoreDeviceResponse' :: BatchAssociateClientDeviceWithCoreDeviceResponse
-> Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
errorEntries} -> Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
errorEntries) (\s :: BatchAssociateClientDeviceWithCoreDeviceResponse
s@BatchAssociateClientDeviceWithCoreDeviceResponse' {} Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
a -> BatchAssociateClientDeviceWithCoreDeviceResponse
s {$sel:errorEntries:BatchAssociateClientDeviceWithCoreDeviceResponse' :: Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
errorEntries = Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
a} :: BatchAssociateClientDeviceWithCoreDeviceResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
batchAssociateClientDeviceWithCoreDeviceResponse_httpStatus :: Lens.Lens' BatchAssociateClientDeviceWithCoreDeviceResponse Prelude.Int
batchAssociateClientDeviceWithCoreDeviceResponse_httpStatus :: Lens' BatchAssociateClientDeviceWithCoreDeviceResponse Int
batchAssociateClientDeviceWithCoreDeviceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateClientDeviceWithCoreDeviceResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchAssociateClientDeviceWithCoreDeviceResponse' :: BatchAssociateClientDeviceWithCoreDeviceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchAssociateClientDeviceWithCoreDeviceResponse
s@BatchAssociateClientDeviceWithCoreDeviceResponse' {} Int
a -> BatchAssociateClientDeviceWithCoreDeviceResponse
s {$sel:httpStatus:BatchAssociateClientDeviceWithCoreDeviceResponse' :: Int
httpStatus = Int
a} :: BatchAssociateClientDeviceWithCoreDeviceResponse)

instance
  Prelude.NFData
    BatchAssociateClientDeviceWithCoreDeviceResponse
  where
  rnf :: BatchAssociateClientDeviceWithCoreDeviceResponse -> ()
rnf
    BatchAssociateClientDeviceWithCoreDeviceResponse' {Int
Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
httpStatus :: Int
errorEntries :: Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
$sel:httpStatus:BatchAssociateClientDeviceWithCoreDeviceResponse' :: BatchAssociateClientDeviceWithCoreDeviceResponse -> Int
$sel:errorEntries:BatchAssociateClientDeviceWithCoreDeviceResponse' :: BatchAssociateClientDeviceWithCoreDeviceResponse
-> Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe [AssociateClientDeviceWithCoreDeviceErrorEntry]
errorEntries
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus