{-# 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-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)
--
-- Create a batch of delegations for a specified 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.Lens as Lens
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 specified assessment.
    BatchCreateDelegationByAssessment -> Text
assessmentId :: Prelude.Text
  }
  deriving (BatchCreateDelegationByAssessment
-> BatchCreateDelegationByAssessment -> Bool
(BatchCreateDelegationByAssessment
 -> BatchCreateDelegationByAssessment -> Bool)
-> (BatchCreateDelegationByAssessment
    -> BatchCreateDelegationByAssessment -> Bool)
-> Eq BatchCreateDelegationByAssessment
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]
(Int -> ReadS BatchCreateDelegationByAssessment)
-> ReadS [BatchCreateDelegationByAssessment]
-> ReadPrec BatchCreateDelegationByAssessment
-> ReadPrec [BatchCreateDelegationByAssessment]
-> Read 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
(Int -> BatchCreateDelegationByAssessment -> ShowS)
-> (BatchCreateDelegationByAssessment -> String)
-> ([BatchCreateDelegationByAssessment] -> ShowS)
-> Show BatchCreateDelegationByAssessment
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.
 BatchCreateDelegationByAssessment
 -> Rep BatchCreateDelegationByAssessment x)
-> (forall x.
    Rep BatchCreateDelegationByAssessment x
    -> BatchCreateDelegationByAssessment)
-> Generic BatchCreateDelegationByAssessment
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 specified assessment.
newBatchCreateDelegationByAssessment ::
  -- | 'createDelegationRequests'
  Prelude.NonEmpty CreateDelegationRequest ->
  -- | 'assessmentId'
  Prelude.Text ->
  BatchCreateDelegationByAssessment
newBatchCreateDelegationByAssessment :: NonEmpty CreateDelegationRequest
-> Text -> BatchCreateDelegationByAssessment
newBatchCreateDelegationByAssessment
  NonEmpty CreateDelegationRequest
pCreateDelegationRequests_
  Text
pAssessmentId_ =
    BatchCreateDelegationByAssessment' :: NonEmpty CreateDelegationRequest
-> Text -> BatchCreateDelegationByAssessment
BatchCreateDelegationByAssessment'
      { $sel:createDelegationRequests:BatchCreateDelegationByAssessment' :: NonEmpty CreateDelegationRequest
createDelegationRequests =
          Tagged
  (NonEmpty CreateDelegationRequest)
  (Identity (NonEmpty CreateDelegationRequest))
-> Tagged
     (NonEmpty CreateDelegationRequest)
     (Identity (NonEmpty CreateDelegationRequest))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            (Tagged
   (NonEmpty CreateDelegationRequest)
   (Identity (NonEmpty CreateDelegationRequest))
 -> Tagged
      (NonEmpty CreateDelegationRequest)
      (Identity (NonEmpty CreateDelegationRequest)))
-> NonEmpty CreateDelegationRequest
-> NonEmpty CreateDelegationRequest
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 :: (NonEmpty CreateDelegationRequest
 -> f (NonEmpty CreateDelegationRequest))
-> BatchCreateDelegationByAssessment
-> f BatchCreateDelegationByAssessment
batchCreateDelegationByAssessment_createDelegationRequests = (BatchCreateDelegationByAssessment
 -> NonEmpty CreateDelegationRequest)
-> (BatchCreateDelegationByAssessment
    -> NonEmpty CreateDelegationRequest
    -> BatchCreateDelegationByAssessment)
-> Lens
     BatchCreateDelegationByAssessment
     BatchCreateDelegationByAssessment
     (NonEmpty CreateDelegationRequest)
     (NonEmpty CreateDelegationRequest)
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) ((NonEmpty CreateDelegationRequest
  -> f (NonEmpty CreateDelegationRequest))
 -> BatchCreateDelegationByAssessment
 -> f BatchCreateDelegationByAssessment)
-> ((NonEmpty CreateDelegationRequest
     -> f (NonEmpty CreateDelegationRequest))
    -> NonEmpty CreateDelegationRequest
    -> f (NonEmpty CreateDelegationRequest))
