{-# 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.Route53Domains.Types.SortCondition 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
import Amazonka.Route53Domains.Types.ListDomainsAttributeName
import Amazonka.Route53Domains.Types.SortOrder
data SortCondition = SortCondition'
{
SortCondition -> ListDomainsAttributeName
name :: ListDomainsAttributeName,
SortCondition -> SortOrder
sortOrder :: SortOrder
}
deriving (SortCondition -> SortCondition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SortCondition -> SortCondition -> Bool
$c/= :: SortCondition -> SortCondition -> Bool
== :: SortCondition -> SortCondition -> Bool
$c== :: SortCondition -> SortCondition -> Bool
Prelude.Eq, ReadPrec [SortCondition]
ReadPrec SortCondition
Int -> ReadS SortCondition
ReadS [SortCondition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SortCondition]
$creadListPrec :: ReadPrec [SortCondition]
readPrec :: ReadPrec SortCondition
$creadPrec :: ReadPrec SortCondition
readList :: ReadS [SortCondition]
$creadList :: ReadS [SortCondition]
readsPrec :: Int -> ReadS SortCondition
$creadsPrec :: Int -> ReadS SortCondition
Prelude.Read, Int -> SortCondition -> ShowS
[SortCondition] -> ShowS
SortCondition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SortCondition] -> ShowS
$cshowList :: [SortCondition] -> ShowS
show :: SortCondition -> String
$cshow :: SortCondition -> String
showsPrec :: Int -> SortCondition -> ShowS
$cshowsPrec :: Int -> SortCondition -> ShowS
Prelude.Show, forall x. Rep SortCondition x -> SortCondition
forall x. SortCondition -> Rep SortCondition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SortCondition x -> SortCondition
$cfrom :: forall x. SortCondition -> Rep SortCondition x
Prelude.Generic)
newSortCondition ::
ListDomainsAttributeName ->
SortOrder ->
SortCondition
newSortCondition :: ListDomainsAttributeName -> SortOrder -> SortCondition
newSortCondition ListDomainsAttributeName
pName_ SortOrder
pSortOrder_ =
SortCondition'
{ $sel:name:SortCondition' :: ListDomainsAttributeName
name = ListDomainsAttributeName
pName_,
$sel:sortOrder:SortCondition' :: SortOrder
sortOrder = SortOrder
pSortOrder_
}
sortCondition_name :: Lens.Lens' SortCondition ListDomainsAttributeName
sortCondition_name :: Lens' SortCondition ListDomainsAttributeName
sortCondition_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SortCondition' {ListDomainsAttributeName
name :: ListDomainsAttributeName
$sel:name:SortCondition' :: SortCondition -> ListDomainsAttributeName
name} -> ListDomainsAttributeName
name) (\s :: SortCondition
s@SortCondition' {} ListDomainsAttributeName
a -> SortCondition
s {$sel:name:SortCondition' :: ListDomainsAttributeName
name = ListDomainsAttributeName
a} :: SortCondition)
sortCondition_sortOrder :: Lens.Lens' SortCondition SortOrder
sortCondition_sortOrder :: Lens' SortCondition SortOrder
sortCondition_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SortCondition' {SortOrder
sortOrder :: SortOrder
$sel:sortOrder:SortCondition' :: SortCondition -> SortOrder
sortOrder} -> SortOrder
sortOrder) (\s :: SortCondition
s@SortCondition' {} SortOrder
a -> SortCondition
s {$sel:sortOrder:SortCondition' :: SortOrder
sortOrder = SortOrder
a} :: SortCondition)
instance Prelude.Hashable SortCondition where
hashWithSalt :: Int -> SortCondition -> Int
hashWithSalt Int
_salt SortCondition' {ListDomainsAttributeName
SortOrder
sortOrder :: SortOrder
name :: ListDomainsAttributeName
$sel:sortOrder:SortCondition' :: SortCondition -> SortOrder
$sel:name:SortCondition' :: SortCondition -> ListDomainsAttributeName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ListDomainsAttributeName
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SortOrder
sortOrder
instance Prelude.NFData SortCondition where
rnf :: SortCondition -> ()
rnf SortCondition' {ListDomainsAttributeName
SortOrder
sortOrder :: SortOrder
name :: ListDomainsAttributeName
$sel:sortOrder:SortCondition' :: SortCondition -> SortOrder
$sel:name:SortCondition' :: SortCondition -> ListDomainsAttributeName
..} =
forall a. NFData a => a -> ()
Prelude.rnf ListDomainsAttributeName
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SortOrder
sortOrder
instance Data.ToJSON SortCondition where
toJSON :: SortCondition -> Value
toJSON SortCondition' {ListDomainsAttributeName
SortOrder
sortOrder :: SortOrder
name :: ListDomainsAttributeName
$sel:sortOrder:SortCondition' :: SortCondition -> SortOrder
$sel:name:SortCondition' :: SortCondition -> ListDomainsAttributeName
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ListDomainsAttributeName
name),
forall a. a -> Maybe a
Prelude.Just (Key
"SortOrder" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SortOrder
sortOrder)
]
)