{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DeviceFarm.Types.Upload
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | An app or a set of one or more tests to upload or that have been
-- uploaded.
--
-- /See:/ 'newUpload' smart constructor.
data Upload = Upload'
  { -- | The upload\'s status.
    --
    -- Must be one of the following values:
    --
    -- -   FAILED
    --
    -- -   INITIALIZED
    --
    -- -   PROCESSING
    --
    -- -   SUCCEEDED
    Upload -> Maybe UploadStatus
status :: Prelude.Maybe UploadStatus,
    -- | The upload\'s ARN.
    Upload -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | When the upload was created.
    Upload -> Maybe POSIX
created :: Prelude.Maybe Core.POSIX,
    -- | The upload\'s category. Allowed values include:
    --
    -- -   CURATED: An upload managed by AWS Device Farm.
    --
    -- -   PRIVATE: An upload managed by the AWS Device Farm customer.
    Upload -> Maybe UploadCategory
category :: Prelude.Maybe UploadCategory,
    -- | The presigned Amazon S3 URL that was used to store a file using a PUT
    -- request.
    Upload -> Maybe (Sensitive Text)
url :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The upload\'s file name.
    Upload -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The upload\'s metadata. For example, for Android, this contains
    -- information that is parsed from the manifest and is displayed in the AWS
    -- Device Farm console after the associated app is uploaded.
    Upload -> Maybe Text
metadata :: Prelude.Maybe Prelude.Text,
    -- | The upload\'s type.
    --
    -- Must be one of the following values:
    --
    -- -   ANDROID_APP
    --
    -- -   IOS_APP
    --
    -- -   WEB_APP
    --
    -- -   EXTERNAL_DATA
    --
    -- -   APPIUM_JAVA_JUNIT_TEST_PACKAGE
    --
    -- -   APPIUM_JAVA_TESTNG_TEST_PACKAGE
    --
    -- -   APPIUM_PYTHON_TEST_PACKAGE
    --
    -- -   APPIUM_NODE_TEST_PACKAGE
    --
    -- -   APPIUM_RUBY_TEST_PACKAGE
    --
    -- -   APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE
    --
    -- -   APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE
    --
    -- -   APPIUM_WEB_PYTHON_TEST_PACKAGE
    --
    -- -   APPIUM_WEB_NODE_TEST_PACKAGE
    --
    -- -   APPIUM_WEB_RUBY_TEST_PACKAGE
    --
    -- -   CALABASH_TEST_PACKAGE
    --
    -- -   INSTRUMENTATION_TEST_PACKAGE
    --
    -- -   UIAUTOMATION_TEST_PACKAGE
    --
    -- -   UIAUTOMATOR_TEST_PACKAGE
    --
    -- -   XCTEST_TEST_PACKAGE
    --
    -- -   XCTEST_UI_TEST_PACKAGE
    --
    -- -   APPIUM_JAVA_JUNIT_TEST_SPEC
    --
    -- -   APPIUM_JAVA_TESTNG_TEST_SPEC
    --
    -- -   APPIUM_PYTHON_TEST_SPEC
    --
    -- -   APPIUM_NODE_TEST_SPEC
    --
    -- -   APPIUM_RUBY_TEST_SPEC
    --
    -- -   APPIUM_WEB_JAVA_JUNIT_TEST_SPEC
    --
    -- -   APPIUM_WEB_JAVA_TESTNG_TEST_SPEC
    --
    -- -   APPIUM_WEB_PYTHON_TEST_SPEC
    --
    -- -   APPIUM_WEB_NODE_TEST_SPEC
    --
    -- -   APPIUM_WEB_RUBY_TEST_SPEC
    --
    -- -   INSTRUMENTATION_TEST_SPEC
    --
    -- -   XCTEST_UI_TEST_SPEC
    Upload -> Maybe UploadType
type' :: Prelude.Maybe UploadType,
    -- | A message about the upload\'s result.
    Upload -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The upload\'s content type (for example, @application\/octet-stream@).
    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)

-- |
-- Create a value of 'Upload' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'upload_status' - The upload\'s status.
--
-- Must be one of the following values:
--
-- -   FAILED
--
-- -   INITIALIZED
--
-- -   PROCESSING
--
-- -   SUCCEEDED
--
-- 'arn', 'upload_arn' - The upload\'s ARN.
--
-- 'created', 'upload_created' - When the upload was created.
--
-- 'category', 'upload_category' - The upload\'s category. Allowed values include:
--
-- -   CURATED: An upload managed by AWS Device Farm.
--
-- -   PRIVATE: An upload managed by the AWS Device Farm customer.
--
-- 'url', 'upload_url' - The presigned Amazon S3 URL that was used to store a file using a PUT
-- request.
--
-- 'name', 'upload_name' - The upload\'s file name.
--
-- 'metadata', 'upload_metadata' - The upload\'s metadata. For example, for Android, this contains
-- information that is parsed from the manifest and is displayed in the AWS
-- Device Farm console after the associated app is uploaded.
--
-- 'type'', 'upload_type' - The upload\'s type.
--
-- Must be one of the following values:
--
-- -   ANDROID_APP
--
-- -   IOS_APP
--
-- -   WEB_APP
--
-- -   EXTERNAL_DATA
--
-- -   APPIUM_JAVA_JUNIT_TEST_PACKAGE
--
-- -   APPIUM_JAVA_TESTNG_TEST_PACKAGE
--
-- -   APPIUM_PYTHON_TEST_PACKAGE
--
-- -   APPIUM_NODE_TEST_PACKAGE
--
-- -   APPIUM_RUBY_TEST_PACKAGE
--
-- -   APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE
--
-- -   APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE
--
-- -   APPIUM_WEB_PYTHON_TEST_PACKAGE
--
-- -   APPIUM_WEB_NODE_TEST_PACKAGE
--
-- -   APPIUM_WEB_RUBY_TEST_PACKAGE
--
-- -   CALABASH_TEST_PACKAGE
--
-- -   INSTRUMENTATION_TEST_PACKAGE
--
-- -   UIAUTOMATION_TEST_PACKAGE
--
-- -   UIAUTOMATOR_TEST_PACKAGE
--
-- -   XCTEST_TEST_PACKAGE
--
-- -   XCTEST_UI_TEST_PACKAGE
--
-- -   APPIUM_JAVA_JUNIT_TEST_SPEC
--
-- -   APPIUM_JAVA_TESTNG_TEST_SPEC
--
-- -   APPIUM_PYTHON_TEST_SPEC
--
-- -   APPIUM_NODE_TEST_SPEC
--
-- -   APPIUM_RUBY_TEST_SPEC
--
-- -   APPIUM_WEB_JAVA_JUNIT_TEST_SPEC
--
-- -   APPIUM_WEB_JAVA_TESTNG_TEST_SPEC
--
-- -   APPIUM_WEB_PYTHON_TEST_SPEC
--
-- -   APPIUM_WEB_NODE_TEST_SPEC
--
-- -   APPIUM_WEB_RUBY_TEST_SPEC
--
-- -   INSTRUMENTATION_TEST_SPEC
--
-- -   XCTEST_UI_TEST_SPEC
--
-- 'message', 'upload_message' - A message about the upload\'s result.
--
-- 'contentType', 'upload_contentType' - The upload\'s content type (for example, @application\/octet-stream@).
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
    }

