{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudDirectory.Types.BatchListPolicyAttachmentsResponse
-- 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)
module Amazonka.CloudDirectory.Types.BatchListPolicyAttachmentsResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the output of a ListPolicyAttachments response operation.
--
-- /See:/ 'newBatchListPolicyAttachmentsResponse' smart constructor.
data BatchListPolicyAttachmentsResponse = BatchListPolicyAttachmentsResponse'
  { -- | A list of @ObjectIdentifiers@ to which the policy is attached.
    BatchListPolicyAttachmentsResponse -> Maybe [Text]
objectIdentifiers :: Prelude.Maybe [Prelude.Text],
    -- | The pagination token.
    BatchListPolicyAttachmentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchListPolicyAttachmentsResponse
-> BatchListPolicyAttachmentsResponse -> Bool
(BatchListPolicyAttachmentsResponse
 -> BatchListPolicyAttachmentsResponse -> Bool)
-> (BatchListPolicyAttachmentsResponse
    -> BatchListPolicyAttachmentsResponse -> Bool)
-> Eq BatchListPolicyAttachmentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchListPolicyAttachmentsResponse
-> BatchListPolicyAttachmentsResponse -> Bool
$c/= :: BatchListPolicyAttachmentsResponse
-> BatchListPolicyAttachmentsResponse -> Bool
== :: BatchListPolicyAttachmentsResponse
-> BatchListPolicyAttachmentsResponse -> Bool
$c== :: BatchListPolicyAttachmentsResponse
-> BatchListPolicyAttachmentsResponse -> Bool
Prelude.Eq, ReadPrec [BatchListPolicyAttachmentsResponse]
ReadPrec BatchListPolicyAttachmentsResponse
Int -> ReadS BatchListPolicyAttachmentsResponse
ReadS [BatchListPolicyAttachmentsResponse]
(Int -> ReadS BatchListPolicyAttachmentsResponse)
-> ReadS [BatchListPolicyAttachmentsResponse]
-> ReadPrec BatchListPolicyAttachmentsResponse
-> ReadPrec [BatchListPolicyAttachmentsResponse]
-> Read BatchListPolicyAttachmentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchListPolicyAttachmentsResponse]
$creadListPrec :: ReadPrec [BatchListPolicyAttachmentsResponse]
readPrec :: ReadPrec BatchListPolicyAttachmentsResponse
$creadPrec :: ReadPrec BatchListPolicyAttachmentsResponse
readList :: ReadS [BatchListPolicyAttachmentsResponse]
$creadList :: ReadS [BatchListPolicyAttachmentsResponse]
readsPrec :: Int -> ReadS BatchListPolicyAttachmentsResponse
$creadsPrec :: Int -> ReadS BatchListPolicyAttachmentsResponse
Prelude.Read, Int -> BatchListPolicyAttachmentsResponse -> ShowS
[BatchListPolicyAttachmentsResponse] -> ShowS
BatchListPolicyAttachmentsResponse -> String
(Int -> BatchListPolicyAttachmentsResponse -> ShowS)
-> (BatchListPolicyAttachmentsResponse -> String)
-> ([BatchListPolicyAttachmentsResponse] -> ShowS)
-> Show BatchListPolicyAttachmentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchListPolicyAttachmentsResponse] -> ShowS
$cshowList :: [BatchListPolicyAttachmentsResponse] -> ShowS
show :: BatchListPolicyAttachmentsResponse -> String
$cshow :: BatchListPolicyAttachmentsResponse -> String
showsPrec :: Int -> BatchListPolicyAttachmentsResponse -> ShowS
$cshowsPrec :: Int -> BatchListPolicyAttachmentsResponse -> ShowS
Prelude.Show, (forall x.
 BatchListPolicyAttachmentsResponse
 -> Rep BatchListPolicyAttachmentsResponse x)
-> (forall x.
    Rep BatchListPolicyAttachmentsResponse x
    -> BatchListPolicyAttachmentsResponse)
-> Generic BatchListPolicyAttachmentsResponse
forall x.
Rep BatchListPolicyAttachmentsResponse x
-> BatchListPolicyAttachmentsResponse
forall x.
BatchListPolicyAttachmentsResponse
-> Rep BatchListPolicyAttachmentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchListPolicyAttachmentsResponse x
-> BatchListPolicyAttachmentsResponse
$cfrom :: forall x.
BatchListPolicyAttachmentsResponse
-> Rep BatchListPolicyAttachmentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchListPolicyAttachmentsResponse' 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:
--
-- 'objectIdentifiers', 'batchListPolicyAttachmentsResponse_objectIdentifiers' - A list of @ObjectIdentifiers@ to which the policy is attached.
--
-- 'nextToken', 'batchListPolicyAttachmentsResponse_nextToken' - The pagination token.
newBatchListPolicyAttachmentsResponse ::
  BatchListPolicyAttachmentsResponse
