{-# 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-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.Nimble.Types.ComputeFarmConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 Text
endpoint :: Prelude.Maybe Prelude.Text
  }
  deriving (ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool
(ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool)
-> (ComputeFarmConfiguration -> ComputeFarmConfiguration -> Bool)
-> Eq ComputeFarmConfiguration
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, ReadPrec [ComputeFarmConfiguration]
ReadPrec ComputeFarmConfiguration
Int -> ReadS ComputeFarmConfiguration
ReadS [ComputeFarmConfiguration]
(Int -> ReadS ComputeFarmConfiguration)
-> ReadS [ComputeFarmConfiguration]
-> ReadPrec ComputeFarmConfiguration
-> ReadPrec [ComputeFarmConfiguration]
-> Read ComputeFarmConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeFarmConfiguration]
$creadListPrec :: ReadPrec [ComputeFarmConfiguration]
readPrec :: ReadPrec ComputeFarmConfiguration
$creadPrec :: ReadPrec ComputeFarmConfiguration
readList :: ReadS [ComputeFarmConfiguration]
$creadList :: ReadS [ComputeFarmConfiguration]
readsPrec :: Int -> ReadS ComputeFarmConfiguration
$creadsPrec :: Int -> ReadS ComputeFarmConfiguration
Prelude.Read, Int -> ComputeFarmConfiguration -> ShowS
[ComputeFarmConfiguration] -> ShowS
ComputeFarmConfiguration -> String
(Int -> ComputeFarmConfiguration -> ShowS)
-> (ComputeFarmConfiguration -> String)
-> ([ComputeFarmConfiguration] -> ShowS)
-> Show ComputeFarmConfiguration
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.
 ComputeFarmConfiguration -> Rep ComputeFarmConfiguration x)
-> (forall x.
    Rep ComputeFarmConfiguration x -> ComputeFarmConfiguration)
-> Generic ComputeFarmConfiguration
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' :: Maybe Text -> Maybe Text -> ComputeFarmConfiguration
ComputeFarmConfiguration'
    { $sel:activeDirectoryUser:ComputeFarmConfiguration' :: Maybe Text
activeDirectoryUser =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpoint:ComputeFarmConfiguration' :: Maybe Text
endpoint = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ComputeFarmConfiguration -> f ComputeFarmConfiguration
computeFarmConfiguration_activeDirectoryUser = (ComputeFarmConfiguration -> Maybe Text)
-> (ComputeFarmConfiguration
    -> Maybe Text -> ComputeFarmConfiguration)
-> Lens
     ComputeFarmConfiguration
     ComputeFarmConfiguration
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ComputeFarmConfiguration -> f ComputeFarmConfiguration
computeFarmConfiguration_endpoint = (ComputeFarmConfiguration -> Maybe Text)
-> (ComputeFarmConfiguration
    -> Maybe Text -> ComputeFarmConfiguration)
-> Lens
     ComputeFarmConfiguration
     ComputeFarmConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeFarmConfiguration' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:ComputeFarmConfiguration' :: ComputeFarmConfiguration -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: ComputeFarmConfiguration
s@ComputeFarmConfiguration' {} Maybe Text
a -> ComputeFarmConfiguration
s {$sel:endpoint:ComputeFarmConfiguration' :: Maybe Text
endpoint = Maybe Text
a} :: ComputeFarmConfiguration)

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

instance Prelude.Hashable ComputeFarmConfiguration

instance Prelude.NFData ComputeFarmConfiguration

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