{-# 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.IoT.Types.HttpUrlDestinationProperties
-- 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.IoT.Types.HttpUrlDestinationProperties where

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

-- | HTTP URL destination properties.
--
-- /See:/ 'newHttpUrlDestinationProperties' smart constructor.
data HttpUrlDestinationProperties = HttpUrlDestinationProperties'
  { -- | The URL used to confirm the HTTP topic rule destination URL.
    HttpUrlDestinationProperties -> Maybe Text
confirmationUrl :: Prelude.Maybe Prelude.Text
  }
  deriving (HttpUrlDestinationProperties
-> HttpUrlDestinationProperties -> Bool
(HttpUrlDestinationProperties
 -> HttpUrlDestinationProperties -> Bool)
-> (HttpUrlDestinationProperties
    -> HttpUrlDestinationProperties -> Bool)
-> Eq HttpUrlDestinationProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpUrlDestinationProperties
-> HttpUrlDestinationProperties -> Bool
$c/= :: HttpUrlDestinationProperties
-> HttpUrlDestinationProperties -> Bool
== :: HttpUrlDestinationProperties
-> HttpUrlDestinationProperties -> Bool
$c== :: HttpUrlDestinationProperties
-> HttpUrlDestinationProperties -> Bool
Prelude.Eq, ReadPrec [HttpUrlDestinationProperties]
ReadPrec HttpUrlDestinationProperties
Int -> ReadS HttpUrlDestinationProperties
ReadS [HttpUrlDestinationProperties]
(Int -> ReadS HttpUrlDestinationProperties)
-> ReadS [HttpUrlDestinationProperties]
-> ReadPrec HttpUrlDestinationProperties
-> ReadPrec [HttpUrlDestinationProperties]
-> Read HttpUrlDestinationProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HttpUrlDestinationProperties]
$creadListPrec :: ReadPrec [HttpUrlDestinationProperties]
readPrec :: ReadPrec HttpUrlDestinationProperties
$creadPrec :: ReadPrec HttpUrlDestinationProperties
readList :: ReadS [HttpUrlDestinationProperties]
$creadList :: ReadS [HttpUrlDestinationProperties]
readsPrec :: Int -> ReadS HttpUrlDestinationProperties
$creadsPrec :: Int -> ReadS HttpUrlDestinationProperties
Prelude.Read, Int -> HttpUrlDestinationProperties -> ShowS
[HttpUrlDestinationProperties] -> ShowS
HttpUrlDestinationProperties -> String
(Int -> HttpUrlDestinationProperties -> ShowS)
-> (HttpUrlDestinationProperties -> String)
-> ([HttpUrlDestinationProperties] -> ShowS)
-> Show HttpUrlDestinationProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpUrlDestinationProperties] -> ShowS
$cshowList :: [HttpUrlDestinationProperties] -> ShowS
show :: HttpUrlDestinationProperties -> String
$cshow :: HttpUrlDestinationProperties -> String
showsPrec :: Int -> HttpUrlDestinationProperties -> ShowS
$cshowsPrec :: Int -> HttpUrlDestinationProperties -> ShowS
Prelude.Show, (forall x.
 HttpUrlDestinationProperties -> Rep HttpUrlDestinationProperties x)
-> (forall x.
    Rep HttpUrlDestinationProperties x -> HttpUrlDestinationProperties)
-> Generic HttpUrlDestinationProperties
forall x.
Rep HttpUrlDestinationProperties x -> HttpUrlDestinationProperties
forall x.
HttpUrlDestinationProperties -> Rep HttpUrlDestinationProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HttpUrlDestinationProperties x -> HttpUrlDestinationProperties
$cfrom :: forall x.
HttpUrlDestinationProperties -> Rep HttpUrlDestinationProperties x
Prelude.Generic)

-- |
-- Create a value of 'HttpUrlDestinationProperties' 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:
--
-- 'confirmationUrl', 'httpUrlDestinationProperties_confirmationUrl' - The URL used to confirm the HTTP topic rule destination URL.
newHttpUrlDestinationProperties ::
  HttpUrlDestinationProperties
newHttpUrlDestinationProperties :: HttpUrlDestinationProperties
newHttpUrlDestinationProperties =
  HttpUrlDestinationProperties' :: Maybe Text -> HttpUrlDestinationProperties
HttpUrlDestinationProperties'
    { $sel:confirmationUrl:HttpUrlDestinationProperties' :: Maybe Text
confirmationUrl =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The URL used to confirm the HTTP topic rule destination URL.
httpUrlDestinationProperties_confirmationUrl :: Lens.Lens' HttpUrlDestinationProperties (Prelude.Maybe Prelude.Text)
httpUrlDestinationProperties_confirmationUrl :: (Maybe Text -> f (Maybe Text))
-> HttpUrlDestinationProperties -> f HttpUrlDestinationProperties
httpUrlDestinationProperties_confirmationUrl = (HttpUrlDestinationProperties -> Maybe Text)
-> (HttpUrlDestinationProperties
    -> Maybe Text -> HttpUrlDestinationProperties)
-> Lens
     HttpUrlDestinationProperties
     HttpUrlDestinationProperties
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpUrlDestinationProperties' {Maybe Text
confirmationUrl :: Maybe Text
$sel:confirmationUrl:HttpUrlDestinationProperties' :: HttpUrlDestinationProperties -> Maybe Text
confirmationUrl} -> Maybe Text
confirmationUrl) (\s :: HttpUrlDestinationProperties
s@HttpUrlDestinationProperties' {} Maybe Text
a -> HttpUrlDestinationProperties
s {$sel:confirmationUrl:HttpUrlDestinationProperties' :: Maybe Text
confirmationUrl = Maybe Text
a} :: HttpUrlDestinationProperties)

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

instance
  Prelude.Hashable
    HttpUrlDestinationProperties

instance Prelude.NFData HttpUrlDestinationProperties