-> (NonEmpty CreateDelegationRequest
    -> f (NonEmpty CreateDelegationRequest))
-> BatchCreateDelegationByAssessment
-> f BatchCreateDelegationByAssessment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty CreateDelegationRequest
 -> f (NonEmpty CreateDelegationRequest))
-> NonEmpty CreateDelegationRequest
-> f (NonEmpty CreateDelegationRequest)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier for the specified assessment.
batchCreateDelegationByAssessment_assessmentId :: Lens.Lens' BatchCreateDelegationByAssessment Prelude.Text
batchCreateDelegationByAssessment_assessmentId :: (Text -> f Text)
-> BatchCreateDelegationByAssessment
-> f BatchCreateDelegationByAssessment
batchCreateDelegationByAssessment_assessmentId = (BatchCreateDelegationByAssessment -> Text)
-> (BatchCreateDelegationByAssessment
    -> Text -> BatchCreateDelegationByAssessment)
-> Lens
     BatchCreateDelegationByAssessment
     BatchCreateDelegationByAssessment
     Text
     Text
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 :: BatchCreateDelegationByAssessment
-> Request BatchCreateDelegationByAssessment
request = Service
-> BatchCreateDelegationByAssessment
-> Request BatchCreateDelegationByAssessment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchCreateDelegationByAssessment
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse BatchCreateDelegationByAssessment)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchCreateDelegationByAssessment))
-> Logger
-> Service
-> Proxy BatchCreateDelegationByAssessment
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse BatchCreateDelegationByAssessment)))
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 [Delegation]
-> Maybe [BatchCreateDelegationByAssessmentError]
-> Int
-> BatchCreateDelegationByAssessmentResponse
BatchCreateDelegationByAssessmentResponse'
            (Maybe [Delegation]
 -> Maybe [BatchCreateDelegationByAssessmentError]
 -> Int
 -> BatchCreateDelegationByAssessmentResponse)
