{-# 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.WorkDocs.Types.UploadMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UploadMetadata = UploadMetadata'
{
UploadMetadata -> Maybe (Sensitive Text)
uploadUrl :: Prelude.Maybe (Core.Sensitive Prelude.Text),
:: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (UploadMetadata -> UploadMetadata -> Bool
(UploadMetadata -> UploadMetadata -> Bool)
-> (UploadMetadata -> UploadMetadata -> Bool) -> Eq UploadMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadMetadata -> UploadMetadata -> Bool
$c/= :: UploadMetadata -> UploadMetadata -> Bool
== :: UploadMetadata -> UploadMetadata -> Bool
$c== :: UploadMetadata -> UploadMetadata -> Bool
Prelude.Eq, Int -> UploadMetadata -> ShowS
[UploadMetadata] -> ShowS
UploadMetadata -> String
(Int -> UploadMetadata -> ShowS)
-> (UploadMetadata -> String)
-> ([UploadMetadata] -> ShowS)
-> Show UploadMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadMetadata] -> ShowS
$cshowList :: [UploadMetadata] -> ShowS
show :: UploadMetadata -> String
$cshow :: UploadMetadata -> String
showsPrec :: Int -> UploadMetadata -> ShowS
$cshowsPrec :: Int -> UploadMetadata -> ShowS
Prelude.Show, (forall x. UploadMetadata -> Rep UploadMetadata x)
-> (forall x. Rep UploadMetadata x -> UploadMetadata)
-> Generic UploadMetadata
forall x. Rep UploadMetadata x -> UploadMetadata
forall x. UploadMetadata -> Rep UploadMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadMetadata x -> UploadMetadata
$cfrom :: forall x. UploadMetadata -> Rep UploadMetadata x
Prelude.Generic)
newUploadMetadata ::
UploadMetadata
newUploadMetadata :: UploadMetadata
newUploadMetadata =
UploadMetadata' :: Maybe (Sensitive Text)
-> Maybe (HashMap Text Text) -> UploadMetadata
UploadMetadata'
{ $sel:uploadUrl:UploadMetadata' :: Maybe (Sensitive Text)
uploadUrl = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:signedHeaders:UploadMetadata' :: Maybe (HashMap Text Text)
signedHeaders = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
uploadMetadata_uploadUrl :: Lens.Lens' UploadMetadata (Prelude.Maybe Prelude.Text)
uploadMetadata_uploadUrl :: (Maybe Text -> f (Maybe Text))
-> UploadMetadata -> f UploadMetadata
uploadMetadata_uploadUrl = (UploadMetadata -> Maybe (Sensitive Text))
-> (UploadMetadata -> Maybe (Sensitive Text) -> UploadMetadata)
-> Lens
UploadMetadata
UploadMetadata
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadMetadata' {Maybe (Sensitive Text)
uploadUrl :: Maybe (Sensitive Text)
$sel:uploadUrl:UploadMetadata' :: UploadMetadata -> Maybe (Sensitive Text)
uploadUrl} -> Maybe (Sensitive Text)
uploadUrl) (\s :: UploadMetadata
s@UploadMetadata' {} Maybe (Sensitive Text)
a -> UploadMetadata
s {$sel:uploadUrl:UploadMetadata' :: Maybe (Sensitive Text)
uploadUrl = Maybe (Sensitive Text)
a} :: UploadMetadata) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> UploadMetadata -> f UploadMetadata)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UploadMetadata
-> f UploadMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
uploadMetadata_signedHeaders :: Lens.Lens' UploadMetadata (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
= (UploadMetadata -> Maybe (HashMap Text Text))
-> (UploadMetadata -> Maybe (HashMap Text Text) -> UploadMetadata)
-> Lens
UploadMetadata
UploadMetadata
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadMetadata' {Maybe (HashMap Text Text)
signedHeaders :: Maybe (HashMap Text Text)
$sel:signedHeaders:UploadMetadata' :: UploadMetadata -> Maybe (HashMap Text Text)
signedHeaders} -> Maybe (HashMap Text Text)
signedHeaders) (\s :: UploadMetadata
s@UploadMetadata' {} Maybe (HashMap Text Text)
a -> UploadMetadata
s {$sel:signedHeaders:UploadMetadata' :: Maybe (HashMap Text Text)
signedHeaders = Maybe (HashMap Text Text)
a} :: UploadMetadata) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UploadMetadata -> f UploadMetadata)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UploadMetadata
-> f UploadMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON UploadMetadata where
parseJSON :: Value -> Parser UploadMetadata
parseJSON =
String
-> (Object -> Parser UploadMetadata)
-> Value
-> Parser UploadMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UploadMetadata"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe (HashMap Text Text) -> UploadMetadata
UploadMetadata'
(Maybe (Sensitive Text)
-> Maybe (HashMap Text Text) -> UploadMetadata)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe (HashMap Text Text) -> UploadMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UploadUrl")
Parser (Maybe (HashMap Text Text) -> UploadMetadata)
-> Parser (Maybe (HashMap Text Text)) -> Parser UploadMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SignedHeaders" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable UploadMetadata
instance Prelude.NFData UploadMetadata