{-# 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.LicenseServiceConfiguration
-- 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.LicenseServiceConfiguration 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 license service that is associated with a studio
-- resource.
--
-- /See:/ 'newLicenseServiceConfiguration' smart constructor.
data LicenseServiceConfiguration = LicenseServiceConfiguration'
  { -- | The endpoint of the license service that is accessed by the studio
    -- component resource.
    LicenseServiceConfiguration -> Maybe (Sensitive Text)
endpoint :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (LicenseServiceConfiguration -> LicenseServiceConfiguration -> Bool
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, Int -> LicenseServiceConfiguration -> ShowS
[LicenseServiceConfiguration] -> ShowS
LicenseServiceConfiguration -> String
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.
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)

-- |
-- Create a value of 'LicenseServiceConfiguration' 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:
--
-- 'endpoint', 'licenseServiceConfiguration_endpoint' - The endpoint of the license service that is accessed by the studio
-- component resource.
newLicenseServiceConfiguration ::
  LicenseServiceConfiguration
newLicenseServiceConfiguration :: LicenseServiceConfiguration
newLicenseServiceConfiguration =
  LicenseServiceConfiguration'
    { $sel:endpoint:LicenseServiceConfiguration' :: Maybe (Sensitive Text)
endpoint =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The endpoint of the license service that is accessed by the studio
-- component resource.
licenseServiceConfiguration_endpoint :: Lens.Lens' LicenseServiceConfiguration (Prelude.Maybe Prelude.Text)
licenseServiceConfiguration_endpoint :: Lens' LicenseServiceConfiguration (Maybe Text)
licenseServiceConfiguration_endpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseServiceConfiguration' {Maybe (Sensitive Text)
endpoint :: Maybe (Sensitive Text)
$sel:endpoint:LicenseServiceConfiguration' :: LicenseServiceConfiguration -> Maybe (Sensitive Text)
endpoint} -> Maybe (Sensitive Text)
endpoint) (\s :: LicenseServiceConfiguration
s@LicenseServiceConfiguration' {} Maybe (Sensitive Text)
a -> LicenseServiceConfiguration
s {$sel:endpoint:LicenseServiceConfiguration' :: Maybe (Sensitive Text)
endpoint = Maybe (Sensitive Text)
a} :: LicenseServiceConfiguration) 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 LicenseServiceConfiguration where
  parseJSON :: Value -> Parser LicenseServiceConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LicenseServiceConfiguration"
      ( \Object
x ->
          Maybe (Sensitive Text) -> LicenseServiceConfiguration
LicenseServiceConfiguration'
            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
"endpoint")
      )

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

instance Prelude.NFData LicenseServiceConfiguration where
  rnf :: LicenseServiceConfiguration -> ()
rnf LicenseServiceConfiguration' {Maybe (Sensitive Text)
endpoint :: Maybe (Sensitive Text)
$sel:endpoint:LicenseServiceConfiguration' :: LicenseServiceConfiguration -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
endpoint

instance Data.ToJSON LicenseServiceConfiguration where
  toJSON :: LicenseServiceConfiguration -> Value
toJSON LicenseServiceConfiguration' {Maybe (Sensitive Text)
endpoint :: Maybe (Sensitive Text)
$sel:endpoint:LicenseServiceConfiguration' :: LicenseServiceConfiguration -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(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]
      )