{-# 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.AppFlow.Types.DynatraceConnectorProfileProperties
-- 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.AppFlow.Types.DynatraceConnectorProfileProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The connector-specific profile properties required by Dynatrace.
--
-- /See:/ 'newDynatraceConnectorProfileProperties' smart constructor.
data DynatraceConnectorProfileProperties = DynatraceConnectorProfileProperties'
  { -- | The location of the Dynatrace resource.
    DynatraceConnectorProfileProperties -> Text
instanceUrl :: Prelude.Text
  }
  deriving (DynatraceConnectorProfileProperties
-> DynatraceConnectorProfileProperties -> Bool
(DynatraceConnectorProfileProperties
 -> DynatraceConnectorProfileProperties -> Bool)
-> (DynatraceConnectorProfileProperties
    -> DynatraceConnectorProfileProperties -> Bool)
-> Eq DynatraceConnectorProfileProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DynatraceConnectorProfileProperties
-> DynatraceConnectorProfileProperties -> Bool
$c/= :: DynatraceConnectorProfileProperties
-> DynatraceConnectorProfileProperties -> Bool
== :: DynatraceConnectorProfileProperties
-> DynatraceConnectorProfileProperties -> Bool
$c== :: DynatraceConnectorProfileProperties
-> DynatraceConnectorProfileProperties -> Bool
Prelude.Eq, ReadPrec [DynatraceConnectorProfileProperties]
ReadPrec DynatraceConnectorProfileProperties
Int -> ReadS DynatraceConnectorProfileProperties
ReadS [DynatraceConnectorProfileProperties]
(Int -> ReadS DynatraceConnectorProfileProperties)
-> ReadS [DynatraceConnectorProfileProperties]
-> ReadPrec DynatraceConnectorProfileProperties
-> ReadPrec [DynatraceConnectorProfileProperties]
-> Read DynatraceConnectorProfileProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DynatraceConnectorProfileProperties]
$creadListPrec :: ReadPrec [DynatraceConnectorProfileProperties]
readPrec :: ReadPrec DynatraceConnectorProfileProperties
$creadPrec :: ReadPrec DynatraceConnectorProfileProperties
readList :: ReadS [DynatraceConnectorProfileProperties]
$creadList :: ReadS [DynatraceConnectorProfileProperties]
readsPrec :: Int -> ReadS DynatraceConnectorProfileProperties
$creadsPrec :: Int -> ReadS DynatraceConnectorProfileProperties
Prelude.Read, Int -> DynatraceConnectorProfileProperties -> ShowS
[DynatraceConnectorProfileProperties] -> ShowS
DynatraceConnectorProfileProperties -> String
(Int -> DynatraceConnectorProfileProperties -> ShowS)
-> (DynatraceConnectorProfileProperties -> String)
-> ([DynatraceConnectorProfileProperties] -> ShowS)
-> Show DynatraceConnectorProfileProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DynatraceConnectorProfileProperties] -> ShowS
$cshowList :: [DynatraceConnectorProfileProperties] -> ShowS
show :: DynatraceConnectorProfileProperties -> String
$cshow :: DynatraceConnectorProfileProperties -> String
showsPrec :: Int -> DynatraceConnectorProfileProperties -> ShowS
$cshowsPrec :: Int -> DynatraceConnectorProfileProperties -> ShowS
Prelude.Show, (forall x.
 DynatraceConnectorProfileProperties
 -> Rep DynatraceConnectorProfileProperties x)
-> (forall x.
    Rep DynatraceConnectorProfileProperties x
    -> DynatraceConnectorProfileProperties)
-> Generic DynatraceConnectorProfileProperties
forall x.
Rep DynatraceConnectorProfileProperties x
-> DynatraceConnectorProfileProperties
forall x.
DynatraceConnectorProfileProperties
-> Rep DynatraceConnectorProfileProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DynatraceConnectorProfileProperties x
-> DynatraceConnectorProfileProperties
$cfrom :: forall x.
DynatraceConnectorProfileProperties
-> Rep DynatraceConnectorProfileProperties x
Prelude.Generic)

-- |
-- Create a value of 'DynatraceConnectorProfileProperties' 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:
--
-- 'instanceUrl', 'dynatraceConnectorProfileProperties_instanceUrl' - The location of the Dynatrace resource.
newDynatraceConnectorProfileProperties ::
  -- | 'instanceUrl'
  Prelude.Text ->
  DynatraceConnectorProfileProperties
newDynatraceConnectorProfileProperties :: Text -> DynatraceConnectorProfileProperties
newDynatraceConnectorProfileProperties Text
pInstanceUrl_ =
  DynatraceConnectorProfileProperties' :: Text -> DynatraceConnectorProfileProperties
DynatraceConnectorProfileProperties'
    { $sel:instanceUrl:DynatraceConnectorProfileProperties' :: Text
instanceUrl =
        Text
pInstanceUrl_
    }

-- | The location of the Dynatrace resource.
dynatraceConnectorProfileProperties_instanceUrl :: Lens.Lens' DynatraceConnectorProfileProperties Prelude.Text
dynatraceConnectorProfileProperties_instanceUrl :: (Text -> f Text)
-> DynatraceConnectorProfileProperties
-> f DynatraceConnectorProfileProperties
dynatraceConnectorProfileProperties_instanceUrl = (DynatraceConnectorProfileProperties -> Text)
-> (DynatraceConnectorProfileProperties
    -> Text -> DynatraceConnectorProfileProperties)
-> Lens
     DynatraceConnectorProfileProperties
     DynatraceConnectorProfileProperties
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DynatraceConnectorProfileProperties' {Text
instanceUrl :: Text
$sel:instanceUrl:DynatraceConnectorProfileProperties' :: DynatraceConnectorProfileProperties -> Text
instanceUrl} -> Text
instanceUrl) (\s :: DynatraceConnectorProfileProperties
s@DynatraceConnectorProfileProperties' {} Text
a -> DynatraceConnectorProfileProperties
s {$sel:instanceUrl:DynatraceConnectorProfileProperties' :: Text
instanceUrl = Text
a} :: DynatraceConnectorProfileProperties)

instance
  Core.FromJSON
    DynatraceConnectorProfileProperties
  where
  parseJSON :: Value -> Parser DynatraceConnectorProfileProperties
parseJSON =
    String
-> (Object -> Parser DynatraceConnectorProfileProperties)
-> Value
-> Parser DynatraceConnectorProfileProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DynatraceConnectorProfileProperties"
      ( \Object
x ->
          Text -> DynatraceConnectorProfileProperties
DynatraceConnectorProfileProperties'
            (Text -> DynatraceConnectorProfileProperties)
-> Parser Text -> Parser DynatraceConnectorProfileProperties
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"instanceUrl")
      )

instance
  Prelude.Hashable
    DynatraceConnectorProfileProperties

instance
  Prelude.NFData
    DynatraceConnectorProfileProperties

instance
  Core.ToJSON
    DynatraceConnectorProfileProperties
  where
  toJSON :: DynatraceConnectorProfileProperties -> Value
toJSON DynatraceConnectorProfileProperties' {Text
instanceUrl :: Text
$sel:instanceUrl:DynatraceConnectorProfileProperties' :: DynatraceConnectorProfileProperties -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"instanceUrl" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceUrl)]
      )