{-# 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.AppStream.Types.EntitledApplication
-- 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.AppStream.Types.EntitledApplication 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

-- | The application associated to an entitlement. Access is controlled based
-- on user attributes.
--
-- /See:/ 'newEntitledApplication' smart constructor.
data EntitledApplication = EntitledApplication'
  { -- | The identifier of the application.
    EntitledApplication -> Text
applicationIdentifier :: Prelude.Text
  }
  deriving (EntitledApplication -> EntitledApplication -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntitledApplication -> EntitledApplication -> Bool
$c/= :: EntitledApplication -> EntitledApplication -> Bool
== :: EntitledApplication -> EntitledApplication -> Bool
$c== :: EntitledApplication -> EntitledApplication -> Bool
Prelude.Eq, ReadPrec [EntitledApplication]
ReadPrec EntitledApplication
Int -> ReadS EntitledApplication
ReadS [EntitledApplication]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntitledApplication]
$creadListPrec :: ReadPrec [EntitledApplication]
readPrec :: ReadPrec EntitledApplication
$creadPrec :: ReadPrec EntitledApplication
readList :: ReadS [EntitledApplication]
$creadList :: ReadS [EntitledApplication]
readsPrec :: Int -> ReadS EntitledApplication
$creadsPrec :: Int -> ReadS EntitledApplication
Prelude.Read, Int -> EntitledApplication -> ShowS
[EntitledApplication] -> ShowS
EntitledApplication -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntitledApplication] -> ShowS
$cshowList :: [EntitledApplication] -> ShowS
show :: EntitledApplication -> String
$cshow :: EntitledApplication -> String
showsPrec :: Int -> EntitledApplication -> ShowS
$cshowsPrec :: Int -> EntitledApplication -> ShowS
Prelude.Show, forall x. Rep EntitledApplication x -> EntitledApplication
forall x. EntitledApplication -> Rep EntitledApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EntitledApplication x -> EntitledApplication
$cfrom :: forall x. EntitledApplication -> Rep EntitledApplication x
Prelude.Generic)

-- |
-- Create a value of 'EntitledApplication' 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:
--
-- 'applicationIdentifier', 'entitledApplication_applicationIdentifier' - The identifier of the application.
newEntitledApplication ::
  -- | 'applicationIdentifier'
  Prelude.Text ->
  EntitledApplication
newEntitledApplication :: Text -> EntitledApplication
newEntitledApplication Text
pApplicationIdentifier_ =
  EntitledApplication'
    { $sel:applicationIdentifier:EntitledApplication' :: Text
applicationIdentifier =
        Text
pApplicationIdentifier_
    }

-- | The identifier of the application.
entitledApplication_applicationIdentifier :: Lens.Lens' EntitledApplication Prelude.Text
entitledApplication_applicationIdentifier :: Lens' EntitledApplication Text
entitledApplication_applicationIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitledApplication' {Text
applicationIdentifier :: Text
$sel:applicationIdentifier:EntitledApplication' :: EntitledApplication -> Text
applicationIdentifier} -> Text
applicationIdentifier) (\s :: EntitledApplication
s@EntitledApplication' {} Text
a -> EntitledApplication
s {$sel:applicationIdentifier:EntitledApplication' :: Text
applicationIdentifier = Text
a} :: EntitledApplication)

instance Data.FromJSON EntitledApplication where
  parseJSON :: Value -> Parser EntitledApplication
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EntitledApplication"
      ( \Object
x ->
          Text -> EntitledApplication
EntitledApplication'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ApplicationIdentifier")
      )

instance Prelude.Hashable EntitledApplication where
  hashWithSalt :: Int -> EntitledApplication -> Int
hashWithSalt Int
_salt EntitledApplication' {Text
applicationIdentifier :: Text
$sel:applicationIdentifier:EntitledApplication' :: EntitledApplication -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationIdentifier

instance Prelude.NFData EntitledApplication where
  rnf :: EntitledApplication -> ()
rnf EntitledApplication' {Text
applicationIdentifier :: Text
$sel:applicationIdentifier:EntitledApplication' :: EntitledApplication -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
applicationIdentifier