{-# 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.AuditManager.BatchCreateDelegationByAssessment
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a batch of delegations for an assessment in Audit Manager.
module Amazonka.AuditManager.BatchCreateDelegationByAssessment
  ( -- * Creating a Request
    BatchCreateDelegationByAssessment (..),
    newBatchCreateDelegationByAssessment,

    -- * Request Lenses
    batchCreateDelegationByAssessment_createDelegationRequests,
    batchCreateDelegationByAssessment_assessmentId,

    -- * Destructuring the Response
    BatchCreateDelegationByAssessmentResponse (..),
    newBatchCreateDelegationByAssessmentResponse,

    -- * Response Lenses
    batchCreateDelegationByAssessmentResponse_delegations,
    batchCreateDelegationByAssessmentResponse_errors,
    batchCreateDelegationByAssessmentResponse_httpStatus,
  )
where

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

-- | /See:/ 'newBatchCreateDelegationByAssessment' smart constructor.
data BatchCreateDelegationByAssessment = BatchCreateDelegationByAssessment'
  { -- | The API request to batch create delegations in Audit Manager.
    BatchCreateDelegationByAssessment
-> NonEmpty CreateDelegationRequest
createDelegationRequests :: Prelude.NonEmpty CreateDelegationRequest,
    -- | The identifier for the assessment.
    BatchCreateDelegationByAssessment -> Text
assessmentId :: Prelude.Text
  }
  deriving (BatchCreateDelegationByAssessment
-> BatchCreateDelegationByAssessment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchCreateDelegationByAssessment
-> BatchCreateDelegationByAssessment -> Bool
$c/= :: BatchCreateDelegationByAssessment
-> BatchCreateDelegationByAssessment -> Bool
== :: BatchCreateDelegationByAssessment
-> BatchCreateDelegationByAssessment -> Bool
$c== :: BatchCreateDelegationByAssessment
-> BatchCreateDelegationByAssessment -> Bool
Prelude.Eq, ReadPrec [BatchCreateDelegationByAssessment]
ReadPrec BatchCreateDelegationByAssessment
Int -> ReadS BatchCreateDelegationByAssessment
ReadS [BatchCreateDelegationByAssessment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchCreateDelegationByAssessment]
$creadListPrec :: ReadPrec [BatchCreateDelegationByAssessment]
readPrec :: ReadPrec BatchCreateDelegationByAssessment
$creadPrec :: ReadPrec BatchCreateDelegationByAssessment
readList :: ReadS [BatchCreateDelegationByAssessment]
$creadList :: ReadS [BatchCreateDelegationByAssessment]
readsPrec :: Int -> ReadS BatchCreateDelegationByAssessment
$creadsPrec :: Int -> ReadS BatchCreateDelegationByAssessment
Prelude.Read, Int -> BatchCreateDelegationByAssessment -> ShowS
[BatchCreateDelegationByAssessment] -> ShowS
BatchCreateDelegationByAssessment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchCreateDelegationByAssessment] -> ShowS
$cshowList :: [BatchCreateDelegationByAssessment] -> ShowS
show :: BatchCreateDelegationByAssessment -> String
$cshow :: BatchCreateDelegationByAssessment -> String
showsPrec :: Int -> BatchCreateDelegationByAssessment -> ShowS
$cshowsPrec :: Int -> BatchCreateDelegationByAssessment -> ShowS
Prelude.Show, forall x.
Rep BatchCreateDelegationByAssessment x
-> BatchCreateDelegationByAssessment
forall x.
BatchCreateDelegationByAssessment
-> Rep BatchCreateDelegationByAssessment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchCreateDelegationByAssessment x
-> BatchCreateDelegationByAssessment
$cfrom :: forall x.
BatchCreateDelegationByAssessment
-> Rep BatchCreateDelegationByAssessment x
Prelude.Generic)

-- |
-- Create a value of 'BatchCreateDelegationByAssessment' 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:
--
-- 'createDelegationRequests', 'batchCreateDelegationByAssessment_createDelegationRequests' - The API request to batch create delegations in Audit Manager.
--
-- 'assessmentId', 'batchCreateDelegationByAssessment_assessmentId' - The identifier for the assessment.
newBatchCreateDelegationByAssessment ::
  -- | 'createDelegationRequests'
  Prelude.NonEmpty CreateDelegationRequest ->
  -- | 'assessmentId'
  Prelude.Text ->
  BatchCreateDelegationByAssessment
newBatchCreateDelegationByAssessment :: NonEmpty CreateDelegationRequest
-> Text -> BatchCreateDelegationByAssessment
newBatchCreateDelegationByAssessment
  NonEmpty CreateDelegationRequest
pCreateDelegationRequests_
  Text
