{-# 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.MediaLive.BatchDelete
-- 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)
--
-- Starts delete of resources.
module Amazonka.MediaLive.BatchDelete
  ( -- * Creating a Request
    BatchDelete' (..),
    newBatchDelete',

    -- * Request Lenses
    batchDelete'_channelIds,
    batchDelete'_inputIds,
    batchDelete'_multiplexIds,
    batchDelete'_inputSecurityGroupIds,

    -- * Destructuring the Response
    BatchDeleteResponse (..),
    newBatchDeleteResponse,

    -- * Response Lenses
    batchDeleteResponse_successful,
    batchDeleteResponse_failed,
    batchDeleteResponse_httpStatus,
  )
where

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

-- | A request to delete resources
--
-- /See:/ 'newBatchDelete'' smart constructor.
data BatchDelete' = BatchDelete''
  { -- | List of channel IDs
    BatchDelete' -> Maybe [Text]
channelIds :: Prelude.Maybe [Prelude.Text],
    -- | List of input IDs
    BatchDelete' -> Maybe [Text]
inputIds :: Prelude.Maybe [Prelude.Text],
    -- | List of multiplex IDs
    BatchDelete' -> Maybe [Text]
multiplexIds :: Prelude.Maybe [Prelude.Text],
    -- | List of input security group IDs
    BatchDelete' -> Maybe [Text]
inputSecurityGroupIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (BatchDelete' -> BatchDelete' -> Bool
(BatchDelete' -> BatchDelete' -> Bool)
-> (BatchDelete' -> BatchDelete' -> Bool) -> Eq BatchDelete'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDelete' -> BatchDelete' -> Bool
$c/= :: BatchDelete' -> BatchDelete' -> Bool
== :: BatchDelete' -> BatchDelete' -> Bool
$c== :: BatchDelete' -> BatchDelete' -> Bool
Prelude.Eq, ReadPrec [BatchDelete']
ReadPrec BatchDelete'
Int -> ReadS BatchDelete'
ReadS [BatchDelete']
(Int -> ReadS BatchDelete')
-> ReadS [BatchDelete']
-> ReadPrec BatchDelete'
-> ReadPrec [BatchDelete']
-> Read BatchDelete'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDelete']
$creadListPrec :: ReadPrec [BatchDelete']
readPrec :: ReadPrec BatchDelete'
$creadPrec :: ReadPrec BatchDelete'
readList :: ReadS [BatchDelete']
$creadList :: ReadS [BatchDelete']
readsPrec :: Int -> ReadS BatchDelete'
$creadsPrec :: Int -> ReadS BatchDelete'
Prelude.Read, Int -> BatchDelete' -> ShowS
[BatchDelete'] -> ShowS
BatchDelete' -> String
(Int -> BatchDelete' -> ShowS)
-> (BatchDelete' -> String)
-> ([BatchDelete'] -> ShowS)
-> Show BatchDelete'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDelete'] -> ShowS
$cshowList :: [BatchDelete'] -> ShowS
show :: BatchDelete' -> String
$cshow :: BatchDelete' -> String
showsPrec :: Int -> BatchDelete' -> ShowS
$cshowsPrec :: Int -> BatchDelete' -> ShowS
Prelude.Show, (forall x. BatchDelete' -> Rep BatchDelete' x)
-> (forall x. Rep BatchDelete' x -> BatchDelete')
-> Generic BatchDelete'
forall x. Rep BatchDelete' x -> BatchDelete'
forall x. BatchDelete' -> Rep BatchDelete' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDelete' x -> BatchDelete'
$cfrom :: forall x. BatchDelete' -> Rep BatchDelete' x
Prelude.Generic)

-- |
-- Create a value of 'BatchDelete'' 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:
--
-- 'channelIds', 'batchDelete'_channelIds' - List of channel IDs
--
-- 'inputIds', 'batchDelete'_inputIds' - List of input IDs
--
-- 'multiplexIds', 'batchDelete'_multiplexIds' - List of multiplex IDs
--
-- 'inputSecurityGroupIds', 'batchDelete'_inputSecurityGroupIds' - List of input security group IDs
newBatchDelete' ::
  BatchDelete'
newBatchDelete' :: BatchDelete'
newBatchDelete' =
  BatchDelete'' :: Maybe [Text]
-> Maybe [Text] -> Maybe [Text] -> Maybe [Text] -> BatchDelete'
BatchDelete''
    { $sel:channelIds:BatchDelete'' :: Maybe [Text]
channelIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:inputIds:BatchDelete'' :: Maybe [Text]
inputIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:multiplexIds:BatchDelete'' :: Maybe [Text]
multiplexIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:inputSecurityGroupIds:BatchDelete'' :: Maybe [Text]
inputSecurityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | List of channel IDs
batchDelete'_channelIds :: Lens.Lens' BatchDelete' (Prelude.Maybe [Prelude.Text])
batchDelete'_channelIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete' -> f BatchDelete'
batchDelete'_channelIds = (BatchDelete' -> Maybe [Text])
-> (BatchDelete' -> Maybe [Text] -> BatchDelete')
-> Lens BatchDelete' BatchDelete' (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDelete'' {Maybe [Text]
channelIds :: Maybe [Text]
$sel:channelIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
channelIds} -> Maybe [Text]
channelIds) (\s :: BatchDelete'
s@BatchDelete'' {} Maybe [Text]
a -> BatchDelete'
s {$sel:channelIds:BatchDelete'' :: Maybe [Text]
channelIds = Maybe [Text]
a} :: BatchDelete') ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchDelete' -> f BatchDelete')
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete'
-> f BatchDelete'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | List of input IDs
batchDelete'_inputIds :: Lens.Lens' BatchDelete' (Prelude.Maybe [Prelude.Text])
batchDelete'_inputIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete' -> f BatchDelete'
batchDelete'_inputIds = (BatchDelete' -> Maybe [Text])
-> (BatchDelete' -> Maybe [Text] -> BatchDelete')
-> Lens BatchDelete' BatchDelete' (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDelete'' {Maybe [Text]
inputIds :: Maybe [Text]
$sel:inputIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
inputIds} -> Maybe [Text]
inputIds) (\s :: BatchDelete'
s@BatchDelete'' {} Maybe [Text]
a -> BatchDelete'
s {$sel:inputIds:BatchDelete'' :: Maybe [Text]
inputIds = Maybe [Text]
a} :: BatchDelete') ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchDelete' -> f BatchDelete')
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete'
-> f BatchDelete'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | List of multiplex IDs
batchDelete'_multiplexIds :: Lens.Lens' BatchDelete' (Prelude.Maybe [Prelude.Text])
batchDelete'_multiplexIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete' -> f BatchDelete'
batchDelete'_multiplexIds = (BatchDelete' -> Maybe [Text])
-> (BatchDelete' -> Maybe [Text] -> BatchDelete')
-> Lens BatchDelete' BatchDelete' (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDelete'' {Maybe [Text]
multiplexIds :: Maybe [Text]
$sel:multiplexIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
multiplexIds} -> Maybe [Text]
multiplexIds) (\s :: BatchDelete'
s@BatchDelete'' {} Maybe [Text]
a -> BatchDelete'
s {$sel:multiplexIds:BatchDelete'' :: Maybe [Text]
multiplexIds = Maybe [Text]
a} :: BatchDelete') ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchDelete' -> f BatchDelete')
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete'
-> f BatchDelete'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | List of input security group IDs
batchDelete'_inputSecurityGroupIds :: Lens.Lens' BatchDelete' (Prelude.Maybe [Prelude.Text])
batchDelete'_inputSecurityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete' -> f BatchDelete'
batchDelete'_inputSecurityGroupIds = (BatchDelete' -> Maybe [Text])
-> (BatchDelete' -> Maybe [Text] -> BatchDelete')
-> Lens BatchDelete' BatchDelete' (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDelete'' {Maybe [Text]
inputSecurityGroupIds :: Maybe [Text]
$sel:inputSecurityGroupIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
inputSecurityGroupIds} -> Maybe [Text]
inputSecurityGroupIds) (\s :: BatchDelete'
s@BatchDelete'' {} Maybe [Text]
a -> BatchDelete'
s {$sel:inputSecurityGroupIds:BatchDelete'' :: Maybe [Text]
inputSecurityGroupIds = Maybe [Text]
a} :: BatchDelete') ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchDelete' -> f BatchDelete')
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchDelete'
-> f BatchDelete'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData BatchDelete'

instance Core.ToHeaders BatchDelete' where
  toHeaders :: BatchDelete' -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchDelete' -> 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 BatchDelete' where
  toJSON :: BatchDelete' -> Value
toJSON BatchDelete'' {Maybe [Text]
inputSecurityGroupIds :: Maybe [Text]
multiplexIds :: Maybe [Text]
inputIds :: Maybe [Text]
channelIds :: Maybe [Text]
$sel:inputSecurityGroupIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
$sel:multiplexIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
$sel:inputIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
$sel:channelIds:BatchDelete'' :: BatchDelete' -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"channelIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
channelIds,
            (Text
"inputIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
inputIds,
            (Text
"multiplexIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
multiplexIds,
            (Text
"inputSecurityGroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
inputSecurityGroupIds
          ]
      )

instance Core.ToPath BatchDelete' where
  toPath :: BatchDelete' -> ByteString
toPath = ByteString -> BatchDelete' -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/prod/batch/delete"

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

-- | Placeholder documentation for BatchDeleteResponse
--
-- /See:/ 'newBatchDeleteResponse' smart constructor.
data BatchDeleteResponse = BatchDeleteResponse'
  { -- | List of successful operations
    BatchDeleteResponse -> Maybe [BatchSuccessfulResultModel]
successful :: Prelude.Maybe [BatchSuccessfulResultModel],
    -- | List of failed operations
    BatchDeleteResponse -> Maybe [BatchFailedResultModel]
failed :: Prelude.Maybe [BatchFailedResultModel],
    -- | The response's http status code.
    BatchDeleteResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchDeleteResponse -> BatchDeleteResponse -> Bool
(BatchDeleteResponse -> BatchDeleteResponse -> Bool)
-> (BatchDeleteResponse -> BatchDeleteResponse -> Bool)
-> Eq BatchDeleteResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
$c/= :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
== :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
$c== :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
Prelude.Eq, ReadPrec [BatchDeleteResponse]
ReadPrec BatchDeleteResponse
Int -> ReadS BatchDeleteResponse
ReadS [BatchDeleteResponse]
(Int -> ReadS BatchDeleteResponse)
-> ReadS [BatchDeleteResponse]
-> ReadPrec BatchDeleteResponse
-> ReadPrec [BatchDeleteResponse]
-> Read BatchDeleteResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteResponse]
$creadListPrec :: ReadPrec [BatchDeleteResponse]
readPrec :: ReadPrec BatchDeleteResponse
$creadPrec :: ReadPrec BatchDeleteResponse
readList :: ReadS [BatchDeleteResponse]
$creadList :: ReadS [BatchDeleteResponse]
readsPrec :: Int -> ReadS BatchDeleteResponse
$creadsPrec :: Int -> ReadS BatchDeleteResponse
Prelude.Read, Int -> BatchDeleteResponse -> ShowS
[BatchDeleteResponse] -> ShowS
BatchDeleteResponse -> String
(Int -> BatchDeleteResponse -> ShowS)
-> (BatchDeleteResponse -> String)
-> ([BatchDeleteResponse] -> ShowS)
-> Show BatchDeleteResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteResponse] -> ShowS
$cshowList :: [BatchDeleteResponse] -> ShowS
show :: BatchDeleteResponse -> String
$cshow :: BatchDeleteResponse -> String
showsPrec :: Int -> BatchDeleteResponse -> ShowS
$cshowsPrec :: Int -> BatchDeleteResponse -> ShowS
Prelude.Show, (forall x. BatchDeleteResponse -> Rep BatchDeleteResponse x)
-> (forall x. Rep BatchDeleteResponse x -> BatchDeleteResponse)
-> Generic BatchDeleteResponse
forall x. Rep BatchDeleteResponse x -> BatchDeleteResponse
forall x. BatchDeleteResponse -> Rep BatchDeleteResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDeleteResponse x -> BatchDeleteResponse
$cfrom :: forall x. BatchDeleteResponse -> Rep BatchDeleteResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteResponse' 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', 'batchDeleteResponse_successful' - List of successful operations
--
-- 'failed', 'batchDeleteResponse_failed' - List of failed operations
--
-- 'httpStatus', 'batchDeleteResponse_httpStatus' - The response's http status code.
newBatchDeleteResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchDeleteResponse
newBatchDeleteResponse :: Int -> BatchDeleteResponse
newBatchDeleteResponse Int
pHttpStatus_ =
  BatchDeleteResponse' :: Maybe [BatchSuccessfulResultModel]
-> Maybe [BatchFailedResultModel] -> Int -> BatchDeleteResponse
BatchDeleteResponse'
    { $sel:successful:BatchDeleteResponse' :: Maybe [BatchSuccessfulResultModel]
successful = Maybe [BatchSuccessfulResultModel]
forall a. Maybe a
Prelude.Nothing,
      $sel:failed:BatchDeleteResponse' :: Maybe [BatchFailedResultModel]
failed = Maybe [BatchFailedResultModel]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchDeleteResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | List of successful operations
batchDeleteResponse_successful :: Lens.Lens' BatchDeleteResponse (Prelude.Maybe [BatchSuccessfulResultModel])
batchDeleteResponse_successful :: (Maybe [BatchSuccessfulResultModel]
 -> f (Maybe [BatchSuccessfulResultModel]))
-> BatchDeleteResponse -> f BatchDeleteResponse
batchDeleteResponse_successful = (BatchDeleteResponse -> Maybe [BatchSuccessfulResultModel])
-> (BatchDeleteResponse
    -> Maybe [BatchSuccessfulResultModel] -> BatchDeleteResponse)
-> Lens
     BatchDeleteResponse
     BatchDeleteResponse
     (Maybe [BatchSuccessfulResultModel])
     (Maybe [BatchSuccessfulResultModel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteResponse' {Maybe [BatchSuccessfulResultModel]
successful :: Maybe [BatchSuccessfulResultModel]
$sel:successful:BatchDeleteResponse' :: BatchDeleteResponse -> Maybe [BatchSuccessfulResultModel]
successful} -> Maybe [BatchSuccessfulResultModel]
successful) (\s :: BatchDeleteResponse
s@BatchDeleteResponse' {} Maybe [BatchSuccessfulResultModel]
a -> BatchDeleteResponse
s {$sel:successful:BatchDeleteResponse' :: Maybe [BatchSuccessfulResultModel]
successful = Maybe [BatchSuccessfulResultModel]
a} :: BatchDeleteResponse) ((Maybe [BatchSuccessfulResultModel]
  -> f (Maybe [BatchSuccessfulResultModel]))
 -> BatchDeleteResponse -> f BatchDeleteResponse)
-> ((Maybe [BatchSuccessfulResultModel]
     -> f (Maybe [BatchSuccessfulResultModel]))
    -> Maybe [BatchSuccessfulResultModel]
    -> f (Maybe [BatchSuccessfulResultModel]))
-> (Maybe [BatchSuccessfulResultModel]
    -> f (Maybe [BatchSuccessfulResultModel]))
-> BatchDeleteResponse
-> f BatchDeleteResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BatchSuccessfulResultModel]
  [BatchSuccessfulResultModel]
  [BatchSuccessfulResultModel]
  [BatchSuccessfulResultModel]
-> Iso
     (Maybe [BatchSuccessfulResultModel])
     (Maybe [BatchSuccessfulResultModel])
     (Maybe [BatchSuccessfulResultModel])
     (Maybe [BatchSuccessfulResultModel])
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
  [BatchSuccessfulResultModel]
  [BatchSuccessfulResultModel]
  [BatchSuccessfulResultModel]
  [BatchSuccessfulResultModel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | List of failed operations
batchDeleteResponse_failed :: Lens.Lens' BatchDeleteResponse (Prelude.Maybe [BatchFailedResultModel])
batchDeleteResponse_failed :: (Maybe [BatchFailedResultModel]
 -> f (Maybe [BatchFailedResultModel]))
-> BatchDeleteResponse -> f BatchDeleteResponse
batchDeleteResponse_failed = (BatchDeleteResponse -> Maybe [BatchFailedResultModel])
-> (BatchDeleteResponse
    -> Maybe [BatchFailedResultModel] -> BatchDeleteResponse)
-> Lens
     BatchDeleteResponse
     BatchDeleteResponse
     (Maybe [BatchFailedResultModel])
     (Maybe [BatchFailedResultModel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteResponse' {Maybe [BatchFailedResultModel]
failed :: Maybe [BatchFailedResultModel]
$sel:failed:BatchDeleteResponse' :: BatchDeleteResponse -> Maybe [BatchFailedResultModel]
failed} -> Maybe [BatchFailedResultModel]
failed) (\s :: BatchDeleteResponse
s@BatchDeleteResponse' {} Maybe [BatchFailedResultModel]
a -> BatchDeleteResponse
s {$sel:failed:BatchDeleteResponse' :: Maybe [BatchFailedResultModel]
failed = Maybe [BatchFailedResultModel]
a} :: BatchDeleteResponse) ((Maybe [BatchFailedResultModel]
  -> f (Maybe [BatchFailedResultModel]))
 -> BatchDeleteResponse -> f BatchDeleteResponse)
-> ((Maybe [BatchFailedResultModel]
     -> f (Maybe [BatchFailedResultModel]))
    -> Maybe [BatchFailedResultModel]
    -> f (Maybe [BatchFailedResultModel]))
-> (Maybe [BatchFailedResultModel]
    -> f (Maybe [BatchFailedResultModel]))
-> BatchDeleteResponse
-> f BatchDeleteResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BatchFailedResultModel]
  [BatchFailedResultModel]
  [BatchFailedResultModel]
  [BatchFailedResultModel]
-> Iso
     (Maybe [BatchFailedResultModel])
     (Maybe [BatchFailedResultModel])
     (Maybe [BatchFailedResultModel])
     (Maybe [BatchFailedResultModel])
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
  [BatchFailedResultModel]
  [BatchFailedResultModel]
  [BatchFailedResultModel]
  [BatchFailedResultModel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData BatchDeleteResponse