newBatchListPolicyAttachmentsResponse :: BatchListPolicyAttachmentsResponse
newBatchListPolicyAttachmentsResponse =
  BatchListPolicyAttachmentsResponse' :: Maybe [Text] -> Maybe Text -> BatchListPolicyAttachmentsResponse
BatchListPolicyAttachmentsResponse'
    { $sel:objectIdentifiers:BatchListPolicyAttachmentsResponse' :: Maybe [Text]
objectIdentifiers =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListPolicyAttachmentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of @ObjectIdentifiers@ to which the policy is attached.
batchListPolicyAttachmentsResponse_objectIdentifiers :: Lens.Lens' BatchListPolicyAttachmentsResponse (Prelude.Maybe [Prelude.Text])
batchListPolicyAttachmentsResponse_objectIdentifiers :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchListPolicyAttachmentsResponse
-> f BatchListPolicyAttachmentsResponse
batchListPolicyAttachmentsResponse_objectIdentifiers = (BatchListPolicyAttachmentsResponse -> Maybe [Text])
-> (BatchListPolicyAttachmentsResponse
    -> Maybe [Text] -> BatchListPolicyAttachmentsResponse)
-> Lens
     BatchListPolicyAttachmentsResponse
     BatchListPolicyAttachmentsResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListPolicyAttachmentsResponse' {Maybe [Text]
objectIdentifiers :: Maybe [Text]
$sel:objectIdentifiers:BatchListPolicyAttachmentsResponse' :: BatchListPolicyAttachmentsResponse -> Maybe [Text]
objectIdentifiers} -> Maybe [Text]
objectIdentifiers) (\s :: BatchListPolicyAttachmentsResponse
s@BatchListPolicyAttachmentsResponse' {} Maybe [Text]
a -> BatchListPolicyAttachmentsResponse
s {$sel:objectIdentifiers:BatchListPolicyAttachmentsResponse' :: Maybe [Text]
objectIdentifiers = Maybe [Text]
a} :: BatchListPolicyAttachmentsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchListPolicyAttachmentsResponse
 -> f BatchListPolicyAttachmentsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchListPolicyAttachmentsResponse
-> f BatchListPolicyAttachmentsResponse
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

-- | The pagination token.
batchListPolicyAttachmentsResponse_nextToken :: Lens.Lens' BatchListPolicyAttachmentsResponse (Prelude.Maybe Prelude.Text)
batchListPolicyAttachmentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> BatchListPolicyAttachmentsResponse
-> f BatchListPolicyAttachmentsResponse
batchListPolicyAttachmentsResponse_nextToken = (BatchListPolicyAttachmentsResponse -> Maybe Text)
-> (BatchListPolicyAttachmentsResponse
    -> Maybe Text -> BatchListPolicyAttachmentsResponse)
-> Lens
     BatchListPolicyAttachmentsResponse
     BatchListPolicyAttachmentsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListPolicyAttachmentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:BatchListPolicyAttachmentsResponse' :: BatchListPolicyAttachmentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: BatchListPolicyAttachmentsResponse
s@BatchListPolicyAttachmentsResponse' {} Maybe Text
a -> BatchListPolicyAttachmentsResponse
s {$sel:nextToken:BatchListPolicyAttachmentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: BatchListPolicyAttachmentsResponse)

instance
  Core.FromJSON
    BatchListPolicyAttachmentsResponse
  where
  parseJSON :: Value -> Parser BatchListPolicyAttachmentsResponse
parseJSON =
    String
-> (Object -> Parser BatchListPolicyAttachmentsResponse)
-> Value
-> Parser BatchListPolicyAttachmentsResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchListPolicyAttachmentsResponse"
      ( \Object
x ->
          Maybe [Text] -> Maybe Text -> BatchListPolicyAttachmentsResponse
BatchListPolicyAttachmentsResponse'
            (Maybe [Text] -> Maybe Text -> BatchListPolicyAttachmentsResponse)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> BatchListPolicyAttachmentsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ObjectIdentifiers"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> BatchListPolicyAttachmentsResponse)
-> Parser (Maybe Text) -> Parser BatchListPolicyAttachmentsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NextToken")
      )

instance
  Prelude.Hashable
    BatchListPolicyAttachmentsResponse

instance
  Prelude.NFData
    BatchListPolicyAttachmentsResponse