pAssessmentId_ =
    BatchCreateDelegationByAssessment'
      { $sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: NonEmpty CreateDelegationRequest
createDelegationRequests =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            forall t b. AReview t b -> b -> t
Lens.# NonEmpty CreateDelegationRequest
pCreateDelegationRequests_,
        $sel:assessmentId:BatchCreateDelegationByAssessment' :: Text
assessmentId = Text
pAssessmentId_
      }

-- | The API request to batch create delegations in Audit Manager.
batchCreateDelegationByAssessment_createDelegationRequests :: Lens.Lens' BatchCreateDelegationByAssessment (Prelude.NonEmpty CreateDelegationRequest)
batchCreateDelegationByAssessment_createDelegationRequests :: Lens'
  BatchCreateDelegationByAssessment
  (NonEmpty CreateDelegationRequest)
batchCreateDelegationByAssessment_createDelegationRequests = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateDelegationByAssessment' {NonEmpty CreateDelegationRequest
createDelegationRequests :: NonEmpty CreateDelegationRequest
$sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment
-> NonEmpty CreateDelegationRequest
createDelegationRequests} -> NonEmpty CreateDelegationRequest
createDelegationRequests) (\s :: BatchCreateDelegationByAssessment
s@BatchCreateDelegationByAssessment' {} NonEmpty CreateDelegationRequest
a -> BatchCreateDelegationByAssessment
s {$sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: NonEmpty CreateDelegationRequest
createDelegationRequests = NonEmpty CreateDelegationRequest
a} :: BatchCreateDelegationByAssessment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier for the assessment.
batchCreateDelegationByAssessment_assessmentId :: Lens.Lens' BatchCreateDelegationByAssessment Prelude.Text
batchCreateDelegationByAssessment_assessmentId :: Lens' BatchCreateDelegationByAssessment Text
batchCreateDelegationByAssessment_assessmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateDelegationByAssessment' {Text
assessmentId :: Text
$sel:assessmentId:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment -> Text
assessmentId} -> Text
assessmentId) (\s :: BatchCreateDelegationByAssessment
s@BatchCreateDelegationByAssessment' {} Text
a -> BatchCreateDelegationByAssessment
s {$sel:assessmentId:BatchCreateDelegationByAssessment' :: Text
assessmentId = Text
a} :: BatchCreateDelegationByAssessment)

instance
  Core.AWSRequest
    BatchCreateDelegationByAssessment
  where
  type
    AWSResponse BatchCreateDelegationByAssessment =
      BatchCreateDelegationByAssessmentResponse
  request :: (Service -> Service)
-> BatchCreateDelegationByAssessment
-> Request BatchCreateDelegationByAssessment
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 BatchCreateDelegationByAssessment
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse BatchCreateDelegationByAssessment)))
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 [Delegation]
-> Maybe [BatchCreateDelegationByAssessmentError]
-> Int
-> BatchCreateDelegationByAssessmentResponse
BatchCreateDelegationByAssessmentResponse'
            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
"delegations" 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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"errors" 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
    BatchCreateDelegationByAssessment
  where
  hashWithSalt :: Int -> BatchCreateDelegationByAssessment -> Int
hashWithSalt
    Int
_salt
    BatchCreateDelegationByAssessment' {NonEmpty CreateDelegationRequest
Text
assessmentId :: Text
createDelegationRequests :: NonEmpty CreateDelegationRequest
$sel:assessmentId:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment -> Text
$sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment
-> NonEmpty CreateDelegationRequest
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty CreateDelegationRequest
createDelegationRequests
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
assessmentId

instance
  Prelude.NFData
    BatchCreateDelegationByAssessment
  where
  rnf :: BatchCreateDelegationByAssessment -> ()
rnf BatchCreateDelegationByAssessment' {NonEmpty CreateDelegationRequest
Text
assessmentId :: Text
createDelegationRequests :: NonEmpty CreateDelegationRequest
$sel:assessmentId:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment -> Text
$sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment
-> NonEmpty CreateDelegationRequest
..} =
    forall a. NFData a => a -> ()
Prelude.rnf NonEmpty CreateDelegationRequest
createDelegationRequests
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
assessmentId

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

instance
  Data.ToJSON
    BatchCreateDelegationByAssessment
  where
  toJSON :: BatchCreateDelegationByAssessment -> Value
toJSON BatchCreateDelegationByAssessment' {NonEmpty CreateDelegationRequest
Text
assessmentId :: Text
createDelegationRequests :: NonEmpty CreateDelegationRequest
$sel:assessmentId:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment -> Text
$sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment
-> NonEmpty CreateDelegationRequest
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"createDelegationRequests"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty CreateDelegationRequest
createDelegationRequests
              )
          ]
      )

instance
  Data.ToPath
    BatchCreateDelegationByAssessment
  where
  toPath :: BatchCreateDelegationByAssessment -> ByteString
