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

import Amazonka.CloudDirectory.Types.ObjectReference
import Amazonka.CloudDirectory.Types.TypedLinkAttributeRange
import Amazonka.CloudDirectory.Types.TypedLinkSchemaAndFacetName
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Returns a paginated list of all the incoming TypedLinkSpecifier
-- information for an object inside a BatchRead operation. For more
-- information, see ListIncomingTypedLinks and BatchReadRequest$Operations.
--
-- /See:/ 'newBatchListIncomingTypedLinks' smart constructor.
data BatchListIncomingTypedLinks = BatchListIncomingTypedLinks'
  { -- | Provides range filters for multiple attributes. When providing ranges to
    -- typed link selection, any inexact ranges must be specified at the end.
    -- Any attributes that do not have a range specified are presumed to match
    -- the entire range.
    BatchListIncomingTypedLinks -> Maybe [TypedLinkAttributeRange]
filterAttributeRanges :: Prelude.Maybe [TypedLinkAttributeRange],
    -- | The pagination token.
    BatchListIncomingTypedLinks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters are interpreted in the order of the attributes on the typed link
    -- facet, not the order in which they are supplied to any API calls.
    BatchListIncomingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
filterTypedLink :: Prelude.Maybe TypedLinkSchemaAndFacetName,
    -- | The maximum number of results to retrieve.
    BatchListIncomingTypedLinks -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The reference that identifies the object whose attributes will be
    -- listed.
    BatchListIncomingTypedLinks -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchListIncomingTypedLinks -> BatchListIncomingTypedLinks -> Bool
(BatchListIncomingTypedLinks
 -> BatchListIncomingTypedLinks -> Bool)
-> (BatchListIncomingTypedLinks
    -> BatchListIncomingTypedLinks -> Bool)
-> Eq BatchListIncomingTypedLinks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchListIncomingTypedLinks -> BatchListIncomingTypedLinks -> Bool
$c/= :: BatchListIncomingTypedLinks -> BatchListIncomingTypedLinks -> Bool
== :: BatchListIncomingTypedLinks -> BatchListIncomingTypedLinks -> Bool
$c== :: BatchListIncomingTypedLinks -> BatchListIncomingTypedLinks -> Bool
Prelude.Eq, ReadPrec [BatchListIncomingTypedLinks]
ReadPrec BatchListIncomingTypedLinks
Int -> ReadS BatchListIncomingTypedLinks
ReadS [BatchListIncomingTypedLinks]
(Int -> ReadS BatchListIncomingTypedLinks)
-> ReadS [BatchListIncomingTypedLinks]
-> ReadPrec BatchListIncomingTypedLinks
-> ReadPrec [BatchListIncomingTypedLinks]
-> Read BatchListIncomingTypedLinks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchListIncomingTypedLinks]
$creadListPrec :: ReadPrec [BatchListIncomingTypedLinks]
readPrec :: ReadPrec BatchListIncomingTypedLinks
$creadPrec :: ReadPrec BatchListIncomingTypedLinks
readList :: ReadS [BatchListIncomingTypedLinks]
$creadList :: ReadS [BatchListIncomingTypedLinks]
readsPrec :: Int -> ReadS BatchListIncomingTypedLinks
$creadsPrec :: Int -> ReadS BatchListIncomingTypedLinks
Prelude.Read, Int -> BatchListIncomingTypedLinks -> ShowS
[BatchListIncomingTypedLinks] -> ShowS
BatchListIncomingTypedLinks -> String
(Int -> BatchListIncomingTypedLinks -> ShowS)
-> (BatchListIncomingTypedLinks -> String)
-> ([BatchListIncomingTypedLinks] -> ShowS)
-> Show BatchListIncomingTypedLinks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchListIncomingTypedLinks] -> ShowS
$cshowList :: [BatchListIncomingTypedLinks] -> ShowS
show :: BatchListIncomingTypedLinks -> String
$cshow :: BatchListIncomingTypedLinks -> String
showsPrec :: Int -> BatchListIncomingTypedLinks -> ShowS
$cshowsPrec :: Int -> BatchListIncomingTypedLinks -> ShowS
Prelude.Show, (forall x.
 BatchListIncomingTypedLinks -> Rep BatchListIncomingTypedLinks x)
-> (forall x.
    Rep BatchListIncomingTypedLinks x -> BatchListIncomingTypedLinks)
-> Generic BatchListIncomingTypedLinks
forall x.
Rep BatchListIncomingTypedLinks x -> BatchListIncomingTypedLinks
forall x.
BatchListIncomingTypedLinks -> Rep BatchListIncomingTypedLinks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchListIncomingTypedLinks x -> BatchListIncomingTypedLinks
$cfrom :: forall x.
BatchListIncomingTypedLinks -> Rep BatchListIncomingTypedLinks x
Prelude.Generic)

