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