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