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

import Amazonka.CloudDirectory.Types.ObjectReference
import Amazonka.CloudDirectory.Types.SchemaFacet
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A batch operation to remove a facet from an object.
--
-- /See:/ 'newBatchRemoveFacetFromObject' smart constructor.
data BatchRemoveFacetFromObject = BatchRemoveFacetFromObject'
  { -- | The facet to remove from the object.
    BatchRemoveFacetFromObject -> SchemaFacet
schemaFacet :: SchemaFacet,
    -- | A reference to the object whose facet will be removed.
    BatchRemoveFacetFromObject -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchRemoveFacetFromObject -> BatchRemoveFacetFromObject -> Bool
(BatchRemoveFacetFromObject -> BatchRemoveFacetFromObject -> Bool)
-> (BatchRemoveFacetFromObject
    -> BatchRemoveFacetFromObject -> Bool)
-> Eq BatchRemoveFacetFromObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchRemoveFacetFromObject -> BatchRemoveFacetFromObject -> Bool
$c/= :: BatchRemoveFacetFromObject -> BatchRemoveFacetFromObject -> Bool
== :: BatchRemoveFacetFromObject -> BatchRemoveFacetFromObject -> Bool
$c== :: BatchRemoveFacetFromObject -> BatchRemoveFacetFromObject -> Bool
Prelude.Eq, ReadPrec [BatchRemoveFacetFromObject]
ReadPrec BatchRemoveFacetFromObject
Int -> ReadS BatchRemoveFacetFromObject
ReadS [BatchRemoveFacetFromObject]
(Int -> ReadS BatchRemoveFacetFromObject)
-> ReadS [BatchRemoveFacetFromObject]
-> ReadPrec BatchRemoveFacetFromObject
-> ReadPrec [BatchRemoveFacetFromObject]
-> Read BatchRemoveFacetFromObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchRemoveFacetFromObject]
$creadListPrec :: ReadPrec [BatchRemoveFacetFromObject]
readPrec :: ReadPrec BatchRemoveFacetFromObject
$creadPrec :: ReadPrec BatchRemoveFacetFromObject
readList :: ReadS [BatchRemoveFacetFromObject]
$creadList :: ReadS [BatchRemoveFacetFromObject]
readsPrec :: Int -> ReadS BatchRemoveFacetFromObject
$creadsPrec :: Int -> ReadS BatchRemoveFacetFromObject
Prelude.Read, Int -> BatchRemoveFacetFromObject -> ShowS
[BatchRemoveFacetFromObject] -> ShowS
BatchRemoveFacetFromObject -> String
(Int -> BatchRemoveFacetFromObject -> ShowS)
-> (BatchRemoveFacetFromObject -> String)
-> ([BatchRemoveFacetFromObject] -> ShowS)
-> Show BatchRemoveFacetFromObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchRemoveFacetFromObject] -> ShowS
$cshowList :: [BatchRemoveFacetFromObject] -> ShowS
show :: BatchRemoveFacetFromObject -> String
$cshow :: BatchRemoveFacetFromObject -> String
showsPrec :: Int -> BatchRemoveFacetFromObject -> ShowS
$cshowsPrec :: Int -> BatchRemoveFacetFromObject -> ShowS
Prelude.Show, (forall x.
 BatchRemoveFacetFromObject -> Rep BatchRemoveFacetFromObject x)
-> (forall x.
    Rep BatchRemoveFacetFromObject x -> BatchRemoveFacetFromObject)
-> Generic BatchRemoveFacetFromObject
forall x.
Rep BatchRemoveFacetFromObject x -> BatchRemoveFacetFromObject
forall x.
BatchRemoveFacetFromObject -> Rep BatchRemoveFacetFromObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchRemoveFacetFromObject x -> BatchRemoveFacetFromObject
$cfrom :: forall x.
BatchRemoveFacetFromObject -> Rep BatchRemoveFacetFromObject x
Prelude.Generic)

