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

import Amazonka.CloudDirectory.Types.TypedLinkSpecifier
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

-- | 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
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]
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
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. 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'
    { $sel:typedLinkSpecifier:BatchDetachTypedLink' :: TypedLinkSpecifier
typedLinkSpecifier =
        TypedLinkSpecifier
pTypedLinkSpecifier_
    }

-- | Used to accept a typed link specifier as input.
batchDetachTypedLink_typedLinkSpecifier :: Lens.Lens' BatchDetachTypedLink TypedLinkSpecifier
batchDetachTypedLink_typedLinkSpecifier :: Lens' BatchDetachTypedLink TypedLinkSpecifier
batchDetachTypedLink_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 where
  hashWithSalt :: Int -> BatchDetachTypedLink -> Int
hashWithSalt Int
_salt BatchDetachTypedLink' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:BatchDetachTypedLink' :: BatchDetachTypedLink -> TypedLinkSpecifier
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TypedLinkSpecifier
typedLinkSpecifier

instance Prelude.NFData BatchDetachTypedLink where
  rnf :: BatchDetachTypedLink -> ()
rnf BatchDetachTypedLink' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:BatchDetachTypedLink' :: BatchDetachTypedLink -> TypedLinkSpecifier
..} =
    forall a. NFData a => a -> ()
Prelude.rnf TypedLinkSpecifier
typedLinkSpecifier

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