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

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

-- | Detaches a typed link from a specified source and target object inside a
-- BatchRead operation. For more information, see DetachTypedLink and
-- BatchReadRequest$Operations.
--
-- /See:/ 'newBatchDetachTypedLink' smart constructor.
data BatchDetachTypedLink = BatchDetachTypedLink'
  { -- | Used to accept a typed link specifier as input.
    BatchDetachTypedLink -> TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
  }
  deriving (BatchDetachTypedLink -> BatchDetachTypedLink -> Bool
(BatchDetachTypedLink -> BatchDetachTypedLink -> Bool)
-> (BatchDetachTypedLink -> BatchDetachTypedLink -> Bool)
-> Eq BatchDetachTypedLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetachTypedLink -> BatchDetachTypedLink -> Bool
$c/= :: BatchDetachTypedLink -> BatchDetachTypedLink -> Bool
== :: BatchDetachTypedLink -> BatchDetachTypedLink -> Bool
$c== :: BatchDetachTypedLink -> BatchDetachTypedLink -> Bool
Prelude.Eq, ReadPrec [BatchDetachTypedLink]
ReadPrec BatchDetachTypedLink
Int -> ReadS BatchDetachTypedLink
ReadS [BatchDetachTypedLink]
(Int -> ReadS BatchDetachTypedLink)
-> ReadS [BatchDetachTypedLink]
-> ReadPrec BatchDetachTypedLink
-> ReadPrec [BatchDetachTypedLink]
-> Read BatchDetachTypedLink
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDetachTypedLink]
$creadListPrec :: ReadPrec [BatchDetachTypedLink]
readPrec :: ReadPrec BatchDetachTypedLink
$creadPrec :: ReadPrec BatchDetachTypedLink
readList :: ReadS [BatchDetachTypedLink]
$creadList :: ReadS [BatchDetachTypedLink]
readsPrec :: Int -> ReadS BatchDetachTypedLink
$creadsPrec :: Int -> ReadS BatchDetachTypedLink
Prelude.Read, Int -> BatchDetachTypedLink -> ShowS
[BatchDetachTypedLink] -> ShowS
BatchDetachTypedLink -> String
(Int -> BatchDetachTypedLink -> ShowS)
-> (BatchDetachTypedLink -> String)
-> ([BatchDetachTypedLink] -> ShowS)
-> Show BatchDetachTypedLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetachTypedLink] -> ShowS
$cshowList :: [BatchDetachTypedLink] -> ShowS
show :: BatchDetachTypedLink -> String
$cshow :: BatchDetachTypedLink -> String
showsPrec :: Int -> BatchDetachTypedLink -> ShowS
$cshowsPrec :: Int -> BatchDetachTypedLink -> ShowS
Prelude.Show, (forall x. BatchDetachTypedLink -> Rep BatchDetachTypedLink x)
-> (forall x. Rep BatchDetachTypedLink x -> BatchDetachTypedLink)
-> Generic BatchDetachTypedLink
forall x. Rep BatchDetachTypedLink x -> BatchDetachTypedLink
forall x. BatchDetachTypedLink -> Rep BatchDetachTypedLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDetachTypedLink x -> BatchDetachTypedLink
$cfrom :: forall x. BatchDetachTypedLink -> Rep BatchDetachTypedLink x
Prelude.Generic)

-- |
-- Create a value of 'BatchDetachTypedLink' 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:
--
-- 'typedLinkSpecifier', 'batchDetachTypedLink_typedLinkSpecifier' - Used to accept a typed link specifier as input.
newBatchDetachTypedLink ::
  -- | 'typedLinkSpecifier'
  TypedLinkSpecifier ->
  BatchDetachTypedLink
newBatchDetachTypedLink :: TypedLinkSpecifier -> BatchDetachTypedLink
newBatchDetachTypedLink TypedLinkSpecifier
pTypedLinkSpecifier_ =
  BatchDetachTypedLink' :: TypedLinkSpecifier -> BatchDetachTypedLink
BatchDetachTypedLink'
    { $sel:typedLinkSpecifier:BatchDetachTypedLink' :: TypedLinkSpecifier
typedLinkSpecifier =
        TypedLinkSpecifier
pTypedLinkSpecifier_
    }

-- | Used to accept a typed link specifier as input.
batchDetachTypedLink_typedLinkSpecifier :: Lens.Lens' BatchDetachTypedLink TypedLinkSpecifier
batchDetachTypedLink_typedLinkSpecifier :: (TypedLinkSpecifier -> f TypedLinkSpecifier)
-> BatchDetachTypedLink -> f BatchDetachTypedLink
batchDetachTypedLink_typedLinkSpecifier = (BatchDetachTypedLink -> TypedLinkSpecifier)
-> (BatchDetachTypedLink
    -> TypedLinkSpecifier -> BatchDetachTypedLink)
-> Lens
     BatchDetachTypedLink
     BatchDetachTypedLink
     TypedLinkSpecifier
     TypedLinkSpecifier
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetachTypedLink' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:BatchDetachTypedLink' :: BatchDetachTypedLink -> TypedLinkSpecifier
typedLinkSpecifier} -> TypedLinkSpecifier
typedLinkSpecifier) (\s :: BatchDetachTypedLink
s@BatchDetachTypedLink' {} TypedLinkSpecifier
a -> BatchDetachTypedLink
s {$sel:typedLinkSpecifier:BatchDetachTypedLink' :: TypedLinkSpecifier
typedLinkSpecifier = TypedLinkSpecifier
a} :: BatchDetachTypedLink)

instance Prelude.Hashable BatchDetachTypedLink

instance Prelude.NFData BatchDetachTypedLink

instance Core.ToJSON BatchDetachTypedLink where
  toJSON :: BatchDetachTypedLink -> Value
toJSON BatchDetachTypedLink' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:BatchDetachTypedLink' :: BatchDetachTypedLink -> TypedLinkSpecifier
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TypedLinkSpecifier" Text -> TypedLinkSpecifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TypedLinkSpecifier
typedLinkSpecifier)
          ]
      )