{-# 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.BatchListOutgoingTypedLinksResponse
-- 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.BatchListOutgoingTypedLinksResponse where

import Amazonka.CloudDirectory.Types.TypedLinkSpecifier
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the output of a ListOutgoingTypedLinks response operation.
--
-- /See:/ 'newBatchListOutgoingTypedLinksResponse' smart constructor.
data BatchListOutgoingTypedLinksResponse = BatchListOutgoingTypedLinksResponse'
  { -- | Returns a typed link specifier as output.
    BatchListOutgoingTypedLinksResponse -> Maybe [TypedLinkSpecifier]
typedLinkSpecifiers :: Prelude.Maybe [TypedLinkSpecifier],
    -- | The pagination token.
    BatchListOutgoingTypedLinksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchListOutgoingTypedLinksResponse
-> BatchListOutgoingTypedLinksResponse -> Bool
(BatchListOutgoingTypedLinksResponse
 -> BatchListOutgoingTypedLinksResponse -> Bool)
-> (BatchListOutgoingTypedLinksResponse
    -> BatchListOutgoingTypedLinksResponse -> Bool)
-> Eq BatchListOutgoingTypedLinksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchListOutgoingTypedLinksResponse
-> BatchListOutgoingTypedLinksResponse -> Bool
$c/= :: BatchListOutgoingTypedLinksResponse
-> BatchListOutgoingTypedLinksResponse -> Bool
== :: BatchListOutgoingTypedLinksResponse
-> BatchListOutgoingTypedLinksResponse -> Bool
$c== :: BatchListOutgoingTypedLinksResponse
-> BatchListOutgoingTypedLinksResponse -> Bool
Prelude.Eq, ReadPrec [BatchListOutgoingTypedLinksResponse]
ReadPrec BatchListOutgoingTypedLinksResponse
Int -> ReadS BatchListOutgoingTypedLinksResponse
ReadS [BatchListOutgoingTypedLinksResponse]
(Int -> ReadS BatchListOutgoingTypedLinksResponse)
-> ReadS [BatchListOutgoingTypedLinksResponse]
-> ReadPrec BatchListOutgoingTypedLinksResponse
-> ReadPrec [BatchListOutgoingTypedLinksResponse]
-> Read BatchListOutgoingTypedLinksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchListOutgoingTypedLinksResponse]
$creadListPrec :: ReadPrec [BatchListOutgoingTypedLinksResponse]
readPrec :: ReadPrec BatchListOutgoingTypedLinksResponse
$creadPrec :: ReadPrec BatchListOutgoingTypedLinksResponse
readList :: ReadS [BatchListOutgoingTypedLinksResponse]
$creadList :: ReadS [BatchListOutgoingTypedLinksResponse]
readsPrec :: Int -> ReadS BatchListOutgoingTypedLinksResponse
$creadsPrec :: Int -> ReadS BatchListOutgoingTypedLinksResponse
Prelude.Read, Int -> BatchListOutgoingTypedLinksResponse -> ShowS
[BatchListOutgoingTypedLinksResponse] -> ShowS
BatchListOutgoingTypedLinksResponse -> String
(Int -> BatchListOutgoingTypedLinksResponse -> ShowS)
-> (BatchListOutgoingTypedLinksResponse -> String)
-> ([BatchListOutgoingTypedLinksResponse] -> ShowS)
-> Show BatchListOutgoingTypedLinksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchListOutgoingTypedLinksResponse] -> ShowS
$cshowList :: [BatchListOutgoingTypedLinksResponse] -> ShowS
show :: BatchListOutgoingTypedLinksResponse -> String
$cshow :: BatchListOutgoingTypedLinksResponse -> String
showsPrec :: Int -> BatchListOutgoingTypedLinksResponse -> ShowS
$cshowsPrec :: Int -> BatchListOutgoingTypedLinksResponse -> ShowS
Prelude.Show, (forall x.
 BatchListOutgoingTypedLinksResponse
 -> Rep BatchListOutgoingTypedLinksResponse x)
-> (forall x.
    Rep BatchListOutgoingTypedLinksResponse x
    -> BatchListOutgoingTypedLinksResponse)
-> Generic BatchListOutgoingTypedLinksResponse
forall x.
Rep BatchListOutgoingTypedLinksResponse x
-> BatchListOutgoingTypedLinksResponse
forall x.
BatchListOutgoingTypedLinksResponse
-> Rep BatchListOutgoingTypedLinksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchListOutgoingTypedLinksResponse x
-> BatchListOutgoingTypedLinksResponse
$cfrom :: forall x.
BatchListOutgoingTypedLinksResponse
-> Rep BatchListOutgoingTypedLinksResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchListOutgoingTypedLinksResponse' 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:
--
-- 'typedLinkSpecifiers', 'batchListOutgoingTypedLinksResponse_typedLinkSpecifiers' - Returns a typed link specifier as output.
--
-- 'nextToken', 'batchListOutgoingTypedLinksResponse_nextToken' - The pagination token.
newBatchListOutgoingTypedLinksResponse ::
  BatchListOutgoingTypedLinksResponse
