{-# 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.ConnectParticipant.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 Text
urlExpiry :: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UploadMetadata -> Maybe Text
url :: Prelude.Maybe 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, ReadPrec [UploadMetadata]
ReadPrec UploadMetadata
Int -> ReadS UploadMetadata
ReadS [UploadMetadata]
(Int -> ReadS UploadMetadata)
-> ReadS [UploadMetadata]
-> ReadPrec UploadMetadata
-> ReadPrec [UploadMetadata]
-> Read UploadMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadMetadata]
$creadListPrec :: ReadPrec [UploadMetadata]
readPrec :: ReadPrec UploadMetadata
$creadPrec :: ReadPrec UploadMetadata
readList :: ReadS [UploadMetadata]
$creadList :: ReadS [UploadMetadata]
readsPrec :: Int -> ReadS UploadMetadata
$creadsPrec :: Int -> ReadS UploadMetadata
Prelude.Read, 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 Text
-> Maybe (HashMap Text Text) -> Maybe Text -> UploadMetadata
UploadMetadata'
{ $sel:urlExpiry:UploadMetadata' :: Maybe Text
urlExpiry = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:headersToInclude:UploadMetadata' :: Maybe (HashMap Text Text)
headersToInclude = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:url:UploadMetadata' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
uploadMetadata_urlExpiry :: Lens.Lens' UploadMetadata (Prelude.Maybe Prelude.Text)
uploadMetadata_urlExpiry :: (Maybe Text -> f (Maybe Text))
-> UploadMetadata -> f UploadMetadata
uploadMetadata_urlExpiry = (UploadMetadata -> Maybe Text)
-> (UploadMetadata -> Maybe Text -> UploadMetadata)
-> Lens UploadMetadata UploadMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadMetadata' {Maybe Text
urlExpiry :: Maybe Text
$sel:urlExpiry:UploadMetadata' :: UploadMetadata -> Maybe Text
urlExpiry} -> Maybe Text
urlExpiry) (\s :: UploadMetadata
s@UploadMetadata' {} Maybe Text
a -> UploadMetadata
s {$sel:urlExpiry:UploadMetadata' :: Maybe Text
urlExpiry = Maybe Text
a} :: UploadMetadata)
uploadMetadata_headersToInclude :: 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)
headersToInclude :: Maybe (HashMap Text Text)
$sel:headersToInclude:UploadMetadata' :: UploadMetadata -> Maybe (HashMap Text Text)
headersToInclude} -> Maybe (HashMap Text Text)
headersToInclude) (\s :: UploadMetadata
s@UploadMetadata' {} Maybe (HashMap Text Text)
a -> UploadMetadata
s {$sel:headersToInclude:UploadMetadata' :: Maybe (HashMap Text Text)
headersToInclude = 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
uploadMetadata_url :: Lens.Lens' UploadMetadata (Prelude.Maybe Prelude.Text)
uploadMetadata_url :: (Maybe Text -> f (Maybe Text))
-> UploadMetadata -> f UploadMetadata
uploadMetadata_url = (UploadMetadata -> Maybe Text)
-> (UploadMetadata -> Maybe Text -> UploadMetadata)
-> Lens UploadMetadata UploadMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadMetadata' {Maybe Text
url :: Maybe Text
$sel:url:UploadMetadata' :: UploadMetadata -> Maybe Text
url} -> Maybe Text
url) (\s :: UploadMetadata
s@UploadMetadata' {} Maybe Text
a -> UploadMetadata
s {$sel:url:UploadMetadata' :: Maybe Text
url = Maybe Text
a} :: UploadMetadata)
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 Text
-> Maybe (HashMap Text Text) -> Maybe Text -> UploadMetadata
UploadMetadata'
(Maybe Text
-> Maybe (HashMap Text Text) -> Maybe Text -> UploadMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text) -> Maybe Text -> UploadMetadata)
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
"UrlExpiry")
Parser (Maybe (HashMap Text Text) -> Maybe Text -> UploadMetadata)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> 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
"HeadersToInclude"
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
)
Parser (Maybe Text -> UploadMetadata)
-> Parser (Maybe Text) -> Parser UploadMetadata
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
"Url")
)
instance Prelude.Hashable UploadMetadata
instance Prelude.NFData UploadMetadata