{-# 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.Nimble.Types.ComputeFarmConfiguration
-- 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.Nimble.Types.ComputeFarmConfiguration 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 configuration for a render farm that is associated with a studio
-- resource.
--
-- /See:/ 'newComputeFarmConfiguration' smart constructor.
data ComputeFarmConfiguration = ComputeFarmConfiguration'
  { -- | The name of an Active Directory user that is used on ComputeFarm worker
    -- instances.
    ComputeFarmConfiguration -> Maybe Text
activeDirectoryUser :: Prelude.Maybe Prelude.Text,
    -- | The endpoint of the ComputeFarm that is accessed by the studio component
    -- resource.
    ComputeFarmConfiguration -> Maybe (Sensitive Text)
endpoint :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool
$c/= :: ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool
== :: ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool
$c== :: ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool
Prelude.Eq, Int -> ComputeFarmConfiguration -> ShowS
[ComputeFarmConfiguration] -> ShowS
ComputeFarmConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeFarmConfiguration] -> ShowS
$cshowList :: [ComputeFarmConfiguration] -> ShowS
show :: ComputeFarmConfiguration -> String
$cshow :: ComputeFarmConfiguration -> String
showsPrec :: Int -> ComputeFarmConfiguration -> ShowS
$cshowsPrec :: Int -> ComputeFarmConfiguration -> ShowS
Prelude.Show, forall x.
Rep ComputeFarmConfiguration x -> ComputeFarmConfiguration
forall x.
ComputeFarmConfiguration -> Rep ComputeFarmConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ComputeFarmConfiguration x -> ComputeFarmConfiguration
$cfrom :: forall x.
ComputeFarmConfiguration -> Rep ComputeFarmConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ComputeFarmConfiguration' 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:
--
-- 'activeDirectoryUser', 'computeFarmConfiguration_activeDirectoryUser' - The name of an Active Directory user that is used on ComputeFarm worker
-- instances.
--
-- 'endpoint', 'computeFarmConfiguration_endpoint' - The endpoint of the ComputeFarm that is accessed by the studio component
-- resource.
newComputeFarmConfiguration ::
  ComputeFarmConfiguration
newComputeFarmConfiguration :: ComputeFarmConfiguration
newComputeFarmConfiguration =
  ComputeFarmConfiguration'
    { $sel:activeDirectoryUser:ComputeFarmConfiguration' :: Maybe Text
activeDirectoryUser =
        forall a. Maybe a
Prelude.Nothing,
      $sel:endpoint:ComputeFarmConfiguration' :: Maybe (Sensitive Text)
endpoint = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of an Active Directory user that is used on ComputeFarm worker
-- instances.
computeFarmConfiguration_activeDirectoryUser :: Lens.Lens' ComputeFarmConfiguration (Prelude.Maybe Prelude.Text)
computeFarmConfiguration_activeDirectoryUser :: Lens' ComputeFarmConfiguration (Maybe Text)
computeFarmConfiguration_activeDirectoryUser = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeFarmConfiguration' {Maybe Text
activeDirectoryUser :: Maybe Text
$sel:activeDirectoryUser:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe Text
activeDirectoryUser} -> Maybe Text
activeDirectoryUser) (\s :: ComputeFarmConfiguration
s@ComputeFarmConfiguration' {} Maybe Text
a -> ComputeFarmConfiguration
s {$sel:activeDirectoryUser:ComputeFarmConfiguration' :: Maybe Text
activeDirectoryUser = Maybe Text
a} :: ComputeFarmConfiguration)

-- | The endpoint of the ComputeFarm that is accessed by the studio component
-- resource.
computeFarmConfiguration_endpoint :: Lens.Lens' ComputeFarmConfiguration (Prelude.Maybe Prelude.Text)
computeFarmConfiguration_endpoint :: Lens' ComputeFarmConfiguration (Maybe Text)
computeFarmConfiguration_endpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeFarmConfiguration' {Maybe (Sensitive Text)
endpoint :: Maybe (Sensitive Text)
$sel:endpoint:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe (Sensitive Text)
endpoint} -> Maybe (Sensitive Text)
endpoint) (\s :: ComputeFarmConfiguration
s@ComputeFarmConfiguration' {} Maybe (Sensitive Text)
a -> ComputeFarmConfiguration
s {$sel:endpoint:ComputeFarmConfiguration' :: Maybe (Sensitive Text)
endpoint = Maybe (Sensitive Text)
a} :: ComputeFarmConfiguration) 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 a. Iso' (Sensitive a) a
Data._Sensitive

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

instance Prelude.Hashable ComputeFarmConfiguration where
  hashWithSalt :: Int -> ComputeFarmConfiguration -> Int
hashWithSalt Int
_salt ComputeFarmConfiguration' {Maybe Text
Maybe (Sensitive Text)
endpoint :: Maybe (Sensitive Text)
activeDirectoryUser :: Maybe Text
$sel:endpoint:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe (Sensitive Text)
$sel:activeDirectoryUser:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
activeDirectoryUser
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
endpoint

instance Prelude.NFData ComputeFarmConfiguration where
  rnf :: ComputeFarmConfiguration -> ()
rnf ComputeFarmConfiguration' {Maybe Text
Maybe (Sensitive Text)
endpoint :: Maybe (Sensitive Text)
activeDirectoryUser :: Maybe Text
$sel:endpoint:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe (Sensitive Text)
$sel:activeDirectoryUser:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
activeDirectoryUser
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
endpoint

instance Data.ToJSON ComputeFarmConfiguration where
  toJSON :: ComputeFarmConfiguration -> Value
toJSON ComputeFarmConfiguration' {Maybe Text
Maybe (Sensitive Text)
endpoint :: Maybe (Sensitive Text)
activeDirectoryUser :: Maybe Text
$sel:endpoint:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe (Sensitive Text)
$sel:activeDirectoryUser:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"activeDirectoryUser" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
activeDirectoryUser,
            (Key
"endpoint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
endpoint
          ]
      )