{-# 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.GreengrassV2.Types.ComponentDependencyRequirement where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types.ComponentDependencyType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComponentDependencyRequirement = ComponentDependencyRequirement'
{
ComponentDependencyRequirement -> Maybe ComponentDependencyType
dependencyType :: Prelude.Maybe ComponentDependencyType,
ComponentDependencyRequirement -> Maybe Text
versionRequirement :: Prelude.Maybe Prelude.Text
}
deriving (ComponentDependencyRequirement
-> ComponentDependencyRequirement -> Bool
(ComponentDependencyRequirement
-> ComponentDependencyRequirement -> Bool)
-> (ComponentDependencyRequirement
-> ComponentDependencyRequirement -> Bool)
-> Eq ComponentDependencyRequirement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentDependencyRequirement
-> ComponentDependencyRequirement -> Bool
$c/= :: ComponentDependencyRequirement
-> ComponentDependencyRequirement -> Bool
== :: ComponentDependencyRequirement
-> ComponentDependencyRequirement -> Bool
$c== :: ComponentDependencyRequirement
-> ComponentDependencyRequirement -> Bool
Prelude.Eq, ReadPrec [ComponentDependencyRequirement]
ReadPrec ComponentDependencyRequirement
Int -> ReadS ComponentDependencyRequirement
ReadS [ComponentDependencyRequirement]
(Int -> ReadS ComponentDependencyRequirement)
-> ReadS [ComponentDependencyRequirement]
-> ReadPrec ComponentDependencyRequirement
-> ReadPrec [ComponentDependencyRequirement]
-> Read ComponentDependencyRequirement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentDependencyRequirement]
$creadListPrec :: ReadPrec [ComponentDependencyRequirement]
readPrec :: ReadPrec ComponentDependencyRequirement
$creadPrec :: ReadPrec ComponentDependencyRequirement
readList :: ReadS [ComponentDependencyRequirement]
$creadList :: ReadS [ComponentDependencyRequirement]
readsPrec :: Int -> ReadS ComponentDependencyRequirement
$creadsPrec :: Int -> ReadS ComponentDependencyRequirement
Prelude.Read, Int -> ComponentDependencyRequirement -> ShowS
[ComponentDependencyRequirement] -> ShowS
ComponentDependencyRequirement -> String
(Int -> ComponentDependencyRequirement -> ShowS)
-> (ComponentDependencyRequirement -> String)
-> ([ComponentDependencyRequirement] -> ShowS)
-> Show ComponentDependencyRequirement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentDependencyRequirement] -> ShowS
$cshowList :: [ComponentDependencyRequirement] -> ShowS
show :: ComponentDependencyRequirement -> String
$cshow :: ComponentDependencyRequirement -> String
showsPrec :: Int -> ComponentDependencyRequirement -> ShowS
$cshowsPrec :: Int -> ComponentDependencyRequirement -> ShowS
Prelude.Show, (forall x.
ComponentDependencyRequirement
-> Rep ComponentDependencyRequirement x)
-> (forall x.
Rep ComponentDependencyRequirement x
-> ComponentDependencyRequirement)
-> Generic ComponentDependencyRequirement
forall x.
Rep ComponentDependencyRequirement x
-> ComponentDependencyRequirement
forall x.
ComponentDependencyRequirement
-> Rep ComponentDependencyRequirement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ComponentDependencyRequirement x
-> ComponentDependencyRequirement
$cfrom :: forall x.
ComponentDependencyRequirement
-> Rep ComponentDependencyRequirement x
Prelude.Generic)
newComponentDependencyRequirement ::
ComponentDependencyRequirement
newComponentDependencyRequirement :: ComponentDependencyRequirement
newComponentDependencyRequirement =
ComponentDependencyRequirement' :: Maybe ComponentDependencyType
-> Maybe Text -> ComponentDependencyRequirement
ComponentDependencyRequirement'
{ $sel:dependencyType:ComponentDependencyRequirement' :: Maybe ComponentDependencyType
dependencyType =
Maybe ComponentDependencyType
forall a. Maybe a
Prelude.Nothing,
$sel:versionRequirement:ComponentDependencyRequirement' :: Maybe Text
versionRequirement = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
componentDependencyRequirement_dependencyType :: Lens.Lens' ComponentDependencyRequirement (Prelude.Maybe ComponentDependencyType)
componentDependencyRequirement_dependencyType :: (Maybe ComponentDependencyType
-> f (Maybe ComponentDependencyType))
-> ComponentDependencyRequirement
-> f ComponentDependencyRequirement
componentDependencyRequirement_dependencyType = (ComponentDependencyRequirement -> Maybe ComponentDependencyType)
-> (ComponentDependencyRequirement
-> Maybe ComponentDependencyType -> ComponentDependencyRequirement)
-> Lens
ComponentDependencyRequirement
ComponentDependencyRequirement
(Maybe ComponentDependencyType)
(Maybe ComponentDependencyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentDependencyRequirement' {Maybe ComponentDependencyType
dependencyType :: Maybe ComponentDependencyType
$sel:dependencyType:ComponentDependencyRequirement' :: ComponentDependencyRequirement -> Maybe ComponentDependencyType
dependencyType} -> Maybe ComponentDependencyType
dependencyType) (\s :: ComponentDependencyRequirement
s@ComponentDependencyRequirement' {} Maybe ComponentDependencyType
a -> ComponentDependencyRequirement
s {$sel:dependencyType:ComponentDependencyRequirement' :: Maybe ComponentDependencyType
dependencyType = Maybe ComponentDependencyType
a} :: ComponentDependencyRequirement)
componentDependencyRequirement_versionRequirement :: Lens.Lens' ComponentDependencyRequirement (Prelude.Maybe Prelude.Text)
componentDependencyRequirement_versionRequirement :: (Maybe Text -> f (Maybe Text))
-> ComponentDependencyRequirement
-> f ComponentDependencyRequirement
componentDependencyRequirement_versionRequirement = (ComponentDependencyRequirement -> Maybe Text)
-> (ComponentDependencyRequirement
-> Maybe Text -> ComponentDependencyRequirement)
-> Lens
ComponentDependencyRequirement
ComponentDependencyRequirement
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentDependencyRequirement' {Maybe Text
versionRequirement :: Maybe Text
$sel:versionRequirement:ComponentDependencyRequirement' :: ComponentDependencyRequirement -> Maybe Text
versionRequirement} -> Maybe Text
versionRequirement) (\s :: ComponentDependencyRequirement
s@ComponentDependencyRequirement' {} Maybe Text
a -> ComponentDependencyRequirement
s {$sel:versionRequirement:ComponentDependencyRequirement' :: Maybe Text
versionRequirement = Maybe Text
a} :: ComponentDependencyRequirement)
instance
Prelude.Hashable
ComponentDependencyRequirement
instance
Prelude.NFData
ComponentDependencyRequirement
instance Core.ToJSON ComponentDependencyRequirement where
toJSON :: ComponentDependencyRequirement -> Value
toJSON ComponentDependencyRequirement' {Maybe Text
Maybe ComponentDependencyType
versionRequirement :: Maybe Text
dependencyType :: Maybe ComponentDependencyType
$sel:versionRequirement:ComponentDependencyRequirement' :: ComponentDependencyRequirement -> Maybe Text
$sel:dependencyType:ComponentDependencyRequirement' :: ComponentDependencyRequirement -> Maybe ComponentDependencyType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"dependencyType" Text -> ComponentDependencyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ComponentDependencyType -> Pair)
-> Maybe ComponentDependencyType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComponentDependencyType
dependencyType,
(Text
"versionRequirement" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
versionRequirement
]
)