{-# 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.Chime.Types.PhoneNumberOrder where
import Amazonka.Chime.Types.OrderedPhoneNumber
import Amazonka.Chime.Types.PhoneNumberOrderStatus
import Amazonka.Chime.Types.PhoneNumberProductType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PhoneNumberOrder = PhoneNumberOrder'
{
PhoneNumberOrder -> Maybe PhoneNumberOrderStatus
status :: Prelude.Maybe PhoneNumberOrderStatus,
PhoneNumberOrder -> Maybe [OrderedPhoneNumber]
orderedPhoneNumbers :: Prelude.Maybe [OrderedPhoneNumber],
PhoneNumberOrder -> Maybe POSIX
updatedTimestamp :: Prelude.Maybe Core.POSIX,
PhoneNumberOrder -> Maybe PhoneNumberProductType
productType :: Prelude.Maybe PhoneNumberProductType,
PhoneNumberOrder -> Maybe Text
phoneNumberOrderId :: Prelude.Maybe Prelude.Text,
PhoneNumberOrder -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX
}
deriving (PhoneNumberOrder -> PhoneNumberOrder -> Bool
(PhoneNumberOrder -> PhoneNumberOrder -> Bool)
-> (PhoneNumberOrder -> PhoneNumberOrder -> Bool)
-> Eq PhoneNumberOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhoneNumberOrder -> PhoneNumberOrder -> Bool
$c/= :: PhoneNumberOrder -> PhoneNumberOrder -> Bool
== :: PhoneNumberOrder -> PhoneNumberOrder -> Bool
$c== :: PhoneNumberOrder -> PhoneNumberOrder -> Bool
Prelude.Eq, Int -> PhoneNumberOrder -> ShowS
[PhoneNumberOrder] -> ShowS
PhoneNumberOrder -> String
(Int -> PhoneNumberOrder -> ShowS)
-> (PhoneNumberOrder -> String)
-> ([PhoneNumberOrder] -> ShowS)
-> Show PhoneNumberOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhoneNumberOrder] -> ShowS
$cshowList :: [PhoneNumberOrder] -> ShowS
show :: PhoneNumberOrder -> String
$cshow :: PhoneNumberOrder -> String
showsPrec :: Int -> PhoneNumberOrder -> ShowS
$cshowsPrec :: Int -> PhoneNumberOrder -> ShowS
Prelude.Show, (forall x. PhoneNumberOrder -> Rep PhoneNumberOrder x)
-> (forall x. Rep PhoneNumberOrder x -> PhoneNumberOrder)
-> Generic PhoneNumberOrder
forall x. Rep PhoneNumberOrder x -> PhoneNumberOrder
forall x. PhoneNumberOrder -> Rep PhoneNumberOrder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhoneNumberOrder x -> PhoneNumberOrder
$cfrom :: forall x. PhoneNumberOrder -> Rep PhoneNumberOrder x
Prelude.Generic)
newPhoneNumberOrder ::
PhoneNumberOrder
newPhoneNumberOrder :: PhoneNumberOrder
newPhoneNumberOrder =
PhoneNumberOrder' :: Maybe PhoneNumberOrderStatus
-> Maybe [OrderedPhoneNumber]
-> Maybe POSIX
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe POSIX
-> PhoneNumberOrder
PhoneNumberOrder'
{ $sel:status:PhoneNumberOrder' :: Maybe PhoneNumberOrderStatus
status = Maybe PhoneNumberOrderStatus
forall a. Maybe a
Prelude.Nothing,
$sel:orderedPhoneNumbers:PhoneNumberOrder' :: Maybe [OrderedPhoneNumber]
orderedPhoneNumbers = Maybe [OrderedPhoneNumber]
forall a. Maybe a
Prelude.Nothing,
$sel:updatedTimestamp:PhoneNumberOrder' :: Maybe POSIX
updatedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:productType:PhoneNumberOrder' :: Maybe PhoneNumberProductType
productType = Maybe PhoneNumberProductType
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumberOrderId:PhoneNumberOrder' :: Maybe Text
phoneNumberOrderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:PhoneNumberOrder' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
phoneNumberOrder_status :: Lens.Lens' PhoneNumberOrder (Prelude.Maybe PhoneNumberOrderStatus)
phoneNumberOrder_status :: (Maybe PhoneNumberOrderStatus -> f (Maybe PhoneNumberOrderStatus))
-> PhoneNumberOrder -> f PhoneNumberOrder
phoneNumberOrder_status = (PhoneNumberOrder -> Maybe PhoneNumberOrderStatus)
-> (PhoneNumberOrder
-> Maybe PhoneNumberOrderStatus -> PhoneNumberOrder)
-> Lens
PhoneNumberOrder
PhoneNumberOrder
(Maybe PhoneNumberOrderStatus)
(Maybe PhoneNumberOrderStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberOrder' {Maybe PhoneNumberOrderStatus
status :: Maybe PhoneNumberOrderStatus
$sel:status:PhoneNumberOrder' :: PhoneNumberOrder -> Maybe PhoneNumberOrderStatus
status} -> Maybe PhoneNumberOrderStatus
status) (\s :: PhoneNumberOrder
s@PhoneNumberOrder' {} Maybe PhoneNumberOrderStatus
a -> PhoneNumberOrder
s {$sel:status:PhoneNumberOrder' :: Maybe PhoneNumberOrderStatus
status = Maybe PhoneNumberOrderStatus
a} :: PhoneNumberOrder)
phoneNumberOrder_orderedPhoneNumbers :: Lens.Lens' PhoneNumberOrder (Prelude.Maybe [OrderedPhoneNumber])
phoneNumberOrder_orderedPhoneNumbers :: (Maybe [OrderedPhoneNumber] -> f (Maybe [OrderedPhoneNumber]))
-> PhoneNumberOrder -> f PhoneNumberOrder
phoneNumberOrder_orderedPhoneNumbers = (PhoneNumberOrder -> Maybe [OrderedPhoneNumber])
-> (PhoneNumberOrder
-> Maybe [OrderedPhoneNumber] -> PhoneNumberOrder)
-> Lens
PhoneNumberOrder
PhoneNumberOrder
(Maybe [OrderedPhoneNumber])
(Maybe [OrderedPhoneNumber])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberOrder' {Maybe [OrderedPhoneNumber]
orderedPhoneNumbers :: Maybe [OrderedPhoneNumber]
$sel:orderedPhoneNumbers:PhoneNumberOrder' :: PhoneNumberOrder -> Maybe [OrderedPhoneNumber]
orderedPhoneNumbers} -> Maybe [OrderedPhoneNumber]
orderedPhoneNumbers) (\s :: PhoneNumberOrder
s@PhoneNumberOrder' {} Maybe [OrderedPhoneNumber]
a -> PhoneNumberOrder
s {$sel:orderedPhoneNumbers:PhoneNumberOrder' :: Maybe [OrderedPhoneNumber]
orderedPhoneNumbers = Maybe [OrderedPhoneNumber]
a} :: PhoneNumberOrder) ((Maybe [OrderedPhoneNumber] -> f (Maybe [OrderedPhoneNumber]))
-> PhoneNumberOrder -> f PhoneNumberOrder)
-> ((Maybe [OrderedPhoneNumber] -> f (Maybe [OrderedPhoneNumber]))
-> Maybe [OrderedPhoneNumber] -> f (Maybe [OrderedPhoneNumber]))
-> (Maybe [OrderedPhoneNumber] -> f (Maybe [OrderedPhoneNumber]))
-> PhoneNumberOrder
-> f PhoneNumberOrder
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[OrderedPhoneNumber]
[OrderedPhoneNumber]
[OrderedPhoneNumber]
[OrderedPhoneNumber]
-> Iso
(Maybe [OrderedPhoneNumber])
(Maybe [OrderedPhoneNumber])
(Maybe [OrderedPhoneNumber])
(Maybe [OrderedPhoneNumber])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[OrderedPhoneNumber]
[OrderedPhoneNumber]
[OrderedPhoneNumber]
[OrderedPhoneNumber]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
phoneNumberOrder_updatedTimestamp :: Lens.Lens' PhoneNumberOrder (Prelude.Maybe Prelude.UTCTime)
phoneNumberOrder_updatedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PhoneNumberOrder -> f PhoneNumberOrder
phoneNumberOrder_updatedTimestamp = (PhoneNumberOrder -> Maybe POSIX)
-> (PhoneNumberOrder -> Maybe POSIX -> PhoneNumberOrder)
-> Lens
PhoneNumberOrder PhoneNumberOrder (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberOrder' {Maybe POSIX
updatedTimestamp :: Maybe POSIX
$sel:updatedTimestamp:PhoneNumberOrder' :: PhoneNumberOrder -> Maybe POSIX
updatedTimestamp} -> Maybe POSIX
updatedTimestamp) (\s :: PhoneNumberOrder
s@PhoneNumberOrder' {} Maybe POSIX
a -> PhoneNumberOrder
s {$sel:updatedTimestamp:PhoneNumberOrder' :: Maybe POSIX
updatedTimestamp = Maybe POSIX
a} :: PhoneNumberOrder) ((Maybe POSIX -> f (Maybe POSIX))
-> PhoneNumberOrder -> f PhoneNumberOrder)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PhoneNumberOrder
-> f PhoneNumberOrder
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
phoneNumberOrder_productType :: Lens.Lens' PhoneNumberOrder (Prelude.Maybe PhoneNumberProductType)
phoneNumberOrder_productType :: (Maybe PhoneNumberProductType -> f (Maybe PhoneNumberProductType))
-> PhoneNumberOrder -> f PhoneNumberOrder
phoneNumberOrder_productType = (PhoneNumberOrder -> Maybe PhoneNumberProductType)
-> (PhoneNumberOrder
-> Maybe PhoneNumberProductType -> PhoneNumberOrder)
-> Lens
PhoneNumberOrder
PhoneNumberOrder
(Maybe PhoneNumberProductType)
(Maybe PhoneNumberProductType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberOrder' {Maybe PhoneNumberProductType
productType :: Maybe PhoneNumberProductType
$sel:productType:PhoneNumberOrder' :: PhoneNumberOrder -> Maybe PhoneNumberProductType
productType} -> Maybe PhoneNumberProductType
productType) (\s :: PhoneNumberOrder
s@PhoneNumberOrder' {} Maybe PhoneNumberProductType
a -> PhoneNumberOrder
s {$sel:productType:PhoneNumberOrder' :: Maybe PhoneNumberProductType
productType = Maybe PhoneNumberProductType
a} :: PhoneNumberOrder)
phoneNumberOrder_phoneNumberOrderId :: Lens.Lens' PhoneNumberOrder (Prelude.Maybe Prelude.Text)
phoneNumberOrder_phoneNumberOrderId :: (Maybe Text -> f (Maybe Text))
-> PhoneNumberOrder -> f PhoneNumberOrder
phoneNumberOrder_phoneNumberOrderId = (PhoneNumberOrder -> Maybe Text)
-> (PhoneNumberOrder -> Maybe Text -> PhoneNumberOrder)
-> Lens PhoneNumberOrder PhoneNumberOrder (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberOrder' {Maybe Text
phoneNumberOrderId :: Maybe Text
$sel:phoneNumberOrderId:PhoneNumberOrder' :: PhoneNumberOrder -> Maybe Text
phoneNumberOrderId} -> Maybe Text
phoneNumberOrderId) (\s :: PhoneNumberOrder
s@PhoneNumberOrder' {} Maybe Text
a -> PhoneNumberOrder
s {$sel:phoneNumberOrderId:PhoneNumberOrder' :: Maybe Text
phoneNumberOrderId = Maybe Text
a} :: PhoneNumberOrder)
phoneNumberOrder_createdTimestamp :: Lens.Lens' PhoneNumberOrder (Prelude.Maybe Prelude.UTCTime)
phoneNumberOrder_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PhoneNumberOrder -> f PhoneNumberOrder
phoneNumberOrder_createdTimestamp = (PhoneNumberOrder -> Maybe POSIX)
-> (PhoneNumberOrder -> Maybe POSIX -> PhoneNumberOrder)
-> Lens
PhoneNumberOrder PhoneNumberOrder (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberOrder' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:PhoneNumberOrder' :: PhoneNumberOrder -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: PhoneNumberOrder
s@PhoneNumberOrder' {} Maybe POSIX
a -> PhoneNumberOrder
s {$sel:createdTimestamp:PhoneNumberOrder' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: PhoneNumberOrder) ((Maybe POSIX -> f (Maybe POSIX))
-> PhoneNumberOrder -> f PhoneNumberOrder)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PhoneNumberOrder
-> f PhoneNumberOrder
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON PhoneNumberOrder where
parseJSON :: Value -> Parser PhoneNumberOrder
parseJSON =
String
-> (Object -> Parser PhoneNumberOrder)
-> Value
-> Parser PhoneNumberOrder
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PhoneNumberOrder"
( \Object
x ->
Maybe PhoneNumberOrderStatus
-> Maybe [OrderedPhoneNumber]
-> Maybe POSIX
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe POSIX
-> PhoneNumberOrder
PhoneNumberOrder'
(Maybe PhoneNumberOrderStatus
-> Maybe [OrderedPhoneNumber]
-> Maybe POSIX
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe POSIX
-> PhoneNumberOrder)
-> Parser (Maybe PhoneNumberOrderStatus)
-> Parser
(Maybe [OrderedPhoneNumber]
-> Maybe POSIX
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe POSIX
-> PhoneNumberOrder)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PhoneNumberOrderStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe [OrderedPhoneNumber]
-> Maybe POSIX
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe POSIX
-> PhoneNumberOrder)
-> Parser (Maybe [OrderedPhoneNumber])
-> Parser
(Maybe POSIX
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe POSIX
-> PhoneNumberOrder)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [OrderedPhoneNumber]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OrderedPhoneNumbers"
Parser (Maybe (Maybe [OrderedPhoneNumber]))
-> Maybe [OrderedPhoneNumber]
-> Parser (Maybe [OrderedPhoneNumber])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [OrderedPhoneNumber]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe POSIX
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe POSIX
-> PhoneNumberOrder)
-> Parser (Maybe POSIX)
-> Parser
(Maybe PhoneNumberProductType
-> Maybe Text -> Maybe POSIX -> PhoneNumberOrder)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpdatedTimestamp")
Parser
(Maybe PhoneNumberProductType
-> Maybe Text -> Maybe POSIX -> PhoneNumberOrder)
-> Parser (Maybe PhoneNumberProductType)
-> Parser (Maybe Text -> Maybe POSIX -> PhoneNumberOrder)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PhoneNumberProductType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProductType")
Parser (Maybe Text -> Maybe POSIX -> PhoneNumberOrder)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> PhoneNumberOrder)
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
"PhoneNumberOrderId")
Parser (Maybe POSIX -> PhoneNumberOrder)
-> Parser (Maybe POSIX) -> Parser PhoneNumberOrder
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTimestamp")
)
instance Prelude.Hashable PhoneNumberOrder
instance Prelude.NFData PhoneNumberOrder