{-# 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 #-}
module Amazonka.Nimble.Types.ComputeFarmConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComputeFarmConfiguration = ComputeFarmConfiguration'
{
ComputeFarmConfiguration -> Maybe Text
activeDirectoryUser :: Prelude.Maybe Prelude.Text,
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)
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
}
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)
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
]
)