{-# 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.MigrationHubStrategy.Types.ApplicationComponentSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MigrationHubStrategy.Types.ApplicationComponentSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types.AppType
import qualified Amazonka.Prelude as Prelude

-- | Contains the summary of application components.
--
-- /See:/ 'newApplicationComponentSummary' smart constructor.
data ApplicationComponentSummary = ApplicationComponentSummary'
  { -- | Contains the name of application types.
    ApplicationComponentSummary -> Maybe AppType
appType :: Prelude.Maybe AppType,
    -- | Contains the count of application type.
    ApplicationComponentSummary -> Maybe Int
count :: Prelude.Maybe Prelude.Int
  }
  deriving (ApplicationComponentSummary -> ApplicationComponentSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationComponentSummary -> ApplicationComponentSummary -> Bool
$c/= :: ApplicationComponentSummary -> ApplicationComponentSummary -> Bool
== :: ApplicationComponentSummary -> ApplicationComponentSummary -> Bool
$c== :: ApplicationComponentSummary -> ApplicationComponentSummary -> Bool
Prelude.Eq, ReadPrec [ApplicationComponentSummary]
ReadPrec ApplicationComponentSummary
Int -> ReadS ApplicationComponentSummary
ReadS [ApplicationComponentSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationComponentSummary]
$creadListPrec :: ReadPrec [ApplicationComponentSummary]
readPrec :: ReadPrec ApplicationComponentSummary
$creadPrec :: ReadPrec ApplicationComponentSummary
readList :: ReadS [ApplicationComponentSummary]
$creadList :: ReadS [ApplicationComponentSummary]
readsPrec :: Int -> ReadS ApplicationComponentSummary
$creadsPrec :: Int -> ReadS ApplicationComponentSummary
Prelude.Read, Int -> ApplicationComponentSummary -> ShowS
[ApplicationComponentSummary] -> ShowS
ApplicationComponentSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationComponentSummary] -> ShowS
$cshowList :: [ApplicationComponentSummary] -> ShowS
show :: ApplicationComponentSummary -> String
$cshow :: ApplicationComponentSummary -> String
showsPrec :: Int -> ApplicationComponentSummary -> ShowS
$cshowsPrec :: Int -> ApplicationComponentSummary -> ShowS
Prelude.Show, forall x.
Rep ApplicationComponentSummary x -> ApplicationComponentSummary
forall x.
ApplicationComponentSummary -> Rep ApplicationComponentSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationComponentSummary x -> ApplicationComponentSummary
$cfrom :: forall x.
ApplicationComponentSummary -> Rep ApplicationComponentSummary x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationComponentSummary' 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:
--
-- 'appType', 'applicationComponentSummary_appType' - Contains the name of application types.
--
-- 'count', 'applicationComponentSummary_count' - Contains the count of application type.
newApplicationComponentSummary ::
  ApplicationComponentSummary
newApplicationComponentSummary :: ApplicationComponentSummary
newApplicationComponentSummary =
  ApplicationComponentSummary'
    { $sel:appType:ApplicationComponentSummary' :: Maybe AppType
appType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:count:ApplicationComponentSummary' :: Maybe Int
count = forall a. Maybe a
Prelude.Nothing
    }

-- | Contains the name of application types.
applicationComponentSummary_appType :: Lens.Lens' ApplicationComponentSummary (Prelude.Maybe AppType)
applicationComponentSummary_appType :: Lens' ApplicationComponentSummary (Maybe AppType)
applicationComponentSummary_appType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationComponentSummary' {Maybe AppType
appType :: Maybe AppType
$sel:appType:ApplicationComponentSummary' :: ApplicationComponentSummary -> Maybe AppType
appType} -> Maybe AppType
appType) (\s :: ApplicationComponentSummary
s@ApplicationComponentSummary' {} Maybe AppType
a -> ApplicationComponentSummary
s {$sel:appType:ApplicationComponentSummary' :: Maybe AppType
appType = Maybe AppType
a} :: ApplicationComponentSummary)

-- | Contains the count of application type.
applicationComponentSummary_count :: Lens.Lens' ApplicationComponentSummary (Prelude.Maybe Prelude.Int)
applicationComponentSummary_count :: Lens' ApplicationComponentSummary (Maybe Int)
applicationComponentSummary_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationComponentSummary' {Maybe Int
count :: Maybe Int
$sel:count:ApplicationComponentSummary' :: ApplicationComponentSummary -> Maybe Int
count} -> Maybe Int
count) (\s :: ApplicationComponentSummary
s@ApplicationComponentSummary' {} Maybe Int
a -> ApplicationComponentSummary
s {$sel:count:ApplicationComponentSummary' :: Maybe Int
count = Maybe Int
a} :: ApplicationComponentSummary)

instance Data.FromJSON ApplicationComponentSummary where
  parseJSON :: Value -> Parser ApplicationComponentSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApplicationComponentSummary"
      ( \Object
x ->
          Maybe AppType -> Maybe Int -> ApplicationComponentSummary
ApplicationComponentSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"appType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"count")
      )

instance Prelude.Hashable ApplicationComponentSummary where
  hashWithSalt :: Int -> ApplicationComponentSummary -> Int
hashWithSalt Int
_salt ApplicationComponentSummary' {Maybe Int
Maybe AppType
count :: Maybe Int
appType :: Maybe AppType
$sel:count:ApplicationComponentSummary' :: ApplicationComponentSummary -> Maybe Int
$sel:appType:ApplicationComponentSummary' :: ApplicationComponentSummary -> Maybe AppType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppType
appType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
count

instance Prelude.NFData ApplicationComponentSummary where
  rnf :: ApplicationComponentSummary -> ()
rnf ApplicationComponentSummary' {Maybe Int
Maybe AppType
count :: Maybe Int
appType :: Maybe AppType
$sel:count:ApplicationComponentSummary' :: ApplicationComponentSummary -> Maybe Int
$sel:appType:ApplicationComponentSummary' :: ApplicationComponentSummary -> Maybe AppType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AppType
appType seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
count