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

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

-- | Represents the output of a GetObjectInformation response operation.
--
-- /See:/ 'newBatchGetObjectInformationResponse' smart constructor.
data BatchGetObjectInformationResponse = BatchGetObjectInformationResponse'
  { -- | The @ObjectIdentifier@ of the specified object.
    BatchGetObjectInformationResponse -> Maybe Text
objectIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The facets attached to the specified object.
    BatchGetObjectInformationResponse -> Maybe [SchemaFacet]
schemaFacets :: Prelude.Maybe [SchemaFacet]
  }
  deriving (BatchGetObjectInformationResponse
-> BatchGetObjectInformationResponse -> Bool
(BatchGetObjectInformationResponse
 -> BatchGetObjectInformationResponse -> Bool)
-> (BatchGetObjectInformationResponse
    -> BatchGetObjectInformationResponse -> Bool)
-> Eq BatchGetObjectInformationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetObjectInformationResponse
-> BatchGetObjectInformationResponse -> Bool
$c/= :: BatchGetObjectInformationResponse
-> BatchGetObjectInformationResponse -> Bool
== :: BatchGetObjectInformationResponse
-> BatchGetObjectInformationResponse -> Bool
$c== :: BatchGetObjectInformationResponse
-> BatchGetObjectInformationResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetObjectInformationResponse]
ReadPrec BatchGetObjectInformationResponse
Int -> ReadS BatchGetObjectInformationResponse
ReadS [BatchGetObjectInformationResponse]
(Int -> ReadS BatchGetObjectInformationResponse)
-> ReadS [BatchGetObjectInformationResponse]
-> ReadPrec BatchGetObjectInformationResponse
-> ReadPrec [BatchGetObjectInformationResponse]
-> Read BatchGetObjectInformationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetObjectInformationResponse]
$creadListPrec :: ReadPrec [BatchGetObjectInformationResponse]
readPrec :: ReadPrec BatchGetObjectInformationResponse
$creadPrec :: ReadPrec BatchGetObjectInformationResponse
readList :: ReadS [BatchGetObjectInformationResponse]
$creadList :: ReadS [BatchGetObjectInformationResponse]
readsPrec :: Int -> ReadS BatchGetObjectInformationResponse
$creadsPrec :: Int -> ReadS BatchGetObjectInformationResponse
Prelude.Read, Int -> BatchGetObjectInformationResponse -> ShowS
[BatchGetObjectInformationResponse] -> ShowS
BatchGetObjectInformationResponse -> String
(Int -> BatchGetObjectInformationResponse -> ShowS)
-> (BatchGetObjectInformationResponse -> String)
-> ([BatchGetObjectInformationResponse] -> ShowS)
-> Show BatchGetObjectInformationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetObjectInformationResponse] -> ShowS
$cshowList :: [BatchGetObjectInformationResponse] -> ShowS
show :: BatchGetObjectInformationResponse -> String
$cshow :: BatchGetObjectInformationResponse -> String
showsPrec :: Int -> BatchGetObjectInformationResponse -> ShowS
$cshowsPrec :: Int -> BatchGetObjectInformationResponse -> ShowS
Prelude.Show, (forall x.
 BatchGetObjectInformationResponse
 -> Rep BatchGetObjectInformationResponse x)
-> (forall x.
    Rep BatchGetObjectInformationResponse x
    -> BatchGetObjectInformationResponse)
-> Generic BatchGetObjectInformationResponse
forall x.
Rep BatchGetObjectInformationResponse x
-> BatchGetObjectInformationResponse
forall x.
BatchGetObjectInformationResponse
-> Rep BatchGetObjectInformationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetObjectInformationResponse x
-> BatchGetObjectInformationResponse
$cfrom :: forall x.
BatchGetObjectInformationResponse
-> Rep BatchGetObjectInformationResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetObjectInformationResponse' 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:
--
-- 'objectIdentifier', 'batchGetObjectInformationResponse_objectIdentifier' - The @ObjectIdentifier@ of the specified object.
--
-- 'schemaFacets', 'batchGetObjectInformationResponse_schemaFacets' - The facets attached to the specified object.
newBatchGetObjectInformationResponse ::
  BatchGetObjectInformationResponse
newBatchGetObjectInformationResponse :: BatchGetObjectInformationResponse
newBatchGetObjectInformationResponse =
  BatchGetObjectInformationResponse' :: Maybe Text
-> Maybe [SchemaFacet] -> BatchGetObjectInformationResponse
BatchGetObjectInformationResponse'
    { $sel:objectIdentifier:BatchGetObjectInformationResponse' :: Maybe Text
objectIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaFacets:BatchGetObjectInformationResponse' :: Maybe [SchemaFacet]
schemaFacets = Maybe [SchemaFacet]
forall a. Maybe a
Prelude.Nothing
    }

