{-# 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-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)
--
-- Associate 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 Amazonka.GreengrassV2.Types
import qualified Amazonka.Lens as Lens
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
(BatchAssociateClientDeviceWithCoreDevice
 -> BatchAssociateClientDeviceWithCoreDevice -> Bool)
-> (BatchAssociateClientDeviceWithCoreDevice
    -> BatchAssociateClientDeviceWithCoreDevice -> Bool)
-> Eq BatchAssociateClientDeviceWithCoreDevice
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]
(Int -> ReadS BatchAssociateClientDeviceWithCoreDevice)
-> ReadS [BatchAssociateClientDeviceWithCoreDevice]
-> ReadPrec BatchAssociateClientDeviceWithCoreDevice
-> ReadPrec [BatchAssociateClientDeviceWithCoreDevice]
-> Read 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
(Int -> BatchAssociateClientDeviceWithCoreDevice -> ShowS)
-> (BatchAssociateClientDeviceWithCoreDevice -> String)
-> ([BatchAssociateClientDeviceWithCoreDevice] -> ShowS)
-> Show BatchAssociateClientDeviceWithCoreDevice
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.
 BatchAssociateClientDeviceWithCoreDevice
 -> Rep BatchAssociateClientDeviceWithCoreDevice x)
-> (forall x.
    Rep BatchAssociateClientDeviceWithCoreDevice x
    -> BatchAssociateClientDeviceWithCoreDevice)
-> Generic BatchAssociateClientDeviceWithCoreDevice
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' :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
-> Text -> BatchAssociateClientDeviceWithCoreDevice
BatchAssociateClientDeviceWithCoreDevice'
      { $sel:entries:BatchAssociateClientDeviceWithCoreDevice' :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries =
          Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
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 :: (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
 -> f (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)))
-> BatchAssociateClientDeviceWithCoreDevice
-> f BatchAssociateClientDeviceWithCoreDevice
batchAssociateClientDeviceWithCoreDevice_entries = (BatchAssociateClientDeviceWithCoreDevice
 -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
-> (BatchAssociateClientDeviceWithCoreDevice
    -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
    -> BatchAssociateClientDeviceWithCoreDevice)
-> Lens
     BatchAssociateClientDeviceWithCoreDevice
     BatchAssociateClientDeviceWithCoreDevice
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
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) ((Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
  -> f (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)))
 -> BatchAssociateClientDeviceWithCoreDevice
 -> f BatchAssociateClientDeviceWithCoreDevice)
-> ((Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
     -> f (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)))
    -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
    -> f (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)))
-> (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
    -> f (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)))
-> BatchAssociateClientDeviceWithCoreDevice
-> f BatchAssociateClientDeviceWithCoreDevice
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
-> Iso
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry))
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 AnIso
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
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 :: (Text -> f Text)
-> BatchAssociateClientDeviceWithCoreDevice
-> f BatchAssociateClientDeviceWithCoreDevice
batchAssociateClientDeviceWithCoreDevice_coreDeviceThingName = (BatchAssociateClientDeviceWithCoreDevice -> Text)
-> (BatchAssociateClientDeviceWithCoreDevice
    -> Text -> BatchAssociateClientDeviceWithCoreDevice)
-> Lens
     BatchAssociateClientDeviceWithCoreDevice
     BatchAssociateClientDeviceWithCoreDevice
     Text
     Text
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 :: BatchAssociateClientDeviceWithCoreDevice
-> Request BatchAssociateClientDeviceWithCoreDevice
request = Service
-> BatchAssociateClientDeviceWithCoreDevice
-> Request BatchAssociateClientDeviceWithCoreDevice
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchAssociateClientDeviceWithCoreDevice
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse BatchAssociateClientDeviceWithCoreDevice)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse BatchAssociateClientDeviceWithCoreDevice))
-> Logger
-> Service
-> Proxy BatchAssociateClientDeviceWithCoreDevice
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse BatchAssociateClientDeviceWithCoreDevice)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
-> Int -> BatchAssociateClientDeviceWithCoreDeviceResponse
BatchAssociateClientDeviceWithCoreDeviceResponse'
            (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
 -> Int -> BatchAssociateClientDeviceWithCoreDeviceResponse)
-> Either
     String
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
-> Either
     String (Int -> BatchAssociateClientDeviceWithCoreDeviceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either
     String
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"errorEntries")
              Either
  String (Int -> BatchAssociateClientDeviceWithCoreDeviceResponse)
-> Either String Int
-> Either String BatchAssociateClientDeviceWithCoreDeviceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    BatchAssociateClientDeviceWithCoreDevice

instance
  Prelude.NFData
    BatchAssociateClientDeviceWithCoreDevice

instance
  Core.ToHeaders
    BatchAssociateClientDeviceWithCoreDevice
  where
  toHeaders :: BatchAssociateClientDeviceWithCoreDevice -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> BatchAssociateClientDeviceWithCoreDevice -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"entries" Text -> NonEmpty AssociateClientDeviceWithCoreDeviceEntry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty AssociateClientDeviceWithCoreDeviceEntry -> Pair)
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceEntry)
entries]
      )

instance
  Core.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)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/coreDevices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
