{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data UsageInstruction = UsageInstruction'
{
UsageInstruction -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
UsageInstruction -> Maybe Text
value :: Prelude.Maybe Prelude.Text
}
deriving (UsageInstruction -> UsageInstruction -> Bool
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]
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
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. 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'
{ $sel:type':UsageInstruction' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing,
$sel:value:UsageInstruction' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
}
usageInstruction_type :: Lens.Lens' UsageInstruction (Prelude.Maybe Prelude.Text)
usageInstruction_type :: Lens' UsageInstruction (Maybe Text)
usageInstruction_type = 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)
usageInstruction_value :: Lens.Lens' UsageInstruction (Prelude.Maybe Prelude.Text)
usageInstruction_value :: Lens' UsageInstruction (Maybe Text)
usageInstruction_value = 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)
instance Data.FromJSON UsageInstruction where
parseJSON :: Value -> Parser UsageInstruction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UsageInstruction"
( \Object
x ->
Maybe Text -> Maybe Text -> UsageInstruction
UsageInstruction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Value")
)
instance Prelude.Hashable UsageInstruction where
hashWithSalt :: Int -> UsageInstruction -> Int
hashWithSalt Int
_salt UsageInstruction' {Maybe Text
value :: Maybe Text
type' :: Maybe Text
$sel:value:UsageInstruction' :: UsageInstruction -> Maybe Text
$sel:type':UsageInstruction' :: UsageInstruction -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
instance Prelude.NFData UsageInstruction where
rnf :: UsageInstruction -> ()
rnf UsageInstruction' {Maybe Text
value :: Maybe Text
type' :: Maybe Text
$sel:value:UsageInstruction' :: UsageInstruction -> Maybe Text
$sel:type':UsageInstruction' :: UsageInstruction -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value