{-# 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.IoTThingsGraph.GetUploadStatus
-- 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)
--
-- Gets the status of the specified upload.
module Amazonka.IoTThingsGraph.GetUploadStatus
  ( -- * Creating a Request
    GetUploadStatus (..),
    newGetUploadStatus,

    -- * Request Lenses
    getUploadStatus_uploadId,

    -- * Destructuring the Response
    GetUploadStatusResponse (..),
    newGetUploadStatusResponse,

    -- * Response Lenses
    getUploadStatusResponse_failureReason,
    getUploadStatusResponse_namespaceArn,
    getUploadStatusResponse_namespaceVersion,
    getUploadStatusResponse_namespaceName,
    getUploadStatusResponse_httpStatus,
    getUploadStatusResponse_uploadId,
    getUploadStatusResponse_uploadStatus,
    getUploadStatusResponse_createdDate,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTThingsGraph.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

-- | /See:/ 'newGetUploadStatus' smart constructor.
data GetUploadStatus = GetUploadStatus'
  { -- | The ID of the upload. This value is returned by the
    -- @UploadEntityDefinitions@ action.
    GetUploadStatus -> Text
uploadId :: Prelude.Text
  }
  deriving (GetUploadStatus -> GetUploadStatus -> Bool
(GetUploadStatus -> GetUploadStatus -> Bool)
-> (GetUploadStatus -> GetUploadStatus -> Bool)
-> Eq GetUploadStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUploadStatus -> GetUploadStatus -> Bool
$c/= :: GetUploadStatus -> GetUploadStatus -> Bool
== :: GetUploadStatus -> GetUploadStatus -> Bool
$c== :: GetUploadStatus -> GetUploadStatus -> Bool
Prelude.Eq, ReadPrec [GetUploadStatus]
ReadPrec GetUploadStatus
Int -> ReadS GetUploadStatus
ReadS [GetUploadStatus]
(Int -> ReadS GetUploadStatus)
-> ReadS [GetUploadStatus]
-> ReadPrec GetUploadStatus
-> ReadPrec [GetUploadStatus]
-> Read GetUploadStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUploadStatus]
$creadListPrec :: ReadPrec [GetUploadStatus]
readPrec :: ReadPrec GetUploadStatus
$creadPrec :: ReadPrec GetUploadStatus
readList :: ReadS [GetUploadStatus]
$creadList :: ReadS [GetUploadStatus]
readsPrec :: Int -> ReadS GetUploadStatus
$creadsPrec :: Int -> ReadS GetUploadStatus
Prelude.Read, Int -> GetUploadStatus -> ShowS
[GetUploadStatus] -> ShowS
GetUploadStatus -> String
(Int -> GetUploadStatus -> ShowS)
-> (GetUploadStatus -> String)
-> ([GetUploadStatus] -> ShowS)
-> Show GetUploadStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUploadStatus] -> ShowS
$cshowList :: [GetUploadStatus] -> ShowS
show :: GetUploadStatus -> String
$cshow :: GetUploadStatus -> String
showsPrec :: Int -> GetUploadStatus -> ShowS
$cshowsPrec :: Int -> GetUploadStatus -> ShowS
Prelude.Show, (forall x. GetUploadStatus -> Rep GetUploadStatus x)
-> (forall x. Rep GetUploadStatus x -> GetUploadStatus)
-> Generic GetUploadStatus
forall x. Rep GetUploadStatus x -> GetUploadStatus
forall x. GetUploadStatus -> Rep GetUploadStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUploadStatus x -> GetUploadStatus
$cfrom :: forall x. GetUploadStatus -> Rep GetUploadStatus x
Prelude.Generic)

-- |
-- Create a value of 'GetUploadStatus' 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:
--
-- 'uploadId', 'getUploadStatus_uploadId' - The ID of the upload. This value is returned by the
-- @UploadEntityDefinitions@ action.
newGetUploadStatus ::
  -- | 'uploadId'
  Prelude.Text ->
  GetUploadStatus
newGetUploadStatus :: Text -> GetUploadStatus
newGetUploadStatus Text
pUploadId_ =
  GetUploadStatus' :: Text -> GetUploadStatus
GetUploadStatus' {$sel:uploadId:GetUploadStatus' :: Text
uploadId = Text
pUploadId_}

