{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateUpload
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Uploads an app or test scripts.
module Amazonka.DeviceFarm.CreateUpload
  ( -- * Creating a Request
    CreateUpload (..),
    newCreateUpload,

    -- * Request Lenses
    createUpload_contentType,
    createUpload_projectArn,
    createUpload_name,
    createUpload_type,

    -- * Destructuring the Response
    CreateUploadResponse (..),
    newCreateUploadResponse,

    -- * Response Lenses
    createUploadResponse_upload,
    createUploadResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents a request to the create upload operation.
--
-- /See:/ 'newCreateUpload' smart constructor.
data CreateUpload = CreateUpload'
  { -- | The upload\'s content type (for example, @application\/octet-stream@).
    CreateUpload -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the project for the upload.
    CreateUpload -> Text
projectArn :: Prelude.Text,
    -- | The upload\'s file name. The name should not contain any forward slashes
    -- (@\/@). If you are uploading an iOS app, the file name must end with the
    -- @.ipa@ extension. If you are uploading an Android app, the file name
    -- must end with the @.apk@ extension. For all others, the file name must
    -- end with the @.zip@ file extension.
    CreateUpload -> Text
name :: Prelude.Text,
    -- | The upload\'s upload 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
    --
    -- If you call @CreateUpload@ with @WEB_APP@ specified, AWS Device Farm
    -- throws an @ArgumentException@ error.
    CreateUpload -> UploadType
type' :: UploadType
  }
  deriving (CreateUpload -> CreateUpload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUpload -> CreateUpload -> Bool
$c/= :: CreateUpload -> CreateUpload -> Bool
== :: CreateUpload -> CreateUpload -> Bool
$c== :: CreateUpload -> CreateUpload -> Bool
Prelude.Eq, ReadPrec [CreateUpload]
ReadPrec CreateUpload
Int -> ReadS CreateUpload
ReadS [CreateUpload]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUpload]
$creadListPrec :: ReadPrec [CreateUpload]
readPrec :: ReadPrec CreateUpload
$creadPrec :: ReadPrec CreateUpload
readList :: ReadS [CreateUpload]
$creadList :: ReadS [CreateUpload]
readsPrec :: Int -> ReadS CreateUpload
$creadsPrec :: Int -> ReadS CreateUpload
Prelude.Read, Int -> CreateUpload -> ShowS
[CreateUpload] -> ShowS
CreateUpload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUpload] -> ShowS
$cshowList :: [CreateUpload] -> ShowS
show :: CreateUpload -> String
$cshow :: CreateUpload -> String
showsPrec :: Int -> CreateUpload -> ShowS
$cshowsPrec :: Int -> CreateUpload -> ShowS
Prelude.Show, forall x. Rep CreateUpload x -> CreateUpload
forall x. CreateUpload -> Rep CreateUpload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUpload x -> CreateUpload
$cfrom :: forall x. CreateUpload -> Rep CreateUpload x
Prelude.Generic)

-- |
-- Create a value of 'CreateUpload' 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:
--
-- 'contentType', 'createUpload_contentType' - The upload\'s content type (for example, @application\/octet-stream@).
--
-- 'projectArn', 'createUpload_projectArn' - The ARN of the project for the upload.
--
-- 'name', 'createUpload_name' - The upload\'s file name. The name should not contain any forward slashes
-- (@\/@). If you are uploading an iOS app, the file name must end with the
-- @.ipa@ extension. If you are uploading an Android app, the file name
-- must end with the @.apk@ extension. For all others, the file name must
-- end with the @.zip@ file extension.
--
-- 'type'', 'createUpload_type' - The upload\'s upload 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
--
-- If you call @CreateUpload@ with @WEB_APP@ specified, AWS Device Farm
-- throws an @ArgumentException@ error.
newCreateUpload ::
  -- | 'projectArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'type''
  UploadType ->
  CreateUpload
newCreateUpload :: Text -> Text -> UploadType -> CreateUpload
newCreateUpload Text
pProjectArn_ Text
pName_ UploadType
pType_ =
  CreateUpload'
    { $sel:contentType:CreateUpload' :: Maybe Text
contentType = forall a. Maybe a
Prelude.Nothing,
      $sel:projectArn:CreateUpload' :: Text
projectArn = Text
pProjectArn_,
      $sel:name:CreateUpload' :: Text
name = Text
pName_,
      $sel:type':CreateUpload' :: UploadType
type' = UploadType
pType_
    }

