{-# 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.Evidently.Types.ProjectAppConfigResource
-- 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.Evidently.Types.ProjectAppConfigResource 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

-- | This is a structure that defines the configuration of how your
-- application integrates with AppConfig to run client-side evaluation.
--
-- /See:/ 'newProjectAppConfigResource' smart constructor.
data ProjectAppConfigResource = ProjectAppConfigResource'
  { -- | The ID of the AppConfig application to use for client-side evaluation.
    ProjectAppConfigResource -> Text
applicationId :: Prelude.Text,
    -- | The ID of the AppConfig profile to use for client-side evaluation.
    ProjectAppConfigResource -> Text
configurationProfileId :: Prelude.Text,
    -- | The ID of the AppConfig environment to use for client-side evaluation.
    -- This must be an environment that is within the application that you
    -- specify for @applicationId@.
    ProjectAppConfigResource -> Text
environmentId :: Prelude.Text
  }
  deriving (ProjectAppConfigResource -> ProjectAppConfigResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectAppConfigResource -> ProjectAppConfigResource -> Bool
$c/= :: ProjectAppConfigResource -> ProjectAppConfigResource -> Bool
== :: ProjectAppConfigResource -> ProjectAppConfigResource -> Bool
$c== :: ProjectAppConfigResource -> ProjectAppConfigResource -> Bool
Prelude.Eq, ReadPrec [ProjectAppConfigResource]
ReadPrec ProjectAppConfigResource
Int -> ReadS ProjectAppConfigResource
ReadS [ProjectAppConfigResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectAppConfigResource]
$creadListPrec :: ReadPrec [ProjectAppConfigResource]
readPrec :: ReadPrec ProjectAppConfigResource
$creadPrec :: ReadPrec ProjectAppConfigResource
readList :: ReadS [ProjectAppConfigResource]
$creadList :: ReadS [ProjectAppConfigResource]
readsPrec :: Int -> ReadS ProjectAppConfigResource
$creadsPrec :: Int -> ReadS ProjectAppConfigResource
Prelude.Read, Int -> ProjectAppConfigResource -> ShowS
[ProjectAppConfigResource] -> ShowS
ProjectAppConfigResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectAppConfigResource] -> ShowS
$cshowList :: [ProjectAppConfigResource] -> ShowS
show :: ProjectAppConfigResource -> String
$cshow :: ProjectAppConfigResource -> String
showsPrec :: Int -> ProjectAppConfigResource -> ShowS
$cshowsPrec :: Int -> ProjectAppConfigResource -> ShowS
Prelude.Show, forall x.
Rep ProjectAppConfigResource x -> ProjectAppConfigResource
forall x.
ProjectAppConfigResource -> Rep ProjectAppConfigResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProjectAppConfigResource x -> ProjectAppConfigResource
$cfrom :: forall x.
ProjectAppConfigResource -> Rep ProjectAppConfigResource x
Prelude.Generic)

-- |
-- Create a value of 'ProjectAppConfigResource' 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:
--
-- 'applicationId', 'projectAppConfigResource_applicationId' - The ID of the AppConfig application to use for client-side evaluation.
--
-- 'configurationProfileId', 'projectAppConfigResource_configurationProfileId' - The ID of the AppConfig profile to use for client-side evaluation.
--
-- 'environmentId', 'projectAppConfigResource_environmentId' - The ID of the AppConfig environment to use for client-side evaluation.
-- This must be an environment that is within the application that you
-- specify for @applicationId@.
newProjectAppConfigResource ::
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'configurationProfileId'
  Prelude.Text ->
  -- | 'environmentId'
  Prelude.Text ->
  ProjectAppConfigResource
newProjectAppConfigResource :: Text -> Text -> Text -> ProjectAppConfigResource
newProjectAppConfigResource
  Text
pApplicationId_
  Text
pConfigurationProfileId_
  Text
pEnvironmentId_ =
    ProjectAppConfigResource'
      { $sel:applicationId:ProjectAppConfigResource' :: Text
applicationId =
          Text
pApplicationId_,
        $sel:configurationProfileId:ProjectAppConfigResource' :: Text
configurationProfileId = Text
pConfigurationProfileId_,
        $sel:environmentId:ProjectAppConfigResource' :: Text
environmentId = Text
pEnvironmentId_
      }

-- | The ID of the AppConfig application to use for client-side evaluation.
projectAppConfigResource_applicationId :: Lens.Lens' ProjectAppConfigResource Prelude.Text
projectAppConfigResource_applicationId :: Lens' ProjectAppConfigResource Text
projectAppConfigResource_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectAppConfigResource' {Text
applicationId :: Text
$sel:applicationId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
applicationId} -> Text
applicationId) (\s :: ProjectAppConfigResource
s@ProjectAppConfigResource' {} Text
a -> ProjectAppConfigResource
s {$sel:applicationId:ProjectAppConfigResource' :: Text
applicationId = Text
a} :: ProjectAppConfigResource)

-- | The ID of the AppConfig profile to use for client-side evaluation.
projectAppConfigResource_configurationProfileId :: Lens.Lens' ProjectAppConfigResource Prelude.Text
projectAppConfigResource_configurationProfileId :: Lens' ProjectAppConfigResource Text
projectAppConfigResource_configurationProfileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectAppConfigResource' {Text
configurationProfileId :: Text
$sel:configurationProfileId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
configurationProfileId} -> Text
configurationProfileId) (\s :: ProjectAppConfigResource
s@ProjectAppConfigResource' {} Text
a -> ProjectAppConfigResource
s {$sel:configurationProfileId:ProjectAppConfigResource' :: Text
configurationProfileId = Text
a} :: ProjectAppConfigResource)

-- | The ID of the AppConfig environment to use for client-side evaluation.
-- This must be an environment that is within the application that you
-- specify for @applicationId@.
projectAppConfigResource_environmentId :: Lens.Lens' ProjectAppConfigResource Prelude.Text
projectAppConfigResource_environmentId :: Lens' ProjectAppConfigResource Text
projectAppConfigResource_environmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectAppConfigResource' {Text
environmentId :: Text
$sel:environmentId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
environmentId} -> Text
environmentId) (\s :: ProjectAppConfigResource
s@ProjectAppConfigResource' {} Text
a -> ProjectAppConfigResource
s {$sel:environmentId:ProjectAppConfigResource' :: Text
environmentId = Text
a} :: ProjectAppConfigResource)

instance Data.FromJSON ProjectAppConfigResource where
  parseJSON :: Value -> Parser ProjectAppConfigResource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProjectAppConfigResource"
      ( \Object
x ->
          Text -> Text -> Text -> ProjectAppConfigResource
ProjectAppConfigResource'
            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
"applicationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"configurationProfileId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"environmentId")
      )

instance Prelude.Hashable ProjectAppConfigResource where
  hashWithSalt :: Int -> ProjectAppConfigResource -> Int
hashWithSalt Int
_salt ProjectAppConfigResource' {Text
environmentId :: Text
configurationProfileId :: Text
applicationId :: Text
$sel:environmentId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
$sel:configurationProfileId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
$sel:applicationId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationProfileId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
environmentId

instance Prelude.NFData ProjectAppConfigResource where
  rnf :: ProjectAppConfigResource -> ()
rnf ProjectAppConfigResource' {Text
environmentId :: Text
configurationProfileId :: Text
applicationId :: Text
$sel:environmentId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
$sel:configurationProfileId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
$sel:applicationId:ProjectAppConfigResource' :: ProjectAppConfigResource -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
configurationProfileId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
environmentId