{-# 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 #-}
module Amazonka.Firehose.Types.HttpEndpointConfiguration 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
data HttpEndpointConfiguration = HttpEndpointConfiguration'
{
HttpEndpointConfiguration -> Maybe (Sensitive Text)
accessKey :: Prelude.Maybe (Data.Sensitive Prelude.Text),
HttpEndpointConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
HttpEndpointConfiguration -> Sensitive Text
url :: Data.Sensitive Prelude.Text
}
deriving (HttpEndpointConfiguration -> HttpEndpointConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpEndpointConfiguration -> HttpEndpointConfiguration -> Bool
$c/= :: HttpEndpointConfiguration -> HttpEndpointConfiguration -> Bool
== :: HttpEndpointConfiguration -> HttpEndpointConfiguration -> Bool
$c== :: HttpEndpointConfiguration -> HttpEndpointConfiguration -> Bool
Prelude.Eq, Int -> HttpEndpointConfiguration -> ShowS
[HttpEndpointConfiguration] -> ShowS
HttpEndpointConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpEndpointConfiguration] -> ShowS
$cshowList :: [HttpEndpointConfiguration] -> ShowS
show :: HttpEndpointConfiguration -> String
$cshow :: HttpEndpointConfiguration -> String
showsPrec :: Int -> HttpEndpointConfiguration -> ShowS
$cshowsPrec :: Int -> HttpEndpointConfiguration -> ShowS
Prelude.Show, forall x.
Rep HttpEndpointConfiguration x -> HttpEndpointConfiguration
forall x.
HttpEndpointConfiguration -> Rep HttpEndpointConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HttpEndpointConfiguration x -> HttpEndpointConfiguration
$cfrom :: forall x.
HttpEndpointConfiguration -> Rep HttpEndpointConfiguration x
Prelude.Generic)
newHttpEndpointConfiguration ::
Prelude.Text ->
HttpEndpointConfiguration
newHttpEndpointConfiguration :: Text -> HttpEndpointConfiguration
newHttpEndpointConfiguration Text
pUrl_ =
HttpEndpointConfiguration'
{ $sel:accessKey:HttpEndpointConfiguration' :: Maybe (Sensitive Text)
accessKey =
forall a. Maybe a
Prelude.Nothing,
$sel:name:HttpEndpointConfiguration' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:url:HttpEndpointConfiguration' :: Sensitive Text
url = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pUrl_
}
httpEndpointConfiguration_accessKey :: Lens.Lens' HttpEndpointConfiguration (Prelude.Maybe Prelude.Text)
httpEndpointConfiguration_accessKey :: Lens' HttpEndpointConfiguration (Maybe Text)
httpEndpointConfiguration_accessKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpEndpointConfiguration' {Maybe (Sensitive Text)
accessKey :: Maybe (Sensitive Text)
$sel:accessKey:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe (Sensitive Text)
accessKey} -> Maybe (Sensitive Text)
accessKey) (\s :: HttpEndpointConfiguration
s@HttpEndpointConfiguration' {} Maybe (Sensitive Text)
a -> HttpEndpointConfiguration
s {$sel:accessKey:HttpEndpointConfiguration' :: Maybe (Sensitive Text)
accessKey = Maybe (Sensitive Text)
a} :: HttpEndpointConfiguration) 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
httpEndpointConfiguration_name :: Lens.Lens' HttpEndpointConfiguration (Prelude.Maybe Prelude.Text)
httpEndpointConfiguration_name :: Lens' HttpEndpointConfiguration (Maybe Text)
httpEndpointConfiguration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpEndpointConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: HttpEndpointConfiguration
s@HttpEndpointConfiguration' {} Maybe Text
a -> HttpEndpointConfiguration
s {$sel:name:HttpEndpointConfiguration' :: Maybe Text
name = Maybe Text
a} :: HttpEndpointConfiguration)
httpEndpointConfiguration_url :: Lens.Lens' HttpEndpointConfiguration Prelude.Text
httpEndpointConfiguration_url :: Lens' HttpEndpointConfiguration Text
httpEndpointConfiguration_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpEndpointConfiguration' {Sensitive Text
url :: Sensitive Text
$sel:url:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Sensitive Text
url} -> Sensitive Text
url) (\s :: HttpEndpointConfiguration
s@HttpEndpointConfiguration' {} Sensitive Text
a -> HttpEndpointConfiguration
s {$sel:url:HttpEndpointConfiguration' :: Sensitive Text
url = Sensitive Text
a} :: HttpEndpointConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Prelude.Hashable HttpEndpointConfiguration where
hashWithSalt :: Int -> HttpEndpointConfiguration -> Int
hashWithSalt Int
_salt HttpEndpointConfiguration' {Maybe Text
Maybe (Sensitive Text)
Sensitive Text
url :: Sensitive Text
name :: Maybe Text
accessKey :: Maybe (Sensitive Text)
$sel:url:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Sensitive Text
$sel:name:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe Text
$sel:accessKey:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
accessKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
url
instance Prelude.NFData HttpEndpointConfiguration where
rnf :: HttpEndpointConfiguration -> ()
rnf HttpEndpointConfiguration' {Maybe Text
Maybe (Sensitive Text)
Sensitive Text
url :: Sensitive Text
name :: Maybe Text
accessKey :: Maybe (Sensitive Text)
$sel:url:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Sensitive Text
$sel:name:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe Text
$sel:accessKey:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
accessKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
url
instance Data.ToJSON HttpEndpointConfiguration where
toJSON :: HttpEndpointConfiguration -> Value
toJSON HttpEndpointConfiguration' {Maybe Text
Maybe (Sensitive Text)
Sensitive Text
url :: Sensitive Text
name :: Maybe Text
accessKey :: Maybe (Sensitive Text)
$sel:url:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Sensitive Text
$sel:name:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe Text
$sel:accessKey:HttpEndpointConfiguration' :: HttpEndpointConfiguration -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AccessKey" 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)
accessKey,
(Key
"Name" 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 Text
name,
forall a. a -> Maybe a
Prelude.Just (Key
"Url" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
url)
]
)