{-# 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.Lightsail.Types.InputOrigin where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.OriginProtocolPolicyEnum
import Amazonka.Lightsail.Types.RegionName
import qualified Amazonka.Prelude as Prelude
data InputOrigin = InputOrigin'
{
InputOrigin -> Maybe RegionName
regionName :: Prelude.Maybe RegionName,
InputOrigin -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
InputOrigin -> Maybe OriginProtocolPolicyEnum
protocolPolicy :: Prelude.Maybe OriginProtocolPolicyEnum
}
deriving (InputOrigin -> InputOrigin -> Bool
(InputOrigin -> InputOrigin -> Bool)
-> (InputOrigin -> InputOrigin -> Bool) -> Eq InputOrigin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputOrigin -> InputOrigin -> Bool
$c/= :: InputOrigin -> InputOrigin -> Bool
== :: InputOrigin -> InputOrigin -> Bool
$c== :: InputOrigin -> InputOrigin -> Bool
Prelude.Eq, ReadPrec [InputOrigin]
ReadPrec InputOrigin
Int -> ReadS InputOrigin
ReadS [InputOrigin]
(Int -> ReadS InputOrigin)
-> ReadS [InputOrigin]
-> ReadPrec InputOrigin
-> ReadPrec [InputOrigin]
-> Read InputOrigin
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputOrigin]
$creadListPrec :: ReadPrec [InputOrigin]
readPrec :: ReadPrec InputOrigin
$creadPrec :: ReadPrec InputOrigin
readList :: ReadS [InputOrigin]
$creadList :: ReadS [InputOrigin]
readsPrec :: Int -> ReadS InputOrigin
$creadsPrec :: Int -> ReadS InputOrigin
Prelude.Read, Int -> InputOrigin -> ShowS
[InputOrigin] -> ShowS
InputOrigin -> String
(Int -> InputOrigin -> ShowS)
-> (InputOrigin -> String)
-> ([InputOrigin] -> ShowS)
-> Show InputOrigin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputOrigin] -> ShowS
$cshowList :: [InputOrigin] -> ShowS
show :: InputOrigin -> String
$cshow :: InputOrigin -> String
showsPrec :: Int -> InputOrigin -> ShowS
$cshowsPrec :: Int -> InputOrigin -> ShowS
Prelude.Show, (forall x. InputOrigin -> Rep InputOrigin x)
-> (forall x. Rep InputOrigin x -> InputOrigin)
-> Generic InputOrigin
forall x. Rep InputOrigin x -> InputOrigin
forall x. InputOrigin -> Rep InputOrigin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputOrigin x -> InputOrigin
$cfrom :: forall x. InputOrigin -> Rep InputOrigin x
Prelude.Generic)
newInputOrigin ::
InputOrigin
newInputOrigin :: InputOrigin
newInputOrigin =
InputOrigin' :: Maybe RegionName
-> Maybe Text -> Maybe OriginProtocolPolicyEnum -> InputOrigin
InputOrigin'
{ $sel:regionName:InputOrigin' :: Maybe RegionName
regionName = Maybe RegionName
forall a. Maybe a
Prelude.Nothing,
$sel:name:InputOrigin' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:protocolPolicy:InputOrigin' :: Maybe OriginProtocolPolicyEnum
protocolPolicy = Maybe OriginProtocolPolicyEnum
forall a. Maybe a
Prelude.Nothing
}
inputOrigin_regionName :: Lens.Lens' InputOrigin (Prelude.Maybe RegionName)
inputOrigin_regionName :: (Maybe RegionName -> f (Maybe RegionName))
-> InputOrigin -> f InputOrigin
inputOrigin_regionName = (InputOrigin -> Maybe RegionName)
-> (InputOrigin -> Maybe RegionName -> InputOrigin)
-> Lens
InputOrigin InputOrigin (Maybe RegionName) (Maybe RegionName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputOrigin' {Maybe RegionName
regionName :: Maybe RegionName
$sel:regionName:InputOrigin' :: InputOrigin -> Maybe RegionName
regionName} -> Maybe RegionName
regionName) (\s :: InputOrigin
s@InputOrigin' {} Maybe RegionName
a -> InputOrigin
s {$sel:regionName:InputOrigin' :: Maybe RegionName
regionName = Maybe RegionName
a} :: InputOrigin)
inputOrigin_name :: Lens.Lens' InputOrigin (Prelude.Maybe Prelude.Text)
inputOrigin_name :: (Maybe Text -> f (Maybe Text)) -> InputOrigin -> f InputOrigin
inputOrigin_name = (InputOrigin -> Maybe Text)
-> (InputOrigin -> Maybe Text -> InputOrigin)
-> Lens InputOrigin InputOrigin (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputOrigin' {Maybe Text
name :: Maybe Text
$sel:name:InputOrigin' :: InputOrigin -> Maybe Text
name} -> Maybe Text
name) (\s :: InputOrigin
s@InputOrigin' {} Maybe Text
a -> InputOrigin
s {$sel:name:InputOrigin' :: Maybe Text
name = Maybe Text
a} :: InputOrigin)
inputOrigin_protocolPolicy :: Lens.Lens' InputOrigin (Prelude.Maybe OriginProtocolPolicyEnum)
inputOrigin_protocolPolicy :: (Maybe OriginProtocolPolicyEnum
-> f (Maybe OriginProtocolPolicyEnum))
-> InputOrigin -> f InputOrigin
inputOrigin_protocolPolicy = (InputOrigin -> Maybe OriginProtocolPolicyEnum)
-> (InputOrigin -> Maybe OriginProtocolPolicyEnum -> InputOrigin)
-> Lens
InputOrigin
InputOrigin
(Maybe OriginProtocolPolicyEnum)
(Maybe OriginProtocolPolicyEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputOrigin' {Maybe OriginProtocolPolicyEnum
protocolPolicy :: Maybe OriginProtocolPolicyEnum
$sel:protocolPolicy:InputOrigin' :: InputOrigin -> Maybe OriginProtocolPolicyEnum
protocolPolicy} -> Maybe OriginProtocolPolicyEnum
protocolPolicy) (\s :: InputOrigin
s@InputOrigin' {} Maybe OriginProtocolPolicyEnum
a -> InputOrigin
s {$sel:protocolPolicy:InputOrigin' :: Maybe OriginProtocolPolicyEnum
protocolPolicy = Maybe OriginProtocolPolicyEnum
a} :: InputOrigin)
instance Prelude.Hashable InputOrigin
instance Prelude.NFData InputOrigin
instance Core.ToJSON InputOrigin where
toJSON :: InputOrigin -> Value
toJSON InputOrigin' {Maybe Text
Maybe OriginProtocolPolicyEnum
Maybe RegionName
protocolPolicy :: Maybe OriginProtocolPolicyEnum
name :: Maybe Text
regionName :: Maybe RegionName
$sel:protocolPolicy:InputOrigin' :: InputOrigin -> Maybe OriginProtocolPolicyEnum
$sel:name:InputOrigin' :: InputOrigin -> Maybe Text
$sel:regionName:InputOrigin' :: InputOrigin -> Maybe RegionName
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"regionName" Text -> RegionName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RegionName -> Pair) -> Maybe RegionName -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RegionName
regionName,
(Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"protocolPolicy" Text -> OriginProtocolPolicyEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(OriginProtocolPolicyEnum -> Pair)
-> Maybe OriginProtocolPolicyEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OriginProtocolPolicyEnum
protocolPolicy
]
)