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

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

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

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

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

instance Prelude.Hashable HttpUrlDestinationSummary where
  hashWithSalt :: Int -> HttpUrlDestinationSummary -> Int
hashWithSalt Int
_salt HttpUrlDestinationSummary' {Maybe Text
confirmationUrl :: Maybe Text
$sel:confirmationUrl:HttpUrlDestinationSummary' :: HttpUrlDestinationSummary -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
confirmationUrl

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