{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types.UploadCategory
import Amazonka.DeviceFarm.Types.UploadStatus
import Amazonka.DeviceFarm.Types.UploadType
import qualified Amazonka.Prelude as Prelude
data Upload = Upload'
{
Upload -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Upload -> Maybe UploadCategory
category :: Prelude.Maybe UploadCategory,
Upload -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
Upload -> Maybe POSIX
created :: Prelude.Maybe Data.POSIX,
Upload -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
Upload -> Maybe Text
metadata :: Prelude.Maybe Prelude.Text,
Upload -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Upload -> Maybe UploadStatus
status :: Prelude.Maybe UploadStatus,
Upload -> Maybe UploadType
type' :: Prelude.Maybe UploadType,
Upload -> Maybe (Sensitive Text)
url :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (Upload -> Upload -> Bool
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
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. 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'
{ $sel:arn:Upload' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:category:Upload' :: Maybe UploadCategory
category = forall a. Maybe a
Prelude.Nothing,
$sel:contentType:Upload' :: Maybe Text
contentType = forall a. Maybe a
Prelude.Nothing,
$sel:created:Upload' :: Maybe POSIX
created = forall a. Maybe a
Prelude.Nothing,
$sel:message:Upload' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
$sel:metadata:Upload' :: Maybe Text
metadata = forall a. Maybe a
Prelude.Nothing,
$sel:name:Upload' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:status:Upload' :: Maybe UploadStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:type':Upload' :: Maybe UploadType
type' = forall a. Maybe a
Prelude.Nothing,
$sel:url:Upload' :: Maybe (Sensitive Text)
url = forall a. Maybe a
Prelude.Nothing
}
upload_arn :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_arn :: Lens' Upload (Maybe Text)
upload_arn = 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_category :: Lens.Lens' Upload (Prelude.Maybe UploadCategory)
upload_category :: Lens' Upload (Maybe UploadCategory)
upload_category = 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_contentType :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_contentType :: Lens' Upload (Maybe Text)
upload_contentType = 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)
upload_created :: Lens.Lens' Upload (Prelude.Maybe Prelude.UTCTime)
upload_created :: Lens' Upload (Maybe UTCTime)
upload_created = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
upload_message :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_message :: Lens' Upload (Maybe Text)
upload_message = 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_metadata :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_metadata :: Lens' Upload (Maybe Text)
upload_metadata = 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_name :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_name :: Lens' Upload (Maybe Text)
upload_name = 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_status :: Lens.Lens' Upload (Prelude.Maybe UploadStatus)
upload_status :: Lens' Upload (Maybe UploadStatus)
upload_status = 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_type :: Lens.Lens' Upload (Prelude.Maybe UploadType)
upload_type :: Lens' Upload (Maybe UploadType)
upload_type = 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_url :: Lens.Lens' Upload (Prelude.Maybe Prelude.Text)
upload_url :: Lens' Upload (Maybe Text)
upload_url = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON Upload where
parseJSON :: Value -> Parser Upload
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Upload"
( \Object
x ->
Maybe Text
-> Maybe UploadCategory
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UploadStatus
-> Maybe UploadType
-> Maybe (Sensitive Text)
-> Upload
Upload'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"category")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"contentType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"created")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"message")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"metadata")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"url")
)
instance Prelude.Hashable Upload where
hashWithSalt :: Int -> Upload -> Int
hashWithSalt Int
_salt Upload' {Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe UploadCategory
Maybe UploadStatus
Maybe UploadType
url :: Maybe (Sensitive Text)
type' :: Maybe UploadType
status :: Maybe UploadStatus
name :: Maybe Text
metadata :: Maybe Text
message :: Maybe Text
created :: Maybe POSIX
contentType :: Maybe Text
category :: Maybe UploadCategory
arn :: Maybe Text
$sel:url:Upload' :: Upload -> Maybe (Sensitive Text)
$sel:type':Upload' :: Upload -> Maybe UploadType
$sel:status:Upload' :: Upload -> Maybe UploadStatus
$sel:name:Upload' :: Upload -> Maybe Text
$sel:metadata:Upload' :: Upload -> Maybe Text
$sel:message:Upload' :: Upload -> Maybe Text
$sel:created:Upload' :: Upload -> Maybe POSIX
$sel:contentType:Upload' :: Upload -> Maybe Text
$sel:category:Upload' :: Upload -> Maybe UploadCategory
$sel:arn:Upload' :: Upload -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UploadCategory
category
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
created
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UploadStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UploadType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
url
instance Prelude.NFData Upload where
rnf :: Upload -> ()
rnf Upload' {Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe UploadCategory
Maybe UploadStatus
Maybe UploadType
url :: Maybe (Sensitive Text)
type' :: Maybe UploadType
status :: Maybe UploadStatus
name :: Maybe Text
metadata :: Maybe Text
message :: Maybe Text
created :: Maybe POSIX
contentType :: Maybe Text
category :: Maybe UploadCategory
arn :: Maybe Text
$sel:url:Upload' :: Upload -> Maybe (Sensitive Text)
$sel:type':Upload' :: Upload -> Maybe UploadType
$sel:status:Upload' :: Upload -> Maybe UploadStatus
$sel:name:Upload' :: Upload -> Maybe Text
$sel:metadata:Upload' :: Upload -> Maybe Text
$sel:message:Upload' :: Upload -> Maybe Text
$sel:created:Upload' :: Upload -> Maybe POSIX
$sel:contentType:Upload' :: Upload -> Maybe Text
$sel:category:Upload' :: Upload -> Maybe UploadCategory
$sel:arn:Upload' :: Upload -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UploadCategory
category
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
created
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UploadStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UploadType
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
url