{-# 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.SSM.CreateAssociationBatch
-- 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)
--
-- Associates the specified Amazon Web Services Systems Manager document
-- (SSM document) with the specified instances or targets.
--
-- When you associate a document with one or more instances using instance
-- IDs or tags, Amazon Web Services Systems Manager Agent (SSM Agent)
-- running on the instance processes the document and configures the
-- instance as specified.
--
-- If you associate a document with an instance that already has an
-- associated document, the system returns the AssociationAlreadyExists
-- exception.
module Amazonka.SSM.CreateAssociationBatch
  ( -- * Creating a Request
    CreateAssociationBatch (..),
    newCreateAssociationBatch,

    -- * Request Lenses
    createAssociationBatch_entries,

    -- * Destructuring the Response
    CreateAssociationBatchResponse (..),
    newCreateAssociationBatchResponse,

    -- * Response Lenses
    createAssociationBatchResponse_successful,
    createAssociationBatchResponse_failed,
    createAssociationBatchResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types

-- | /See:/ 'newCreateAssociationBatch' smart constructor.
data CreateAssociationBatch = CreateAssociationBatch'
  { -- | One or more associations.
    CreateAssociationBatch
-> NonEmpty CreateAssociationBatchRequestEntry
entries :: Prelude.NonEmpty CreateAssociationBatchRequestEntry
  }
  deriving (CreateAssociationBatch -> CreateAssociationBatch -> Bool
(CreateAssociationBatch -> CreateAssociationBatch -> Bool)
-> (CreateAssociationBatch -> CreateAssociationBatch -> Bool)
-> Eq CreateAssociationBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssociationBatch -> CreateAssociationBatch -> Bool
$c/= :: CreateAssociationBatch -> CreateAssociationBatch -> Bool
== :: CreateAssociationBatch -> CreateAssociationBatch -> Bool
$c== :: CreateAssociationBatch -> CreateAssociationBatch -> Bool
Prelude.Eq, ReadPrec [CreateAssociationBatch]
ReadPrec CreateAssociationBatch
Int -> ReadS CreateAssociationBatch
ReadS [CreateAssociationBatch]
(Int -> ReadS CreateAssociationBatch)
-> ReadS [CreateAssociationBatch]
-> ReadPrec CreateAssociationBatch
-> ReadPrec [CreateAssociationBatch]
-> Read CreateAssociationBatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssociationBatch]
$creadListPrec :: ReadPrec [CreateAssociationBatch]
readPrec :: ReadPrec CreateAssociationBatch
$creadPrec :: ReadPrec CreateAssociationBatch
readList :: ReadS [CreateAssociationBatch]
$creadList :: ReadS [CreateAssociationBatch]
readsPrec :: Int -> ReadS CreateAssociationBatch
$creadsPrec :: Int -> ReadS CreateAssociationBatch
Prelude.Read, Int -> CreateAssociationBatch -> ShowS
[CreateAssociationBatch] -> ShowS
CreateAssociationBatch -> String
(Int -> CreateAssociationBatch -> ShowS)
-> (CreateAssociationBatch -> String)
-> ([CreateAssociationBatch] -> ShowS)
-> Show CreateAssociationBatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssociationBatch] -> ShowS
$cshowList :: [CreateAssociationBatch] -> ShowS
show :: CreateAssociationBatch -> String
$cshow :: CreateAssociationBatch -> String
showsPrec :: Int -> CreateAssociationBatch -> ShowS
$cshowsPrec :: Int -> CreateAssociationBatch -> ShowS
Prelude.Show, (forall x. CreateAssociationBatch -> Rep CreateAssociationBatch x)
-> (forall x.
    Rep CreateAssociationBatch x -> CreateAssociationBatch)
-> Generic CreateAssociationBatch
forall x. Rep CreateAssociationBatch x -> CreateAssociationBatch
forall x. CreateAssociationBatch -> Rep CreateAssociationBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAssociationBatch x -> CreateAssociationBatch
$cfrom :: forall x. CreateAssociationBatch -> Rep CreateAssociationBatch x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssociationBatch' 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', 'createAssociationBatch_entries' - One or more associations.
newCreateAssociationBatch ::
  -- | 'entries'
  Prelude.NonEmpty CreateAssociationBatchRequestEntry ->
  CreateAssociationBatch