-- |
-- Create a value of 'BatchListIncomingTypedLinks' 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:
--
-- 'filterAttributeRanges', 'batchListIncomingTypedLinks_filterAttributeRanges' - Provides range filters for multiple attributes. When providing ranges to
-- typed link selection, any inexact ranges must be specified at the end.
-- Any attributes that do not have a range specified are presumed to match
-- the entire range.
--
-- 'nextToken', 'batchListIncomingTypedLinks_nextToken' - The pagination token.
--
-- 'filterTypedLink', 'batchListIncomingTypedLinks_filterTypedLink' - Filters are interpreted in the order of the attributes on the typed link
-- facet, not the order in which they are supplied to any API calls.
--
-- 'maxResults', 'batchListIncomingTypedLinks_maxResults' - The maximum number of results to retrieve.
--
-- 'objectReference', 'batchListIncomingTypedLinks_objectReference' - The reference that identifies the object whose attributes will be
-- listed.
newBatchListIncomingTypedLinks ::
  -- | 'objectReference'
  ObjectReference ->
  BatchListIncomingTypedLinks
newBatchListIncomingTypedLinks :: ObjectReference -> BatchListIncomingTypedLinks
newBatchListIncomingTypedLinks ObjectReference
pObjectReference_ =
  BatchListIncomingTypedLinks' :: Maybe [TypedLinkAttributeRange]
-> Maybe Text
-> Maybe TypedLinkSchemaAndFacetName
-> Maybe Natural
-> ObjectReference
-> BatchListIncomingTypedLinks
BatchListIncomingTypedLinks'
    { $sel:filterAttributeRanges:BatchListIncomingTypedLinks' :: Maybe [TypedLinkAttributeRange]
filterAttributeRanges =
        Maybe [TypedLinkAttributeRange]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListIncomingTypedLinks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filterTypedLink:BatchListIncomingTypedLinks' :: Maybe TypedLinkSchemaAndFacetName
filterTypedLink = Maybe TypedLinkSchemaAndFacetName
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:BatchListIncomingTypedLinks' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:objectReference:BatchListIncomingTypedLinks' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
    }

-- | Provides range filters for multiple attributes. When providing ranges to
-- typed link selection, any inexact ranges must be specified at the end.
-- Any attributes that do not have a range specified are presumed to match
-- the entire range.
batchListIncomingTypedLinks_filterAttributeRanges :: Lens.Lens' BatchListIncomingTypedLinks (Prelude.Maybe [TypedLinkAttributeRange])
batchListIncomingTypedLinks_filterAttributeRanges :: (Maybe [TypedLinkAttributeRange]
 -> f (Maybe [TypedLinkAttributeRange]))
-> BatchListIncomingTypedLinks -> f BatchListIncomingTypedLinks
batchListIncomingTypedLinks_filterAttributeRanges = (BatchListIncomingTypedLinks -> Maybe [TypedLinkAttributeRange])
-> (BatchListIncomingTypedLinks
    -> Maybe [TypedLinkAttributeRange] -> BatchListIncomingTypedLinks)
-> Lens
     BatchListIncomingTypedLinks
     BatchListIncomingTypedLinks
     (Maybe [TypedLinkAttributeRange])
     (Maybe [TypedLinkAttributeRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListIncomingTypedLinks' {Maybe [TypedLinkAttributeRange]
filterAttributeRanges :: Maybe [TypedLinkAttributeRange]
$sel:filterAttributeRanges:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe [TypedLinkAttributeRange]
filterAttributeRanges} -> Maybe [TypedLinkAttributeRange]
filterAttributeRanges) (\s :: BatchListIncomingTypedLinks
s@BatchListIncomingTypedLinks' {} Maybe [TypedLinkAttributeRange]
a -> BatchListIncomingTypedLinks
s {$sel:filterAttributeRanges:BatchListIncomingTypedLinks' :: Maybe [TypedLinkAttributeRange]
filterAttributeRanges = Maybe [TypedLinkAttributeRange]
a} :: BatchListIncomingTypedLinks) ((Maybe [TypedLinkAttributeRange]
  -> f (Maybe [TypedLinkAttributeRange]))
 -> BatchListIncomingTypedLinks -> f BatchListIncomingTypedLinks)
-> ((Maybe [TypedLinkAttributeRange]
     -> f (Maybe [TypedLinkAttributeRange]))
    -> Maybe [TypedLinkAttributeRange]
    -> f (Maybe [TypedLinkAttributeRange]))
-> (Maybe [TypedLinkAttributeRange]
    -> f (Maybe [TypedLinkAttributeRange]))
-> BatchListIncomingTypedLinks
-> f BatchListIncomingTypedLinks
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TypedLinkAttributeRange]
  [TypedLinkAttributeRange]
  [TypedLinkAttributeRange]
  [TypedLinkAttributeRange]