-- | The upload\'s content type (for example, @application\/octet-stream@).
createUpload_contentType :: Lens.Lens' CreateUpload (Prelude.Maybe Prelude.Text)
createUpload_contentType :: Lens' CreateUpload (Maybe Text)
createUpload_contentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpload' {Maybe Text
contentType :: Maybe Text
$sel:contentType:CreateUpload' :: CreateUpload -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: CreateUpload
s@CreateUpload' {} Maybe Text
a -> CreateUpload
s {$sel:contentType:CreateUpload' :: Maybe Text
contentType = Maybe Text
a} :: CreateUpload)

-- | The ARN of the project for the upload.
createUpload_projectArn :: Lens.Lens' CreateUpload Prelude.Text
createUpload_projectArn :: Lens' CreateUpload Text
createUpload_projectArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpload' {Text
projectArn :: Text
$sel:projectArn:CreateUpload' :: CreateUpload -> Text
projectArn} -> Text
projectArn) (\s :: CreateUpload
s@CreateUpload' {} Text
a -> CreateUpload
s {$sel:projectArn:CreateUpload' :: Text
projectArn = Text
a} :: CreateUpload)

-- | The upload\'s file name. The name should not contain any forward slashes
-- (@\/@). If you are uploading an iOS app, the file name must end with the
-- @.ipa@ extension. If you are uploading an Android app, the file name
-- must end with the @.apk@ extension. For all others, the file name must
-- end with the @.zip@ file extension.
createUpload_name :: Lens.Lens' CreateUpload Prelude.Text
createUpload_name :: Lens' CreateUpload Text
createUpload_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpload' {Text
name :: Text
$sel:name:CreateUpload' :: CreateUpload -> Text
name} -> Text
name) (\s :: CreateUpload
s@CreateUpload' {} Text
a -> CreateUpload
s {$sel:name:CreateUpload' :: Text
name = Text
a} :: CreateUpload)

-- | The upload\'s upload 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
--
-- If you call @CreateUpload@ with @WEB_APP@ specified, AWS Device Farm
-- throws an @ArgumentException@ error.
createUpload_type :: Lens.Lens' CreateUpload UploadType
createUpload_type :: Lens' CreateUpload UploadType
createUpload_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpload' {UploadType
type' :: UploadType
$sel:type':CreateUpload' :: CreateUpload -> UploadType
type'} -> UploadType
type') (\s :: CreateUpload
s@CreateUpload' {} UploadType
a -> CreateUpload
s {$sel:type':CreateUpload' :: UploadType
type' = UploadType
a} :: CreateUpload)

instance Core.AWSRequest CreateUpload where
  type AWSResponse CreateUpload = CreateUploadResponse
  request :: (Service -> Service) -> CreateUpload -> Request CreateUpload
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateUpload
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateUpload)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Upload -> Int -> CreateUploadResponse
CreateUploadResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"upload")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateUpload where
  hashWithSalt :: Int -> CreateUpload -> Int
hashWithSalt Int
_salt CreateUpload' {Maybe Text
Text
UploadType
type' :: UploadType
name :: Text
projectArn :: Text
contentType :: Maybe Text
$sel:type':CreateUpload' :: CreateUpload -> UploadType
$sel:name:CreateUpload' :: CreateUpload -> Text
$sel:projectArn:CreateUpload' :: CreateUpload -> Text
$sel:contentType:CreateUpload' :: CreateUpload -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UploadType
type'

instance Prelude.NFData CreateUpload where
  rnf :: CreateUpload -> ()
rnf CreateUpload' {Maybe Text
Text
UploadType
type' :: UploadType
name :: Text
projectArn :: Text
contentType :: Maybe Text
$sel:type':CreateUpload' :: CreateUpload -> UploadType
$sel:name:CreateUpload' :: CreateUpload -> Text
$sel:projectArn:CreateUpload' :: CreateUpload -> Text
$sel:contentType:CreateUpload' :: CreateUpload -> Maybe Text
..} =
    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 Text
projectArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UploadType
type'

instance Data.ToHeaders CreateUpload where
  toHeaders :: CreateUpload -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"DeviceFarm_20150623.CreateUpload" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateUpload where
  toJSON :: CreateUpload -> Value