-- | The @ObjectIdentifier@ of the specified object.
batchGetObjectInformationResponse_objectIdentifier :: Lens.Lens' BatchGetObjectInformationResponse (Prelude.Maybe Prelude.Text)
batchGetObjectInformationResponse_objectIdentifier :: (Maybe Text -> f (Maybe Text))
-> BatchGetObjectInformationResponse
-> f BatchGetObjectInformationResponse
batchGetObjectInformationResponse_objectIdentifier = (BatchGetObjectInformationResponse -> Maybe Text)
-> (BatchGetObjectInformationResponse
    -> Maybe Text -> BatchGetObjectInformationResponse)
-> Lens
     BatchGetObjectInformationResponse
     BatchGetObjectInformationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetObjectInformationResponse' {Maybe Text
objectIdentifier :: Maybe Text
$sel:objectIdentifier:BatchGetObjectInformationResponse' :: BatchGetObjectInformationResponse -> Maybe Text
objectIdentifier} -> Maybe Text
objectIdentifier) (\s :: BatchGetObjectInformationResponse
s@BatchGetObjectInformationResponse' {} Maybe Text
a -> BatchGetObjectInformationResponse
s {$sel:objectIdentifier:BatchGetObjectInformationResponse' :: Maybe Text
objectIdentifier = Maybe Text
a} :: BatchGetObjectInformationResponse)

-- | The facets attached to the specified object.
batchGetObjectInformationResponse_schemaFacets :: Lens.Lens' BatchGetObjectInformationResponse (Prelude.Maybe [SchemaFacet])
batchGetObjectInformationResponse_schemaFacets :: (Maybe [SchemaFacet] -> f (Maybe [SchemaFacet]))
-> BatchGetObjectInformationResponse
-> f BatchGetObjectInformationResponse
batchGetObjectInformationResponse_schemaFacets = (BatchGetObjectInformationResponse -> Maybe [SchemaFacet])
-> (BatchGetObjectInformationResponse
    -> Maybe [SchemaFacet] -> BatchGetObjectInformationResponse)
-> Lens
     BatchGetObjectInformationResponse
     BatchGetObjectInformationResponse
     (Maybe [SchemaFacet])
     (Maybe [SchemaFacet])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetObjectInformationResponse' {Maybe [SchemaFacet]
schemaFacets :: Maybe [SchemaFacet]
$sel:schemaFacets:BatchGetObjectInformationResponse' :: BatchGetObjectInformationResponse -> Maybe [SchemaFacet]
schemaFacets} -> Maybe [SchemaFacet]
schemaFacets) (\s :: BatchGetObjectInformationResponse
s@BatchGetObjectInformationResponse' {} Maybe [SchemaFacet]
a -> BatchGetObjectInformationResponse
s {$sel:schemaFacets:BatchGetObjectInformationResponse' :: Maybe [SchemaFacet]
schemaFacets = Maybe [SchemaFacet]
a} :: BatchGetObjectInformationResponse) ((Maybe [SchemaFacet] -> f (Maybe [SchemaFacet]))
 -> BatchGetObjectInformationResponse
 -> f BatchGetObjectInformationResponse)
-> ((Maybe [SchemaFacet] -> f (Maybe [SchemaFacet]))
    -> Maybe [SchemaFacet] -> f (Maybe [SchemaFacet]))
-> (Maybe [SchemaFacet] -> f (Maybe [SchemaFacet]))
-> BatchGetObjectInformationResponse
-> f BatchGetObjectInformationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SchemaFacet] [SchemaFacet] [SchemaFacet] [SchemaFacet]
-> Iso
     (Maybe [SchemaFacet])
     (Maybe [SchemaFacet])
     (Maybe [SchemaFacet])
     (Maybe [SchemaFacet])
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 [SchemaFacet] [SchemaFacet] [SchemaFacet] [SchemaFacet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromJSON
    BatchGetObjectInformationResponse
  where
  parseJSON :: Value -> Parser BatchGetObjectInformationResponse
parseJSON =
    String
-> (Object -> Parser BatchGetObjectInformationResponse)
-> Value
-> Parser BatchGetObjectInformationResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchGetObjectInformationResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe [SchemaFacet] -> BatchGetObjectInformationResponse
BatchGetObjectInformationResponse'
            (Maybe Text
 -> Maybe [SchemaFacet] -> BatchGetObjectInformationResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe [SchemaFacet] -> BatchGetObjectInformationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ObjectIdentifier")
            Parser (Maybe [SchemaFacet] -> BatchGetObjectInformationResponse)
-> Parser (Maybe [SchemaFacet])
-> Parser BatchGetObjectInformationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [SchemaFacet]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SchemaFacets" Parser (Maybe (Maybe [SchemaFacet]))
-> Maybe [SchemaFacet] -> Parser (Maybe [SchemaFacet])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SchemaFacet]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    BatchGetObjectInformationResponse

instance
  Prelude.NFData
    BatchGetObjectInformationResponse