{-# 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.OpenSearch.Types.DomainInformationContainer
-- 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.OpenSearch.Types.DomainInformationContainer where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.AWSDomainInformation
import qualified Amazonka.Prelude as Prelude

-- | /See:/ 'newDomainInformationContainer' smart constructor.
data DomainInformationContainer = DomainInformationContainer'
  { DomainInformationContainer -> Maybe AWSDomainInformation
aWSDomainInformation :: Prelude.Maybe AWSDomainInformation
  }
  deriving (DomainInformationContainer -> DomainInformationContainer -> Bool
(DomainInformationContainer -> DomainInformationContainer -> Bool)
-> (DomainInformationContainer
    -> DomainInformationContainer -> Bool)
-> Eq DomainInformationContainer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainInformationContainer -> DomainInformationContainer -> Bool
$c/= :: DomainInformationContainer -> DomainInformationContainer -> Bool
== :: DomainInformationContainer -> DomainInformationContainer -> Bool
$c== :: DomainInformationContainer -> DomainInformationContainer -> Bool
Prelude.Eq, ReadPrec [DomainInformationContainer]
ReadPrec DomainInformationContainer
Int -> ReadS DomainInformationContainer
ReadS [DomainInformationContainer]
(Int -> ReadS DomainInformationContainer)
-> ReadS [DomainInformationContainer]
-> ReadPrec DomainInformationContainer
-> ReadPrec [DomainInformationContainer]
-> Read DomainInformationContainer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainInformationContainer]
$creadListPrec :: ReadPrec [DomainInformationContainer]
readPrec :: ReadPrec DomainInformationContainer
$creadPrec :: ReadPrec DomainInformationContainer
readList :: ReadS [DomainInformationContainer]
$creadList :: ReadS [DomainInformationContainer]
readsPrec :: Int -> ReadS DomainInformationContainer
$creadsPrec :: Int -> ReadS DomainInformationContainer
Prelude.Read, Int -> DomainInformationContainer -> ShowS
[DomainInformationContainer] -> ShowS
DomainInformationContainer -> String
(Int -> DomainInformationContainer -> ShowS)
-> (DomainInformationContainer -> String)
-> ([DomainInformationContainer] -> ShowS)
-> Show DomainInformationContainer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainInformationContainer] -> ShowS
$cshowList :: [DomainInformationContainer] -> ShowS
show :: DomainInformationContainer -> String
$cshow :: DomainInformationContainer -> String
showsPrec :: Int -> DomainInformationContainer -> ShowS
$cshowsPrec :: Int -> DomainInformationContainer -> ShowS
Prelude.Show, (forall x.
 DomainInformationContainer -> Rep DomainInformationContainer x)
-> (forall x.
    Rep DomainInformationContainer x -> DomainInformationContainer)
-> Generic DomainInformationContainer
forall x.
Rep DomainInformationContainer x -> DomainInformationContainer
forall x.
DomainInformationContainer -> Rep DomainInformationContainer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DomainInformationContainer x -> DomainInformationContainer
$cfrom :: forall x.
DomainInformationContainer -> Rep DomainInformationContainer x
Prelude.Generic)

-- |
-- Create a value of 'DomainInformationContainer' 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:
--
-- 'aWSDomainInformation', 'domainInformationContainer_aWSDomainInformation' - Undocumented member.
newDomainInformationContainer ::
  DomainInformationContainer
newDomainInformationContainer :: DomainInformationContainer
newDomainInformationContainer =
  DomainInformationContainer' :: Maybe AWSDomainInformation -> DomainInformationContainer
DomainInformationContainer'
    { $sel:aWSDomainInformation:DomainInformationContainer' :: Maybe AWSDomainInformation
aWSDomainInformation =
        Maybe AWSDomainInformation
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
domainInformationContainer_aWSDomainInformation :: Lens.Lens' DomainInformationContainer (Prelude.Maybe AWSDomainInformation)
domainInformationContainer_aWSDomainInformation :: (Maybe AWSDomainInformation -> f (Maybe AWSDomainInformation))
-> DomainInformationContainer -> f DomainInformationContainer
domainInformationContainer_aWSDomainInformation = (DomainInformationContainer -> Maybe AWSDomainInformation)
-> (DomainInformationContainer
    -> Maybe AWSDomainInformation -> DomainInformationContainer)
-> Lens
     DomainInformationContainer
     DomainInformationContainer
     (Maybe AWSDomainInformation)
     (Maybe AWSDomainInformation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainInformationContainer' {Maybe AWSDomainInformation
aWSDomainInformation :: Maybe AWSDomainInformation
$sel:aWSDomainInformation:DomainInformationContainer' :: DomainInformationContainer -> Maybe AWSDomainInformation
aWSDomainInformation} -> Maybe AWSDomainInformation
aWSDomainInformation) (\s :: DomainInformationContainer
s@DomainInformationContainer' {} Maybe AWSDomainInformation
a -> DomainInformationContainer
s {$sel:aWSDomainInformation:DomainInformationContainer' :: Maybe AWSDomainInformation
aWSDomainInformation = Maybe AWSDomainInformation
a} :: DomainInformationContainer)

instance Core.FromJSON DomainInformationContainer where
  parseJSON :: Value -> Parser DomainInformationContainer
parseJSON =
    String
-> (Object -> Parser DomainInformationContainer)
-> Value
-> Parser DomainInformationContainer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DomainInformationContainer"
      ( \Object
x ->
          Maybe AWSDomainInformation -> DomainInformationContainer
DomainInformationContainer'
            (Maybe AWSDomainInformation -> DomainInformationContainer)
-> Parser (Maybe AWSDomainInformation)
-> Parser DomainInformationContainer
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AWSDomainInformation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AWSDomainInformation")
      )

instance Prelude.Hashable DomainInformationContainer

instance Prelude.NFData DomainInformationContainer

instance Core.ToJSON DomainInformationContainer where
  toJSON :: DomainInformationContainer -> Value
toJSON DomainInformationContainer' {Maybe AWSDomainInformation
aWSDomainInformation :: Maybe AWSDomainInformation
$sel:aWSDomainInformation:DomainInformationContainer' :: DomainInformationContainer -> Maybe AWSDomainInformation
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AWSDomainInformation" Text -> AWSDomainInformation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AWSDomainInformation -> Pair)
-> Maybe AWSDomainInformation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AWSDomainInformation
aWSDomainInformation
          ]
      )