{-# 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.SageMaker.Types.SearchExpression where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.BooleanOperator
import Amazonka.SageMaker.Types.Filter
import Amazonka.SageMaker.Types.NestedFilters
data SearchExpression = SearchExpression'
{
SearchExpression -> Maybe (NonEmpty SearchExpression)
subExpressions :: Prelude.Maybe (Prelude.NonEmpty SearchExpression),
SearchExpression -> Maybe BooleanOperator
operator :: Prelude.Maybe BooleanOperator,
SearchExpression -> Maybe (NonEmpty Filter)
filters :: Prelude.Maybe (Prelude.NonEmpty Filter),
SearchExpression -> Maybe (NonEmpty NestedFilters)
nestedFilters :: Prelude.Maybe (Prelude.NonEmpty NestedFilters)
}
deriving (SearchExpression -> SearchExpression -> Bool
(SearchExpression -> SearchExpression -> Bool)
-> (SearchExpression -> SearchExpression -> Bool)
-> Eq SearchExpression
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchExpression -> SearchExpression -> Bool
$c/= :: SearchExpression -> SearchExpression -> Bool
== :: SearchExpression -> SearchExpression -> Bool
$c== :: SearchExpression -> SearchExpression -> Bool
Prelude.Eq, ReadPrec [SearchExpression]
ReadPrec SearchExpression
Int -> ReadS SearchExpression
ReadS [SearchExpression]
(Int -> ReadS SearchExpression)
-> ReadS [SearchExpression]
-> ReadPrec SearchExpression
-> ReadPrec [SearchExpression]
-> Read SearchExpression
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchExpression]
$creadListPrec :: ReadPrec [SearchExpression]
readPrec :: ReadPrec SearchExpression
$creadPrec :: ReadPrec SearchExpression
readList :: ReadS [SearchExpression]
$creadList :: ReadS [SearchExpression]
readsPrec :: Int -> ReadS SearchExpression
$creadsPrec :: Int -> ReadS SearchExpression
Prelude.Read, Int -> SearchExpression -> ShowS
[SearchExpression] -> ShowS
SearchExpression -> String
(Int -> SearchExpression -> ShowS)
-> (SearchExpression -> String)
-> ([SearchExpression] -> ShowS)
-> Show SearchExpression
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchExpression] -> ShowS
$cshowList :: [SearchExpression] -> ShowS
show :: SearchExpression -> String
$cshow :: SearchExpression -> String
showsPrec :: Int -> SearchExpression -> ShowS
$cshowsPrec :: Int -> SearchExpression -> ShowS
Prelude.Show, (forall x. SearchExpression -> Rep SearchExpression x)
-> (forall x. Rep SearchExpression x -> SearchExpression)
-> Generic SearchExpression
forall x. Rep SearchExpression x -> SearchExpression
forall x. SearchExpression -> Rep SearchExpression x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchExpression x -> SearchExpression
$cfrom :: forall x. SearchExpression -> Rep SearchExpression x
Prelude.Generic)
newSearchExpression ::
SearchExpression
newSearchExpression :: SearchExpression
newSearchExpression =
SearchExpression' :: Maybe (NonEmpty SearchExpression)
-> Maybe BooleanOperator
-> Maybe (NonEmpty Filter)
-> Maybe (NonEmpty NestedFilters)
-> SearchExpression
SearchExpression'
{ $sel:subExpressions:SearchExpression' :: Maybe (NonEmpty SearchExpression)
subExpressions = Maybe (NonEmpty SearchExpression)
forall a. Maybe a
Prelude.Nothing,
$sel:operator:SearchExpression' :: Maybe BooleanOperator
operator = Maybe BooleanOperator
forall a. Maybe a
Prelude.Nothing,
$sel:filters:SearchExpression' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
$sel:nestedFilters:SearchExpression' :: Maybe (NonEmpty NestedFilters)
nestedFilters = Maybe (NonEmpty NestedFilters)
forall a. Maybe a
Prelude.Nothing
}
searchExpression_subExpressions :: Lens.Lens' SearchExpression (Prelude.Maybe (Prelude.NonEmpty SearchExpression))
searchExpression_subExpressions :: (Maybe (NonEmpty SearchExpression)
-> f (Maybe (NonEmpty SearchExpression)))
-> SearchExpression -> f SearchExpression
searchExpression_subExpressions = (SearchExpression -> Maybe (NonEmpty SearchExpression))
-> (SearchExpression
-> Maybe (NonEmpty SearchExpression) -> SearchExpression)
-> Lens
SearchExpression
SearchExpression
(Maybe (NonEmpty SearchExpression))
(Maybe (NonEmpty SearchExpression))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchExpression' {Maybe (NonEmpty SearchExpression)
subExpressions :: Maybe (NonEmpty SearchExpression)
$sel:subExpressions:SearchExpression' :: SearchExpression -> Maybe (NonEmpty SearchExpression)
subExpressions} -> Maybe (NonEmpty SearchExpression)
subExpressions) (\s :: SearchExpression
s@SearchExpression' {} Maybe (NonEmpty SearchExpression)
a -> SearchExpression
s {$sel:subExpressions:SearchExpression' :: Maybe (NonEmpty SearchExpression)
subExpressions = Maybe (NonEmpty SearchExpression)
a} :: SearchExpression) ((Maybe (NonEmpty SearchExpression)
-> f (Maybe (NonEmpty SearchExpression)))
-> SearchExpression -> f SearchExpression)
-> ((Maybe (NonEmpty SearchExpression)
-> f (Maybe (NonEmpty SearchExpression)))
-> Maybe (NonEmpty SearchExpression)
-> f (Maybe (NonEmpty SearchExpression)))
-> (Maybe (NonEmpty SearchExpression)
-> f (Maybe (NonEmpty SearchExpression)))
-> SearchExpression
-> f SearchExpression
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty SearchExpression)
(NonEmpty SearchExpression)
(NonEmpty SearchExpression)
(NonEmpty SearchExpression)
-> Iso
(Maybe (NonEmpty SearchExpression))
(Maybe (NonEmpty SearchExpression))
(Maybe (NonEmpty SearchExpression))
(Maybe (NonEmpty SearchExpression))
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
(NonEmpty SearchExpression)
(NonEmpty SearchExpression)
(NonEmpty SearchExpression)
(NonEmpty SearchExpression)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchExpression_operator :: Lens.Lens' SearchExpression (Prelude.Maybe BooleanOperator)
searchExpression_operator :: (Maybe BooleanOperator -> f (Maybe BooleanOperator))
-> SearchExpression -> f SearchExpression
searchExpression_operator = (SearchExpression -> Maybe BooleanOperator)
-> (SearchExpression -> Maybe BooleanOperator -> SearchExpression)
-> Lens
SearchExpression
SearchExpression
(Maybe BooleanOperator)
(Maybe BooleanOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchExpression' {Maybe BooleanOperator
operator :: Maybe BooleanOperator
$sel:operator:SearchExpression' :: SearchExpression -> Maybe BooleanOperator
operator} -> Maybe BooleanOperator
operator) (\s :: SearchExpression
s@SearchExpression' {} Maybe BooleanOperator
a -> SearchExpression
s {$sel:operator:SearchExpression' :: Maybe BooleanOperator
operator = Maybe BooleanOperator
a} :: SearchExpression)
searchExpression_filters :: Lens.Lens' SearchExpression (Prelude.Maybe (Prelude.NonEmpty Filter))
searchExpression_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> SearchExpression -> f SearchExpression
searchExpression_filters = (SearchExpression -> Maybe (NonEmpty Filter))
-> (SearchExpression
-> Maybe (NonEmpty Filter) -> SearchExpression)
-> Lens
SearchExpression
SearchExpression
(Maybe (NonEmpty Filter))
(Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchExpression' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:SearchExpression' :: SearchExpression -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: SearchExpression
s@SearchExpression' {} Maybe (NonEmpty Filter)
a -> SearchExpression
s {$sel:filters:SearchExpression' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: SearchExpression) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> SearchExpression -> f SearchExpression)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> SearchExpression
-> f SearchExpression
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Filter)
(NonEmpty Filter)
(NonEmpty Filter)
(NonEmpty Filter)
-> Iso
(Maybe (NonEmpty Filter))
(Maybe (NonEmpty Filter))
(Maybe (NonEmpty Filter))
(Maybe (NonEmpty Filter))
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
(NonEmpty Filter)
(NonEmpty Filter)
(NonEmpty Filter)
(NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchExpression_nestedFilters :: Lens.Lens' SearchExpression (Prelude.Maybe (Prelude.NonEmpty NestedFilters))
searchExpression_nestedFilters :: (Maybe (NonEmpty NestedFilters)
-> f (Maybe (NonEmpty NestedFilters)))
-> SearchExpression -> f SearchExpression
searchExpression_nestedFilters = (SearchExpression -> Maybe (NonEmpty NestedFilters))
-> (SearchExpression
-> Maybe (NonEmpty NestedFilters) -> SearchExpression)
-> Lens
SearchExpression
SearchExpression
(Maybe (NonEmpty NestedFilters))
(Maybe (NonEmpty NestedFilters))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchExpression' {Maybe (NonEmpty NestedFilters)
nestedFilters :: Maybe (NonEmpty NestedFilters)
$sel:nestedFilters:SearchExpression' :: SearchExpression -> Maybe (NonEmpty NestedFilters)
nestedFilters} -> Maybe (NonEmpty NestedFilters)
nestedFilters) (\s :: SearchExpression
s@SearchExpression' {} Maybe (NonEmpty NestedFilters)
a -> SearchExpression
s {$sel:nestedFilters:SearchExpression' :: Maybe (NonEmpty NestedFilters)
nestedFilters = Maybe (NonEmpty NestedFilters)
a} :: SearchExpression) ((Maybe (NonEmpty NestedFilters)
-> f (Maybe (NonEmpty NestedFilters)))
-> SearchExpression -> f SearchExpression)
-> ((Maybe (NonEmpty NestedFilters)
-> f (Maybe (NonEmpty NestedFilters)))
-> Maybe (NonEmpty NestedFilters)
-> f (Maybe (NonEmpty NestedFilters)))
-> (Maybe (NonEmpty NestedFilters)
-> f (Maybe (NonEmpty NestedFilters)))
-> SearchExpression
-> f SearchExpression
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty NestedFilters)
(NonEmpty NestedFilters)
(NonEmpty NestedFilters)
(NonEmpty NestedFilters)
-> Iso
(Maybe (NonEmpty NestedFilters))
(Maybe (NonEmpty NestedFilters))
(Maybe (NonEmpty NestedFilters))
(Maybe (NonEmpty NestedFilters))
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
(NonEmpty NestedFilters)
(NonEmpty NestedFilters)
(NonEmpty NestedFilters)
(NonEmpty NestedFilters)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable SearchExpression
instance Prelude.NFData SearchExpression
instance Core.ToJSON SearchExpression where
toJSON :: SearchExpression -> Value
toJSON SearchExpression' {Maybe (NonEmpty Filter)
Maybe (NonEmpty NestedFilters)
Maybe (NonEmpty SearchExpression)
Maybe BooleanOperator
nestedFilters :: Maybe (NonEmpty NestedFilters)
filters :: Maybe (NonEmpty Filter)
operator :: Maybe BooleanOperator
subExpressions :: Maybe (NonEmpty SearchExpression)
$sel:nestedFilters:SearchExpression' :: SearchExpression -> Maybe (NonEmpty NestedFilters)
$sel:filters:SearchExpression' :: SearchExpression -> Maybe (NonEmpty Filter)
$sel:operator:SearchExpression' :: SearchExpression -> Maybe BooleanOperator
$sel:subExpressions:SearchExpression' :: SearchExpression -> Maybe (NonEmpty SearchExpression)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SubExpressions" Text -> NonEmpty SearchExpression -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty SearchExpression -> Pair)
-> Maybe (NonEmpty SearchExpression) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SearchExpression)
subExpressions,
(Text
"Operator" Text -> BooleanOperator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BooleanOperator -> Pair) -> Maybe BooleanOperator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BooleanOperator
operator,
(Text
"Filters" Text -> NonEmpty Filter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Filter -> Pair) -> Maybe (NonEmpty Filter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Filter)
filters,
(Text
"NestedFilters" Text -> NonEmpty NestedFilters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty NestedFilters -> Pair)
-> Maybe (NonEmpty NestedFilters) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty NestedFilters)
nestedFilters
]
)