{-# 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.ElasticSearch.Types.AdditionalLimit where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AdditionalLimit = AdditionalLimit'
{
AdditionalLimit -> Maybe Text
limitName :: Prelude.Maybe Prelude.Text,
AdditionalLimit -> Maybe [Text]
limitValues :: Prelude.Maybe [Prelude.Text]
}
deriving (AdditionalLimit -> AdditionalLimit -> Bool
(AdditionalLimit -> AdditionalLimit -> Bool)
-> (AdditionalLimit -> AdditionalLimit -> Bool)
-> Eq AdditionalLimit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdditionalLimit -> AdditionalLimit -> Bool
$c/= :: AdditionalLimit -> AdditionalLimit -> Bool
== :: AdditionalLimit -> AdditionalLimit -> Bool
$c== :: AdditionalLimit -> AdditionalLimit -> Bool
Prelude.Eq, ReadPrec [AdditionalLimit]
ReadPrec AdditionalLimit
Int -> ReadS AdditionalLimit
ReadS [AdditionalLimit]
(Int -> ReadS AdditionalLimit)
-> ReadS [AdditionalLimit]
-> ReadPrec AdditionalLimit
-> ReadPrec [AdditionalLimit]
-> Read AdditionalLimit
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdditionalLimit]
$creadListPrec :: ReadPrec [AdditionalLimit]
readPrec :: ReadPrec AdditionalLimit
$creadPrec :: ReadPrec AdditionalLimit
readList :: ReadS [AdditionalLimit]
$creadList :: ReadS [AdditionalLimit]
readsPrec :: Int -> ReadS AdditionalLimit
$creadsPrec :: Int -> ReadS AdditionalLimit
Prelude.Read, Int -> AdditionalLimit -> ShowS
[AdditionalLimit] -> ShowS
AdditionalLimit -> String
(Int -> AdditionalLimit -> ShowS)
-> (AdditionalLimit -> String)
-> ([AdditionalLimit] -> ShowS)
-> Show AdditionalLimit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdditionalLimit] -> ShowS
$cshowList :: [AdditionalLimit] -> ShowS
show :: AdditionalLimit -> String
$cshow :: AdditionalLimit -> String
showsPrec :: Int -> AdditionalLimit -> ShowS
$cshowsPrec :: Int -> AdditionalLimit -> ShowS
Prelude.Show, (forall x. AdditionalLimit -> Rep AdditionalLimit x)
-> (forall x. Rep AdditionalLimit x -> AdditionalLimit)
-> Generic AdditionalLimit
forall x. Rep AdditionalLimit x -> AdditionalLimit
forall x. AdditionalLimit -> Rep AdditionalLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdditionalLimit x -> AdditionalLimit
$cfrom :: forall x. AdditionalLimit -> Rep AdditionalLimit x
Prelude.Generic)
newAdditionalLimit ::
AdditionalLimit
newAdditionalLimit :: AdditionalLimit
newAdditionalLimit =
AdditionalLimit' :: Maybe Text -> Maybe [Text] -> AdditionalLimit
AdditionalLimit'
{ $sel:limitName:AdditionalLimit' :: Maybe Text
limitName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limitValues:AdditionalLimit' :: Maybe [Text]
limitValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
additionalLimit_limitName :: Lens.Lens' AdditionalLimit (Prelude.Maybe Prelude.Text)
additionalLimit_limitName :: (Maybe Text -> f (Maybe Text))
-> AdditionalLimit -> f AdditionalLimit
additionalLimit_limitName = (AdditionalLimit -> Maybe Text)
-> (AdditionalLimit -> Maybe Text -> AdditionalLimit)
-> Lens AdditionalLimit AdditionalLimit (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdditionalLimit' {Maybe Text
limitName :: Maybe Text
$sel:limitName:AdditionalLimit' :: AdditionalLimit -> Maybe Text
limitName} -> Maybe Text
limitName) (\s :: AdditionalLimit
s@AdditionalLimit' {} Maybe Text
a -> AdditionalLimit
s {$sel:limitName:AdditionalLimit' :: Maybe Text
limitName = Maybe Text
a} :: AdditionalLimit)
additionalLimit_limitValues :: Lens.Lens' AdditionalLimit (Prelude.Maybe [Prelude.Text])
additionalLimit_limitValues :: (Maybe [Text] -> f (Maybe [Text]))
-> AdditionalLimit -> f AdditionalLimit
additionalLimit_limitValues = (AdditionalLimit -> Maybe [Text])
-> (AdditionalLimit -> Maybe [Text] -> AdditionalLimit)
-> Lens
AdditionalLimit AdditionalLimit (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdditionalLimit' {Maybe [Text]
limitValues :: Maybe [Text]
$sel:limitValues:AdditionalLimit' :: AdditionalLimit -> Maybe [Text]
limitValues} -> Maybe [Text]
limitValues) (\s :: AdditionalLimit
s@AdditionalLimit' {} Maybe [Text]
a -> AdditionalLimit
s {$sel:limitValues:AdditionalLimit' :: Maybe [Text]
limitValues = Maybe [Text]
a} :: AdditionalLimit) ((Maybe [Text] -> f (Maybe [Text]))
-> AdditionalLimit -> f AdditionalLimit)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AdditionalLimit
-> f AdditionalLimit
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AdditionalLimit where
parseJSON :: Value -> Parser AdditionalLimit
parseJSON =
String
-> (Object -> Parser AdditionalLimit)
-> Value
-> Parser AdditionalLimit
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AdditionalLimit"
( \Object
x ->
Maybe Text -> Maybe [Text] -> AdditionalLimit
AdditionalLimit'
(Maybe Text -> Maybe [Text] -> AdditionalLimit)
-> Parser (Maybe Text) -> Parser (Maybe [Text] -> AdditionalLimit)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LimitName")
Parser (Maybe [Text] -> AdditionalLimit)
-> Parser (Maybe [Text]) -> Parser AdditionalLimit
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LimitValues" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AdditionalLimit
instance Prelude.NFData AdditionalLimit