{-# 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.BatchListOutgoingTypedLinks
-- 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.BatchListOutgoingTypedLinks 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 outgoing TypedLinkSpecifier
-- information for an object inside a BatchRead operation. For more
-- information, see ListOutgoingTypedLinks and BatchReadRequest$Operations.
--
-- /See:/ 'newBatchListOutgoingTypedLinks' smart constructor.
data BatchListOutgoingTypedLinks = BatchListOutgoingTypedLinks'
  { -- | 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.
    BatchListOutgoingTypedLinks -> Maybe [TypedLinkAttributeRange]
filterAttributeRanges :: Prelude.Maybe [TypedLinkAttributeRange],
    -- | The pagination token.
    BatchListOutgoingTypedLinks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters are interpreted in the order of the attributes defined on the
    -- typed link facet, not the order they are supplied to any API calls.
    BatchListOutgoingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
filterTypedLink :: Prelude.Maybe TypedLinkSchemaAndFacetName,
    -- | The maximum number of results to retrieve.
    BatchListOutgoingTypedLinks -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The reference that identifies the object whose attributes will be
    -- listed.
    BatchListOutgoingTypedLinks -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchListOutgoingTypedLinks -> BatchListOutgoingTypedLinks -> Bool
(BatchListOutgoingTypedLinks
 -> BatchListOutgoingTypedLinks -> Bool)
-> (BatchListOutgoingTypedLinks
    -> BatchListOutgoingTypedLinks -> Bool)
-> Eq BatchListOutgoingTypedLinks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchListOutgoingTypedLinks -> BatchListOutgoingTypedLinks -> Bool
$c/= :: BatchListOutgoingTypedLinks -> BatchListOutgoingTypedLinks -> Bool
== :: BatchListOutgoingTypedLinks -> BatchListOutgoingTypedLinks -> Bool
$c== :: BatchListOutgoingTypedLinks -> BatchListOutgoingTypedLinks -> Bool
Prelude.Eq, ReadPrec [BatchListOutgoingTypedLinks]
ReadPrec BatchListOutgoingTypedLinks
Int -> ReadS BatchListOutgoingTypedLinks
ReadS [BatchListOutgoingTypedLinks]
(Int -> ReadS BatchListOutgoingTypedLinks)
-> ReadS [BatchListOutgoingTypedLinks]
-> ReadPrec BatchListOutgoingTypedLinks
-> ReadPrec [BatchListOutgoingTypedLinks]
-> Read BatchListOutgoingTypedLinks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchListOutgoingTypedLinks]
$creadListPrec :: ReadPrec [BatchListOutgoingTypedLinks]
readPrec :: ReadPrec BatchListOutgoingTypedLinks
$creadPrec :: ReadPrec BatchListOutgoingTypedLinks
readList :: ReadS [BatchListOutgoingTypedLinks]
$creadList :: ReadS [BatchListOutgoingTypedLinks]
readsPrec :: Int -> ReadS BatchListOutgoingTypedLinks
$creadsPrec :: Int -> ReadS BatchListOutgoingTypedLinks
Prelude.Read, Int -> BatchListOutgoingTypedLinks -> ShowS
[BatchListOutgoingTypedLinks] -> ShowS
BatchListOutgoingTypedLinks -> String
(Int -> BatchListOutgoingTypedLinks -> ShowS)
-> (BatchListOutgoingTypedLinks -> String)
-> ([BatchListOutgoingTypedLinks] -> ShowS)
-> Show BatchListOutgoingTypedLinks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchListOutgoingTypedLinks] -> ShowS
$cshowList :: [BatchListOutgoingTypedLinks] -> ShowS
show :: BatchListOutgoingTypedLinks -> String
$cshow :: BatchListOutgoingTypedLinks -> String
showsPrec :: Int -> BatchListOutgoingTypedLinks -> ShowS
$cshowsPrec :: Int -> BatchListOutgoingTypedLinks -> ShowS
Prelude.Show, (forall x.
 BatchListOutgoingTypedLinks -> Rep BatchListOutgoingTypedLinks x)
-> (forall x.
    Rep BatchListOutgoingTypedLinks x -> BatchListOutgoingTypedLinks)
-> Generic BatchListOutgoingTypedLinks
forall x.
Rep BatchListOutgoingTypedLinks x -> BatchListOutgoingTypedLinks
forall x.
BatchListOutgoingTypedLinks -> Rep BatchListOutgoingTypedLinks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchListOutgoingTypedLinks x -> BatchListOutgoingTypedLinks
$cfrom :: forall x.
BatchListOutgoingTypedLinks -> Rep BatchListOutgoingTypedLinks x
Prelude.Generic)

-- |
-- Create a value of 'BatchListOutgoingTypedLinks' 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', 'batchListOutgoingTypedLinks_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', 'batchListOutgoingTypedLinks_nextToken' - The pagination token.
--
-- 'filterTypedLink', 'batchListOutgoingTypedLinks_filterTypedLink' - Filters are interpreted in the order of the attributes defined on the
-- typed link facet, not the order they are supplied to any API calls.
--
-- 'maxResults', 'batchListOutgoingTypedLinks_maxResults' - The maximum number of results to retrieve.
--
-- 'objectReference', 'batchListOutgoingTypedLinks_objectReference' - The reference that identifies the object whose attributes will be
-- listed.
newBatchListOutgoingTypedLinks ::
  -- | 'objectReference'
  ObjectReference ->
  BatchListOutgoingTypedLinks
