{-# 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-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)
--
-- 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 Amazonka.DeviceFarm.Types
import qualified Amazonka.Lens as Lens
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
(CreateUpload -> CreateUpload -> Bool)
-> (CreateUpload -> CreateUpload -> Bool) -> Eq CreateUpload
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]
(Int -> ReadS CreateUpload)
-> ReadS [CreateUpload]
-> ReadPrec CreateUpload
-> ReadPrec [CreateUpload]
-> Read 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
(Int -> CreateUpload -> ShowS)
-> (CreateUpload -> String)
-> ([CreateUpload] -> ShowS)
-> Show CreateUpload
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. CreateUpload -> Rep CreateUpload x)
-> (forall x. Rep CreateUpload x -> CreateUpload)
-> Generic CreateUpload
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' :: Maybe Text -> Text -> Text -> UploadType -> CreateUpload
CreateUpload'
    { $sel:contentType:CreateUpload' :: Maybe Text
contentType = Maybe Text
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 :: (Maybe Text -> f (Maybe Text)) -> CreateUpload -> f CreateUpload
createUpload_contentType = (CreateUpload -> Maybe Text)
-> (CreateUpload -> Maybe Text -> CreateUpload)
-> Lens CreateUpload CreateUpload (Maybe Text) (Maybe Text)
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 :: (Text -> f Text) -> CreateUpload -> f CreateUpload
createUpload_projectArn = (CreateUpload -> Text)
-> (CreateUpload -> Text -> CreateUpload)
-> Lens CreateUpload CreateUpload Text Text
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 :: (Text -> f Text) -> CreateUpload -> f CreateUpload
createUpload_name = (CreateUpload -> Text)
-> (CreateUpload -> Text -> CreateUpload)
-> Lens CreateUpload CreateUpload Text Text
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 :: (UploadType -> f UploadType) -> CreateUpload -> f CreateUpload
createUpload_type = (CreateUpload -> UploadType)
-> (CreateUpload -> UploadType -> CreateUpload)
-> Lens CreateUpload CreateUpload UploadType UploadType
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 :: CreateUpload -> Request CreateUpload
request = Service -> CreateUpload -> Request CreateUpload
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateUpload
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateUpload)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateUpload))
-> Logger
-> Service
-> Proxy CreateUpload
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateUpload)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Upload -> Int -> CreateUploadResponse
CreateUploadResponse'
            (Maybe Upload -> Int -> CreateUploadResponse)
-> Either String (Maybe Upload)
-> Either String (Int -> CreateUploadResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Upload)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"upload")
            Either String (Int -> CreateUploadResponse)
-> Either String Int -> Either String CreateUploadResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateUpload

instance Prelude.NFData CreateUpload

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

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"contentType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
contentType,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"projectArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
projectArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> UploadType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UploadType
type')
          ]
      )

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

instance Core.ToQuery CreateUpload where
  toQuery :: CreateUpload -> QueryString
toQuery = QueryString -> CreateUpload -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateUploadResponse -> CreateUploadResponse -> Bool)
-> (CreateUploadResponse -> CreateUploadResponse -> Bool)
-> Eq CreateUploadResponse
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
(Int -> CreateUploadResponse -> ShowS)
-> (CreateUploadResponse -> String)
-> ([CreateUploadResponse] -> ShowS)
-> Show CreateUploadResponse
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. CreateUploadResponse -> Rep CreateUploadResponse x)
-> (forall x. Rep CreateUploadResponse x -> CreateUploadResponse)
-> Generic CreateUploadResponse
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' :: Maybe Upload -> Int -> CreateUploadResponse
CreateUploadResponse'
    { $sel:upload:CreateUploadResponse' :: Maybe Upload
upload = Maybe 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 :: (Maybe Upload -> f (Maybe Upload))
-> CreateUploadResponse -> f CreateUploadResponse
createUploadResponse_upload = (CreateUploadResponse -> Maybe Upload)
-> (CreateUploadResponse -> Maybe Upload -> CreateUploadResponse)
-> Lens
     CreateUploadResponse
     CreateUploadResponse
     (Maybe Upload)
     (Maybe 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 :: (Int -> f Int) -> CreateUploadResponse -> f CreateUploadResponse
createUploadResponse_httpStatus = (CreateUploadResponse -> Int)
-> (CreateUploadResponse -> Int -> CreateUploadResponse)
-> Lens CreateUploadResponse CreateUploadResponse Int Int
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