toJSON CreateUpload' {Maybe Text
Text
UploadType
type' :: UploadType
name :: Text
projectArn :: Text
contentType :: Maybe Text
$sel:type':CreateUpload' :: CreateUpload -> UploadType
$sel:name:CreateUpload' :: CreateUpload -> Text
$sel:projectArn:CreateUpload' :: CreateUpload -> Text
$sel:contentType:CreateUpload' :: CreateUpload -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"contentType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
contentType,
            forall a. a -> Maybe a
Prelude.Just (Key
"projectArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
projectArn),
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= UploadType
type')
          ]
      )

instance Data.ToPath CreateUpload where
  toPath :: CreateUpload -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateUpload where
  toQuery :: CreateUpload -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | Represents the result of a create upload request.
--
-- /See:/ 'newCreateUploadResponse' smart constructor.
data CreateUploadResponse = CreateUploadResponse'
  { -- | The newly created upload.
    CreateUploadResponse -> Maybe Upload
upload :: Prelude.Maybe Upload,
    -- | The response's http status code.
    CreateUploadResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateUploadResponse -> CreateUploadResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUploadResponse -> CreateUploadResponse -> Bool
$c/= :: CreateUploadResponse -> CreateUploadResponse -> Bool
== :: CreateUploadResponse -> CreateUploadResponse -> Bool
$c== :: CreateUploadResponse -> CreateUploadResponse -> Bool
Prelude.Eq, Int -> CreateUploadResponse -> ShowS
[CreateUploadResponse] -> ShowS
CreateUploadResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUploadResponse] -> ShowS
$cshowList :: [CreateUploadResponse] -> ShowS
show :: CreateUploadResponse -> String
$cshow :: CreateUploadResponse -> String
showsPrec :: Int -> CreateUploadResponse -> ShowS
$cshowsPrec :: Int -> CreateUploadResponse -> ShowS
Prelude.Show, forall x. Rep CreateUploadResponse x -> CreateUploadResponse
forall x. CreateUploadResponse -> Rep CreateUploadResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUploadResponse x -> CreateUploadResponse
$cfrom :: forall x. CreateUploadResponse -> Rep CreateUploadResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateUploadResponse' 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:
--
-- 'upload', 'createUploadResponse_upload' - The newly created upload.
--
-- 'httpStatus', 'createUploadResponse_httpStatus' - The response's http status code.
newCreateUploadResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateUploadResponse
newCreateUploadResponse :: Int -> CreateUploadResponse
newCreateUploadResponse Int
pHttpStatus_ =
  CreateUploadResponse'
    { $sel:upload:CreateUploadResponse' :: Maybe Upload
upload = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateUploadResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The newly created upload.
createUploadResponse_upload :: Lens.Lens' CreateUploadResponse (Prelude.Maybe Upload)
createUploadResponse_upload :: Lens' CreateUploadResponse (Maybe Upload)
createUploadResponse_upload = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUploadResponse' {Maybe Upload
upload :: Maybe Upload
$sel:upload:CreateUploadResponse' :: CreateUploadResponse -> Maybe Upload
upload} -> Maybe Upload
upload) (\s :: CreateUploadResponse
s@CreateUploadResponse' {} Maybe Upload
a -> CreateUploadResponse
s {$sel:upload:CreateUploadResponse' :: Maybe Upload
upload = Maybe Upload
a} :: CreateUploadResponse)

-- | The response's http status code.
createUploadResponse_httpStatus :: Lens.Lens' CreateUploadResponse Prelude.Int
createUploadResponse_httpStatus :: Lens' CreateUploadResponse Int
createUploadResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUploadResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateUploadResponse' :: CreateUploadResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateUploadResponse
s@CreateUploadResponse' {} Int
a -> CreateUploadResponse
s {$sel:httpStatus:CreateUploadResponse' :: Int
httpStatus = Int
a} :: CreateUploadResponse)

instance Prelude.NFData CreateUploadResponse where
  rnf :: CreateUploadResponse -> ()
rnf CreateUploadResponse' {Int
Maybe Upload
httpStatus :: Int
upload :: Maybe Upload
$sel:httpStatus:CreateUploadResponse' :: CreateUploadResponse -> Int
$sel:upload:CreateUploadResponse' :: CreateUploadResponse -> Maybe Upload
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Upload
upload
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus