{-# 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.LicenseManager.Types.ReceivedMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LicenseManager.Types.AllowedOperation
import Amazonka.LicenseManager.Types.ReceivedStatus
import qualified Amazonka.Prelude as Prelude
data ReceivedMetadata = ReceivedMetadata'
{
ReceivedMetadata -> Maybe ReceivedStatus
receivedStatus :: Prelude.Maybe ReceivedStatus,
ReceivedMetadata -> Maybe (NonEmpty AllowedOperation)
allowedOperations :: Prelude.Maybe (Prelude.NonEmpty AllowedOperation),
ReceivedMetadata -> Maybe Text
receivedStatusReason :: Prelude.Maybe Prelude.Text
}
deriving (ReceivedMetadata -> ReceivedMetadata -> Bool
(ReceivedMetadata -> ReceivedMetadata -> Bool)
-> (ReceivedMetadata -> ReceivedMetadata -> Bool)
-> Eq ReceivedMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReceivedMetadata -> ReceivedMetadata -> Bool
$c/= :: ReceivedMetadata -> ReceivedMetadata -> Bool
== :: ReceivedMetadata -> ReceivedMetadata -> Bool
$c== :: ReceivedMetadata -> ReceivedMetadata -> Bool
Prelude.Eq, ReadPrec [ReceivedMetadata]
ReadPrec ReceivedMetadata
Int -> ReadS ReceivedMetadata
ReadS [ReceivedMetadata]
(Int -> ReadS ReceivedMetadata)
-> ReadS [ReceivedMetadata]
-> ReadPrec ReceivedMetadata
-> ReadPrec [ReceivedMetadata]
-> Read ReceivedMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReceivedMetadata]
$creadListPrec :: ReadPrec [ReceivedMetadata]
readPrec :: ReadPrec ReceivedMetadata
$creadPrec :: ReadPrec ReceivedMetadata
readList :: ReadS [ReceivedMetadata]
$creadList :: ReadS [ReceivedMetadata]
readsPrec :: Int -> ReadS ReceivedMetadata
$creadsPrec :: Int -> ReadS ReceivedMetadata
Prelude.Read, Int -> ReceivedMetadata -> ShowS
[ReceivedMetadata] -> ShowS
ReceivedMetadata -> String
(Int -> ReceivedMetadata -> ShowS)
-> (ReceivedMetadata -> String)
-> ([ReceivedMetadata] -> ShowS)
-> Show ReceivedMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReceivedMetadata] -> ShowS
$cshowList :: [ReceivedMetadata] -> ShowS
show :: ReceivedMetadata -> String
$cshow :: ReceivedMetadata -> String
showsPrec :: Int -> ReceivedMetadata -> ShowS
$cshowsPrec :: Int -> ReceivedMetadata -> ShowS
Prelude.Show, (forall x. ReceivedMetadata -> Rep ReceivedMetadata x)
-> (forall x. Rep ReceivedMetadata x -> ReceivedMetadata)
-> Generic ReceivedMetadata
forall x. Rep ReceivedMetadata x -> ReceivedMetadata
forall x. ReceivedMetadata -> Rep ReceivedMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReceivedMetadata x -> ReceivedMetadata
$cfrom :: forall x. ReceivedMetadata -> Rep ReceivedMetadata x
Prelude.Generic)
newReceivedMetadata ::
ReceivedMetadata
newReceivedMetadata :: ReceivedMetadata
newReceivedMetadata =
ReceivedMetadata' :: Maybe ReceivedStatus
-> Maybe (NonEmpty AllowedOperation)
-> Maybe Text
-> ReceivedMetadata
ReceivedMetadata'
{ $sel:receivedStatus:ReceivedMetadata' :: Maybe ReceivedStatus
receivedStatus = Maybe ReceivedStatus
forall a. Maybe a
Prelude.Nothing,
$sel:allowedOperations:ReceivedMetadata' :: Maybe (NonEmpty AllowedOperation)
allowedOperations = Maybe (NonEmpty AllowedOperation)
forall a. Maybe a
Prelude.Nothing,
$sel:receivedStatusReason:ReceivedMetadata' :: Maybe Text
receivedStatusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
receivedMetadata_receivedStatus :: Lens.Lens' ReceivedMetadata (Prelude.Maybe ReceivedStatus)
receivedMetadata_receivedStatus :: (Maybe ReceivedStatus -> f (Maybe ReceivedStatus))
-> ReceivedMetadata -> f ReceivedMetadata
receivedMetadata_receivedStatus = (ReceivedMetadata -> Maybe ReceivedStatus)
-> (ReceivedMetadata -> Maybe ReceivedStatus -> ReceivedMetadata)
-> Lens
ReceivedMetadata
ReceivedMetadata
(Maybe ReceivedStatus)
(Maybe ReceivedStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceivedMetadata' {Maybe ReceivedStatus
receivedStatus :: Maybe ReceivedStatus
$sel:receivedStatus:ReceivedMetadata' :: ReceivedMetadata -> Maybe ReceivedStatus
receivedStatus} -> Maybe ReceivedStatus
receivedStatus) (\s :: ReceivedMetadata
s@ReceivedMetadata' {} Maybe ReceivedStatus
a -> ReceivedMetadata
s {$sel:receivedStatus:ReceivedMetadata' :: Maybe ReceivedStatus
receivedStatus = Maybe ReceivedStatus
a} :: ReceivedMetadata)
receivedMetadata_allowedOperations :: Lens.Lens' ReceivedMetadata (Prelude.Maybe (Prelude.NonEmpty AllowedOperation))
receivedMetadata_allowedOperations :: (Maybe (NonEmpty AllowedOperation)
-> f (Maybe (NonEmpty AllowedOperation)))
-> ReceivedMetadata -> f ReceivedMetadata
receivedMetadata_allowedOperations = (ReceivedMetadata -> Maybe (NonEmpty AllowedOperation))
-> (ReceivedMetadata
-> Maybe (NonEmpty AllowedOperation) -> ReceivedMetadata)
-> Lens
ReceivedMetadata
ReceivedMetadata
(Maybe (NonEmpty AllowedOperation))
(Maybe (NonEmpty AllowedOperation))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceivedMetadata' {Maybe (NonEmpty AllowedOperation)
allowedOperations :: Maybe (NonEmpty AllowedOperation)
$sel:allowedOperations:ReceivedMetadata' :: ReceivedMetadata -> Maybe (NonEmpty AllowedOperation)
allowedOperations} -> Maybe (NonEmpty AllowedOperation)
allowedOperations) (\s :: ReceivedMetadata
s@ReceivedMetadata' {} Maybe (NonEmpty AllowedOperation)
a -> ReceivedMetadata
s {$sel:allowedOperations:ReceivedMetadata' :: Maybe (NonEmpty AllowedOperation)
allowedOperations = Maybe (NonEmpty AllowedOperation)
a} :: ReceivedMetadata) ((Maybe (NonEmpty AllowedOperation)
-> f (Maybe (NonEmpty AllowedOperation)))
-> ReceivedMetadata -> f ReceivedMetadata)
-> ((Maybe (NonEmpty AllowedOperation)
-> f (Maybe (NonEmpty AllowedOperation)))
-> Maybe (NonEmpty AllowedOperation)
-> f (Maybe (NonEmpty AllowedOperation)))
-> (Maybe (NonEmpty AllowedOperation)
-> f (Maybe (NonEmpty AllowedOperation)))
-> ReceivedMetadata
-> f ReceivedMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty AllowedOperation)
(NonEmpty AllowedOperation)
(NonEmpty AllowedOperation)
(NonEmpty AllowedOperation)
-> Iso
(Maybe (NonEmpty AllowedOperation))
(Maybe (NonEmpty AllowedOperation))
(Maybe (NonEmpty AllowedOperation))
(Maybe (NonEmpty AllowedOperation))
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
(NonEmpty AllowedOperation)
(NonEmpty AllowedOperation)
(NonEmpty AllowedOperation)
(NonEmpty AllowedOperation)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
receivedMetadata_receivedStatusReason :: Lens.Lens' ReceivedMetadata (Prelude.Maybe Prelude.Text)
receivedMetadata_receivedStatusReason :: (Maybe Text -> f (Maybe Text))
-> ReceivedMetadata -> f ReceivedMetadata
receivedMetadata_receivedStatusReason = (ReceivedMetadata -> Maybe Text)
-> (ReceivedMetadata -> Maybe Text -> ReceivedMetadata)
-> Lens ReceivedMetadata ReceivedMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceivedMetadata' {Maybe Text
receivedStatusReason :: Maybe Text
$sel:receivedStatusReason:ReceivedMetadata' :: ReceivedMetadata -> Maybe Text
receivedStatusReason} -> Maybe Text
receivedStatusReason) (\s :: ReceivedMetadata
s@ReceivedMetadata' {} Maybe Text
a -> ReceivedMetadata
s {$sel:receivedStatusReason:ReceivedMetadata' :: Maybe Text
receivedStatusReason = Maybe Text
a} :: ReceivedMetadata)
instance Core.FromJSON ReceivedMetadata where
parseJSON :: Value -> Parser ReceivedMetadata
parseJSON =
String
-> (Object -> Parser ReceivedMetadata)
-> Value
-> Parser ReceivedMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReceivedMetadata"
( \Object
x ->
Maybe ReceivedStatus
-> Maybe (NonEmpty AllowedOperation)
-> Maybe Text
-> ReceivedMetadata
ReceivedMetadata'
(Maybe ReceivedStatus
-> Maybe (NonEmpty AllowedOperation)
-> Maybe Text
-> ReceivedMetadata)
-> Parser (Maybe ReceivedStatus)
-> Parser
(Maybe (NonEmpty AllowedOperation)
-> Maybe Text -> ReceivedMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ReceivedStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReceivedStatus")
Parser
(Maybe (NonEmpty AllowedOperation)
-> Maybe Text -> ReceivedMetadata)
-> Parser (Maybe (NonEmpty AllowedOperation))
-> Parser (Maybe Text -> ReceivedMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty AllowedOperation))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AllowedOperations")
Parser (Maybe Text -> ReceivedMetadata)
-> Parser (Maybe Text) -> Parser ReceivedMetadata
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
"ReceivedStatusReason")
)
instance Prelude.Hashable ReceivedMetadata
instance Prelude.NFData ReceivedMetadata