toPath BatchCreateDelegationByAssessment' {NonEmpty CreateDelegationRequest
Text
assessmentId :: Text
createDelegationRequests :: NonEmpty CreateDelegationRequest
$sel:assessmentId:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment -> Text
$sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: BatchCreateDelegationByAssessment
-> NonEmpty CreateDelegationRequest
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/assessments/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
assessmentId,
        ByteString
"/delegations"
      ]

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

-- | /See:/ 'newBatchCreateDelegationByAssessmentResponse' smart constructor.
data BatchCreateDelegationByAssessmentResponse = BatchCreateDelegationByAssessmentResponse'
  { -- | The delegations that are associated with the assessment.
    BatchCreateDelegationByAssessmentResponse -> Maybe [Delegation]
delegations :: Prelude.Maybe [Delegation],
    -- | A list of errors that the @BatchCreateDelegationByAssessment@ API
    -- returned.
    BatchCreateDelegationByAssessmentResponse
-> Maybe [BatchCreateDelegationByAssessmentError]
errors :: Prelude.Maybe [BatchCreateDelegationByAssessmentError],
    -- | The response's http status code.
    BatchCreateDelegationByAssessmentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchCreateDelegationByAssessmentResponse
-> BatchCreateDelegationByAssessmentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchCreateDelegationByAssessmentResponse
-> BatchCreateDelegationByAssessmentResponse -> Bool
$c/= :: BatchCreateDelegationByAssessmentResponse
-> BatchCreateDelegationByAssessmentResponse -> Bool
== :: BatchCreateDelegationByAssessmentResponse
-> BatchCreateDelegationByAssessmentResponse -> Bool
$c== :: BatchCreateDelegationByAssessmentResponse
-> BatchCreateDelegationByAssessmentResponse -> Bool
Prelude.Eq, ReadPrec [BatchCreateDelegationByAssessmentResponse]
ReadPrec BatchCreateDelegationByAssessmentResponse
Int -> ReadS BatchCreateDelegationByAssessmentResponse
ReadS [BatchCreateDelegationByAssessmentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchCreateDelegationByAssessmentResponse]
$creadListPrec :: ReadPrec [BatchCreateDelegationByAssessmentResponse]
readPrec :: ReadPrec BatchCreateDelegationByAssessmentResponse
$creadPrec :: ReadPrec BatchCreateDelegationByAssessmentResponse
readList :: ReadS [BatchCreateDelegationByAssessmentResponse]
$creadList :: ReadS [BatchCreateDelegationByAssessmentResponse]
readsPrec :: Int -> ReadS BatchCreateDelegationByAssessmentResponse
$creadsPrec :: Int -> ReadS BatchCreateDelegationByAssessmentResponse
Prelude.Read, Int -> BatchCreateDelegationByAssessmentResponse -> ShowS
[BatchCreateDelegationByAssessmentResponse] -> ShowS
BatchCreateDelegationByAssessmentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchCreateDelegationByAssessmentResponse] -> ShowS
$cshowList :: [BatchCreateDelegationByAssessmentResponse] -> ShowS
show :: BatchCreateDelegationByAssessmentResponse -> String
$cshow :: BatchCreateDelegationByAssessmentResponse -> String
showsPrec :: Int -> BatchCreateDelegationByAssessmentResponse -> ShowS
$cshowsPrec :: Int -> BatchCreateDelegationByAssessmentResponse -> ShowS
Prelude.Show, forall x.
Rep BatchCreateDelegationByAssessmentResponse x
-> BatchCreateDelegationByAssessmentResponse
forall x.
BatchCreateDelegationByAssessmentResponse
-> Rep BatchCreateDelegationByAssessmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchCreateDelegationByAssessmentResponse x
-> BatchCreateDelegationByAssessmentResponse
$cfrom :: forall x.
BatchCreateDelegationByAssessmentResponse
-> Rep BatchCreateDelegationByAssessmentResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchCreateDelegationByAssessmentResponse' 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:
--
-- 'delegations', 'batchCreateDelegationByAssessmentResponse_delegations' - The delegations that are associated with the assessment.
--
-- 'errors', 'batchCreateDelegationByAssessmentResponse_errors' - A list of errors that the @BatchCreateDelegationByAssessment@ API
-- returned.
--
-- 'httpStatus', 'batchCreateDelegationByAssessmentResponse_httpStatus' - The response's http status code.
newBatchCreateDelegationByAssessmentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchCreateDelegationByAssessmentResponse
newBatchCreateDelegationByAssessmentResponse :: Int -> BatchCreateDelegationByAssessmentResponse
newBatchCreateDelegationByAssessmentResponse
  Int