-- | The ID of the upload. This value is returned by the
-- @UploadEntityDefinitions@ action.
getUploadStatus_uploadId :: Lens.Lens' GetUploadStatus Prelude.Text
getUploadStatus_uploadId :: (Text -> f Text) -> GetUploadStatus -> f GetUploadStatus
getUploadStatus_uploadId = (GetUploadStatus -> Text)
-> (GetUploadStatus -> Text -> GetUploadStatus)
-> Lens GetUploadStatus GetUploadStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatus' {Text
uploadId :: Text
$sel:uploadId:GetUploadStatus' :: GetUploadStatus -> Text
uploadId} -> Text
uploadId) (\s :: GetUploadStatus
s@GetUploadStatus' {} Text
a -> GetUploadStatus
s {$sel:uploadId:GetUploadStatus' :: Text
uploadId = Text
a} :: GetUploadStatus)

instance Core.AWSRequest GetUploadStatus where
  type
    AWSResponse GetUploadStatus =
      GetUploadStatusResponse
  request :: GetUploadStatus -> Request GetUploadStatus
request = Service -> GetUploadStatus -> Request GetUploadStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetUploadStatus
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetUploadStatus)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetUploadStatus))
-> Logger
-> Service
-> Proxy GetUploadStatus
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetUploadStatus)))
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 [Text]
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Int
-> Text
-> UploadStatus
-> POSIX
-> GetUploadStatusResponse
GetUploadStatusResponse'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Text
 -> Int
 -> Text
 -> UploadStatus
 -> POSIX
 -> GetUploadStatusResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Int
      -> Text
      -> UploadStatus
      -> POSIX
      -> GetUploadStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failureReason" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Int
   -> Text
   -> UploadStatus
   -> POSIX
   -> GetUploadStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Maybe Text
      -> Int
      -> Text
      -> UploadStatus
      -> POSIX
      -> GetUploadStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"namespaceArn")
            Either
  String
  (Maybe Integer
   -> Maybe Text
   -> Int
   -> Text
   -> UploadStatus
   -> POSIX
   -> GetUploadStatusResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Text
      -> Int -> Text -> UploadStatus -> POSIX -> GetUploadStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"namespaceVersion")
            Either
  String
  (Maybe Text
   -> Int -> Text -> UploadStatus -> POSIX -> GetUploadStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> Text -> UploadStatus -> POSIX -> GetUploadStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"namespaceName")
            Either
  String
  (Int -> Text -> UploadStatus -> POSIX -> GetUploadStatusResponse)
-> Either String Int
-> Either
     String (Text -> UploadStatus -> POSIX -> GetUploadStatusResponse)
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))
            Either
  String (Text -> UploadStatus -> POSIX -> GetUploadStatusResponse)
-> Either String Text
-> Either String (UploadStatus -> POSIX -> GetUploadStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"uploadId")
            Either String (UploadStatus -> POSIX -> GetUploadStatusResponse)
-> Either String UploadStatus
-> Either String (POSIX -> GetUploadStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String UploadStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"uploadStatus")
            Either String (POSIX -> GetUploadStatusResponse)
-> Either String POSIX -> Either String GetUploadStatusResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"createdDate")
      )

instance Prelude.Hashable GetUploadStatus

instance Prelude.NFData GetUploadStatus

instance Core.ToHeaders GetUploadStatus where
  toHeaders :: GetUploadStatus -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetUploadStatus -> 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
"IotThingsGraphFrontEndService.GetUploadStatus" ::
                          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 GetUploadStatus where
  toJSON :: GetUploadStatus -> Value
toJSON GetUploadStatus' {Text
uploadId :: Text
$sel:uploadId:GetUploadStatus' :: GetUploadStatus -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"uploadId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
uploadId)]
      )

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

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

-- | /See:/ 'newGetUploadStatusResponse' smart constructor.
data GetUploadStatusResponse = GetUploadStatusResponse'
  { -- | The reason for an upload failure.
    GetUploadStatusResponse -> Maybe [Text]
failureReason :: Prelude.Maybe [Prelude.Text],
    -- | The ARN of the upload.
    GetUploadStatusResponse -> Maybe Text
namespaceArn :: Prelude.Maybe Prelude.Text,
    -- | The version of the user\'s namespace. Defaults to the latest version of
    -- the user\'s namespace.
    GetUploadStatusResponse -> Maybe Integer
namespaceVersion :: Prelude.Maybe Prelude.Integer,
    -- | The name of the upload\'s namespace.
    GetUploadStatusResponse -> Maybe Text
namespaceName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetUploadStatusResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the upload.
    GetUploadStatusResponse -> Text
uploadId :: Prelude.Text,
    -- | The status of the upload. The initial status is @IN_PROGRESS@. The
    -- response show all validation failures if the upload fails.
    GetUploadStatusResponse -> UploadStatus
uploadStatus :: UploadStatus,
    -- | The date at which the upload was created.
    GetUploadStatusResponse -> POSIX
createdDate :: Core.POSIX
  }
  deriving (GetUploadStatusResponse -> GetUploadStatusResponse -> Bool
(GetUploadStatusResponse -> GetUploadStatusResponse -> Bool)
-> (GetUploadStatusResponse -> GetUploadStatusResponse -> Bool)
-> Eq GetUploadStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUploadStatusResponse -> GetUploadStatusResponse -> Bool
$c/= :: GetUploadStatusResponse -> GetUploadStatusResponse -> Bool
== :: GetUploadStatusResponse -> GetUploadStatusResponse -> Bool
$c== :: GetUploadStatusResponse -> GetUploadStatusResponse -> Bool
Prelude.Eq, ReadPrec [GetUploadStatusResponse]
ReadPrec GetUploadStatusResponse
Int -> ReadS GetUploadStatusResponse
ReadS [GetUploadStatusResponse]
(Int -> ReadS GetUploadStatusResponse)
-> ReadS [GetUploadStatusResponse]
-> ReadPrec GetUploadStatusResponse
-> ReadPrec [GetUploadStatusResponse]
-> Read GetUploadStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUploadStatusResponse]
$creadListPrec :: ReadPrec [GetUploadStatusResponse]
readPrec :: ReadPrec GetUploadStatusResponse
$creadPrec :: ReadPrec GetUploadStatusResponse
readList :: ReadS [GetUploadStatusResponse]
$creadList :: ReadS [GetUploadStatusResponse]
readsPrec :: Int -> ReadS GetUploadStatusResponse
$creadsPrec :: Int -> ReadS GetUploadStatusResponse
Prelude.Read, Int -> GetUploadStatusResponse -> ShowS
[GetUploadStatusResponse] -> ShowS
GetUploadStatusResponse -> String
(Int -> GetUploadStatusResponse -> ShowS)
-> (GetUploadStatusResponse -> String)
-> ([GetUploadStatusResponse] -> ShowS)
-> Show GetUploadStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUploadStatusResponse] -> ShowS
$cshowList :: [GetUploadStatusResponse] -> ShowS
show :: GetUploadStatusResponse -> String
$cshow :: GetUploadStatusResponse -> String
showsPrec :: Int -> GetUploadStatusResponse -> ShowS
$cshowsPrec :: Int -> GetUploadStatusResponse -> ShowS
Prelude.Show, (forall x.
 GetUploadStatusResponse -> Rep GetUploadStatusResponse x)
-> (forall x.
    Rep GetUploadStatusResponse x -> GetUploadStatusResponse)
-> Generic GetUploadStatusResponse
forall x. Rep GetUploadStatusResponse x -> GetUploadStatusResponse
forall x. GetUploadStatusResponse -> Rep GetUploadStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUploadStatusResponse x -> GetUploadStatusResponse
$cfrom :: forall x. GetUploadStatusResponse -> Rep GetUploadStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetUploadStatusResponse' 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:
--
-- 'failureReason', 'getUploadStatusResponse_failureReason' - The reason for an upload failure.
--
-- 'namespaceArn', 'getUploadStatusResponse_namespaceArn' - The ARN of the upload.
--
-- 'namespaceVersion', 'getUploadStatusResponse_namespaceVersion' - The version of the user\'s namespace. Defaults to the latest version of
-- the user\'s namespace.
--
-- 'namespaceName', 'getUploadStatusResponse_namespaceName' - The name of the upload\'s namespace.
--
-- 'httpStatus', 'getUploadStatusResponse_httpStatus' - The response's http status code.
--
-- 'uploadId', 'getUploadStatusResponse_uploadId' - The ID of the upload.
--
-- 'uploadStatus', 'getUploadStatusResponse_uploadStatus' - The status of the upload. The initial status is @IN_PROGRESS@. The
-- response show all validation failures if the upload fails.
--
-- 'createdDate', 'getUploadStatusResponse_createdDate' - The date at which the upload was created.
newGetUploadStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'uploadId'
  Prelude.Text ->
  -- | 'uploadStatus'
  UploadStatus ->
  -- | 'createdDate'
  Prelude.UTCTime ->
  GetUploadStatusResponse
newGetUploadStatusResponse :: Int -> Text -> UploadStatus -> UTCTime -> GetUploadStatusResponse
newGetUploadStatusResponse
  Int
pHttpStatus_
  Text
pUploadId_
  UploadStatus
pUploadStatus_
  UTCTime
pCreatedDate_ =
    GetUploadStatusResponse' :: Maybe [Text]
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Int
-> Text
-> UploadStatus
-> POSIX
-> GetUploadStatusResponse
GetUploadStatusResponse'
      { $sel:failureReason:GetUploadStatusResponse' :: Maybe [Text]
failureReason =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:namespaceArn:GetUploadStatusResponse' :: Maybe Text
namespaceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:namespaceVersion:GetUploadStatusResponse' :: Maybe Integer
namespaceVersion = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:namespaceName:GetUploadStatusResponse' :: Maybe Text
namespaceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetUploadStatusResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:uploadId:GetUploadStatusResponse' :: Text
uploadId = Text
pUploadId_,
        $sel:uploadStatus:GetUploadStatusResponse' :: UploadStatus
uploadStatus = UploadStatus
pUploadStatus_,
        $sel:createdDate:GetUploadStatusResponse' :: POSIX
createdDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedDate_
      }

-- | The reason for an upload failure.
getUploadStatusResponse_failureReason :: Lens.Lens' GetUploadStatusResponse (Prelude.Maybe [Prelude.Text])
getUploadStatusResponse_failureReason :: (Maybe [Text] -> f (Maybe [Text]))
-> GetUploadStatusResponse -> f GetUploadStatusResponse
getUploadStatusResponse_failureReason = (GetUploadStatusResponse -> Maybe [Text])
-> (GetUploadStatusResponse
    -> Maybe [Text] -> GetUploadStatusResponse)
-> Lens
     GetUploadStatusResponse
     GetUploadStatusResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatusResponse' {Maybe [Text]
failureReason :: Maybe [Text]
$sel:failureReason:GetUploadStatusResponse' :: GetUploadStatusResponse -> Maybe [Text]
failureReason} -> Maybe [Text]
failureReason) (\s :: GetUploadStatusResponse
s@GetUploadStatusResponse' {} Maybe [Text]
a -> GetUploadStatusResponse
s {$sel:failureReason:GetUploadStatusResponse' :: Maybe [Text]
failureReason = Maybe [Text]
a} :: GetUploadStatusResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetUploadStatusResponse -> f GetUploadStatusResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetUploadStatusResponse
-> f GetUploadStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the upload.
getUploadStatusResponse_namespaceArn :: Lens.Lens' GetUploadStatusResponse (Prelude.Maybe Prelude.Text)
getUploadStatusResponse_namespaceArn :: (Maybe Text -> f (Maybe Text))
-> GetUploadStatusResponse -> f GetUploadStatusResponse
getUploadStatusResponse_namespaceArn = (GetUploadStatusResponse -> Maybe Text)
-> (GetUploadStatusResponse
    -> Maybe Text -> GetUploadStatusResponse)
-> Lens
     GetUploadStatusResponse
     GetUploadStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatusResponse' {Maybe Text
namespaceArn :: Maybe Text
$sel:namespaceArn:GetUploadStatusResponse' :: GetUploadStatusResponse -> Maybe Text
namespaceArn} -> Maybe Text
namespaceArn) (\s :: GetUploadStatusResponse
s@GetUploadStatusResponse' {} Maybe Text
a -> GetUploadStatusResponse
s {$sel:namespaceArn:GetUploadStatusResponse' :: Maybe Text
namespaceArn = Maybe Text
a} :: GetUploadStatusResponse)

-- | The version of the user\'s namespace. Defaults to the latest version of
-- the user\'s namespace.
getUploadStatusResponse_namespaceVersion :: Lens.Lens' GetUploadStatusResponse (Prelude.Maybe Prelude.Integer)
getUploadStatusResponse_namespaceVersion :: (Maybe Integer -> f (Maybe Integer))
-> GetUploadStatusResponse -> f GetUploadStatusResponse
getUploadStatusResponse_namespaceVersion = (GetUploadStatusResponse -> Maybe Integer)
-> (GetUploadStatusResponse
    -> Maybe Integer -> GetUploadStatusResponse)
-> Lens
     GetUploadStatusResponse
     GetUploadStatusResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatusResponse' {Maybe Integer
namespaceVersion :: Maybe Integer
$sel:namespaceVersion:GetUploadStatusResponse' :: GetUploadStatusResponse -> Maybe Integer
namespaceVersion} -> Maybe Integer
namespaceVersion) (\s :: GetUploadStatusResponse
s@GetUploadStatusResponse' {} Maybe Integer
a -> GetUploadStatusResponse
s {$sel:namespaceVersion:GetUploadStatusResponse' :: Maybe Integer
namespaceVersion = Maybe Integer
a} :: GetUploadStatusResponse)

