{-# 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.LicenseServiceConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LicenseServiceConfiguration = LicenseServiceConfiguration'
{
LicenseServiceConfiguration -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text
}
deriving (LicenseServiceConfiguration -> LicenseServiceConfiguration -> Bool
(LicenseServiceConfiguration
-> LicenseServiceConfiguration -> Bool)
-> (LicenseServiceConfiguration
-> LicenseServiceConfiguration -> Bool)
-> Eq LicenseServiceConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LicenseServiceConfiguration -> LicenseServiceConfiguration -> Bool
$c/= :: LicenseServiceConfiguration -> LicenseServiceConfiguration -> Bool
== :: LicenseServiceConfiguration -> LicenseServiceConfiguration -> Bool
$c== :: LicenseServiceConfiguration -> LicenseServiceConfiguration -> Bool
Prelude.Eq, ReadPrec [LicenseServiceConfiguration]
ReadPrec LicenseServiceConfiguration
Int -> ReadS LicenseServiceConfiguration
ReadS [LicenseServiceConfiguration]
(Int -> ReadS LicenseServiceConfiguration)
-> ReadS [LicenseServiceConfiguration]
-> ReadPrec LicenseServiceConfiguration
-> ReadPrec [LicenseServiceConfiguration]
-> Read LicenseServiceConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LicenseServiceConfiguration]
$creadListPrec :: ReadPrec [LicenseServiceConfiguration]
readPrec :: ReadPrec LicenseServiceConfiguration
$creadPrec :: ReadPrec LicenseServiceConfiguration
readList :: ReadS [LicenseServiceConfiguration]
$creadList :: ReadS [LicenseServiceConfiguration]
readsPrec :: Int -> ReadS LicenseServiceConfiguration
$creadsPrec :: Int -> ReadS LicenseServiceConfiguration
Prelude.Read, Int -> LicenseServiceConfiguration -> ShowS
[LicenseServiceConfiguration] -> ShowS
LicenseServiceConfiguration -> String
(Int -> LicenseServiceConfiguration -> ShowS)
-> (LicenseServiceConfiguration -> String)
-> ([LicenseServiceConfiguration] -> ShowS)
-> Show LicenseServiceConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LicenseServiceConfiguration] -> ShowS
$cshowList :: [LicenseServiceConfiguration] -> ShowS
show :: LicenseServiceConfiguration -> String
$cshow :: LicenseServiceConfiguration -> String
showsPrec :: Int -> LicenseServiceConfiguration -> ShowS
$cshowsPrec :: Int -> LicenseServiceConfiguration -> ShowS
Prelude.Show, (forall x.
LicenseServiceConfiguration -> Rep LicenseServiceConfiguration x)
-> (forall x.
Rep LicenseServiceConfiguration x -> LicenseServiceConfiguration)
-> Generic LicenseServiceConfiguration
forall x.
Rep LicenseServiceConfiguration x -> LicenseServiceConfiguration
forall x.
LicenseServiceConfiguration -> Rep LicenseServiceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LicenseServiceConfiguration x -> LicenseServiceConfiguration
$cfrom :: forall x.
LicenseServiceConfiguration -> Rep LicenseServiceConfiguration x
Prelude.Generic)
newLicenseServiceConfiguration ::
LicenseServiceConfiguration
newLicenseServiceConfiguration :: LicenseServiceConfiguration
newLicenseServiceConfiguration =
LicenseServiceConfiguration' :: Maybe Text -> LicenseServiceConfiguration
LicenseServiceConfiguration'
{ $sel:endpoint:LicenseServiceConfiguration' :: Maybe Text
endpoint =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
licenseServiceConfiguration_endpoint :: Lens.Lens' LicenseServiceConfiguration (Prelude.Maybe Prelude.Text)
licenseServiceConfiguration_endpoint :: (Maybe Text -> f (Maybe Text))
-> LicenseServiceConfiguration -> f LicenseServiceConfiguration
licenseServiceConfiguration_endpoint = (LicenseServiceConfiguration -> Maybe Text)
-> (LicenseServiceConfiguration
-> Maybe Text -> LicenseServiceConfiguration)
-> Lens
LicenseServiceConfiguration
LicenseServiceConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseServiceConfiguration' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:LicenseServiceConfiguration' :: LicenseServiceConfiguration -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: LicenseServiceConfiguration
s@LicenseServiceConfiguration' {} Maybe Text
a -> LicenseServiceConfiguration
s {$sel:endpoint:LicenseServiceConfiguration' :: Maybe Text
endpoint = Maybe Text
a} :: LicenseServiceConfiguration)
instance Core.FromJSON LicenseServiceConfiguration where
parseJSON :: Value -> Parser LicenseServiceConfiguration
parseJSON =
String
-> (Object -> Parser LicenseServiceConfiguration)
-> Value
-> Parser LicenseServiceConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LicenseServiceConfiguration"
( \Object
x ->
Maybe Text -> LicenseServiceConfiguration
LicenseServiceConfiguration'
(Maybe Text -> LicenseServiceConfiguration)
-> Parser (Maybe Text) -> Parser LicenseServiceConfiguration
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
"endpoint")
)
instance Prelude.Hashable LicenseServiceConfiguration
instance Prelude.NFData LicenseServiceConfiguration
instance Core.ToJSON LicenseServiceConfiguration where
toJSON :: LicenseServiceConfiguration -> Value
toJSON LicenseServiceConfiguration' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:LicenseServiceConfiguration' :: LicenseServiceConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(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]
)