{-# 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.RDS.Types.Range 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 Range = Range'
{
Range -> Maybe Int
from :: Prelude.Maybe Prelude.Int,
Range -> Maybe Int
step :: Prelude.Maybe Prelude.Int,
Range -> Maybe Int
to :: Prelude.Maybe Prelude.Int
}
deriving (Range -> Range -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Range -> Range -> Bool
$c/= :: Range -> Range -> Bool
== :: Range -> Range -> Bool
$c== :: Range -> Range -> Bool
Prelude.Eq, ReadPrec [Range]
ReadPrec Range
Int -> ReadS Range
ReadS [Range]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Range]
$creadListPrec :: ReadPrec [Range]
readPrec :: ReadPrec Range
$creadPrec :: ReadPrec Range
readList :: ReadS [Range]
$creadList :: ReadS [Range]
readsPrec :: Int -> ReadS Range
$creadsPrec :: Int -> ReadS Range
Prelude.Read, Int -> Range -> ShowS
[Range] -> ShowS
Range -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Range] -> ShowS
$cshowList :: [Range] -> ShowS
show :: Range -> String
$cshow :: Range -> String
showsPrec :: Int -> Range -> ShowS
$cshowsPrec :: Int -> Range -> ShowS
Prelude.Show, forall x. Rep Range x -> Range
forall x. Range -> Rep Range x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Range x -> Range
$cfrom :: forall x. Range -> Rep Range x
Prelude.Generic)
newRange ::
Range
newRange :: Range
newRange =
Range'
{ $sel:from:Range' :: Maybe Int
from = forall a. Maybe a
Prelude.Nothing,
$sel:step:Range' :: Maybe Int
step = forall a. Maybe a
Prelude.Nothing,
$sel:to:Range' :: Maybe Int
to = forall a. Maybe a
Prelude.Nothing
}
range_from :: Lens.Lens' Range (Prelude.Maybe Prelude.Int)
range_from :: Lens' Range (Maybe Int)
range_from = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Range' {Maybe Int
from :: Maybe Int
$sel:from:Range' :: Range -> Maybe Int
from} -> Maybe Int
from) (\s :: Range
s@Range' {} Maybe Int
a -> Range
s {$sel:from:Range' :: Maybe Int
from = Maybe Int
a} :: Range)
range_step :: Lens.Lens' Range (Prelude.Maybe Prelude.Int)
range_step :: Lens' Range (Maybe Int)
range_step = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Range' {Maybe Int
step :: Maybe Int
$sel:step:Range' :: Range -> Maybe Int
step} -> Maybe Int
step) (\s :: Range
s@Range' {} Maybe Int
a -> Range
s {$sel:step:Range' :: Maybe Int
step = Maybe Int
a} :: Range)
range_to :: Lens.Lens' Range (Prelude.Maybe Prelude.Int)
range_to :: Lens' Range (Maybe Int)
range_to = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Range' {Maybe Int
to :: Maybe Int
$sel:to:Range' :: Range -> Maybe Int
to} -> Maybe Int
to) (\s :: Range
s@Range' {} Maybe Int
a -> Range
s {$sel:to:Range' :: Maybe Int
to = Maybe Int
a} :: Range)
instance Data.FromXML Range where
parseXML :: [Node] -> Either String Range
parseXML [Node]
x =
Maybe Int -> Maybe Int -> Maybe Int -> Range
Range'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"From")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Step")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"To")
instance Prelude.Hashable Range where
hashWithSalt :: Int -> Range -> Int
hashWithSalt Int
_salt Range' {Maybe Int
to :: Maybe Int
step :: Maybe Int
from :: Maybe Int
$sel:to:Range' :: Range -> Maybe Int
$sel:step:Range' :: Range -> Maybe Int
$sel:from:Range' :: Range -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
from
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
step
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
to
instance Prelude.NFData Range where
rnf :: Range -> ()
rnf Range' {Maybe Int
to :: Maybe Int
step :: Maybe Int
from :: Maybe Int
$sel:to:Range' :: Range -> Maybe Int
$sel:step:Range' :: Range -> Maybe Int
$sel:from:Range' :: Range -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
from
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
step
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
to