{-# 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.HttpEndpointRequestConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Firehose.Types.ContentEncoding
import Amazonka.Firehose.Types.HttpEndpointCommonAttribute
import qualified Amazonka.Prelude as Prelude
data HttpEndpointRequestConfiguration = HttpEndpointRequestConfiguration'
{
HttpEndpointRequestConfiguration
-> Maybe [HttpEndpointCommonAttribute]
commonAttributes :: Prelude.Maybe [HttpEndpointCommonAttribute],
HttpEndpointRequestConfiguration -> Maybe ContentEncoding
contentEncoding :: Prelude.Maybe ContentEncoding
}
deriving (HttpEndpointRequestConfiguration
-> HttpEndpointRequestConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpEndpointRequestConfiguration
-> HttpEndpointRequestConfiguration -> Bool
$c/= :: HttpEndpointRequestConfiguration
-> HttpEndpointRequestConfiguration -> Bool
== :: HttpEndpointRequestConfiguration
-> HttpEndpointRequestConfiguration -> Bool
$c== :: HttpEndpointRequestConfiguration
-> HttpEndpointRequestConfiguration -> Bool
Prelude.Eq, Int -> HttpEndpointRequestConfiguration -> ShowS
[HttpEndpointRequestConfiguration] -> ShowS
HttpEndpointRequestConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpEndpointRequestConfiguration] -> ShowS
$cshowList :: [HttpEndpointRequestConfiguration] -> ShowS
show :: HttpEndpointRequestConfiguration -> String
$cshow :: HttpEndpointRequestConfiguration -> String
showsPrec :: Int -> HttpEndpointRequestConfiguration -> ShowS
$cshowsPrec :: Int -> HttpEndpointRequestConfiguration -> ShowS
Prelude.Show, forall x.
Rep HttpEndpointRequestConfiguration x
-> HttpEndpointRequestConfiguration
forall x.
HttpEndpointRequestConfiguration
-> Rep HttpEndpointRequestConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HttpEndpointRequestConfiguration x
-> HttpEndpointRequestConfiguration
$cfrom :: forall x.
HttpEndpointRequestConfiguration
-> Rep HttpEndpointRequestConfiguration x
Prelude.Generic)
newHttpEndpointRequestConfiguration ::
HttpEndpointRequestConfiguration
newHttpEndpointRequestConfiguration :: HttpEndpointRequestConfiguration
newHttpEndpointRequestConfiguration =
HttpEndpointRequestConfiguration'
{ $sel:commonAttributes:HttpEndpointRequestConfiguration' :: Maybe [HttpEndpointCommonAttribute]
commonAttributes =
forall a. Maybe a
Prelude.Nothing,
$sel:contentEncoding:HttpEndpointRequestConfiguration' :: Maybe ContentEncoding
contentEncoding = forall a. Maybe a
Prelude.Nothing
}
httpEndpointRequestConfiguration_commonAttributes :: Lens.Lens' HttpEndpointRequestConfiguration (Prelude.Maybe [HttpEndpointCommonAttribute])
httpEndpointRequestConfiguration_commonAttributes :: Lens'
HttpEndpointRequestConfiguration
(Maybe [HttpEndpointCommonAttribute])
httpEndpointRequestConfiguration_commonAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpEndpointRequestConfiguration' {Maybe [HttpEndpointCommonAttribute]
commonAttributes :: Maybe [HttpEndpointCommonAttribute]
$sel:commonAttributes:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration
-> Maybe [HttpEndpointCommonAttribute]
commonAttributes} -> Maybe [HttpEndpointCommonAttribute]
commonAttributes) (\s :: HttpEndpointRequestConfiguration
s@HttpEndpointRequestConfiguration' {} Maybe [HttpEndpointCommonAttribute]
a -> HttpEndpointRequestConfiguration
s {$sel:commonAttributes:HttpEndpointRequestConfiguration' :: Maybe [HttpEndpointCommonAttribute]
commonAttributes = Maybe [HttpEndpointCommonAttribute]
a} :: HttpEndpointRequestConfiguration) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
httpEndpointRequestConfiguration_contentEncoding :: Lens.Lens' HttpEndpointRequestConfiguration (Prelude.Maybe ContentEncoding)
httpEndpointRequestConfiguration_contentEncoding :: Lens' HttpEndpointRequestConfiguration (Maybe ContentEncoding)
httpEndpointRequestConfiguration_contentEncoding = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpEndpointRequestConfiguration' {Maybe ContentEncoding
contentEncoding :: Maybe ContentEncoding
$sel:contentEncoding:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration -> Maybe ContentEncoding
contentEncoding} -> Maybe ContentEncoding
contentEncoding) (\s :: HttpEndpointRequestConfiguration
s@HttpEndpointRequestConfiguration' {} Maybe ContentEncoding
a -> HttpEndpointRequestConfiguration
s {$sel:contentEncoding:HttpEndpointRequestConfiguration' :: Maybe ContentEncoding
contentEncoding = Maybe ContentEncoding
a} :: HttpEndpointRequestConfiguration)
instance
Data.FromJSON
HttpEndpointRequestConfiguration
where
parseJSON :: Value -> Parser HttpEndpointRequestConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HttpEndpointRequestConfiguration"
( \Object
x ->
Maybe [HttpEndpointCommonAttribute]
-> Maybe ContentEncoding -> HttpEndpointRequestConfiguration
HttpEndpointRequestConfiguration'
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
"CommonAttributes"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ContentEncoding")
)
instance
Prelude.Hashable
HttpEndpointRequestConfiguration
where
hashWithSalt :: Int -> HttpEndpointRequestConfiguration -> Int
hashWithSalt
Int
_salt
HttpEndpointRequestConfiguration' {Maybe [HttpEndpointCommonAttribute]
Maybe ContentEncoding
contentEncoding :: Maybe ContentEncoding
commonAttributes :: Maybe [HttpEndpointCommonAttribute]
$sel:contentEncoding:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration -> Maybe ContentEncoding
$sel:commonAttributes:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration
-> Maybe [HttpEndpointCommonAttribute]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [HttpEndpointCommonAttribute]
commonAttributes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContentEncoding
contentEncoding
instance
Prelude.NFData
HttpEndpointRequestConfiguration
where
rnf :: HttpEndpointRequestConfiguration -> ()
rnf HttpEndpointRequestConfiguration' {Maybe [HttpEndpointCommonAttribute]
Maybe ContentEncoding
contentEncoding :: Maybe ContentEncoding
commonAttributes :: Maybe [HttpEndpointCommonAttribute]
$sel:contentEncoding:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration -> Maybe ContentEncoding
$sel:commonAttributes:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration
-> Maybe [HttpEndpointCommonAttribute]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [HttpEndpointCommonAttribute]
commonAttributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContentEncoding
contentEncoding
instance Data.ToJSON HttpEndpointRequestConfiguration where
toJSON :: HttpEndpointRequestConfiguration -> Value
toJSON HttpEndpointRequestConfiguration' {Maybe [HttpEndpointCommonAttribute]
Maybe ContentEncoding
contentEncoding :: Maybe ContentEncoding
commonAttributes :: Maybe [HttpEndpointCommonAttribute]
$sel:contentEncoding:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration -> Maybe ContentEncoding
$sel:commonAttributes:HttpEndpointRequestConfiguration' :: HttpEndpointRequestConfiguration
-> Maybe [HttpEndpointCommonAttribute]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CommonAttributes" 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 [HttpEndpointCommonAttribute]
commonAttributes,
(Key
"ContentEncoding" 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 ContentEncoding
contentEncoding
]
)