{-# 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.DeviceFarm.Types.Upload where
import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types.UploadCategory
import Amazonka.DeviceFarm.Types.UploadStatus
import Amazonka.DeviceFarm.Types.UploadType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Upload = Upload'
{
Upload -> Maybe UploadStatus
status :: Prelude.Maybe UploadStatus,
Upload -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Upload -> Maybe POSIX
created :: Prelude.Maybe Core.POSIX,
Upload -> Maybe UploadCategory
category :: Prelude.Maybe UploadCategory,
Upload -> Maybe (Sensitive Text)
url :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Upload -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Upload -> Maybe Text
metadata :: Prelude.Maybe Prelude.Text,
Upload -> Maybe UploadType
type' :: Prelude.Maybe UploadType,
Upload -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
Upload -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text
}
deriving (Upload -> Upload -> Bool
(Upload -> Upload -> Bool)
-> (Upload -> Upload -> Bool) -> Eq Upload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Upload -> Upload -> Bool
$c/= :: Upload -> Upload -> Bool
== :: Upload -> Upload -> Bool
$c== :: Upload -> Upload -> Bool
Prelude.Eq, Int -> Upload -> ShowS
[Upload] -> ShowS
Upload -> String
(Int -> Upload -> ShowS)
-> (Upload -> String) -> ([Upload] -> ShowS) -> Show Upload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Upload] -> ShowS
$cshowList :: [Upload] -> ShowS
show :: Upload -> String
$cshow :: Upload -> String
showsPrec :: Int -> Upload -> ShowS
$cshowsPrec :: Int -> Upload -> ShowS
Prelude.Show, (forall x. Upload -> Rep Upload x)
-> (forall x. Rep Upload x -> Upload) -> Generic Upload
forall x. Rep Upload x -> Upload
forall x. Upload -> Rep Upload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Upload x -> Upload
$cfrom :: forall x. Upload -> Rep Upload x
Prelude.Generic)
newUpload ::
Upload
newUpload :: Upload
newUpload =
Upload' :: Maybe UploadStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload
Upload'
{ $sel:status:Upload' :: Maybe UploadStatus
status = Maybe UploadStatus
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Upload' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:created:Upload' :: Maybe POSIX
created = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:category:Upload' :: Maybe UploadCategory
category = Maybe UploadCategory
forall a. Maybe a
Prelude.Nothing,
$sel:url:Upload' :: Maybe (Sensitive Text)
url = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:Upload' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metadata:Upload' :: Maybe Text
metadata = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':Upload' :: Maybe UploadType
type' = Maybe UploadType
forall a. Maybe a
Prelude.Nothing,
$sel:message:Upload' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:Upload' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
upload_status :: Lens.Lens' Upload (Prelude.Maybe UploadStatus)
upload_status :: (Maybe UploadStatus -> f (Maybe UploadStatus))
-> Upload -> f Upload
upload_status = (Upload -> Maybe UploadStatus)
-> (Upload -> Maybe UploadStatus -> Upload)
-> Lens Upload Upload (Maybe UploadStatus) (Maybe UploadStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe UploadStatus
status :: Maybe UploadStatus
$sel:status:Upload' :: Upload -> Maybe UploadStatus
status} -> Maybe UploadStatus
status) (\s :: Upload
s@Upload' {} Maybe UploadStatus
a -> Upload
s {$sel:status:Upload' :: Maybe UploadStatus
status = Maybe UploadStatus
a} :: Upload)
upload_arn :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_arn :: (Maybe Text -> f (Maybe Text)) -> Upload -> f Upload
upload_arn = (Upload -> Maybe Text)
-> (Upload -> Maybe Text -> Upload)
-> Lens Upload Upload (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe Text
arn :: Maybe Text
$sel:arn:Upload' :: Upload -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Upload
s@Upload' {} Maybe Text
a -> Upload
s {$sel:arn:Upload' :: Maybe Text
arn = Maybe Text
a} :: Upload)
upload_created :: Lens.Lens' Upload (Prelude.Maybe Prelude.UTCTime)
upload_created :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Upload -> f Upload
upload_created = (Upload -> Maybe POSIX)
-> (Upload -> Maybe POSIX -> Upload)
-> Lens Upload Upload (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe POSIX
created :: Maybe POSIX
$sel:created:Upload' :: Upload -> Maybe POSIX
created} -> Maybe POSIX
created) (\s :: Upload
s@Upload' {} Maybe POSIX
a -> Upload
s {$sel:created:Upload' :: Maybe POSIX
created = Maybe POSIX
a} :: Upload) ((Maybe POSIX -> f (Maybe POSIX)) -> Upload -> f Upload)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Upload
-> f Upload
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
upload_category :: Lens.Lens' Upload (Prelude.Maybe UploadCategory)
upload_category :: (Maybe UploadCategory -> f (Maybe UploadCategory))
-> Upload -> f Upload
upload_category = (Upload -> Maybe UploadCategory)
-> (Upload -> Maybe UploadCategory -> Upload)
-> Lens Upload Upload (Maybe UploadCategory) (Maybe UploadCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe UploadCategory
category :: Maybe UploadCategory
$sel:category:Upload' :: Upload -> Maybe UploadCategory
category} -> Maybe UploadCategory
category) (\s :: Upload
s@Upload' {} Maybe UploadCategory
a -> Upload
s {$sel:category:Upload' :: Maybe UploadCategory
category = Maybe UploadCategory
a} :: Upload)
upload_url :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_url :: (Maybe Text -> f (Maybe Text)) -> Upload -> f Upload
upload_url = (Upload -> Maybe (Sensitive Text))
-> (Upload -> Maybe (Sensitive Text) -> Upload)
-> Lens
Upload Upload (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe (Sensitive Text)
url :: Maybe (Sensitive Text)
$sel:url:Upload' :: Upload -> Maybe (Sensitive Text)
url} -> Maybe (Sensitive Text)
url) (\s :: Upload
s@Upload' {} Maybe (Sensitive Text)
a -> Upload
s {$sel:url:Upload' :: Maybe (Sensitive Text)
url = Maybe (Sensitive Text)
a} :: Upload) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Upload -> f Upload)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Upload
-> f Upload
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
upload_name :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_name :: (Maybe Text -> f (Maybe Text)) -> Upload -> f Upload
upload_name = (Upload -> Maybe Text)
-> (Upload -> Maybe Text -> Upload)
-> Lens Upload Upload (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe Text
name :: Maybe Text
$sel:name:Upload' :: Upload -> Maybe Text
name} -> Maybe Text
name) (\s :: Upload
s@Upload' {} Maybe Text
a -> Upload
s {$sel:name:Upload' :: Maybe Text
name = Maybe Text
a} :: Upload)
upload_metadata :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_metadata :: (Maybe Text -> f (Maybe Text)) -> Upload -> f Upload
upload_metadata = (Upload -> Maybe Text)
-> (Upload -> Maybe Text -> Upload)
-> Lens Upload Upload (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe Text
metadata :: Maybe Text
$sel:metadata:Upload' :: Upload -> Maybe Text
metadata} -> Maybe Text
metadata) (\s :: Upload
s@Upload' {} Maybe Text
a -> Upload
s {$sel:metadata:Upload' :: Maybe Text
metadata = Maybe Text
a} :: Upload)
upload_type :: Lens.Lens' Upload (Prelude.Maybe UploadType)
upload_type :: (Maybe UploadType -> f (Maybe UploadType)) -> Upload -> f Upload
upload_type = (Upload -> Maybe UploadType)
-> (Upload -> Maybe UploadType -> Upload)
-> Lens Upload Upload (Maybe UploadType) (Maybe UploadType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe UploadType
type' :: Maybe UploadType
$sel:type':Upload' :: Upload -> Maybe UploadType
type'} -> Maybe UploadType
type') (\s :: Upload
s@Upload' {} Maybe UploadType
a -> Upload
s {$sel:type':Upload' :: Maybe UploadType
type' = Maybe UploadType
a} :: Upload)
upload_message :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_message :: (Maybe Text -> f (Maybe Text)) -> Upload -> f Upload
upload_message = (Upload -> Maybe Text)
-> (Upload -> Maybe Text -> Upload)
-> Lens Upload Upload (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe Text
message :: Maybe Text
$sel:message:Upload' :: Upload -> Maybe Text
message} -> Maybe Text
message) (\s :: Upload
s@Upload' {} Maybe Text
a -> Upload
s {$sel:message:Upload' :: Maybe Text
message = Maybe Text
a} :: Upload)
upload_contentType :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_contentType :: (Maybe Text -> f (Maybe Text)) -> Upload -> f Upload
upload_contentType = (Upload -> Maybe Text)
-> (Upload -> Maybe Text -> Upload)
-> Lens Upload Upload (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Upload' {Maybe Text
contentType :: Maybe Text
$sel:contentType:Upload' :: Upload -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: Upload
s@Upload' {} Maybe Text
a -> Upload
s {$sel:contentType:Upload' :: Maybe Text
contentType = Maybe Text
a} :: Upload)
instance Core.FromJSON Upload where
parseJSON :: Value -> Parser Upload
parseJSON =
String -> (Object -> Parser Upload) -> Value -> Parser Upload
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Upload"
( \Object
x ->
Maybe UploadStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload
Upload'
(Maybe UploadStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
-> Parser (Maybe UploadStatus)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe UploadStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
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
"arn")
Parser
(Maybe POSIX
-> Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
-> Parser (Maybe POSIX)
-> Parser
(Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
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
"created")
Parser
(Maybe UploadCategory
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
-> Parser (Maybe UploadCategory)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UploadCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"category")
Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
forall (f :: * -> *) a b. Applicative f => 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
"url")
Parser
(Maybe Text
-> Maybe Text
-> Maybe UploadType
-> Maybe Text
-> Maybe Text
-> Upload)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe UploadType -> Maybe Text -> Maybe Text -> Upload)
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
"name")
Parser
(Maybe Text
-> Maybe UploadType -> Maybe Text -> Maybe Text -> Upload)
-> Parser (Maybe Text)
-> Parser (Maybe UploadType -> Maybe Text -> Maybe Text -> Upload)
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
"metadata")
Parser (Maybe UploadType -> Maybe Text -> Maybe Text -> Upload)
-> Parser (Maybe UploadType)
-> Parser (Maybe Text -> Maybe Text -> Upload)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UploadType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
Parser (Maybe Text -> Maybe Text -> Upload)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Upload)
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
"message")
Parser (Maybe Text -> Upload)
-> Parser (Maybe Text) -> Parser Upload
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
"contentType")
)
instance Prelude.Hashable Upload
instance Prelude.NFData Upload