{-# 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.DatadogConnectorProfileProperties
-- 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.DatadogConnectorProfileProperties 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 Datadog.
--
-- /See:/ 'newDatadogConnectorProfileProperties' smart constructor.
data DatadogConnectorProfileProperties = DatadogConnectorProfileProperties'
  { -- | The location of the Datadog resource.
    DatadogConnectorProfileProperties -> Text
instanceUrl :: Prelude.Text
  }
  deriving (DatadogConnectorProfileProperties
-> DatadogConnectorProfileProperties -> Bool
(DatadogConnectorProfileProperties
 -> DatadogConnectorProfileProperties -> Bool)
-> (DatadogConnectorProfileProperties
    -> DatadogConnectorProfileProperties -> Bool)
-> Eq DatadogConnectorProfileProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatadogConnectorProfileProperties
-> DatadogConnectorProfileProperties -> Bool
$c/= :: DatadogConnectorProfileProperties
-> DatadogConnectorProfileProperties -> Bool
== :: DatadogConnectorProfileProperties
-> DatadogConnectorProfileProperties -> Bool
$c== :: DatadogConnectorProfileProperties
-> DatadogConnectorProfileProperties -> Bool
Prelude.Eq, ReadPrec [DatadogConnectorProfileProperties]
ReadPrec DatadogConnectorProfileProperties
Int -> ReadS DatadogConnectorProfileProperties
ReadS [DatadogConnectorProfileProperties]
(Int -> ReadS DatadogConnectorProfileProperties)
-> ReadS [DatadogConnectorProfileProperties]
-> ReadPrec DatadogConnectorProfileProperties
-> ReadPrec [DatadogConnectorProfileProperties]
-> Read DatadogConnectorProfileProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatadogConnectorProfileProperties]
$creadListPrec :: ReadPrec [DatadogConnectorProfileProperties]
readPrec :: ReadPrec DatadogConnectorProfileProperties
$creadPrec :: ReadPrec DatadogConnectorProfileProperties
readList :: ReadS [DatadogConnectorProfileProperties]
$creadList :: ReadS [DatadogConnectorProfileProperties]
readsPrec :: Int -> ReadS DatadogConnectorProfileProperties
$creadsPrec :: Int -> ReadS DatadogConnectorProfileProperties
Prelude.Read, Int -> DatadogConnectorProfileProperties -> ShowS
[DatadogConnectorProfileProperties] -> ShowS
DatadogConnectorProfileProperties -> String
(Int -> DatadogConnectorProfileProperties -> ShowS)
-> (DatadogConnectorProfileProperties -> String)
-> ([DatadogConnectorProfileProperties] -> ShowS)
-> Show DatadogConnectorProfileProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatadogConnectorProfileProperties] -> ShowS
$cshowList :: [DatadogConnectorProfileProperties] -> ShowS
show :: DatadogConnectorProfileProperties -> String
$cshow :: DatadogConnectorProfileProperties -> String
showsPrec :: Int -> DatadogConnectorProfileProperties -> ShowS
$cshowsPrec :: Int -> DatadogConnectorProfileProperties -> ShowS
Prelude.Show, (forall x.
 DatadogConnectorProfileProperties
 -> Rep DatadogConnectorProfileProperties x)
-> (forall x.
    Rep DatadogConnectorProfileProperties x
    -> DatadogConnectorProfileProperties)
-> Generic DatadogConnectorProfileProperties
forall x.
Rep DatadogConnectorProfileProperties x
-> DatadogConnectorProfileProperties
forall x.
DatadogConnectorProfileProperties
-> Rep DatadogConnectorProfileProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DatadogConnectorProfileProperties x
-> DatadogConnectorProfileProperties
$cfrom :: forall x.
DatadogConnectorProfileProperties
-> Rep DatadogConnectorProfileProperties x
Prelude.Generic)

-- |
-- Create a value of 'DatadogConnectorProfileProperties' 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', 'datadogConnectorProfileProperties_instanceUrl' - The location of the Datadog resource.
newDatadogConnectorProfileProperties ::
  -- | 'instanceUrl'
  Prelude.Text ->
  DatadogConnectorProfileProperties
newDatadogConnectorProfileProperties :: Text -> DatadogConnectorProfileProperties
newDatadogConnectorProfileProperties Text
pInstanceUrl_ =
  DatadogConnectorProfileProperties' :: Text -> DatadogConnectorProfileProperties
DatadogConnectorProfileProperties'
    { $sel:instanceUrl:DatadogConnectorProfileProperties' :: Text
instanceUrl =
        Text
pInstanceUrl_
    }

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

instance
  Core.FromJSON
    DatadogConnectorProfileProperties
  where
  parseJSON :: Value -> Parser DatadogConnectorProfileProperties
parseJSON =
    String
-> (Object -> Parser DatadogConnectorProfileProperties)
-> Value
-> Parser DatadogConnectorProfileProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatadogConnectorProfileProperties"
      ( \Object
x ->
          Text -> DatadogConnectorProfileProperties
DatadogConnectorProfileProperties'
            (Text -> DatadogConnectorProfileProperties)
-> Parser Text -> Parser DatadogConnectorProfileProperties
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
    DatadogConnectorProfileProperties

instance
  Prelude.NFData
    DatadogConnectorProfileProperties

instance
  Core.ToJSON
    DatadogConnectorProfileProperties
  where
  toJSON :: DatadogConnectorProfileProperties -> Value
toJSON DatadogConnectorProfileProperties' {Text
instanceUrl :: Text
$sel:instanceUrl:DatadogConnectorProfileProperties' :: DatadogConnectorProfileProperties -> 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)]
      )