{-# 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.AssociatedApplication
-- 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.AssociatedApplication 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

-- | Object containing details about applications as defined in Application
-- Discovery Service.
--
-- /See:/ 'newAssociatedApplication' smart constructor.
data AssociatedApplication = AssociatedApplication'
  { -- | ID of the application as defined in Application Discovery Service.
    AssociatedApplication -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Name of the application as defined in Application Discovery Service.
    AssociatedApplication -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (AssociatedApplication -> AssociatedApplication -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatedApplication -> AssociatedApplication -> Bool
$c/= :: AssociatedApplication -> AssociatedApplication -> Bool
== :: AssociatedApplication -> AssociatedApplication -> Bool
$c== :: AssociatedApplication -> AssociatedApplication -> Bool
Prelude.Eq, ReadPrec [AssociatedApplication]
ReadPrec AssociatedApplication
Int -> ReadS AssociatedApplication
ReadS [AssociatedApplication]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociatedApplication]
$creadListPrec :: ReadPrec [AssociatedApplication]
readPrec :: ReadPrec AssociatedApplication
$creadPrec :: ReadPrec AssociatedApplication
readList :: ReadS [AssociatedApplication]
$creadList :: ReadS [AssociatedApplication]
readsPrec :: Int -> ReadS AssociatedApplication
$creadsPrec :: Int -> ReadS AssociatedApplication
Prelude.Read, Int -> AssociatedApplication -> ShowS
[AssociatedApplication] -> ShowS
AssociatedApplication -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatedApplication] -> ShowS
$cshowList :: [AssociatedApplication] -> ShowS
show :: AssociatedApplication -> String
$cshow :: AssociatedApplication -> String
showsPrec :: Int -> AssociatedApplication -> ShowS
$cshowsPrec :: Int -> AssociatedApplication -> ShowS
Prelude.Show, forall x. Rep AssociatedApplication x -> AssociatedApplication
forall x. AssociatedApplication -> Rep AssociatedApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociatedApplication x -> AssociatedApplication
$cfrom :: forall x. AssociatedApplication -> Rep AssociatedApplication x
Prelude.Generic)

-- |
-- Create a value of 'AssociatedApplication' 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:
--
-- 'id', 'associatedApplication_id' - ID of the application as defined in Application Discovery Service.
--
-- 'name', 'associatedApplication_name' - Name of the application as defined in Application Discovery Service.
newAssociatedApplication ::
  AssociatedApplication
newAssociatedApplication :: AssociatedApplication
newAssociatedApplication =
  AssociatedApplication'
    { $sel:id:AssociatedApplication' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AssociatedApplication' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | ID of the application as defined in Application Discovery Service.
associatedApplication_id :: Lens.Lens' AssociatedApplication (Prelude.Maybe Prelude.Text)
associatedApplication_id :: Lens' AssociatedApplication (Maybe Text)
associatedApplication_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedApplication' {Maybe Text
id :: Maybe Text
$sel:id:AssociatedApplication' :: AssociatedApplication -> Maybe Text
id} -> Maybe Text
id) (\s :: AssociatedApplication
s@AssociatedApplication' {} Maybe Text
a -> AssociatedApplication
s {$sel:id:AssociatedApplication' :: Maybe Text
id = Maybe Text
a} :: AssociatedApplication)

-- | Name of the application as defined in Application Discovery Service.
associatedApplication_name :: Lens.Lens' AssociatedApplication (Prelude.Maybe Prelude.Text)
associatedApplication_name :: Lens' AssociatedApplication (Maybe Text)
associatedApplication_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedApplication' {Maybe Text
name :: Maybe Text
$sel:name:AssociatedApplication' :: AssociatedApplication -> Maybe Text
name} -> Maybe Text
name) (\s :: AssociatedApplication
s@AssociatedApplication' {} Maybe Text
a -> AssociatedApplication
s {$sel:name:AssociatedApplication' :: Maybe Text
name = Maybe Text
a} :: AssociatedApplication)

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

instance Prelude.Hashable AssociatedApplication where
  hashWithSalt :: Int -> AssociatedApplication -> Int
hashWithSalt Int
_salt AssociatedApplication' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:AssociatedApplication' :: AssociatedApplication -> Maybe Text
$sel:id:AssociatedApplication' :: AssociatedApplication -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData AssociatedApplication where
  rnf :: AssociatedApplication -> ()
rnf AssociatedApplication' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:AssociatedApplication' :: AssociatedApplication -> Maybe Text
$sel:id:AssociatedApplication' :: AssociatedApplication -> Maybe Text
..} =
    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 Text
name