-> Either String (Maybe [Delegation])
-> Either
     String
     (Maybe [BatchCreateDelegationByAssessmentError]
      -> Int -> BatchCreateDelegationByAssessmentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Delegation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"delegations" Either String (Maybe (Maybe [Delegation]))
-> Maybe [Delegation] -> Either String (Maybe [Delegation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Delegation]
forall a. Monoid a => a
Prelude.mempty)
              Either
  String
  (Maybe [BatchCreateDelegationByAssessmentError]
   -> Int -> BatchCreateDelegationByAssessmentResponse)
-> Either String (Maybe [BatchCreateDelegationByAssessmentError])
-> Either String (Int -> BatchCreateDelegationByAssessmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either
     String (Maybe (Maybe [BatchCreateDelegationByAssessmentError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"errors" Either
  String (Maybe (Maybe [BatchCreateDelegationByAssessmentError]))
-> Maybe [BatchCreateDelegationByAssessmentError]
-> Either String (Maybe [BatchCreateDelegationByAssessmentError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [BatchCreateDelegationByAssessmentError]
forall a. Monoid a => a
Prelude.mempty)
              Either String (Int -> BatchCreateDelegationByAssessmentResponse)
-> Either String Int
-> Either String BatchCreateDelegationByAssessmentResponse
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
    BatchCreateDelegationByAssessment

instance
  Prelude.NFData
    BatchCreateDelegationByAssessment

instance
  Core.ToHeaders
    BatchCreateDelegationByAssessment
  where
  toHeaders :: BatchCreateDelegationByAssessment -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> BatchCreateDelegationByAssessment -> 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
    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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"createDelegationRequests"
                  Text -> NonEmpty CreateDelegationRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty CreateDelegationRequest
createDelegationRequests
              )
          ]
      )

instance
  Core.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
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/assessments/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assessmentId,
        ByteString
"/delegations"
      ]

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

-- | /See:/ 'newBatchCreateDelegationByAssessmentResponse' smart constructor.
data BatchCreateDelegationByAssessmentResponse = BatchCreateDelegationByAssessmentResponse'
  { -- | The delegations associated with the assessment.
    BatchCreateDelegationByAssessmentResponse -> Maybe [Delegation]
delegations :: Prelude.Maybe [Delegation],
    -- | A list of errors returned by the @BatchCreateDelegationByAssessment@
    -- API.
    BatchCreateDelegationByAssessmentResponse
-> Maybe [BatchCreateDelegationByAssessmentError]
errors :: Prelude.Maybe [BatchCreateDelegationByAssessmentError],
    -- | The response's http status code.
    BatchCreateDelegationByAssessmentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchCreateDelegationByAssessmentResponse
-> BatchCreateDelegationByAssessmentResponse -> Bool
(BatchCreateDelegationByAssessmentResponse
 -> BatchCreateDelegationByAssessmentResponse -> Bool)
-> (BatchCreateDelegationByAssessmentResponse
    -> BatchCreateDelegationByAssessmentResponse -> Bool)
-> Eq BatchCreateDelegationByAssessmentResponse
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]
(Int -> ReadS BatchCreateDelegationByAssessmentResponse)
-> ReadS [BatchCreateDelegationByAssessmentResponse]
-> ReadPrec BatchCreateDelegationByAssessmentResponse
-> ReadPrec [BatchCreateDelegationByAssessmentResponse]
-> Read 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
(Int -> BatchCreateDelegationByAssessmentResponse -> ShowS)
-> (BatchCreateDelegationByAssessmentResponse -> String)
-> ([BatchCreateDelegationByAssessmentResponse] -> ShowS)
-> Show BatchCreateDelegationByAssessmentResponse
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.
 BatchCreateDelegationByAssessmentResponse
 -> Rep BatchCreateDelegationByAssessmentResponse x)
-> (forall x.
    Rep BatchCreateDelegationByAssessmentResponse x
    -> BatchCreateDelegationByAssessmentResponse)
-> Generic BatchCreateDelegationByAssessmentResponse
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 associated with the assessment.
--
-- 'errors', 'batchCreateDelegationByAssessmentResponse_errors' - A list of errors returned by the @BatchCreateDelegationByAssessment@
-- API.
--
-- 'httpStatus', 'batchCreateDelegationByAssessmentResponse_httpStatus' - The response's http status code.
newBatchCreateDelegationByAssessmentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchCreateDelegationByAssessmentResponse
newBatchCreateDelegationByAssessmentResponse :: Int -> BatchCreateDelegationByAssessmentResponse
newBatchCreateDelegationByAssessmentResponse
  Int
pHttpStatus_ =
    BatchCreateDelegationByAssessmentResponse' :: Maybe [Delegation]
-> Maybe [BatchCreateDelegationByAssessmentError]
-> Int
-> BatchCreateDelegationByAssessmentResponse
BatchCreateDelegationByAssessmentResponse'
      { $sel:delegations:BatchCreateDelegationByAssessmentResponse' :: Maybe [Delegation]
delegations =
          Maybe [Delegation]
forall a. Maybe a
Prelude.Nothing,
        $sel:errors:BatchCreateDelegationByAssessmentResponse' :: Maybe [BatchCreateDelegationByAssessmentError]
errors = Maybe [BatchCreateDelegationByAssessmentError]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchCreateDelegationByAssessmentResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The delegations associated with the assessment.
batchCreateDelegationByAssessmentResponse_delegations :: Lens.Lens' BatchCreateDelegationByAssessmentResponse (Prelude.Maybe [Delegation])
batchCreateDelegationByAssessmentResponse_delegations :: (Maybe [Delegation] -> f (Maybe [Delegation]))
-> BatchCreateDelegationByAssessmentResponse
-> f BatchCreateDelegationByAssessmentResponse
batchCreateDelegationByAssessmentResponse_delegations = (BatchCreateDelegationByAssessmentResponse -> Maybe [Delegation])
-> (BatchCreateDelegationByAssessmentResponse
    -> Maybe [Delegation] -> BatchCreateDelegationByAssessmentResponse)
-> Lens
     BatchCreateDelegationByAssessmentResponse
     BatchCreateDelegationByAssessmentResponse
     (Maybe [Delegation])
     (Maybe [Delegation])
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) ((Maybe [Delegation] -> f (Maybe [Delegation]))
 -> BatchCreateDelegationByAssessmentResponse
 -> f BatchCreateDelegationByAssessmentResponse)
-> ((Maybe [Delegation] -> f (Maybe [Delegation]))
    -> Maybe [Delegation] -> f (Maybe [Delegation]))
-> (Maybe [Delegation] -> f (Maybe [Delegation]))
-> BatchCreateDelegationByAssessmentResponse
-> f BatchCreateDelegationByAssessmentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Delegation] [Delegation] [Delegation] [Delegation]
-> Iso
     (Maybe [Delegation])
     (Maybe [Delegation])
     (Maybe [Delegation])
     (Maybe [Delegation])
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 [Delegation] [Delegation] [Delegation] [Delegation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of errors returned by the @BatchCreateDelegationByAssessment@
-- API.
batchCreateDelegationByAssessmentResponse_errors :: Lens.Lens' BatchCreateDelegationByAssessmentResponse (Prelude.Maybe [BatchCreateDelegationByAssessmentError])
batchCreateDelegationByAssessmentResponse_errors :: (Maybe [BatchCreateDelegationByAssessmentError]
 -> f (Maybe [BatchCreateDelegationByAssessmentError]))
-> BatchCreateDelegationByAssessmentResponse
-> f BatchCreateDelegationByAssessmentResponse
batchCreateDelegationByAssessmentResponse_errors = (BatchCreateDelegationByAssessmentResponse
 -> Maybe [BatchCreateDelegationByAssessmentError])
-> (BatchCreateDelegationByAssessmentResponse
    -> Maybe [BatchCreateDelegationByAssessmentError]
    -> BatchCreateDelegationByAssessmentResponse)
-> Lens
     BatchCreateDelegationByAssessmentResponse
     BatchCreateDelegationByAssessmentResponse
     (Maybe [BatchCreateDelegationByAssessmentError])
     (Maybe [BatchCreateDelegationByAssessmentError])
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) ((Maybe [BatchCreateDelegationByAssessmentError]
  -> f (Maybe [BatchCreateDelegationByAssessmentError]))
 -> BatchCreateDelegationByAssessmentResponse
 -> f BatchCreateDelegationByAssessmentResponse)