-- | The upload\'s status.
--
-- Must be one of the following values:
--
-- -   FAILED
--
-- -   INITIALIZED
--
-- -   PROCESSING
--
-- -   SUCCEEDED
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)

-- | The upload\'s ARN.
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)

-- | When the upload was created.
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

-- | The upload\'s category. Allowed values include:
--
-- -   CURATED: An upload managed by AWS Device Farm.
--
-- -   PRIVATE: An upload managed by the AWS Device Farm customer.
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)

-- | The presigned Amazon S3 URL that was used to store a file using a PUT
-- request.
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

-- | The upload\'s file name.
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)

-- | The upload\'s metadata. For example, for Android, this contains
-- information that is parsed from the manifest and is displayed in the AWS
-- Device Farm console after the associated app is uploaded.
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)

-- | The upload\'s type.
--
-- Must be one of the following values:
--
-- -   ANDROID_APP
--
-- -   IOS_APP
--
-- -   WEB_APP
--
-- -   EXTERNAL_DATA
--
-- -   APPIUM_JAVA_JUNIT_TEST_PACKAGE
--
-- -   APPIUM_JAVA_TESTNG_TEST_PACKAGE
--
-- -   APPIUM_PYTHON_TEST_PACKAGE
--
-- -   APPIUM_NODE_TEST_PACKAGE
--
-- -   APPIUM_RUBY_TEST_PACKAGE
--
-- -   APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE
--
-- -   APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE
--
-- -   APPIUM_WEB_PYTHON_TEST_PACKAGE
--
-- -   APPIUM_WEB_NODE_TEST_PACKAGE
--
-- -   APPIUM_WEB_RUBY_TEST_PACKAGE
--
-- -   CALABASH_TEST_PACKAGE
--
-- -   INSTRUMENTATION_TEST_PACKAGE
--
-- -   UIAUTOMATION_TEST_PACKAGE
--
-- -   UIAUTOMATOR_TEST_PACKAGE
--
-- -   XCTEST_TEST_PACKAGE
--
-- -   XCTEST_UI_TEST_PACKAGE
--
-- -   APPIUM_JAVA_JUNIT_TEST_SPEC
--
-- -   APPIUM_JAVA_TESTNG_TEST_SPEC
--
-- -   APPIUM_PYTHON_TEST_SPEC
--
-- -   APPIUM_NODE_TEST_SPEC
--
-- -   APPIUM_RUBY_TEST_SPEC
--
-- -   APPIUM_WEB_JAVA_JUNIT_TEST_SPEC
--
-- -   APPIUM_WEB_JAVA_TESTNG_TEST_SPEC
--
-- -   APPIUM_WEB_PYTHON_TEST_SPEC
--
-- -   APPIUM_WEB_NODE_TEST_SPEC
--
-- -   APPIUM_WEB_RUBY_TEST_SPEC
--
-- -   INSTRUMENTATION_TEST_SPEC
--
-- -   XCTEST_UI_TEST_SPEC
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)

-- | A message about the upload\'s result.
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)

-- | The upload\'s content type (for example, @application\/octet-stream@).
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