newBatchListOutgoingTypedLinks :: ObjectReference -> BatchListOutgoingTypedLinks
newBatchListOutgoingTypedLinks ObjectReference
pObjectReference_ =
  BatchListOutgoingTypedLinks' :: Maybe [TypedLinkAttributeRange]
-> Maybe Text
-> Maybe TypedLinkSchemaAndFacetName
-> Maybe Natural
-> ObjectReference
-> BatchListOutgoingTypedLinks
BatchListOutgoingTypedLinks'
    { $sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: Maybe [TypedLinkAttributeRange]
filterAttributeRanges =
        Maybe [TypedLinkAttributeRange]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListOutgoingTypedLinks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filterTypedLink:BatchListOutgoingTypedLinks' :: Maybe TypedLinkSchemaAndFacetName
filterTypedLink = Maybe TypedLinkSchemaAndFacetName
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:BatchListOutgoingTypedLinks' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:objectReference:BatchListOutgoingTypedLinks' :: 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.
batchListOutgoingTypedLinks_filterAttributeRanges :: Lens.Lens' BatchListOutgoingTypedLinks (Prelude.Maybe [TypedLinkAttributeRange])
batchListOutgoingTypedLinks_filterAttributeRanges :: (Maybe [TypedLinkAttributeRange]
 -> f (Maybe [TypedLinkAttributeRange]))
-> BatchListOutgoingTypedLinks -> f BatchListOutgoingTypedLinks
batchListOutgoingTypedLinks_filterAttributeRanges = (BatchListOutgoingTypedLinks -> Maybe [TypedLinkAttributeRange])
-> (BatchListOutgoingTypedLinks
    -> Maybe [TypedLinkAttributeRange] -> BatchListOutgoingTypedLinks)
-> Lens
     BatchListOutgoingTypedLinks
     BatchListOutgoingTypedLinks
     (Maybe [TypedLinkAttributeRange])
     (Maybe [TypedLinkAttributeRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListOutgoingTypedLinks' {Maybe [TypedLinkAttributeRange]
filterAttributeRanges :: Maybe [TypedLinkAttributeRange]
$sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe [TypedLinkAttributeRange]
filterAttributeRanges} -> Maybe [TypedLinkAttributeRange]
filterAttributeRanges) (\s :: BatchListOutgoingTypedLinks
s@BatchListOutgoingTypedLinks' {} Maybe [TypedLinkAttributeRange]
a -> BatchListOutgoingTypedLinks
s {$sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: Maybe [TypedLinkAttributeRange]
filterAttributeRanges = Maybe [TypedLinkAttributeRange]
a} :: BatchListOutgoingTypedLinks) ((Maybe [TypedLinkAttributeRange]
  -> f (Maybe [TypedLinkAttributeRange]))
 -> BatchListOutgoingTypedLinks -> f BatchListOutgoingTypedLinks)
-> ((Maybe [TypedLinkAttributeRange]
     -> f (Maybe [TypedLinkAttributeRange]))
    -> Maybe [TypedLinkAttributeRange]
    -> f (Maybe [TypedLinkAttributeRange]))
-> (Maybe [TypedLinkAttributeRange]
    -> f (Maybe [TypedLinkAttributeRange]))
-> BatchListOutgoingTypedLinks
-> f BatchListOutgoingTypedLinks
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.
batchListOutgoingTypedLinks_nextToken :: Lens.Lens' BatchListOutgoingTypedLinks (Prelude.Maybe Prelude.Text)
batchListOutgoingTypedLinks_nextToken :: (Maybe Text -> f (Maybe Text))
-> BatchListOutgoingTypedLinks -> f BatchListOutgoingTypedLinks
batchListOutgoingTypedLinks_nextToken = (BatchListOutgoingTypedLinks -> Maybe Text)
-> (BatchListOutgoingTypedLinks
    -> Maybe Text -> BatchListOutgoingTypedLinks)
-> Lens
     BatchListOutgoingTypedLinks
     BatchListOutgoingTypedLinks
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListOutgoingTypedLinks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: BatchListOutgoingTypedLinks
s@BatchListOutgoingTypedLinks' {} Maybe Text
a -> BatchListOutgoingTypedLinks
s {$sel:nextToken:BatchListOutgoingTypedLinks' :: Maybe Text
nextToken = Maybe Text
a} :: BatchListOutgoingTypedLinks)

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

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

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

instance Prelude.Hashable BatchListOutgoingTypedLinks

instance Prelude.NFData BatchListOutgoingTypedLinks

instance Core.ToJSON BatchListOutgoingTypedLinks where
  toJSON :: BatchListOutgoingTypedLinks -> Value
toJSON BatchListOutgoingTypedLinks' {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:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> ObjectReference
$sel:maxResults:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Natural
$sel:filterTypedLink:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
$sel:nextToken:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Text
$sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> 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)
          ]
      )