-- | The name of the upload\'s namespace.
getUploadStatusResponse_namespaceName :: Lens.Lens' GetUploadStatusResponse (Prelude.Maybe Prelude.Text)
getUploadStatusResponse_namespaceName :: (Maybe Text -> f (Maybe Text))
-> GetUploadStatusResponse -> f GetUploadStatusResponse
getUploadStatusResponse_namespaceName = (GetUploadStatusResponse -> Maybe Text)
-> (GetUploadStatusResponse
    -> Maybe Text -> GetUploadStatusResponse)
-> Lens
     GetUploadStatusResponse
     GetUploadStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatusResponse' {Maybe Text
namespaceName :: Maybe Text
$sel:namespaceName:GetUploadStatusResponse' :: GetUploadStatusResponse -> Maybe Text
namespaceName} -> Maybe Text
namespaceName) (\s :: GetUploadStatusResponse
s@GetUploadStatusResponse' {} Maybe Text
a -> GetUploadStatusResponse
s {$sel:namespaceName:GetUploadStatusResponse' :: Maybe Text
namespaceName = Maybe Text
a} :: GetUploadStatusResponse)

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

-- | The ID of the upload.
getUploadStatusResponse_uploadId :: Lens.Lens' GetUploadStatusResponse Prelude.Text
getUploadStatusResponse_uploadId :: (Text -> f Text)
-> GetUploadStatusResponse -> f GetUploadStatusResponse
getUploadStatusResponse_uploadId = (GetUploadStatusResponse -> Text)
-> (GetUploadStatusResponse -> Text -> GetUploadStatusResponse)
-> Lens GetUploadStatusResponse GetUploadStatusResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatusResponse' {Text
uploadId :: Text
$sel:uploadId:GetUploadStatusResponse' :: GetUploadStatusResponse -> Text
uploadId} -> Text
uploadId) (\s :: GetUploadStatusResponse
s@GetUploadStatusResponse' {} Text
a -> GetUploadStatusResponse
s {$sel:uploadId:GetUploadStatusResponse' :: Text
uploadId = Text
a} :: GetUploadStatusResponse)

-- | The status of the upload. The initial status is @IN_PROGRESS@. The
-- response show all validation failures if the upload fails.
getUploadStatusResponse_uploadStatus :: Lens.Lens' GetUploadStatusResponse UploadStatus
getUploadStatusResponse_uploadStatus :: (UploadStatus -> f UploadStatus)
-> GetUploadStatusResponse -> f GetUploadStatusResponse
getUploadStatusResponse_uploadStatus = (GetUploadStatusResponse -> UploadStatus)
-> (GetUploadStatusResponse
    -> UploadStatus -> GetUploadStatusResponse)
-> Lens
     GetUploadStatusResponse
     GetUploadStatusResponse
     UploadStatus
     UploadStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatusResponse' {UploadStatus
uploadStatus :: UploadStatus
$sel:uploadStatus:GetUploadStatusResponse' :: GetUploadStatusResponse -> UploadStatus
uploadStatus} -> UploadStatus
uploadStatus) (\s :: GetUploadStatusResponse
s@GetUploadStatusResponse' {} UploadStatus
a -> GetUploadStatusResponse
s {$sel:uploadStatus:GetUploadStatusResponse' :: UploadStatus
uploadStatus = UploadStatus
a} :: GetUploadStatusResponse)

-- | The date at which the upload was created.
getUploadStatusResponse_createdDate :: Lens.Lens' GetUploadStatusResponse Prelude.UTCTime
getUploadStatusResponse_createdDate :: (UTCTime -> f UTCTime)
-> GetUploadStatusResponse -> f GetUploadStatusResponse
getUploadStatusResponse_createdDate = (GetUploadStatusResponse -> POSIX)
-> (GetUploadStatusResponse -> POSIX -> GetUploadStatusResponse)
-> Lens GetUploadStatusResponse GetUploadStatusResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUploadStatusResponse' {POSIX
createdDate :: POSIX
$sel:createdDate:GetUploadStatusResponse' :: GetUploadStatusResponse -> POSIX
createdDate} -> POSIX
createdDate) (\s :: GetUploadStatusResponse
s@GetUploadStatusResponse' {} POSIX
a -> GetUploadStatusResponse
s {$sel:createdDate:GetUploadStatusResponse' :: POSIX
createdDate = POSIX
a} :: GetUploadStatusResponse) ((POSIX -> f POSIX)
 -> GetUploadStatusResponse -> f GetUploadStatusResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetUploadStatusResponse
-> f GetUploadStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Prelude.NFData GetUploadStatusResponse