{-# 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.Amplify.Types.SubDomainSetting where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SubDomainSetting = SubDomainSetting'
{
SubDomainSetting -> Text
prefix :: Prelude.Text,
SubDomainSetting -> Text
branchName :: Prelude.Text
}
deriving (SubDomainSetting -> SubDomainSetting -> Bool
(SubDomainSetting -> SubDomainSetting -> Bool)
-> (SubDomainSetting -> SubDomainSetting -> Bool)
-> Eq SubDomainSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubDomainSetting -> SubDomainSetting -> Bool
$c/= :: SubDomainSetting -> SubDomainSetting -> Bool
== :: SubDomainSetting -> SubDomainSetting -> Bool
$c== :: SubDomainSetting -> SubDomainSetting -> Bool
Prelude.Eq, ReadPrec [SubDomainSetting]
ReadPrec SubDomainSetting
Int -> ReadS SubDomainSetting
ReadS [SubDomainSetting]
(Int -> ReadS SubDomainSetting)
-> ReadS [SubDomainSetting]
-> ReadPrec SubDomainSetting
-> ReadPrec [SubDomainSetting]
-> Read SubDomainSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubDomainSetting]
$creadListPrec :: ReadPrec [SubDomainSetting]
readPrec :: ReadPrec SubDomainSetting
$creadPrec :: ReadPrec SubDomainSetting
readList :: ReadS [SubDomainSetting]
$creadList :: ReadS [SubDomainSetting]
readsPrec :: Int -> ReadS SubDomainSetting
$creadsPrec :: Int -> ReadS SubDomainSetting
Prelude.Read, Int -> SubDomainSetting -> ShowS
[SubDomainSetting] -> ShowS
SubDomainSetting -> String
(Int -> SubDomainSetting -> ShowS)
-> (SubDomainSetting -> String)
-> ([SubDomainSetting] -> ShowS)
-> Show SubDomainSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubDomainSetting] -> ShowS
$cshowList :: [SubDomainSetting] -> ShowS
show :: SubDomainSetting -> String
$cshow :: SubDomainSetting -> String
showsPrec :: Int -> SubDomainSetting -> ShowS
$cshowsPrec :: Int -> SubDomainSetting -> ShowS
Prelude.Show, (forall x. SubDomainSetting -> Rep SubDomainSetting x)
-> (forall x. Rep SubDomainSetting x -> SubDomainSetting)
-> Generic SubDomainSetting
forall x. Rep SubDomainSetting x -> SubDomainSetting
forall x. SubDomainSetting -> Rep SubDomainSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubDomainSetting x -> SubDomainSetting
$cfrom :: forall x. SubDomainSetting -> Rep SubDomainSetting x
Prelude.Generic)
newSubDomainSetting ::
Prelude.Text ->
Prelude.Text ->
SubDomainSetting
newSubDomainSetting :: Text -> Text -> SubDomainSetting
newSubDomainSetting Text
pPrefix_ Text
pBranchName_ =
SubDomainSetting' :: Text -> Text -> SubDomainSetting
SubDomainSetting'
{ $sel:prefix:SubDomainSetting' :: Text
prefix = Text
pPrefix_,
$sel:branchName:SubDomainSetting' :: Text
branchName = Text
pBranchName_
}
subDomainSetting_prefix :: Lens.Lens' SubDomainSetting Prelude.Text
subDomainSetting_prefix :: (Text -> f Text) -> SubDomainSetting -> f SubDomainSetting
subDomainSetting_prefix = (SubDomainSetting -> Text)
-> (SubDomainSetting -> Text -> SubDomainSetting)
-> Lens SubDomainSetting SubDomainSetting Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubDomainSetting' {Text
prefix :: Text
$sel:prefix:SubDomainSetting' :: SubDomainSetting -> Text
prefix} -> Text
prefix) (\s :: SubDomainSetting
s@SubDomainSetting' {} Text
a -> SubDomainSetting
s {$sel:prefix:SubDomainSetting' :: Text
prefix = Text
a} :: SubDomainSetting)
subDomainSetting_branchName :: Lens.Lens' SubDomainSetting Prelude.Text
subDomainSetting_branchName :: (Text -> f Text) -> SubDomainSetting -> f SubDomainSetting
subDomainSetting_branchName = (SubDomainSetting -> Text)
-> (SubDomainSetting -> Text -> SubDomainSetting)
-> Lens SubDomainSetting SubDomainSetting Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubDomainSetting' {Text
branchName :: Text
$sel:branchName:SubDomainSetting' :: SubDomainSetting -> Text
branchName} -> Text
branchName) (\s :: SubDomainSetting
s@SubDomainSetting' {} Text
a -> SubDomainSetting
s {$sel:branchName:SubDomainSetting' :: Text
branchName = Text
a} :: SubDomainSetting)
instance Core.FromJSON SubDomainSetting where
parseJSON :: Value -> Parser SubDomainSetting
parseJSON =
String
-> (Object -> Parser SubDomainSetting)
-> Value
-> Parser SubDomainSetting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SubDomainSetting"
( \Object
x ->
Text -> Text -> SubDomainSetting
SubDomainSetting'
(Text -> Text -> SubDomainSetting)
-> Parser Text -> Parser (Text -> SubDomainSetting)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"prefix")
Parser (Text -> SubDomainSetting)
-> Parser Text -> Parser SubDomainSetting
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"branchName")
)
instance Prelude.Hashable SubDomainSetting
instance Prelude.NFData SubDomainSetting
instance Core.ToJSON SubDomainSetting where
toJSON :: SubDomainSetting -> Value
toJSON SubDomainSetting' {Text
branchName :: Text
prefix :: Text
$sel:branchName:SubDomainSetting' :: SubDomainSetting -> Text
$sel:prefix:SubDomainSetting' :: SubDomainSetting -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"prefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
prefix),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"branchName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
branchName)
]
)