{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:key:InstancePatchStateFilter' :: Text
key = Text
pKey_,
$sel:values:InstancePatchStateFilter' :: NonEmpty Text
values = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced 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 :: Lens' InstancePatchStateFilter Text
instancePatchStateFilter_key = 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 :: Lens' InstancePatchStateFilter (NonEmpty Text)
instancePatchStateFilter_values = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: Lens' InstancePatchStateFilter InstancePatchStateOperatorType
instancePatchStateFilter_type = 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 where
hashWithSalt :: Int -> InstancePatchStateFilter -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
values
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InstancePatchStateOperatorType
type'
instance Prelude.NFData InstancePatchStateFilter where
rnf :: InstancePatchStateFilter -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
values
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InstancePatchStateOperatorType
type'
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Key" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
key),
forall a. a -> Maybe a
Prelude.Just (Key
"Values" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
values),
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= InstancePatchStateOperatorType
type')
]
)