pHttpStatus_ =
    BatchCreateDelegationByAssessmentResponse'
      { $sel:delegations:BatchCreateDelegationByAssessmentResponse' :: Maybe [Delegation]
delegations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:errors:BatchCreateDelegationByAssessmentResponse' :: Maybe [BatchCreateDelegationByAssessmentError]
errors = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchCreateDelegationByAssessmentResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The delegations that are associated with the assessment.
batchCreateDelegationByAssessmentResponse_delegations :: Lens.Lens' BatchCreateDelegationByAssessmentResponse (Prelude.Maybe [Delegation])
batchCreateDelegationByAssessmentResponse_delegations :: Lens'
  BatchCreateDelegationByAssessmentResponse (Maybe [Delegation])
batchCreateDelegationByAssessmentResponse_delegations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateDelegationByAssessmentResponse' {Maybe [Delegation]
delegations :: Maybe [Delegation]
$sel:delegations:BatchCreateDelegationByAssessmentResponse' :: BatchCreateDelegationByAssessmentResponse -> Maybe [Delegation]
delegations} -> Maybe [Delegation]
delegations) (\s :: BatchCreateDelegationByAssessmentResponse
s@BatchCreateDelegationByAssessmentResponse' {} Maybe [Delegation]
a -> BatchCreateDelegationByAssessmentResponse
s {$sel:delegations:BatchCreateDelegationByAssessmentResponse' :: Maybe [Delegation]
delegations = Maybe [Delegation]
a} :: BatchCreateDelegationByAssessmentResponse) 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

-- | A list of errors that the @BatchCreateDelegationByAssessment@ API
-- returned.
batchCreateDelegationByAssessmentResponse_errors :: Lens.Lens' BatchCreateDelegationByAssessmentResponse (Prelude.Maybe [BatchCreateDelegationByAssessmentError])
batchCreateDelegationByAssessmentResponse_errors :: Lens'
  BatchCreateDelegationByAssessmentResponse
  (Maybe [BatchCreateDelegationByAssessmentError])
batchCreateDelegationByAssessmentResponse_errors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateDelegationByAssessmentResponse' {Maybe [BatchCreateDelegationByAssessmentError]
errors :: Maybe [BatchCreateDelegationByAssessmentError]
$sel:errors:BatchCreateDelegationByAssessmentResponse' :: BatchCreateDelegationByAssessmentResponse
-> Maybe [BatchCreateDelegationByAssessmentError]
errors} -> Maybe [BatchCreateDelegationByAssessmentError]
errors) (\s :: BatchCreateDelegationByAssessmentResponse
s@BatchCreateDelegationByAssessmentResponse' {} Maybe [BatchCreateDelegationByAssessmentError]
a -> BatchCreateDelegationByAssessmentResponse
s {$sel:errors:BatchCreateDelegationByAssessmentResponse' :: Maybe [BatchCreateDelegationByAssessmentError]
errors = Maybe [BatchCreateDelegationByAssessmentError]
a} :: BatchCreateDelegationByAssessmentResponse) 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.
batchCreateDelegationByAssessmentResponse_httpStatus :: Lens.Lens' BatchCreateDelegationByAssessmentResponse Prelude.Int
batchCreateDelegationByAssessmentResponse_httpStatus :: Lens' BatchCreateDelegationByAssessmentResponse Int
batchCreateDelegationByAssessmentResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateDelegationByAssessmentResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchCreateDelegationByAssessmentResponse' :: BatchCreateDelegationByAssessmentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchCreateDelegationByAssessmentResponse
s@BatchCreateDelegationByAssessmentResponse' {} Int
a -> BatchCreateDelegationByAssessmentResponse
s {$sel:httpStatus:BatchCreateDelegationByAssessmentResponse' :: Int
httpStatus = Int
a} :: BatchCreateDelegationByAssessmentResponse)

instance
  Prelude.NFData
    BatchCreateDelegationByAssessmentResponse
  where
  rnf :: BatchCreateDelegationByAssessmentResponse -> ()
rnf BatchCreateDelegationByAssessmentResponse' {Int
Maybe [Delegation]
Maybe [BatchCreateDelegationByAssessmentError]
httpStatus :: Int
errors :: Maybe [BatchCreateDelegationByAssessmentError]
delegations :: Maybe [Delegation]
$sel:httpStatus:BatchCreateDelegationByAssessmentResponse' :: BatchCreateDelegationByAssessmentResponse -> Int
$sel:errors:BatchCreateDelegationByAssessmentResponse' :: BatchCreateDelegationByAssessmentResponse
-> Maybe [BatchCreateDelegationByAssessmentError]
$sel:delegations:BatchCreateDelegationByAssessmentResponse' :: BatchCreateDelegationByAssessmentResponse -> Maybe [Delegation]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Delegation]
delegations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [BatchCreateDelegationByAssessmentError]
errors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus