{-# 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.SSM.Types.InstancePatchStateFilter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.InstancePatchStateOperatorType
data InstancePatchStateFilter = InstancePatchStateFilter'
{
InstancePatchStateFilter -> Text
key :: Prelude.Text,
InstancePatchStateFilter -> NonEmpty Text
values :: Prelude.NonEmpty Prelude.Text,
InstancePatchStateFilter -> InstancePatchStateOperatorType
type' :: InstancePatchStateOperatorType
}
deriving (InstancePatchStateFilter -> InstancePatchStateFilter -> Bool
(InstancePatchStateFilter -> InstancePatchStateFilter -> Bool)
-> (InstancePatchStateFilter -> InstancePatchStateFilter -> Bool)
-> Eq InstancePatchStateFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstancePatchStateFilter -> InstancePatchStateFilter -> Bool
$c/= :: InstancePatchStateFilter -> InstancePatchStateFilter -> Bool
== :: InstancePatchStateFilter -> InstancePatchStateFilter -> Bool
$c== :: InstancePatchStateFilter -> InstancePatchStateFilter -> Bool
Prelude.Eq, ReadPrec [InstancePatchStateFilter]
ReadPrec InstancePatchStateFilter
Int -> ReadS InstancePatchStateFilter
ReadS [InstancePatchStateFilter]
(Int -> ReadS InstancePatchStateFilter)
-> ReadS [InstancePatchStateFilter]
-> ReadPrec InstancePatchStateFilter
-> ReadPrec [InstancePatchStateFilter]
-> Read InstancePatchStateFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstancePatchStateFilter]
$creadListPrec :: ReadPrec [InstancePatchStateFilter]
readPrec :: ReadPrec InstancePatchStateFilter
$creadPrec :: ReadPrec InstancePatchStateFilter
readList :: ReadS [InstancePatchStateFilter]
$creadList :: ReadS [InstancePatchStateFilter]
readsPrec :: Int -> ReadS InstancePatchStateFilter
$creadsPrec :: Int -> ReadS InstancePatchStateFilter
Prelude.Read, Int -> InstancePatchStateFilter -> ShowS
[InstancePatchStateFilter] -> ShowS
InstancePatchStateFilter -> String
(Int -> InstancePatchStateFilter -> ShowS)
-> (InstancePatchStateFilter -> String)
-> ([InstancePatchStateFilter] -> ShowS)
-> Show InstancePatchStateFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstancePatchStateFilter] -> ShowS
$cshowList :: [InstancePatchStateFilter] -> ShowS
show :: InstancePatchStateFilter -> String
$cshow :: InstancePatchStateFilter -> String
showsPrec :: Int -> InstancePatchStateFilter -> ShowS
$cshowsPrec :: Int -> InstancePatchStateFilter -> ShowS
Prelude.Show, (forall x.
InstancePatchStateFilter -> Rep InstancePatchStateFilter x)
-> (forall x.
Rep InstancePatchStateFilter x -> InstancePatchStateFilter)
-> Generic InstancePatchStateFilter
forall x.
Rep InstancePatchStateFilter x -> InstancePatchStateFilter
forall x.
InstancePatchStateFilter -> Rep InstancePatchStateFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstancePatchStateFilter x -> InstancePatchStateFilter
$cfrom :: forall x.
InstancePatchStateFilter -> Rep InstancePatchStateFilter x
Prelude.Generic)
newInstancePatchStateFilter ::
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
InstancePatchStateOperatorType ->
InstancePatchStateFilter
newInstancePatchStateFilter :: Text
-> NonEmpty Text
-> InstancePatchStateOperatorType
-> InstancePatchStateFilter
newInstancePatchStateFilter Text
pKey_ NonEmpty Text
pValues_ InstancePatchStateOperatorType
pType_ =
InstancePatchStateFilter' :: Text
-> NonEmpty Text
-> InstancePatchStateOperatorType
-> InstancePatchStateFilter
InstancePatchStateFilter'
{ $sel:key:InstancePatchStateFilter' :: Text
key = Text
pKey_,
$sel:values:InstancePatchStateFilter' :: NonEmpty Text
values = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pValues_,
$sel:type':InstancePatchStateFilter' :: InstancePatchStateOperatorType
type' = InstancePatchStateOperatorType
pType_
}
instancePatchStateFilter_key :: Lens.Lens' InstancePatchStateFilter Prelude.Text
instancePatchStateFilter_key :: (Text -> f Text)
-> InstancePatchStateFilter -> f InstancePatchStateFilter
instancePatchStateFilter_key = (InstancePatchStateFilter -> Text)
-> (InstancePatchStateFilter -> Text -> InstancePatchStateFilter)
-> Lens InstancePatchStateFilter InstancePatchStateFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePatchStateFilter' {Text
key :: Text
$sel:key:InstancePatchStateFilter' :: InstancePatchStateFilter -> Text
key} -> Text
key) (\s :: InstancePatchStateFilter
s@InstancePatchStateFilter' {} Text
a -> InstancePatchStateFilter
s {$sel:key:InstancePatchStateFilter' :: Text
key = Text
a} :: InstancePatchStateFilter)
instancePatchStateFilter_values :: Lens.Lens' InstancePatchStateFilter (Prelude.NonEmpty Prelude.Text)
instancePatchStateFilter_values :: (NonEmpty Text -> f (NonEmpty Text))
-> InstancePatchStateFilter -> f InstancePatchStateFilter
instancePatchStateFilter_values = (InstancePatchStateFilter -> NonEmpty Text)
-> (InstancePatchStateFilter
-> NonEmpty Text -> InstancePatchStateFilter)
-> Lens
InstancePatchStateFilter
InstancePatchStateFilter
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePatchStateFilter' {NonEmpty Text
values :: NonEmpty Text
$sel:values:InstancePatchStateFilter' :: InstancePatchStateFilter -> NonEmpty Text
values} -> NonEmpty Text
values) (\s :: InstancePatchStateFilter
s@InstancePatchStateFilter' {} NonEmpty Text
a -> InstancePatchStateFilter
s {$sel:values:InstancePatchStateFilter' :: NonEmpty Text
values = NonEmpty Text
a} :: InstancePatchStateFilter) ((NonEmpty Text -> f (NonEmpty Text))
-> InstancePatchStateFilter -> f InstancePatchStateFilter)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> InstancePatchStateFilter
-> f InstancePatchStateFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instancePatchStateFilter_type :: Lens.Lens' InstancePatchStateFilter InstancePatchStateOperatorType
instancePatchStateFilter_type :: (InstancePatchStateOperatorType
-> f InstancePatchStateOperatorType)
-> InstancePatchStateFilter -> f InstancePatchStateFilter
instancePatchStateFilter_type = (InstancePatchStateFilter -> InstancePatchStateOperatorType)
-> (InstancePatchStateFilter
-> InstancePatchStateOperatorType -> InstancePatchStateFilter)
-> Lens
InstancePatchStateFilter
InstancePatchStateFilter
InstancePatchStateOperatorType
InstancePatchStateOperatorType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePatchStateFilter' {InstancePatchStateOperatorType
type' :: InstancePatchStateOperatorType
$sel:type':InstancePatchStateFilter' :: InstancePatchStateFilter -> InstancePatchStateOperatorType
type'} -> InstancePatchStateOperatorType
type') (\s :: InstancePatchStateFilter
s@InstancePatchStateFilter' {} InstancePatchStateOperatorType
a -> InstancePatchStateFilter
s {$sel:type':InstancePatchStateFilter' :: InstancePatchStateOperatorType
type' = InstancePatchStateOperatorType
a} :: InstancePatchStateFilter)
instance Prelude.Hashable InstancePatchStateFilter
instance Prelude.NFData InstancePatchStateFilter
instance Core.ToJSON InstancePatchStateFilter where
toJSON :: InstancePatchStateFilter -> Value
toJSON InstancePatchStateFilter' {NonEmpty Text
Text
InstancePatchStateOperatorType
type' :: InstancePatchStateOperatorType
values :: NonEmpty Text
key :: Text
$sel:type':InstancePatchStateFilter' :: InstancePatchStateFilter -> InstancePatchStateOperatorType
$sel:values:InstancePatchStateFilter' :: InstancePatchStateFilter -> NonEmpty Text
$sel:key:InstancePatchStateFilter' :: InstancePatchStateFilter -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
key),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Values" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
values),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> InstancePatchStateOperatorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InstancePatchStateOperatorType
type')
]
)