{-# 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.ServiceCatalog.Types.UsageInstruction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UsageInstruction = UsageInstruction'
{
UsageInstruction -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
UsageInstruction -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (UsageInstruction -> UsageInstruction -> Bool
(UsageInstruction -> UsageInstruction -> Bool)
-> (UsageInstruction -> UsageInstruction -> Bool)
-> Eq UsageInstruction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UsageInstruction -> UsageInstruction -> Bool
$c/= :: UsageInstruction -> UsageInstruction -> Bool
== :: UsageInstruction -> UsageInstruction -> Bool
$c== :: UsageInstruction -> UsageInstruction -> Bool
Prelude.Eq, ReadPrec [UsageInstruction]
ReadPrec UsageInstruction
Int -> ReadS UsageInstruction
ReadS [UsageInstruction]
(Int -> ReadS UsageInstruction)
-> ReadS [UsageInstruction]
-> ReadPrec UsageInstruction
-> ReadPrec [UsageInstruction]
-> Read UsageInstruction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UsageInstruction]
$creadListPrec :: ReadPrec [UsageInstruction]
readPrec :: ReadPrec UsageInstruction
$creadPrec :: ReadPrec UsageInstruction
readList :: ReadS [UsageInstruction]
$creadList :: ReadS [UsageInstruction]
readsPrec :: Int -> ReadS UsageInstruction
$creadsPrec :: Int -> ReadS UsageInstruction
Prelude.Read, Int -> UsageInstruction -> ShowS
[UsageInstruction] -> ShowS
UsageInstruction -> String
(Int -> UsageInstruction -> ShowS)
-> (UsageInstruction -> String)
-> ([UsageInstruction] -> ShowS)
-> Show UsageInstruction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UsageInstruction] -> ShowS
$cshowList :: [UsageInstruction] -> ShowS
show :: UsageInstruction -> String
$cshow :: UsageInstruction -> String
showsPrec :: Int -> UsageInstruction -> ShowS
$cshowsPrec :: Int -> UsageInstruction -> ShowS
Prelude.Show, (forall x. UsageInstruction -> Rep UsageInstruction x)
-> (forall x. Rep UsageInstruction x -> UsageInstruction)
-> Generic UsageInstruction
forall x. Rep UsageInstruction x -> UsageInstruction
forall x. UsageInstruction -> Rep UsageInstruction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UsageInstruction x -> UsageInstruction
$cfrom :: forall x. UsageInstruction -> Rep UsageInstruction x
Prelude.Generic)
newUsageInstruction ::
UsageInstruction
newUsageInstruction :: UsageInstruction
newUsageInstruction =
UsageInstruction' :: Maybe Text -> Maybe Text -> UsageInstruction
UsageInstruction'
{ $sel:value:UsageInstruction' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':UsageInstruction' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
usageInstruction_value :: Lens.Lens' UsageInstruction (Prelude.Maybe Prelude.Text)
usageInstruction_value :: (Maybe Text -> f (Maybe Text))
-> UsageInstruction -> f UsageInstruction
usageInstruction_value = (UsageInstruction -> Maybe Text)
-> (UsageInstruction -> Maybe Text -> UsageInstruction)
-> Lens UsageInstruction UsageInstruction (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageInstruction' {Maybe Text
value :: Maybe Text
$sel:value:UsageInstruction' :: UsageInstruction -> Maybe Text
value} -> Maybe Text
value) (\s :: UsageInstruction
s@UsageInstruction' {} Maybe Text
a -> UsageInstruction
s {$sel:value:UsageInstruction' :: Maybe Text
value = Maybe Text
a} :: UsageInstruction)
usageInstruction_type :: Lens.Lens' UsageInstruction (Prelude.Maybe Prelude.Text)
usageInstruction_type :: (Maybe Text -> f (Maybe Text))
-> UsageInstruction -> f UsageInstruction
usageInstruction_type = (UsageInstruction -> Maybe Text)
-> (UsageInstruction -> Maybe Text -> UsageInstruction)
-> Lens UsageInstruction UsageInstruction (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageInstruction' {Maybe Text
type' :: Maybe Text
$sel:type':UsageInstruction' :: UsageInstruction -> Maybe Text
type'} -> Maybe Text
type') (\s :: UsageInstruction
s@UsageInstruction' {} Maybe Text
a -> UsageInstruction
s {$sel:type':UsageInstruction' :: Maybe Text
type' = Maybe Text
a} :: UsageInstruction)
instance Core.FromJSON UsageInstruction where
parseJSON :: Value -> Parser UsageInstruction
parseJSON =
String
-> (Object -> Parser UsageInstruction)
-> Value
-> Parser UsageInstruction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UsageInstruction"
( \Object
x ->
Maybe Text -> Maybe Text -> UsageInstruction
UsageInstruction'
(Maybe Text -> Maybe Text -> UsageInstruction)
-> Parser (Maybe Text) -> Parser (Maybe Text -> UsageInstruction)
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
"Value") Parser (Maybe Text -> UsageInstruction)
-> Parser (Maybe Text) -> Parser UsageInstruction
forall (f :: * -> *) a b. Applicative f => 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
"Type")
)
instance Prelude.Hashable UsageInstruction
instance Prelude.NFData UsageInstruction