{-# 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.SSMSAP.Types.ApplicationSummary
-- 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.SSMSAP.Types.ApplicationSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMSAP.Types.ApplicationType

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

-- |
-- Create a value of 'ApplicationSummary' 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:
--
-- 'arn', 'applicationSummary_arn' -
--
-- 'id', 'applicationSummary_id' -
--
-- 'tags', 'applicationSummary_tags' -
--
-- 'type'', 'applicationSummary_type' -
newApplicationSummary ::
  ApplicationSummary
newApplicationSummary :: ApplicationSummary
newApplicationSummary =
  ApplicationSummary'
    { $sel:arn:ApplicationSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ApplicationSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ApplicationSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:type':ApplicationSummary' :: Maybe ApplicationType
type' = forall a. Maybe a
Prelude.Nothing
    }

applicationSummary_arn :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_arn :: Lens' ApplicationSummary (Maybe Text)
applicationSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:ApplicationSummary' :: ApplicationSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:arn:ApplicationSummary' :: Maybe Text
arn = Maybe Text
a} :: ApplicationSummary)

applicationSummary_id :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_id :: Lens' ApplicationSummary (Maybe Text)
applicationSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe Text
id :: Maybe Text
$sel:id:ApplicationSummary' :: ApplicationSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:id:ApplicationSummary' :: Maybe Text
id = Maybe Text
a} :: ApplicationSummary)

applicationSummary_tags :: Lens.Lens' ApplicationSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
applicationSummary_tags :: Lens' ApplicationSummary (Maybe (HashMap Text Text))
applicationSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ApplicationSummary' :: ApplicationSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe (HashMap Text Text)
a -> ApplicationSummary
s {$sel:tags:ApplicationSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ApplicationSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

applicationSummary_type :: Lens.Lens' ApplicationSummary (Prelude.Maybe ApplicationType)
applicationSummary_type :: Lens' ApplicationSummary (Maybe ApplicationType)
applicationSummary_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe ApplicationType
type' :: Maybe ApplicationType
$sel:type':ApplicationSummary' :: ApplicationSummary -> Maybe ApplicationType
type'} -> Maybe ApplicationType
type') (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe ApplicationType
a -> ApplicationSummary
s {$sel:type':ApplicationSummary' :: Maybe ApplicationType
type' = Maybe ApplicationType
a} :: ApplicationSummary)

instance Data.FromJSON ApplicationSummary where
  parseJSON :: Value -> Parser ApplicationSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApplicationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe ApplicationType
-> ApplicationSummary
ApplicationSummary'
            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
"Arn")
            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
"Id")
            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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"Type")
      )

instance Prelude.Hashable ApplicationSummary where
  hashWithSalt :: Int -> ApplicationSummary -> Int
hashWithSalt Int
_salt ApplicationSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe ApplicationType
type' :: Maybe ApplicationType
tags :: Maybe (HashMap Text Text)
id :: Maybe Text
arn :: Maybe Text
$sel:type':ApplicationSummary' :: ApplicationSummary -> Maybe ApplicationType
$sel:tags:ApplicationSummary' :: ApplicationSummary -> Maybe (HashMap Text Text)
$sel:id:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:arn:ApplicationSummary' :: ApplicationSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApplicationType
type'

instance Prelude.NFData ApplicationSummary where
  rnf :: ApplicationSummary -> ()
rnf ApplicationSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe ApplicationType
type' :: Maybe ApplicationType
tags :: Maybe (HashMap Text Text)
id :: Maybe Text
arn :: Maybe Text
$sel:type':ApplicationSummary' :: ApplicationSummary -> Maybe ApplicationType
$sel:tags:ApplicationSummary' :: ApplicationSummary -> Maybe (HashMap Text Text)
$sel:id:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:arn:ApplicationSummary' :: ApplicationSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApplicationType
type'