{-# 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.AuditManager.Types.ServiceMetadata
-- 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.AuditManager.Types.ServiceMetadata where

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

-- | The metadata associated with the specified Amazon Web Service.
--
-- /See:/ 'newServiceMetadata' smart constructor.
data ServiceMetadata = ServiceMetadata'
  { -- | The category in which the Amazon Web Service belongs, such as compute,
    -- storage, database, and so on.
    ServiceMetadata -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon Web Service.
    ServiceMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The display name of the Amazon Web Service.
    ServiceMetadata -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The description of the specified Amazon Web Service.
    ServiceMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceMetadata -> ServiceMetadata -> Bool
(ServiceMetadata -> ServiceMetadata -> Bool)
-> (ServiceMetadata -> ServiceMetadata -> Bool)
-> Eq ServiceMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceMetadata -> ServiceMetadata -> Bool
$c/= :: ServiceMetadata -> ServiceMetadata -> Bool
== :: ServiceMetadata -> ServiceMetadata -> Bool
$c== :: ServiceMetadata -> ServiceMetadata -> Bool
Prelude.Eq, ReadPrec [ServiceMetadata]
ReadPrec ServiceMetadata
Int -> ReadS ServiceMetadata
ReadS [ServiceMetadata]
(Int -> ReadS ServiceMetadata)
-> ReadS [ServiceMetadata]
-> ReadPrec ServiceMetadata
-> ReadPrec [ServiceMetadata]
-> Read ServiceMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceMetadata]
$creadListPrec :: ReadPrec [ServiceMetadata]
readPrec :: ReadPrec ServiceMetadata
$creadPrec :: ReadPrec ServiceMetadata
readList :: ReadS [ServiceMetadata]
$creadList :: ReadS [ServiceMetadata]
readsPrec :: Int -> ReadS ServiceMetadata
$creadsPrec :: Int -> ReadS ServiceMetadata
Prelude.Read, Int -> ServiceMetadata -> ShowS
[ServiceMetadata] -> ShowS
ServiceMetadata -> String
(Int -> ServiceMetadata -> ShowS)
-> (ServiceMetadata -> String)
-> ([ServiceMetadata] -> ShowS)
-> Show ServiceMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceMetadata] -> ShowS
$cshowList :: [ServiceMetadata] -> ShowS
show :: ServiceMetadata -> String
$cshow :: ServiceMetadata -> String
showsPrec :: Int -> ServiceMetadata -> ShowS
$cshowsPrec :: Int -> ServiceMetadata -> ShowS
Prelude.Show, (forall x. ServiceMetadata -> Rep ServiceMetadata x)
-> (forall x. Rep ServiceMetadata x -> ServiceMetadata)
-> Generic ServiceMetadata
forall x. Rep ServiceMetadata x -> ServiceMetadata
forall x. ServiceMetadata -> Rep ServiceMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceMetadata x -> ServiceMetadata
$cfrom :: forall x. ServiceMetadata -> Rep ServiceMetadata x
Prelude.Generic)

-- |
-- Create a value of 'ServiceMetadata' 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:
--
-- 'category', 'serviceMetadata_category' - The category in which the Amazon Web Service belongs, such as compute,
-- storage, database, and so on.
--
-- 'name', 'serviceMetadata_name' - The name of the Amazon Web Service.
--
-- 'displayName', 'serviceMetadata_displayName' - The display name of the Amazon Web Service.
--
-- 'description', 'serviceMetadata_description' - The description of the specified Amazon Web Service.
newServiceMetadata ::
  ServiceMetadata
newServiceMetadata :: ServiceMetadata
newServiceMetadata =
  ServiceMetadata' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ServiceMetadata