newCreateAssociationBatch :: NonEmpty CreateAssociationBatchRequestEntry
-> CreateAssociationBatch
newCreateAssociationBatch NonEmpty CreateAssociationBatchRequestEntry
pEntries_ =
  CreateAssociationBatch' :: NonEmpty CreateAssociationBatchRequestEntry
-> CreateAssociationBatch
CreateAssociationBatch'
    { $sel:entries:CreateAssociationBatch' :: NonEmpty CreateAssociationBatchRequestEntry
entries =
        Tagged
  (NonEmpty CreateAssociationBatchRequestEntry)
  (Identity (NonEmpty CreateAssociationBatchRequestEntry))
-> Tagged
     (NonEmpty CreateAssociationBatchRequestEntry)
     (Identity (NonEmpty CreateAssociationBatchRequestEntry))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty CreateAssociationBatchRequestEntry)
   (Identity (NonEmpty CreateAssociationBatchRequestEntry))
 -> Tagged
      (NonEmpty CreateAssociationBatchRequestEntry)
      (Identity (NonEmpty CreateAssociationBatchRequestEntry)))
-> NonEmpty CreateAssociationBatchRequestEntry
-> NonEmpty CreateAssociationBatchRequestEntry
forall t b. AReview t b -> b -> t
Lens.# NonEmpty CreateAssociationBatchRequestEntry
pEntries_
    }

-- | One or more associations.
createAssociationBatch_entries :: Lens.Lens' CreateAssociationBatch (Prelude.NonEmpty CreateAssociationBatchRequestEntry)
createAssociationBatch_entries :: (NonEmpty CreateAssociationBatchRequestEntry
 -> f (NonEmpty CreateAssociationBatchRequestEntry))
-> CreateAssociationBatch -> f CreateAssociationBatch
createAssociationBatch_entries = (CreateAssociationBatch
 -> NonEmpty CreateAssociationBatchRequestEntry)
-> (CreateAssociationBatch
    -> NonEmpty CreateAssociationBatchRequestEntry
    -> CreateAssociationBatch)
-> Lens
     CreateAssociationBatch
     CreateAssociationBatch
     (NonEmpty CreateAssociationBatchRequestEntry)
     (NonEmpty CreateAssociationBatchRequestEntry)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssociationBatch' {NonEmpty CreateAssociationBatchRequestEntry
entries :: NonEmpty CreateAssociationBatchRequestEntry
$sel:entries:CreateAssociationBatch' :: CreateAssociationBatch
-> NonEmpty CreateAssociationBatchRequestEntry
entries} -> NonEmpty CreateAssociationBatchRequestEntry
entries) (\s :: CreateAssociationBatch
s@CreateAssociationBatch' {} NonEmpty CreateAssociationBatchRequestEntry
a -> CreateAssociationBatch
s {$sel:entries:CreateAssociationBatch' :: NonEmpty CreateAssociationBatchRequestEntry
entries = NonEmpty CreateAssociationBatchRequestEntry
a} :: CreateAssociationBatch) ((NonEmpty CreateAssociationBatchRequestEntry
  -> f (NonEmpty CreateAssociationBatchRequestEntry))
 -> CreateAssociationBatch -> f CreateAssociationBatch)
-> ((NonEmpty CreateAssociationBatchRequestEntry
     -> f (NonEmpty CreateAssociationBatchRequestEntry))
    -> NonEmpty CreateAssociationBatchRequestEntry
    -> f (NonEmpty CreateAssociationBatchRequestEntry))
-> (NonEmpty CreateAssociationBatchRequestEntry
    -> f (NonEmpty CreateAssociationBatchRequestEntry))
-> CreateAssociationBatch
-> f CreateAssociationBatch
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty CreateAssociationBatchRequestEntry
 -> f (NonEmpty CreateAssociationBatchRequestEntry))
-> NonEmpty CreateAssociationBatchRequestEntry
-> f (NonEmpty CreateAssociationBatchRequestEntry)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateAssociationBatch where
  type
    AWSResponse CreateAssociationBatch =
      CreateAssociationBatchResponse
  request :: CreateAssociationBatch -> Request CreateAssociationBatch
