{-# 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-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.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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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],
    -- | 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 pagination token.
    BatchListOutgoingTypedLinks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The reference that identifies the object whose attributes will be
    -- listed.
    BatchListOutgoingTypedLinks -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchListOutgoingTypedLinks -> BatchListOutgoingTypedLinks -> Bool
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]
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
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.
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.
--
-- '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.
--
-- 'nextToken', 'batchListOutgoingTypedLinks_nextToken' - The pagination token.
--
-- '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'
    { $sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: Maybe [TypedLinkAttributeRange]
filterAttributeRanges =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filterTypedLink:BatchListOutgoingTypedLinks' :: Maybe TypedLinkSchemaAndFacetName
filterTypedLink = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:BatchListOutgoingTypedLinks' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListOutgoingTypedLinks' :: Maybe Text
nextToken = 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 :: Lens' BatchListOutgoingTypedLinks (Maybe [TypedLinkAttributeRange])
batchListOutgoingTypedLinks_filterAttributeRanges = 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) 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 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 :: Lens'
  BatchListOutgoingTypedLinks (Maybe TypedLinkSchemaAndFacetName)
batchListOutgoingTypedLinks_filterTypedLink = 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 :: Lens' BatchListOutgoingTypedLinks (Maybe Natural)
batchListOutgoingTypedLinks_maxResults = 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 pagination token.
batchListOutgoingTypedLinks_nextToken :: Lens.Lens' BatchListOutgoingTypedLinks (Prelude.Maybe Prelude.Text)
batchListOutgoingTypedLinks_nextToken :: Lens' BatchListOutgoingTypedLinks (Maybe Text)
batchListOutgoingTypedLinks_nextToken = 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)

-- | The reference that identifies the object whose attributes will be
-- listed.
batchListOutgoingTypedLinks_objectReference :: Lens.Lens' BatchListOutgoingTypedLinks ObjectReference
batchListOutgoingTypedLinks_objectReference :: Lens' BatchListOutgoingTypedLinks ObjectReference
batchListOutgoingTypedLinks_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 where
  hashWithSalt :: Int -> BatchListOutgoingTypedLinks -> Int
hashWithSalt Int
_salt BatchListOutgoingTypedLinks' {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:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> ObjectReference
$sel:nextToken:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Text
$sel:maxResults:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Natural
$sel:filterTypedLink:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
$sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> 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 BatchListOutgoingTypedLinks where
  rnf :: BatchListOutgoingTypedLinks -> ()
rnf BatchListOutgoingTypedLinks' {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:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> ObjectReference
$sel:nextToken:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Text
$sel:maxResults:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Natural
$sel:filterTypedLink:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
$sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> 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 BatchListOutgoingTypedLinks where
  toJSON :: BatchListOutgoingTypedLinks -> Value
toJSON BatchListOutgoingTypedLinks' {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:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> ObjectReference
$sel:nextToken:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Text
$sel:maxResults:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe Natural
$sel:filterTypedLink:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> Maybe TypedLinkSchemaAndFacetName
$sel:filterAttributeRanges:BatchListOutgoingTypedLinks' :: BatchListOutgoingTypedLinks -> 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)
          ]
      )