{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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],
    -- | 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 pagination token.
    BatchListIncomingTypedLinks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The reference that identifies the object whose attributes will be
    -- listed.
    BatchListIncomingTypedLinks -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchListIncomingTypedLinks -> BatchListIncomingTypedLinks -> Bool
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]
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
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.
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.
--
-- '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.
--
-- 'nextToken', 'batchListIncomingTypedLinks_nextToken' - The pagination token.
--
-- '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'
    { $sel:filterAttributeRanges:BatchListIncomingTypedLinks' :: Maybe [TypedLinkAttributeRange]
filterAttributeRanges =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filterTypedLink:BatchListIncomingTypedLinks' :: Maybe TypedLinkSchemaAndFacetName
filterTypedLink = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:BatchListIncomingTypedLinks' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListIncomingTypedLinks' :: Maybe Text
nextToken = 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 :: Lens' BatchListIncomingTypedLinks (Maybe [TypedLinkAttributeRange])
batchListIncomingTypedLinks_filterAttributeRanges = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens'
  BatchListIncomingTypedLinks (Maybe TypedLinkSchemaAndFacetName)
batchListIncomingTypedLinks_filterTypedLink = 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 :: Lens' BatchListIncomingTypedLinks (Maybe Natural)
batchListIncomingTypedLinks_maxResults = 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 pagination token.
batchListIncomingTypedLinks_nextToken :: Lens.Lens' BatchListIncomingTypedLinks (Prelude.Maybe Prelude.Text)
batchListIncomingTypedLinks_nextToken :: Lens' BatchListIncomingTypedLinks (Maybe Text)
batchListIncomingTypedLinks_nextToken = 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)

-- | The reference that identifies the object whose attributes will be
-- listed.
batchListIncomingTypedLinks_objectReference :: Lens.Lens' BatchListIncomingTypedLinks ObjectReference
batchListIncomingTypedLinks_objectReference :: Lens' BatchListIncomingTypedLinks ObjectReference
batchListIncomingTypedLinks_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 where
  hashWithSalt :: Int -> BatchListIncomingTypedLinks -> Int
hashWithSalt Int
_salt BatchListIncomingTypedLinks' {Maybe Natural
Maybe [TypedLinkAttributeRange]
Maybe Text
Maybe TypedLinkSchemaAndFacetName
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
filterTypedLink :: Maybe TypedLinkSchemaAndFacetName
filterAttributeRanges :: Maybe [TypedLinkAttributeRange]
$sel:objectReference:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> ObjectReference
$sel:nextToken:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe Text
$sel:maxResults:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe Natural
$sel:filterTypedLink:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
$sel:filterAttributeRanges:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe [TypedLinkAttributeRange]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TypedLinkAttributeRange]
filterAttributeRanges
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TypedLinkSchemaAndFacetName
filterTypedLink
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
objectReference

instance Prelude.NFData BatchListIncomingTypedLinks where
  rnf :: BatchListIncomingTypedLinks -> ()
rnf BatchListIncomingTypedLinks' {Maybe Natural
Maybe [TypedLinkAttributeRange]
Maybe Text
Maybe TypedLinkSchemaAndFacetName
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
filterTypedLink :: Maybe TypedLinkSchemaAndFacetName
filterAttributeRanges :: Maybe [TypedLinkAttributeRange]
$sel:objectReference:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> ObjectReference
$sel:nextToken:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe Text
$sel:maxResults:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe Natural
$sel:filterTypedLink:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
$sel:filterAttributeRanges:BatchListIncomingTypedLinks' :: BatchListIncomingTypedLinks -> Maybe [TypedLinkAttributeRange]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [TypedLinkAttributeRange]
filterAttributeRanges
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TypedLinkSchemaAndFacetName
filterTypedLink
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
objectReference

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