{-# 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.MacieV2.Types.DomainDetails
-- 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.MacieV2.Types.DomainDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the domain name of the device that an entity
-- used to perform an action on an affected resource.
--
-- /See:/ 'newDomainDetails' smart constructor.
data DomainDetails = DomainDetails'
  { -- | The name of the domain.
    DomainDetails -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text
  }
  deriving (DomainDetails -> DomainDetails -> Bool
(DomainDetails -> DomainDetails -> Bool)
-> (DomainDetails -> DomainDetails -> Bool) -> Eq DomainDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainDetails -> DomainDetails -> Bool
$c/= :: DomainDetails -> DomainDetails -> Bool
== :: DomainDetails -> DomainDetails -> Bool
$c== :: DomainDetails -> DomainDetails -> Bool
Prelude.Eq, ReadPrec [DomainDetails]
ReadPrec DomainDetails
Int -> ReadS DomainDetails
ReadS [DomainDetails]
(Int -> ReadS DomainDetails)
-> ReadS [DomainDetails]
-> ReadPrec DomainDetails
-> ReadPrec [DomainDetails]
-> Read DomainDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainDetails]
$creadListPrec :: ReadPrec [DomainDetails]
readPrec :: ReadPrec DomainDetails
$creadPrec :: ReadPrec DomainDetails
readList :: ReadS [DomainDetails]
$creadList :: ReadS [DomainDetails]
readsPrec :: Int -> ReadS DomainDetails
$creadsPrec :: Int -> ReadS DomainDetails
Prelude.Read, Int -> DomainDetails -> ShowS
[DomainDetails] -> ShowS
DomainDetails -> String
(Int -> DomainDetails -> ShowS)
-> (DomainDetails -> String)
-> ([DomainDetails] -> ShowS)
-> Show DomainDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainDetails] -> ShowS
$cshowList :: [DomainDetails] -> ShowS
show :: DomainDetails -> String
$cshow :: DomainDetails -> String
showsPrec :: Int -> DomainDetails -> ShowS
$cshowsPrec :: Int -> DomainDetails -> ShowS
Prelude.Show, (forall x. DomainDetails -> Rep DomainDetails x)
-> (forall x. Rep DomainDetails x -> DomainDetails)
-> Generic DomainDetails
forall x. Rep DomainDetails x -> DomainDetails
forall x. DomainDetails -> Rep DomainDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainDetails x -> DomainDetails
$cfrom :: forall x. DomainDetails -> Rep DomainDetails x
Prelude.Generic)

-- |
-- Create a value of 'DomainDetails' 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:
--
-- 'domainName', 'domainDetails_domainName' - The name of the domain.
newDomainDetails ::
  DomainDetails
newDomainDetails :: DomainDetails
newDomainDetails =
  DomainDetails' :: Maybe Text -> DomainDetails
DomainDetails' {$sel:domainName:DomainDetails' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of the domain.
domainDetails_domainName :: Lens.Lens' DomainDetails (Prelude.Maybe Prelude.Text)
domainDetails_domainName :: (Maybe Text -> f (Maybe Text)) -> DomainDetails -> f DomainDetails
domainDetails_domainName = (DomainDetails -> Maybe Text)
-> (DomainDetails -> Maybe Text -> DomainDetails)
-> Lens DomainDetails DomainDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainDetails' {Maybe Text
domainName :: Maybe Text
$sel:domainName:DomainDetails' :: DomainDetails -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: DomainDetails
s@DomainDetails' {} Maybe Text
a -> DomainDetails
s {$sel:domainName:DomainDetails' :: Maybe Text
domainName = Maybe Text
a} :: DomainDetails)

instance Core.FromJSON DomainDetails where
  parseJSON :: Value -> Parser DomainDetails
parseJSON =
    String
-> (Object -> Parser DomainDetails)
-> Value
-> Parser DomainDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DomainDetails"
      ( \Object
x ->
          Maybe Text -> DomainDetails
DomainDetails' (Maybe Text -> DomainDetails)
-> Parser (Maybe Text) -> Parser DomainDetails
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
"domainName")
      )

instance Prelude.Hashable DomainDetails

instance Prelude.NFData DomainDetails