request = Service -> CreateAssociationBatch -> Request CreateAssociationBatch
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateAssociationBatch
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAssociationBatch)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateAssociationBatch))
-> Logger
-> Service
-> Proxy CreateAssociationBatch
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAssociationBatch)))
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 [AssociationDescription]
-> Maybe [FailedCreateAssociation]
-> Int
-> CreateAssociationBatchResponse
CreateAssociationBatchResponse'
            (Maybe [AssociationDescription]
 -> Maybe [FailedCreateAssociation]
 -> Int
 -> CreateAssociationBatchResponse)
-> Either String (Maybe [AssociationDescription])
-> Either
     String
     (Maybe [FailedCreateAssociation]
      -> Int -> CreateAssociationBatchResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Key -> Either String (Maybe (Maybe [AssociationDescription]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"Successful" Either String (Maybe (Maybe [AssociationDescription]))
-> Maybe [AssociationDescription]
-> Either String (Maybe [AssociationDescription])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AssociationDescription]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [FailedCreateAssociation]
   -> Int -> CreateAssociationBatchResponse)
-> Either String (Maybe [FailedCreateAssociation])
-> Either String (Int -> CreateAssociationBatchResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Key -> Either String (Maybe (Maybe [FailedCreateAssociation]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"Failed" Either String (Maybe (Maybe [FailedCreateAssociation]))
-> Maybe [FailedCreateAssociation]
-> Either String (Maybe [FailedCreateAssociation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FailedCreateAssociation]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateAssociationBatchResponse)
-> Either String Int
-> Either String CreateAssociationBatchResponse
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 CreateAssociationBatch

instance Prelude.NFData CreateAssociationBatch

instance Core.ToHeaders CreateAssociationBatch where
  toHeaders :: CreateAssociationBatch -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAssociationBatch -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonSSM.CreateAssociationBatch" ::
                          Prelude.ByteString
                      ),
            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 CreateAssociationBatch where
  toJSON :: CreateAssociationBatch -> Value
toJSON CreateAssociationBatch' {NonEmpty CreateAssociationBatchRequestEntry
entries :: NonEmpty CreateAssociationBatchRequestEntry
$sel:entries:CreateAssociationBatch' :: CreateAssociationBatch
-> NonEmpty CreateAssociationBatchRequestEntry
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Key
"Entries" Key -> NonEmpty CreateAssociationBatchRequestEntry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= NonEmpty CreateAssociationBatchRequestEntry
entries)]
      )

instance Core.ToPath CreateAssociationBatch where
  toPath :: CreateAssociationBatch -> ByteString
