{-# 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.TaxDocuments where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Snowball.Types.INDTaxDocuments
data TaxDocuments = TaxDocuments'
{ TaxDocuments -> Maybe INDTaxDocuments
ind :: Prelude.Maybe INDTaxDocuments
}
deriving (TaxDocuments -> TaxDocuments -> Bool
(TaxDocuments -> TaxDocuments -> Bool)
-> (TaxDocuments -> TaxDocuments -> Bool) -> Eq TaxDocuments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaxDocuments -> TaxDocuments -> Bool
$c/= :: TaxDocuments -> TaxDocuments -> Bool
== :: TaxDocuments -> TaxDocuments -> Bool
$c== :: TaxDocuments -> TaxDocuments -> Bool
Prelude.Eq, ReadPrec [TaxDocuments]
ReadPrec TaxDocuments
Int -> ReadS TaxDocuments
ReadS [TaxDocuments]
(Int -> ReadS TaxDocuments)
-> ReadS [TaxDocuments]
-> ReadPrec TaxDocuments
-> ReadPrec [TaxDocuments]
-> Read TaxDocuments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaxDocuments]
$creadListPrec :: ReadPrec [TaxDocuments]
readPrec :: ReadPrec TaxDocuments
$creadPrec :: ReadPrec TaxDocuments
readList :: ReadS [TaxDocuments]
$creadList :: ReadS [TaxDocuments]
readsPrec :: Int -> ReadS TaxDocuments
$creadsPrec :: Int -> ReadS TaxDocuments
Prelude.Read, Int -> TaxDocuments -> ShowS
[TaxDocuments] -> ShowS
TaxDocuments -> String
(Int -> TaxDocuments -> ShowS)
-> (TaxDocuments -> String)
-> ([TaxDocuments] -> ShowS)
-> Show TaxDocuments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaxDocuments] -> ShowS
$cshowList :: [TaxDocuments] -> ShowS
show :: TaxDocuments -> String
$cshow :: TaxDocuments -> String
showsPrec :: Int -> TaxDocuments -> ShowS
$cshowsPrec :: Int -> TaxDocuments -> ShowS
Prelude.Show, (forall x. TaxDocuments -> Rep TaxDocuments x)
-> (forall x. Rep TaxDocuments x -> TaxDocuments)
-> Generic TaxDocuments
forall x. Rep TaxDocuments x -> TaxDocuments
forall x. TaxDocuments -> Rep TaxDocuments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TaxDocuments x -> TaxDocuments
$cfrom :: forall x. TaxDocuments -> Rep TaxDocuments x
Prelude.Generic)
newTaxDocuments ::
TaxDocuments
newTaxDocuments :: TaxDocuments
newTaxDocuments =
TaxDocuments' :: Maybe INDTaxDocuments -> TaxDocuments
TaxDocuments' {$sel:ind:TaxDocuments' :: Maybe INDTaxDocuments
ind = Maybe INDTaxDocuments
forall a. Maybe a
Prelude.Nothing}
taxDocuments_ind :: Lens.Lens' TaxDocuments (Prelude.Maybe INDTaxDocuments)
taxDocuments_ind :: (Maybe INDTaxDocuments -> f (Maybe INDTaxDocuments))
-> TaxDocuments -> f TaxDocuments
taxDocuments_ind = (TaxDocuments -> Maybe INDTaxDocuments)
-> (TaxDocuments -> Maybe INDTaxDocuments -> TaxDocuments)
-> Lens
TaxDocuments
TaxDocuments
(Maybe INDTaxDocuments)
(Maybe INDTaxDocuments)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaxDocuments' {Maybe INDTaxDocuments
ind :: Maybe INDTaxDocuments
$sel:ind:TaxDocuments' :: TaxDocuments -> Maybe INDTaxDocuments
ind} -> Maybe INDTaxDocuments
ind) (\s :: TaxDocuments
s@TaxDocuments' {} Maybe INDTaxDocuments
a -> TaxDocuments
s {$sel:ind:TaxDocuments' :: Maybe INDTaxDocuments
ind = Maybe INDTaxDocuments
a} :: TaxDocuments)
instance Core.FromJSON TaxDocuments where
parseJSON :: Value -> Parser TaxDocuments
parseJSON =
String
-> (Object -> Parser TaxDocuments) -> Value -> Parser TaxDocuments
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TaxDocuments"
(\Object
x -> Maybe INDTaxDocuments -> TaxDocuments
TaxDocuments' (Maybe INDTaxDocuments -> TaxDocuments)
-> Parser (Maybe INDTaxDocuments) -> Parser TaxDocuments
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe INDTaxDocuments)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IND"))
instance Prelude.Hashable TaxDocuments
instance Prelude.NFData TaxDocuments
instance Core.ToJSON TaxDocuments where
toJSON :: TaxDocuments -> Value
toJSON TaxDocuments' {Maybe INDTaxDocuments
ind :: Maybe INDTaxDocuments
$sel:ind:TaxDocuments' :: TaxDocuments -> Maybe INDTaxDocuments
..} =
[Pair] -> Value
Core.object
([Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [(Text
"IND" Text -> INDTaxDocuments -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (INDTaxDocuments -> Pair) -> Maybe INDTaxDocuments -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe INDTaxDocuments
ind])