-> Iso
     (Maybe [TypedLinkAttributeRange])
     (Maybe [TypedLinkAttributeRange])
     (Maybe [TypedLinkAttributeRange])
     (Maybe [TypedLinkAttributeRange])
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
  [TypedLinkAttributeRange]
  [TypedLinkAttributeRange]
  [TypedLinkAttributeRange]
  [TypedLinkAttributeRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | Filters are interpreted in the order of the attributes on the typed link
-- facet, not the order in which they are supplied to any API calls.
batchListIncomingTypedLinks_filterTypedLink :: Lens.Lens' BatchListIncomingTypedLinks (Prelude.Maybe TypedLinkSchemaAndFacetName)
batchListIncomingTypedLinks_filterTypedLink :: (Maybe TypedLinkSchemaAndFacetName
 -> f (Maybe TypedLinkSchemaAndFacetName))
-> BatchListIncomingTypedLinks -> f BatchListIncomingTypedLinks
batchListIncomingTypedLinks_filterTypedLink = (BatchListIncomingTypedLinks -> Maybe TypedLinkSchemaAndFacetName)
-> (BatchListIncomingTypedLinks
    -> Maybe TypedLinkSchemaAndFacetName
    -> BatchListIncomingTypedLinks)
-> Lens
     BatchListIncomingTypedLinks
     BatchListIncomingTypedLinks
     (Maybe TypedLinkSchemaAndFacetName)
     (Maybe TypedLinkSchemaAndFacetName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListIncomingTypedLinks' {Maybe TypedLinkSchemaAndFacetName
filterTypedLink :: Maybe TypedLinkSchemaAndFacetName
$sel:filterTypedLink:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
filterTypedLink} -> Maybe TypedLinkSchemaAndFacetName
filterTypedLink) (\s :: BatchListIncomingTypedLinks
s@BatchListIncomingTypedLinks' {} Maybe TypedLinkSchemaAndFacetName
a -> BatchListIncomingTypedLinks
s {$sel:filterTypedLink:BatchListIncomingTypedLinks' :: Maybe TypedLinkSchemaAndFacetName
filterTypedLink = Maybe TypedLinkSchemaAndFacetName
a} :: BatchListIncomingTypedLinks)

-- | The maximum number of results to retrieve.
batchListIncomingTypedLinks_maxResults :: Lens.Lens' BatchListIncomingTypedLinks (Prelude.Maybe Prelude.Natural)
batchListIncomingTypedLinks_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> BatchListIncomingTypedLinks -> f BatchListIncomingTypedLinks
batchListIncomingTypedLinks_maxResults = (BatchListIncomingTypedLinks -> Maybe Natural)
-> (BatchListIncomingTypedLinks
    -> Maybe Natural -> BatchListIncomingTypedLinks)
-> Lens
     BatchListIncomingTypedLinks
     BatchListIncomingTypedLinks
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListIncomingTypedLinks' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: BatchListIncomingTypedLinks
s@BatchListIncomingTypedLinks' {} Maybe Natural
a -> BatchListIncomingTypedLinks
s {$sel:maxResults:BatchListIncomingTypedLinks' :: Maybe Natural
maxResults = Maybe Natural
a} :: BatchListIncomingTypedLinks)

-- | The reference that identifies the object whose attributes will be
-- listed.
batchListIncomingTypedLinks_objectReference :: Lens.Lens' BatchListIncomingTypedLinks ObjectReference
batchListIncomingTypedLinks_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchListIncomingTypedLinks -> f BatchListIncomingTypedLinks
batchListIncomingTypedLinks_objectReference = (BatchListIncomingTypedLinks -> ObjectReference)
-> (BatchListIncomingTypedLinks
    -> ObjectReference -> BatchListIncomingTypedLinks)
-> Lens
     BatchListIncomingTypedLinks
     BatchListIncomingTypedLinks
     ObjectReference
     ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListIncomingTypedLinks' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchListIncomingTypedLinks
s@BatchListIncomingTypedLinks' {} ObjectReference
a -> BatchListIncomingTypedLinks
s {$sel:objectReference:BatchListIncomingTypedLinks' :: ObjectReference
objectReference = ObjectReference
a} :: BatchListIncomingTypedLinks)

instance Prelude.Hashable BatchListIncomingTypedLinks

instance Prelude.NFData BatchListIncomingTypedLinks

instance Core.ToJSON BatchListIncomingTypedLinks where
  toJSON :: BatchListIncomingTypedLinks -> Value
toJSON BatchListIncomingTypedLinks' {Maybe Natural
Maybe [TypedLinkAttributeRange]
Maybe Text
Maybe TypedLinkSchemaAndFacetName
ObjectReference
objectReference :: ObjectReference
maxResults :: Maybe Natural
filterTypedLink :: Maybe TypedLinkSchemaAndFacetName
nextToken :: Maybe Text
filterAttributeRanges :: Maybe [TypedLinkAttributeRange]
$sel:objectReference:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> ObjectReference
$sel:maxResults:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe Natural
$sel:filterTypedLink:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
$sel:nextToken:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe Text
$sel:filterAttributeRanges:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe [TypedLinkAttributeRange]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FilterAttributeRanges" Text -> [TypedLinkAttributeRange] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([TypedLinkAttributeRange] -> Pair)
-> Maybe [TypedLinkAttributeRange] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TypedLinkAttributeRange]
filterAttributeRanges,
            (Text
"NextToken" 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
nextToken,
            (Text
"FilterTypedLink" Text -> TypedLinkSchemaAndFacetName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TypedLinkSchemaAndFacetName -> Pair)
-> Maybe TypedLinkSchemaAndFacetName -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TypedLinkSchemaAndFacetName
filterTypedLink,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ObjectReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
objectReference)
          ]
      )