toPath = ByteString -> CreateAssociationBatch -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newCreateAssociationBatchResponse' smart constructor.
data CreateAssociationBatchResponse = CreateAssociationBatchResponse'
  { -- | Information about the associations that succeeded.
    CreateAssociationBatchResponse -> Maybe [AssociationDescription]
successful :: Prelude.Maybe [AssociationDescription],
    -- | Information about the associations that failed.
    CreateAssociationBatchResponse -> Maybe [FailedCreateAssociation]
failed :: Prelude.Maybe [FailedCreateAssociation],
    -- | The response's http status code.
    CreateAssociationBatchResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateAssociationBatchResponse
-> CreateAssociationBatchResponse -> Bool
(CreateAssociationBatchResponse
 -> CreateAssociationBatchResponse -> Bool)
-> (CreateAssociationBatchResponse
    -> CreateAssociationBatchResponse -> Bool)
-> Eq CreateAssociationBatchResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssociationBatchResponse
-> CreateAssociationBatchResponse -> Bool
$c/= :: CreateAssociationBatchResponse
-> CreateAssociationBatchResponse -> Bool
== :: CreateAssociationBatchResponse
-> CreateAssociationBatchResponse -> Bool
$c== :: CreateAssociationBatchResponse
-> CreateAssociationBatchResponse -> Bool
Prelude.Eq, ReadPrec [CreateAssociationBatchResponse]
ReadPrec CreateAssociationBatchResponse
Int -> ReadS CreateAssociationBatchResponse
ReadS [CreateAssociationBatchResponse]
(Int -> ReadS CreateAssociationBatchResponse)
-> ReadS [CreateAssociationBatchResponse]
-> ReadPrec CreateAssociationBatchResponse
-> ReadPrec [CreateAssociationBatchResponse]
-> Read CreateAssociationBatchResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssociationBatchResponse]
$creadListPrec :: ReadPrec [CreateAssociationBatchResponse]
readPrec :: ReadPrec CreateAssociationBatchResponse
$creadPrec :: ReadPrec CreateAssociationBatchResponse
readList :: ReadS [CreateAssociationBatchResponse]
$creadList :: ReadS [CreateAssociationBatchResponse]
readsPrec :: Int -> ReadS CreateAssociationBatchResponse
$creadsPrec :: Int -> ReadS CreateAssociationBatchResponse
Prelude.Read, Int -> CreateAssociationBatchResponse -> ShowS
[CreateAssociationBatchResponse] -> ShowS
CreateAssociationBatchResponse -> String
(Int -> CreateAssociationBatchResponse -> ShowS)
-> (CreateAssociationBatchResponse -> String)
-> ([CreateAssociationBatchResponse] -> ShowS)
-> Show CreateAssociationBatchResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssociationBatchResponse] -> ShowS
$cshowList :: [CreateAssociationBatchResponse] -> ShowS
show :: CreateAssociationBatchResponse -> String
$cshow :: CreateAssociationBatchResponse -> String
showsPrec :: Int -> CreateAssociationBatchResponse -> ShowS
$cshowsPrec :: Int -> CreateAssociationBatchResponse -> ShowS
Prelude.Show, (forall x.
 CreateAssociationBatchResponse
 -> Rep CreateAssociationBatchResponse x)
-> (forall x.
    Rep CreateAssociationBatchResponse x
    -> CreateAssociationBatchResponse)
-> Generic CreateAssociationBatchResponse
forall x.
Rep CreateAssociationBatchResponse x
-> CreateAssociationBatchResponse
forall x.
CreateAssociationBatchResponse
-> Rep CreateAssociationBatchResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAssociationBatchResponse x
-> CreateAssociationBatchResponse
$cfrom :: forall x.
CreateAssociationBatchResponse
-> Rep CreateAssociationBatchResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssociationBatchResponse' 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:
--
-- 'successful', 'createAssociationBatchResponse_successful' - Information about the associations that succeeded.
--
-- 'failed', 'createAssociationBatchResponse_failed' - Information about the associations that failed.
--
-- 'httpStatus', 'createAssociationBatchResponse_httpStatus' - The response's http status code.
newCreateAssociationBatchResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAssociationBatchResponse
newCreateAssociationBatchResponse :: Int -> CreateAssociationBatchResponse
newCreateAssociationBatchResponse Int
pHttpStatus_ =
  CreateAssociationBatchResponse' :: Maybe [AssociationDescription]