-- |
-- Create a value of 'BatchRemoveFacetFromObject' 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:
--
-- 'schemaFacet', 'batchRemoveFacetFromObject_schemaFacet' - The facet to remove from the object.
--
-- 'objectReference', 'batchRemoveFacetFromObject_objectReference' - A reference to the object whose facet will be removed.
newBatchRemoveFacetFromObject ::
  -- | 'schemaFacet'
  SchemaFacet ->
  -- | 'objectReference'
  ObjectReference ->
  BatchRemoveFacetFromObject
newBatchRemoveFacetFromObject :: SchemaFacet -> ObjectReference -> BatchRemoveFacetFromObject
newBatchRemoveFacetFromObject
  SchemaFacet
pSchemaFacet_
  ObjectReference
pObjectReference_ =
    BatchRemoveFacetFromObject' :: SchemaFacet -> ObjectReference -> BatchRemoveFacetFromObject
BatchRemoveFacetFromObject'
      { $sel:schemaFacet:BatchRemoveFacetFromObject' :: SchemaFacet
schemaFacet =
          SchemaFacet
pSchemaFacet_,
        $sel:objectReference:BatchRemoveFacetFromObject' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
      }

-- | The facet to remove from the object.
batchRemoveFacetFromObject_schemaFacet :: Lens.Lens' BatchRemoveFacetFromObject SchemaFacet
batchRemoveFacetFromObject_schemaFacet :: (SchemaFacet -> f SchemaFacet)
-> BatchRemoveFacetFromObject -> f BatchRemoveFacetFromObject
batchRemoveFacetFromObject_schemaFacet = (BatchRemoveFacetFromObject -> SchemaFacet)
-> (BatchRemoveFacetFromObject
    -> SchemaFacet -> BatchRemoveFacetFromObject)
-> Lens
     BatchRemoveFacetFromObject
     BatchRemoveFacetFromObject
     SchemaFacet
     SchemaFacet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchRemoveFacetFromObject' {SchemaFacet
schemaFacet :: SchemaFacet
$sel:schemaFacet:BatchRemoveFacetFromObject' :: BatchRemoveFacetFromObject -> SchemaFacet
schemaFacet} -> SchemaFacet
schemaFacet) (\s :: BatchRemoveFacetFromObject
s@BatchRemoveFacetFromObject' {} SchemaFacet
a -> BatchRemoveFacetFromObject
s {$sel:schemaFacet:BatchRemoveFacetFromObject' :: SchemaFacet
schemaFacet = SchemaFacet
a} :: BatchRemoveFacetFromObject)

-- | A reference to the object whose facet will be removed.
batchRemoveFacetFromObject_objectReference :: Lens.Lens' BatchRemoveFacetFromObject ObjectReference
batchRemoveFacetFromObject_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchRemoveFacetFromObject -> f BatchRemoveFacetFromObject
batchRemoveFacetFromObject_objectReference = (BatchRemoveFacetFromObject -> ObjectReference)
-> (BatchRemoveFacetFromObject
    -> ObjectReference -> BatchRemoveFacetFromObject)
-> Lens
     BatchRemoveFacetFromObject
     BatchRemoveFacetFromObject
     ObjectReference
     ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchRemoveFacetFromObject' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchRemoveFacetFromObject' :: BatchRemoveFacetFromObject -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchRemoveFacetFromObject
s@BatchRemoveFacetFromObject' {} ObjectReference
a -> BatchRemoveFacetFromObject
s {$sel:objectReference:BatchRemoveFacetFromObject' :: ObjectReference
objectReference = ObjectReference
a} :: BatchRemoveFacetFromObject)

instance Prelude.Hashable BatchRemoveFacetFromObject

instance Prelude.NFData BatchRemoveFacetFromObject

instance Core.ToJSON BatchRemoveFacetFromObject where
  toJSON :: BatchRemoveFacetFromObject -> Value
toJSON BatchRemoveFacetFromObject' {ObjectReference
SchemaFacet
objectReference :: ObjectReference
schemaFacet :: SchemaFacet
$sel:objectReference:BatchRemoveFacetFromObject' :: BatchRemoveFacetFromObject -> ObjectReference
$sel:schemaFacet:BatchRemoveFacetFromObject' :: BatchRemoveFacetFromObject -> SchemaFacet
..} =
    [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
"SchemaFacet" Text -> SchemaFacet -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SchemaFacet
schemaFacet),
            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)
          ]
      )