ServiceMetadata'
    { $sel:category:ServiceMetadata' :: Maybe Text
category = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ServiceMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:ServiceMetadata' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ServiceMetadata' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The category in which the Amazon Web Service belongs, such as compute,
-- storage, database, and so on.
serviceMetadata_category :: Lens.Lens' ServiceMetadata (Prelude.Maybe Prelude.Text)
serviceMetadata_category :: (Maybe Text -> f (Maybe Text))
-> ServiceMetadata -> f ServiceMetadata
serviceMetadata_category = (ServiceMetadata -> Maybe Text)
-> (ServiceMetadata -> Maybe Text -> ServiceMetadata)
-> Lens ServiceMetadata ServiceMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceMetadata' {Maybe Text
category :: Maybe Text
$sel:category:ServiceMetadata' :: ServiceMetadata -> Maybe Text
category} -> Maybe Text
category) (\s :: ServiceMetadata
s@ServiceMetadata' {} Maybe Text
a -> ServiceMetadata
s {$sel:category:ServiceMetadata' :: Maybe Text
category = Maybe Text
a} :: ServiceMetadata)

-- | The name of the Amazon Web Service.
serviceMetadata_name :: Lens.Lens' ServiceMetadata (Prelude.Maybe Prelude.Text)
serviceMetadata_name :: (Maybe Text -> f (Maybe Text))
-> ServiceMetadata -> f ServiceMetadata
serviceMetadata_name = (ServiceMetadata -> Maybe Text)
-> (ServiceMetadata -> Maybe Text -> ServiceMetadata)
-> Lens ServiceMetadata ServiceMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceMetadata' {Maybe Text
name :: Maybe Text
$sel:name:ServiceMetadata' :: ServiceMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: ServiceMetadata
s@ServiceMetadata' {} Maybe Text
a -> ServiceMetadata
s {$sel:name:ServiceMetadata' :: Maybe Text
name = Maybe Text
a} :: ServiceMetadata)

-- | The display name of the Amazon Web Service.
serviceMetadata_displayName :: Lens.Lens' ServiceMetadata (Prelude.Maybe Prelude.Text)
serviceMetadata_displayName :: (Maybe Text -> f (Maybe Text))
-> ServiceMetadata -> f ServiceMetadata
serviceMetadata_displayName = (ServiceMetadata -> Maybe Text)
-> (ServiceMetadata -> Maybe Text -> ServiceMetadata)
-> Lens ServiceMetadata ServiceMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceMetadata' {Maybe Text
displayName :: Maybe Text
$sel:displayName:ServiceMetadata' :: ServiceMetadata -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: ServiceMetadata
s@ServiceMetadata' {} Maybe Text
a -> ServiceMetadata
s {$sel:displayName:ServiceMetadata' :: Maybe Text
displayName = Maybe Text
a} :: ServiceMetadata)

-- | The description of the specified Amazon Web Service.
serviceMetadata_description :: Lens.Lens' ServiceMetadata (Prelude.Maybe Prelude.Text)
serviceMetadata_description :: (Maybe Text -> f (Maybe Text))
-> ServiceMetadata -> f ServiceMetadata
serviceMetadata_description = (ServiceMetadata -> Maybe Text)
-> (ServiceMetadata -> Maybe Text -> ServiceMetadata)
-> Lens ServiceMetadata ServiceMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceMetadata' {Maybe Text
description :: Maybe Text
$sel:description:ServiceMetadata' :: ServiceMetadata -> Maybe Text
description} -> Maybe Text
description) (\s :: ServiceMetadata
s@ServiceMetadata' {} Maybe Text
a -> ServiceMetadata
s {$sel:description:ServiceMetadata' :: Maybe Text
description = Maybe Text
a} :: ServiceMetadata)

instance Core.FromJSON ServiceMetadata where
  parseJSON :: Value -> Parser ServiceMetadata
parseJSON =
    String
-> (Object -> Parser ServiceMetadata)
-> Value
-> Parser ServiceMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ServiceMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ServiceMetadata
ServiceMetadata'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> ServiceMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> ServiceMetadata)
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
"category")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> ServiceMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ServiceMetadata)
forall (f :: * -> *) a b. Applicative f => 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
"name")
            Parser (Maybe Text -> Maybe Text -> ServiceMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ServiceMetadata)
forall (f :: * -> *) a b. Applicative f => 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
"displayName")
            Parser (Maybe Text -> ServiceMetadata)
-> Parser (Maybe Text) -> Parser ServiceMetadata
forall (f :: * -> *) a b. Applicative f => 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
"description")
      )

instance Prelude.Hashable ServiceMetadata

instance Prelude.NFData ServiceMetadata