-> Maybe [FailedCreateAssociation]
-> Int
-> CreateAssociationBatchResponse
CreateAssociationBatchResponse'
    { $sel:successful:CreateAssociationBatchResponse' :: Maybe [AssociationDescription]
successful =
        Maybe [AssociationDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:failed:CreateAssociationBatchResponse' :: Maybe [FailedCreateAssociation]
failed = Maybe [FailedCreateAssociation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAssociationBatchResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the associations that succeeded.
createAssociationBatchResponse_successful :: Lens.Lens' CreateAssociationBatchResponse (Prelude.Maybe [AssociationDescription])
createAssociationBatchResponse_successful :: (Maybe [AssociationDescription]
 -> f (Maybe [AssociationDescription]))
-> CreateAssociationBatchResponse
-> f CreateAssociationBatchResponse
createAssociationBatchResponse_successful = (CreateAssociationBatchResponse -> Maybe [AssociationDescription])
-> (CreateAssociationBatchResponse
    -> Maybe [AssociationDescription]
    -> CreateAssociationBatchResponse)
-> Lens
     CreateAssociationBatchResponse
     CreateAssociationBatchResponse
     (Maybe [AssociationDescription])
     (Maybe [AssociationDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssociationBatchResponse' {Maybe [AssociationDescription]
successful :: Maybe [AssociationDescription]
$sel:successful:CreateAssociationBatchResponse' :: CreateAssociationBatchResponse -> Maybe [AssociationDescription]
successful} -> Maybe [AssociationDescription]
successful) (\s :: CreateAssociationBatchResponse
s@CreateAssociationBatchResponse' {} Maybe [AssociationDescription]
a -> CreateAssociationBatchResponse
s {$sel:successful:CreateAssociationBatchResponse' :: Maybe [AssociationDescription]
successful = Maybe [AssociationDescription]
a} :: CreateAssociationBatchResponse) ((Maybe [AssociationDescription]
  -> f (Maybe [AssociationDescription]))
 -> CreateAssociationBatchResponse
 -> f CreateAssociationBatchResponse)
-> ((Maybe [AssociationDescription]
     -> f (Maybe [AssociationDescription]))
    -> Maybe [AssociationDescription]
    -> f (Maybe [AssociationDescription]))
-> (Maybe [AssociationDescription]
    -> f (Maybe [AssociationDescription]))
-> CreateAssociationBatchResponse
-> f CreateAssociationBatchResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AssociationDescription]
  [AssociationDescription]
  [AssociationDescription]
  [AssociationDescription]
-> Iso
     (Maybe [AssociationDescription])
     (Maybe [AssociationDescription])
     (Maybe [AssociationDescription])
     (Maybe [AssociationDescription])
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
  [AssociationDescription]
  [AssociationDescription]
  [AssociationDescription]
  [AssociationDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the associations that failed.
createAssociationBatchResponse_failed :: Lens.Lens' CreateAssociationBatchResponse (Prelude.Maybe [FailedCreateAssociation])
createAssociationBatchResponse_failed :: (Maybe [FailedCreateAssociation]
 -> f (Maybe [FailedCreateAssociation]))
-> CreateAssociationBatchResponse
-> f CreateAssociationBatchResponse
createAssociationBatchResponse_failed = (CreateAssociationBatchResponse -> Maybe [FailedCreateAssociation])
-> (CreateAssociationBatchResponse
    -> Maybe [FailedCreateAssociation]
    -> CreateAssociationBatchResponse)
-> Lens
     CreateAssociationBatchResponse
     CreateAssociationBatchResponse
     (Maybe [FailedCreateAssociation])
     (Maybe [FailedCreateAssociation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssociationBatchResponse' {Maybe [FailedCreateAssociation]
failed :: Maybe [FailedCreateAssociation]
$sel:failed:CreateAssociationBatchResponse' :: CreateAssociationBatchResponse -> Maybe [FailedCreateAssociation]
failed} -> Maybe [FailedCreateAssociation]
failed) (\s :: CreateAssociationBatchResponse
s@CreateAssociationBatchResponse' {} Maybe [FailedCreateAssociation]
a -> CreateAssociationBatchResponse
s {$sel:failed:CreateAssociationBatchResponse' :: Maybe [FailedCreateAssociation]
failed = Maybe [FailedCreateAssociation]
a} :: CreateAssociationBatchResponse) ((Maybe [FailedCreateAssociation]
  -> f (Maybe [FailedCreateAssociation]))
 -> CreateAssociationBatchResponse
 -> f CreateAssociationBatchResponse)
-> ((Maybe [FailedCreateAssociation]
     -> f (Maybe [FailedCreateAssociation]))
    -> Maybe [FailedCreateAssociation]
    -> f (Maybe [FailedCreateAssociation]))
-> (Maybe [FailedCreateAssociation]
    -> f (Maybe [FailedCreateAssociation]))
-> CreateAssociationBatchResponse
-> f CreateAssociationBatchResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FailedCreateAssociation]
  [FailedCreateAssociation]
  [FailedCreateAssociation]
  [FailedCreateAssociation]
-> Iso
     (Maybe [FailedCreateAssociation])
     (Maybe [FailedCreateAssociation])
     (Maybe [FailedCreateAssociation])
     (Maybe [FailedCreateAssociation])
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
  [FailedCreateAssociation]
  [FailedCreateAssociation]
  [FailedCreateAssociation]
  [FailedCreateAssociation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    CreateAssociationBatchResponse