{-# 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.CloudFront.Types.Restrictions where
import Amazonka.CloudFront.Types.GeoRestriction
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 Restrictions = Restrictions'
{
Restrictions -> GeoRestriction
geoRestriction :: GeoRestriction
}
deriving (Restrictions -> Restrictions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Restrictions -> Restrictions -> Bool
$c/= :: Restrictions -> Restrictions -> Bool
== :: Restrictions -> Restrictions -> Bool
$c== :: Restrictions -> Restrictions -> Bool
Prelude.Eq, ReadPrec [Restrictions]
ReadPrec Restrictions
Int -> ReadS Restrictions
ReadS [Restrictions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Restrictions]
$creadListPrec :: ReadPrec [Restrictions]
readPrec :: ReadPrec Restrictions
$creadPrec :: ReadPrec Restrictions
readList :: ReadS [Restrictions]
$creadList :: ReadS [Restrictions]
readsPrec :: Int -> ReadS Restrictions
$creadsPrec :: Int -> ReadS Restrictions
Prelude.Read, Int -> Restrictions -> ShowS
[Restrictions] -> ShowS
Restrictions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Restrictions] -> ShowS
$cshowList :: [Restrictions] -> ShowS
show :: Restrictions -> String
$cshow :: Restrictions -> String
showsPrec :: Int -> Restrictions -> ShowS
$cshowsPrec :: Int -> Restrictions -> ShowS
Prelude.Show, forall x. Rep Restrictions x -> Restrictions
forall x. Restrictions -> Rep Restrictions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Restrictions x -> Restrictions
$cfrom :: forall x. Restrictions -> Rep Restrictions x
Prelude.Generic)
newRestrictions ::
GeoRestriction ->
Restrictions
newRestrictions :: GeoRestriction -> Restrictions
newRestrictions GeoRestriction
pGeoRestriction_ =
Restrictions' {$sel:geoRestriction:Restrictions' :: GeoRestriction
geoRestriction = GeoRestriction
pGeoRestriction_}
restrictions_geoRestriction :: Lens.Lens' Restrictions GeoRestriction
restrictions_geoRestriction :: Lens' Restrictions GeoRestriction
restrictions_geoRestriction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Restrictions' {GeoRestriction
geoRestriction :: GeoRestriction
$sel:geoRestriction:Restrictions' :: Restrictions -> GeoRestriction
geoRestriction} -> GeoRestriction
geoRestriction) (\s :: Restrictions
s@Restrictions' {} GeoRestriction
a -> Restrictions
s {$sel:geoRestriction:Restrictions' :: GeoRestriction
geoRestriction = GeoRestriction
a} :: Restrictions)
instance Data.FromXML Restrictions where
parseXML :: [Node] -> Either String Restrictions
parseXML [Node]
x =
GeoRestriction -> Restrictions
Restrictions'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"GeoRestriction")
instance Prelude.Hashable Restrictions where
hashWithSalt :: Int -> Restrictions -> Int
hashWithSalt Int
_salt Restrictions' {GeoRestriction
geoRestriction :: GeoRestriction
$sel:geoRestriction:Restrictions' :: Restrictions -> GeoRestriction
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GeoRestriction
geoRestriction
instance Prelude.NFData Restrictions where
rnf :: Restrictions -> ()
rnf Restrictions' {GeoRestriction
geoRestriction :: GeoRestriction
$sel:geoRestriction:Restrictions' :: Restrictions -> GeoRestriction
..} = forall a. NFData a => a -> ()
Prelude.rnf GeoRestriction
geoRestriction
instance Data.ToXML Restrictions where
toXML :: Restrictions -> XML
toXML Restrictions' {GeoRestriction
geoRestriction :: GeoRestriction
$sel:geoRestriction:Restrictions' :: Restrictions -> GeoRestriction
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name
"GeoRestriction" forall a. ToXML a => Name -> a -> XML
Data.@= GeoRestriction
geoRestriction]