-> ((Maybe [BatchCreateDelegationByAssessmentError]
     -> f (Maybe [BatchCreateDelegationByAssessmentError]))
    -> Maybe [BatchCreateDelegationByAssessmentError]
    -> f (Maybe [BatchCreateDelegationByAssessmentError]))
-> (Maybe [BatchCreateDelegationByAssessmentError]
    -> f (Maybe [BatchCreateDelegationByAssessmentError]))
-> BatchCreateDelegationByAssessmentResponse
-> f BatchCreateDelegationByAssessmentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BatchCreateDelegationByAssessmentError]
  [BatchCreateDelegationByAssessmentError]
  [BatchCreateDelegationByAssessmentError]
  [BatchCreateDelegationByAssessmentError]
-> Iso
     (Maybe [BatchCreateDelegationByAssessmentError])
     (Maybe [BatchCreateDelegationByAssessmentError])
     (Maybe [BatchCreateDelegationByAssessmentError])
     (Maybe [BatchCreateDelegationByAssessmentError])
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
  [BatchCreateDelegationByAssessmentError]
  [BatchCreateDelegationByAssessmentError]
  [BatchCreateDelegationByAssessmentError]
  [BatchCreateDelegationByAssessmentError]
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 :: (Int -> f Int)
-> BatchCreateDelegationByAssessmentResponse
-> f BatchCreateDelegationByAssessmentResponse
batchCreateDelegationByAssessmentResponse_httpStatus = (BatchCreateDelegationByAssessmentResponse -> Int)
-> (BatchCreateDelegationByAssessmentResponse
    -> Int -> BatchCreateDelegationByAssessmentResponse)
-> Lens
     BatchCreateDelegationByAssessmentResponse
     BatchCreateDelegationByAssessmentResponse
     Int
     Int
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