{-# 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.ChimeSDKIdentity.Types.AppInstanceSummary
-- 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.ChimeSDKIdentity.Types.AppInstanceSummary where

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

-- | Summary of the data for an @AppInstance@.
--
-- /See:/ 'newAppInstanceSummary' smart constructor.
data AppInstanceSummary = AppInstanceSummary'
  { -- | The name of the @AppInstance@.
    AppInstanceSummary -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The metadata of the @AppInstance@.
    AppInstanceSummary -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The @AppInstance@ ARN.
    AppInstanceSummary -> Maybe Text
appInstanceArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AppInstanceSummary -> AppInstanceSummary -> Bool
(AppInstanceSummary -> AppInstanceSummary -> Bool)
-> (AppInstanceSummary -> AppInstanceSummary -> Bool)
-> Eq AppInstanceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppInstanceSummary -> AppInstanceSummary -> Bool
$c/= :: AppInstanceSummary -> AppInstanceSummary -> Bool
== :: AppInstanceSummary -> AppInstanceSummary -> Bool
$c== :: AppInstanceSummary -> AppInstanceSummary -> Bool
Prelude.Eq, Int -> AppInstanceSummary -> ShowS
[AppInstanceSummary] -> ShowS
AppInstanceSummary -> String
(Int -> AppInstanceSummary -> ShowS)
-> (AppInstanceSummary -> String)
-> ([AppInstanceSummary] -> ShowS)
-> Show AppInstanceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppInstanceSummary] -> ShowS
$cshowList :: [AppInstanceSummary] -> ShowS
show :: AppInstanceSummary -> String
$cshow :: AppInstanceSummary -> String
showsPrec :: Int -> AppInstanceSummary -> ShowS
$cshowsPrec :: Int -> AppInstanceSummary -> ShowS
Prelude.Show, (forall x. AppInstanceSummary -> Rep AppInstanceSummary x)
-> (forall x. Rep AppInstanceSummary x -> AppInstanceSummary)
-> Generic AppInstanceSummary
forall x. Rep AppInstanceSummary x -> AppInstanceSummary
forall x. AppInstanceSummary -> Rep AppInstanceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppInstanceSummary x -> AppInstanceSummary
$cfrom :: forall x. AppInstanceSummary -> Rep AppInstanceSummary x
Prelude.Generic)

-- |
-- Create a value of 'AppInstanceSummary' 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:
--
-- 'name', 'appInstanceSummary_name' - The name of the @AppInstance@.
--
-- 'metadata', 'appInstanceSummary_metadata' - The metadata of the @AppInstance@.
--
-- 'appInstanceArn', 'appInstanceSummary_appInstanceArn' - The @AppInstance@ ARN.
newAppInstanceSummary ::
  AppInstanceSummary
newAppInstanceSummary :: AppInstanceSummary
newAppInstanceSummary =
  AppInstanceSummary' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> Maybe Text -> AppInstanceSummary
AppInstanceSummary'
    { $sel:name:AppInstanceSummary' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:AppInstanceSummary' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:appInstanceArn:AppInstanceSummary' :: Maybe Text
appInstanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the @AppInstance@.
appInstanceSummary_name :: Lens.Lens' AppInstanceSummary (Prelude.Maybe Prelude.Text)
appInstanceSummary_name :: (Maybe Text -> f (Maybe Text))
-> AppInstanceSummary -> f AppInstanceSummary
appInstanceSummary_name = (AppInstanceSummary -> Maybe (Sensitive Text))
-> (AppInstanceSummary
    -> Maybe (Sensitive Text) -> AppInstanceSummary)
-> Lens
     AppInstanceSummary
     AppInstanceSummary
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppInstanceSummary' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:AppInstanceSummary' :: AppInstanceSummary -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: AppInstanceSummary
s@AppInstanceSummary' {} Maybe (Sensitive Text)
a -> AppInstanceSummary
s {$sel:name:AppInstanceSummary' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: AppInstanceSummary) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> AppInstanceSummary -> f AppInstanceSummary)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AppInstanceSummary
-> f AppInstanceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The metadata of the @AppInstance@.
appInstanceSummary_metadata :: Lens.Lens' AppInstanceSummary (Prelude.Maybe Prelude.Text)
appInstanceSummary_metadata :: (Maybe Text -> f (Maybe Text))
-> AppInstanceSummary -> f AppInstanceSummary
appInstanceSummary_metadata = (AppInstanceSummary -> Maybe (Sensitive Text))
-> (AppInstanceSummary
    -> Maybe (Sensitive Text) -> AppInstanceSummary)
-> Lens
     AppInstanceSummary
     AppInstanceSummary
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppInstanceSummary' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:AppInstanceSummary' :: AppInstanceSummary -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: AppInstanceSummary
s@AppInstanceSummary' {} Maybe (Sensitive Text)
a -> AppInstanceSummary
s {$sel:metadata:AppInstanceSummary' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: AppInstanceSummary) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> AppInstanceSummary -> f AppInstanceSummary)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AppInstanceSummary
-> f AppInstanceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The @AppInstance@ ARN.
appInstanceSummary_appInstanceArn :: Lens.Lens' AppInstanceSummary (Prelude.Maybe Prelude.Text)
appInstanceSummary_appInstanceArn :: (Maybe Text -> f (Maybe Text))
-> AppInstanceSummary -> f AppInstanceSummary
appInstanceSummary_appInstanceArn = (AppInstanceSummary -> Maybe Text)
-> (AppInstanceSummary -> Maybe Text -> AppInstanceSummary)
-> Lens
     AppInstanceSummary AppInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppInstanceSummary' {Maybe Text
appInstanceArn :: Maybe Text
$sel:appInstanceArn:AppInstanceSummary' :: AppInstanceSummary -> Maybe Text
appInstanceArn} -> Maybe Text
appInstanceArn) (\s :: AppInstanceSummary
s@AppInstanceSummary' {} Maybe Text
a -> AppInstanceSummary
s {$sel:appInstanceArn:AppInstanceSummary' :: Maybe Text
appInstanceArn = Maybe Text
a} :: AppInstanceSummary)

instance Core.FromJSON AppInstanceSummary where
  parseJSON :: Value -> Parser AppInstanceSummary
parseJSON =
    String
-> (Object -> Parser AppInstanceSummary)
-> Value
-> Parser AppInstanceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AppInstanceSummary"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> Maybe Text -> AppInstanceSummary
AppInstanceSummary'
            (Maybe (Sensitive Text)
 -> Maybe (Sensitive Text) -> Maybe Text -> AppInstanceSummary)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe (Sensitive Text) -> Maybe Text -> AppInstanceSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe (Sensitive Text) -> Maybe Text -> AppInstanceSummary)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> AppInstanceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Metadata")
            Parser (Maybe Text -> AppInstanceSummary)
-> Parser (Maybe Text) -> Parser AppInstanceSummary
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
"AppInstanceArn")
      )

instance Prelude.Hashable AppInstanceSummary

instance Prelude.NFData AppInstanceSummary