coreDeviceThingName,
        ByteString
"/associateClientDevices"
      ]

instance
  Core.ToQuery
    BatchAssociateClientDeviceWithCoreDevice
  where
  toQuery :: BatchAssociateClientDeviceWithCoreDevice -> QueryString
toQuery = QueryString
-> BatchAssociateClientDeviceWithCoreDevice -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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 (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
errorEntries :: Prelude.Maybe (Prelude.NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry),
    -- | The response's http status code.
    BatchAssociateClientDeviceWithCoreDeviceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchAssociateClientDeviceWithCoreDeviceResponse
-> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool
(BatchAssociateClientDeviceWithCoreDeviceResponse
 -> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool)
-> (BatchAssociateClientDeviceWithCoreDeviceResponse
    -> BatchAssociateClientDeviceWithCoreDeviceResponse -> Bool)
-> Eq BatchAssociateClientDeviceWithCoreDeviceResponse
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]
(Int -> ReadS BatchAssociateClientDeviceWithCoreDeviceResponse)
-> ReadS [BatchAssociateClientDeviceWithCoreDeviceResponse]
-> ReadPrec BatchAssociateClientDeviceWithCoreDeviceResponse
-> ReadPrec [BatchAssociateClientDeviceWithCoreDeviceResponse]
-> Read 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
(Int -> BatchAssociateClientDeviceWithCoreDeviceResponse -> ShowS)
-> (BatchAssociateClientDeviceWithCoreDeviceResponse -> String)
-> ([BatchAssociateClientDeviceWithCoreDeviceResponse] -> ShowS)
-> Show BatchAssociateClientDeviceWithCoreDeviceResponse
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.
 BatchAssociateClientDeviceWithCoreDeviceResponse
 -> Rep BatchAssociateClientDeviceWithCoreDeviceResponse x)
-> (forall x.
    Rep BatchAssociateClientDeviceWithCoreDeviceResponse x
    -> BatchAssociateClientDeviceWithCoreDeviceResponse)
-> Generic BatchAssociateClientDeviceWithCoreDeviceResponse
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' :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
-> Int -> BatchAssociateClientDeviceWithCoreDeviceResponse
BatchAssociateClientDeviceWithCoreDeviceResponse'
      { $sel:errorEntries:BatchAssociateClientDeviceWithCoreDeviceResponse' :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
errorEntries =
          Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
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 (Prelude.NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
batchAssociateClientDeviceWithCoreDeviceResponse_errorEntries :: (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
 -> f (Maybe
         (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)))
-> BatchAssociateClientDeviceWithCoreDeviceResponse
-> f BatchAssociateClientDeviceWithCoreDeviceResponse
batchAssociateClientDeviceWithCoreDeviceResponse_errorEntries = (BatchAssociateClientDeviceWithCoreDeviceResponse
 -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
-> (BatchAssociateClientDeviceWithCoreDeviceResponse
    -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
    -> BatchAssociateClientDeviceWithCoreDeviceResponse)
-> Lens
     BatchAssociateClientDeviceWithCoreDeviceResponse
     BatchAssociateClientDeviceWithCoreDeviceResponse
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateClientDeviceWithCoreDeviceResponse' {Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
errorEntries :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
$sel:errorEntries:BatchAssociateClientDeviceWithCoreDeviceResponse' :: BatchAssociateClientDeviceWithCoreDeviceResponse
-> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
errorEntries} -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
errorEntries) (\s :: BatchAssociateClientDeviceWithCoreDeviceResponse
s@BatchAssociateClientDeviceWithCoreDeviceResponse' {} Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
a -> BatchAssociateClientDeviceWithCoreDeviceResponse
s {$sel:errorEntries:BatchAssociateClientDeviceWithCoreDeviceResponse' :: Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
errorEntries = Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
a} :: BatchAssociateClientDeviceWithCoreDeviceResponse) ((Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
  -> f (Maybe
          (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)))
 -> BatchAssociateClientDeviceWithCoreDeviceResponse
 -> f BatchAssociateClientDeviceWithCoreDeviceResponse)
-> ((Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
     -> f (Maybe
             (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)))
    -> Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
    -> f (Maybe
            (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)))
-> (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
    -> f (Maybe
            (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)))
-> BatchAssociateClientDeviceWithCoreDeviceResponse
-> f BatchAssociateClientDeviceWithCoreDeviceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
-> Iso
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
     (Maybe (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry))
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 AnIso
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
  (NonEmpty AssociateClientDeviceWithCoreDeviceErrorEntry)
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 :: (Int -> f Int)
-> BatchAssociateClientDeviceWithCoreDeviceResponse
-> f BatchAssociateClientDeviceWithCoreDeviceResponse
batchAssociateClientDeviceWithCoreDeviceResponse_httpStatus = (BatchAssociateClientDeviceWithCoreDeviceResponse -> Int)
-> (BatchAssociateClientDeviceWithCoreDeviceResponse
    -> Int -> BatchAssociateClientDeviceWithCoreDeviceResponse)
-> Lens
     BatchAssociateClientDeviceWithCoreDeviceResponse
     BatchAssociateClientDeviceWithCoreDeviceResponse
     Int
     Int
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