newBatchListOutgoingTypedLinksResponse :: BatchListOutgoingTypedLinksResponse
newBatchListOutgoingTypedLinksResponse =
  BatchListOutgoingTypedLinksResponse' :: Maybe [TypedLinkSpecifier]
-> Maybe Text -> BatchListOutgoingTypedLinksResponse
BatchListOutgoingTypedLinksResponse'
    { $sel:typedLinkSpecifiers:BatchListOutgoingTypedLinksResponse' :: Maybe [TypedLinkSpecifier]
typedLinkSpecifiers =
        Maybe [TypedLinkSpecifier]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListOutgoingTypedLinksResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Returns a typed link specifier as output.
batchListOutgoingTypedLinksResponse_typedLinkSpecifiers :: Lens.Lens' BatchListOutgoingTypedLinksResponse (Prelude.Maybe [TypedLinkSpecifier])
batchListOutgoingTypedLinksResponse_typedLinkSpecifiers :: (Maybe [TypedLinkSpecifier] -> f (Maybe [TypedLinkSpecifier]))
-> BatchListOutgoingTypedLinksResponse
-> f BatchListOutgoingTypedLinksResponse
batchListOutgoingTypedLinksResponse_typedLinkSpecifiers = (BatchListOutgoingTypedLinksResponse -> Maybe [TypedLinkSpecifier])
-> (BatchListOutgoingTypedLinksResponse
    -> Maybe [TypedLinkSpecifier]
    -> BatchListOutgoingTypedLinksResponse)
-> Lens
     BatchListOutgoingTypedLinksResponse
     BatchListOutgoingTypedLinksResponse
     (Maybe [TypedLinkSpecifier])
     (Maybe [TypedLinkSpecifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListOutgoingTypedLinksResponse' {Maybe [TypedLinkSpecifier]
typedLinkSpecifiers :: Maybe [TypedLinkSpecifier]
$sel:typedLinkSpecifiers:BatchListOutgoingTypedLinksResponse' :: BatchListOutgoingTypedLinksResponse -> Maybe [TypedLinkSpecifier]
typedLinkSpecifiers} -> Maybe [TypedLinkSpecifier]
typedLinkSpecifiers) (\s :: BatchListOutgoingTypedLinksResponse
s@BatchListOutgoingTypedLinksResponse' {} Maybe [TypedLinkSpecifier]
a -> BatchListOutgoingTypedLinksResponse
s {$sel:typedLinkSpecifiers:BatchListOutgoingTypedLinksResponse' :: Maybe [TypedLinkSpecifier]
typedLinkSpecifiers = Maybe [TypedLinkSpecifier]
a} :: BatchListOutgoingTypedLinksResponse) ((Maybe [TypedLinkSpecifier] -> f (Maybe [TypedLinkSpecifier]))
 -> BatchListOutgoingTypedLinksResponse
 -> f BatchListOutgoingTypedLinksResponse)
-> ((Maybe [TypedLinkSpecifier] -> f (Maybe [TypedLinkSpecifier]))
    -> Maybe [TypedLinkSpecifier] -> f (Maybe [TypedLinkSpecifier]))
-> (Maybe [TypedLinkSpecifier] -> f (Maybe [TypedLinkSpecifier]))
-> BatchListOutgoingTypedLinksResponse
-> f BatchListOutgoingTypedLinksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TypedLinkSpecifier]
  [TypedLinkSpecifier]
  [TypedLinkSpecifier]
  [TypedLinkSpecifier]
-> Iso
     (Maybe [TypedLinkSpecifier])
     (Maybe [TypedLinkSpecifier])
     (Maybe [TypedLinkSpecifier])
     (Maybe [TypedLinkSpecifier])
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
  [TypedLinkSpecifier]
  [TypedLinkSpecifier]
  [TypedLinkSpecifier]
  [TypedLinkSpecifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Core.FromJSON
    BatchListOutgoingTypedLinksResponse
  where
  parseJSON :: Value -> Parser BatchListOutgoingTypedLinksResponse
parseJSON =
    String
-> (Object -> Parser BatchListOutgoingTypedLinksResponse)
-> Value
-> Parser BatchListOutgoingTypedLinksResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchListOutgoingTypedLinksResponse"
      ( \Object
x ->
          Maybe [TypedLinkSpecifier]
-> Maybe Text -> BatchListOutgoingTypedLinksResponse
BatchListOutgoingTypedLinksResponse'
            (Maybe [TypedLinkSpecifier]
 -> Maybe Text -> BatchListOutgoingTypedLinksResponse)
-> Parser (Maybe [TypedLinkSpecifier])
-> Parser (Maybe Text -> BatchListOutgoingTypedLinksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [TypedLinkSpecifier]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TypedLinkSpecifiers"
                            Parser (Maybe (Maybe [TypedLinkSpecifier]))
-> Maybe [TypedLinkSpecifier]
-> Parser (Maybe [TypedLinkSpecifier])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [TypedLinkSpecifier]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> BatchListOutgoingTypedLinksResponse)
-> Parser (Maybe Text)
-> Parser BatchListOutgoingTypedLinksResponse
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
    BatchListOutgoingTypedLinksResponse

instance
  Prelude.NFData
    BatchListOutgoingTypedLinksResponse