{-# 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.Wisdom.StartContentUpload
-- 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)
--
-- Get a URL to upload content to a knowledge base. To upload content,
-- first make a PUT request to the returned URL with your file, making sure
-- to include the required headers. Then use
-- <https://docs.aws.amazon.com/wisdom/latest/APIReference/API_CreateContent.html CreateContent>
-- to finalize the content creation process or
-- <https://docs.aws.amazon.com/wisdom/latest/APIReference/API_UpdateContent.html UpdateContent>
-- to modify an existing resource. You can only upload content to a
-- knowledge base of type CUSTOM.
module Amazonka.Wisdom.StartContentUpload
  ( -- * Creating a Request
    StartContentUpload (..),
    newStartContentUpload,

    -- * Request Lenses
    startContentUpload_contentType,
    startContentUpload_knowledgeBaseId,

    -- * Destructuring the Response
    StartContentUploadResponse (..),
    newStartContentUploadResponse,

    -- * Response Lenses
    startContentUploadResponse_httpStatus,
    startContentUploadResponse_headersToInclude,
    startContentUploadResponse_uploadId,
    startContentUploadResponse_url,
    startContentUploadResponse_urlExpiry,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Wisdom.Types

-- | /See:/ 'newStartContentUpload' smart constructor.
data StartContentUpload = StartContentUpload'
  { -- | The type of content to upload.
    StartContentUpload -> Text
contentType :: Prelude.Text,
    -- | The the identifier of the knowledge base. Can be either the ID or the
    -- ARN. URLs cannot contain the ARN.
    StartContentUpload -> Text
knowledgeBaseId :: Prelude.Text
  }
  deriving (StartContentUpload -> StartContentUpload -> Bool
(StartContentUpload -> StartContentUpload -> Bool)
-> (StartContentUpload -> StartContentUpload -> Bool)
-> Eq StartContentUpload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartContentUpload -> StartContentUpload -> Bool
$c/= :: StartContentUpload -> StartContentUpload -> Bool
== :: StartContentUpload -> StartContentUpload -> Bool
$c== :: StartContentUpload -> StartContentUpload -> Bool
Prelude.Eq, ReadPrec [StartContentUpload]
ReadPrec StartContentUpload
Int -> ReadS StartContentUpload
ReadS [StartContentUpload]
(Int -> ReadS StartContentUpload)
-> ReadS [StartContentUpload]
-> ReadPrec StartContentUpload
-> ReadPrec [StartContentUpload]
-> Read StartContentUpload
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartContentUpload]
$creadListPrec :: ReadPrec [StartContentUpload]
readPrec :: ReadPrec StartContentUpload
$creadPrec :: ReadPrec StartContentUpload
readList :: ReadS [StartContentUpload]
$creadList :: ReadS [StartContentUpload]
readsPrec :: Int -> ReadS StartContentUpload
$creadsPrec :: Int -> ReadS StartContentUpload
Prelude.Read, Int -> StartContentUpload -> ShowS
[StartContentUpload] -> ShowS
StartContentUpload -> String
(Int -> StartContentUpload -> ShowS)
-> (StartContentUpload -> String)
-> ([StartContentUpload] -> ShowS)
-> Show StartContentUpload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartContentUpload] -> ShowS
$cshowList :: [StartContentUpload] -> ShowS
show :: StartContentUpload -> String
$cshow :: StartContentUpload -> String
showsPrec :: Int -> StartContentUpload -> ShowS
$cshowsPrec :: Int -> StartContentUpload -> ShowS
Prelude.Show, (forall x. StartContentUpload -> Rep StartContentUpload x)
-> (forall x. Rep StartContentUpload x -> StartContentUpload)
-> Generic StartContentUpload
forall x. Rep StartContentUpload x -> StartContentUpload
forall x. StartContentUpload -> Rep StartContentUpload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartContentUpload x -> StartContentUpload
$cfrom :: forall x. StartContentUpload -> Rep StartContentUpload x
Prelude.Generic)

-- |
-- Create a value of 'StartContentUpload' 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', 'startContentUpload_contentType' - The type of content to upload.
--
-- 'knowledgeBaseId', 'startContentUpload_knowledgeBaseId' - The the identifier of the knowledge base. Can be either the ID or the
-- ARN. URLs cannot contain the ARN.
newStartContentUpload ::
  -- | 'contentType'
  Prelude.Text ->
  -- | 'knowledgeBaseId'
  Prelude.Text ->
  StartContentUpload
newStartContentUpload :: Text -> Text -> StartContentUpload
newStartContentUpload Text
pContentType_ Text
pKnowledgeBaseId_ =
  StartContentUpload' :: Text -> Text -> StartContentUpload
StartContentUpload'
    { $sel:contentType:StartContentUpload' :: Text
contentType = Text
pContentType_,
      $sel:knowledgeBaseId:StartContentUpload' :: Text
knowledgeBaseId = Text
pKnowledgeBaseId_
    }

-- | The type of content to upload.
startContentUpload_contentType :: Lens.Lens' StartContentUpload Prelude.Text
startContentUpload_contentType :: (Text -> f Text) -> StartContentUpload -> f StartContentUpload
startContentUpload_contentType = (StartContentUpload -> Text)
-> (StartContentUpload -> Text -> StartContentUpload)
-> Lens StartContentUpload StartContentUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentUpload' {Text
contentType :: Text
$sel:contentType:StartContentUpload' :: StartContentUpload -> Text
contentType} -> Text
contentType) (\s :: StartContentUpload
s@StartContentUpload' {} Text
a -> StartContentUpload
s {$sel:contentType:StartContentUpload' :: Text
contentType = Text
a} :: StartContentUpload)

-- | The the identifier of the knowledge base. Can be either the ID or the
-- ARN. URLs cannot contain the ARN.
startContentUpload_knowledgeBaseId :: Lens.Lens' StartContentUpload Prelude.Text
startContentUpload_knowledgeBaseId :: (Text -> f Text) -> StartContentUpload -> f StartContentUpload
startContentUpload_knowledgeBaseId = (StartContentUpload -> Text)
-> (StartContentUpload -> Text -> StartContentUpload)
-> Lens StartContentUpload StartContentUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentUpload' {Text
knowledgeBaseId :: Text
$sel:knowledgeBaseId:StartContentUpload' :: StartContentUpload -> Text
knowledgeBaseId} -> Text
knowledgeBaseId) (\s :: StartContentUpload
s@StartContentUpload' {} Text
a -> StartContentUpload
s {$sel:knowledgeBaseId:StartContentUpload' :: Text
knowledgeBaseId = Text
a} :: StartContentUpload)

instance Core.AWSRequest StartContentUpload where
  type
    AWSResponse StartContentUpload =
      StartContentUploadResponse
  request :: StartContentUpload -> Request StartContentUpload
request = Service -> StartContentUpload -> Request StartContentUpload
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartContentUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartContentUpload)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartContentUpload))
-> Logger
-> Service
-> Proxy StartContentUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartContentUpload)))
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 ->
          Int
-> HashMap Text Text
-> Text
-> Sensitive Text
-> POSIX
-> StartContentUploadResponse
StartContentUploadResponse'
            (Int
 -> HashMap Text Text
 -> Text
 -> Sensitive Text
 -> POSIX
 -> StartContentUploadResponse)
-> Either String Int
-> Either
     String
     (HashMap Text Text
      -> Text -> Sensitive Text -> POSIX -> StartContentUploadResponse)
forall (f :: * -> *) a b. Functor 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
  (HashMap Text Text
   -> Text -> Sensitive Text -> POSIX -> StartContentUploadResponse)
-> Either String (HashMap Text Text)
-> Either
     String
     (Text -> Sensitive Text -> POSIX -> StartContentUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (HashMap Text Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"headersToInclude"
                            Either String (Maybe (HashMap Text Text))
-> HashMap Text Text -> Either String (HashMap Text Text)
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ HashMap Text Text
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Text -> Sensitive Text -> POSIX -> StartContentUploadResponse)
-> Either String Text
-> Either
     String (Sensitive Text -> POSIX -> StartContentUploadResponse)
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 (Sensitive Text -> POSIX -> StartContentUploadResponse)
-> Either String (Sensitive Text)
-> Either String (POSIX -> StartContentUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Sensitive Text)
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"url")
            Either String (POSIX -> StartContentUploadResponse)
-> Either String POSIX -> Either String StartContentUploadResponse
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
"urlExpiry")
      )

instance Prelude.Hashable StartContentUpload

instance Prelude.NFData StartContentUpload

instance Core.ToHeaders StartContentUpload where
  toHeaders :: StartContentUpload -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartContentUpload -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 StartContentUpload where
  toJSON :: StartContentUpload -> Value
toJSON StartContentUpload' {Text
knowledgeBaseId :: Text
contentType :: Text
$sel:knowledgeBaseId:StartContentUpload' :: StartContentUpload -> Text
$sel:contentType:StartContentUpload' :: StartContentUpload -> 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
"contentType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contentType)]
      )

instance Core.ToPath StartContentUpload where
  toPath :: StartContentUpload -> ByteString
toPath StartContentUpload' {Text
knowledgeBaseId :: Text
contentType :: Text
$sel:knowledgeBaseId:StartContentUpload' :: StartContentUpload -> Text
$sel:contentType:StartContentUpload' :: StartContentUpload -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/knowledgeBases/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
knowledgeBaseId,
        ByteString
"/upload"
      ]

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

-- | /See:/ 'newStartContentUploadResponse' smart constructor.
data StartContentUploadResponse = StartContentUploadResponse'
  { -- | The response's http status code.
    StartContentUploadResponse -> Int
httpStatus :: Prelude.Int,
    -- | The headers to include in the upload.
    StartContentUploadResponse -> HashMap Text Text
headersToInclude :: Prelude.HashMap Prelude.Text Prelude.Text,
    -- | The identifier of the upload.
    StartContentUploadResponse -> Text
uploadId :: Prelude.Text,
    -- | The URL of the upload.
    StartContentUploadResponse -> Sensitive Text
url :: Core.Sensitive Prelude.Text,
    -- | The expiration time of the URL as an epoch timestamp.
    StartContentUploadResponse -> POSIX
urlExpiry :: Core.POSIX
  }
  deriving (StartContentUploadResponse -> StartContentUploadResponse -> Bool
(StartContentUploadResponse -> StartContentUploadResponse -> Bool)
-> (StartContentUploadResponse
    -> StartContentUploadResponse -> Bool)
-> Eq StartContentUploadResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartContentUploadResponse -> StartContentUploadResponse -> Bool
$c/= :: StartContentUploadResponse -> StartContentUploadResponse -> Bool
== :: StartContentUploadResponse -> StartContentUploadResponse -> Bool
$c== :: StartContentUploadResponse -> StartContentUploadResponse -> Bool
Prelude.Eq, Int -> StartContentUploadResponse -> ShowS
[StartContentUploadResponse] -> ShowS
StartContentUploadResponse -> String
(Int -> StartContentUploadResponse -> ShowS)
-> (StartContentUploadResponse -> String)
-> ([StartContentUploadResponse] -> ShowS)
-> Show StartContentUploadResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartContentUploadResponse] -> ShowS
$cshowList :: [StartContentUploadResponse] -> ShowS
show :: StartContentUploadResponse -> String
$cshow :: StartContentUploadResponse -> String
showsPrec :: Int -> StartContentUploadResponse -> ShowS
$cshowsPrec :: Int -> StartContentUploadResponse -> ShowS
Prelude.Show, (forall x.
 StartContentUploadResponse -> Rep StartContentUploadResponse x)
-> (forall x.
    Rep StartContentUploadResponse x -> StartContentUploadResponse)
-> Generic StartContentUploadResponse
forall x.
Rep StartContentUploadResponse x -> StartContentUploadResponse
forall x.
StartContentUploadResponse -> Rep StartContentUploadResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartContentUploadResponse x -> StartContentUploadResponse
$cfrom :: forall x.
StartContentUploadResponse -> Rep StartContentUploadResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartContentUploadResponse' 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:
--
-- 'httpStatus', 'startContentUploadResponse_httpStatus' - The response's http status code.
--
-- 'headersToInclude', 'startContentUploadResponse_headersToInclude' - The headers to include in the upload.
--
-- 'uploadId', 'startContentUploadResponse_uploadId' - The identifier of the upload.
--
-- 'url', 'startContentUploadResponse_url' - The URL of the upload.
--
-- 'urlExpiry', 'startContentUploadResponse_urlExpiry' - The expiration time of the URL as an epoch timestamp.
newStartContentUploadResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'uploadId'
  Prelude.Text ->
  -- | 'url'
  Prelude.Text ->
  -- | 'urlExpiry'
  Prelude.UTCTime ->
  StartContentUploadResponse
newStartContentUploadResponse :: Int -> Text -> Text -> UTCTime -> StartContentUploadResponse
newStartContentUploadResponse
  Int
pHttpStatus_
  Text
pUploadId_
  Text
pUrl_
  UTCTime
pUrlExpiry_ =
    StartContentUploadResponse' :: Int
-> HashMap Text Text
-> Text
-> Sensitive Text
-> POSIX
-> StartContentUploadResponse
StartContentUploadResponse'
      { $sel:httpStatus:StartContentUploadResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:headersToInclude:StartContentUploadResponse' :: HashMap Text Text
headersToInclude = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty,
        $sel:uploadId:StartContentUploadResponse' :: Text
uploadId = Text
pUploadId_,
        $sel:url:StartContentUploadResponse' :: Sensitive Text
url = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pUrl_,
        $sel:urlExpiry:StartContentUploadResponse' :: POSIX
urlExpiry = 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
pUrlExpiry_
      }

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

-- | The headers to include in the upload.
startContentUploadResponse_headersToInclude :: Lens.Lens' StartContentUploadResponse (Prelude.HashMap Prelude.Text Prelude.Text)
startContentUploadResponse_headersToInclude :: (HashMap Text Text -> f (HashMap Text Text))
-> StartContentUploadResponse -> f StartContentUploadResponse
startContentUploadResponse_headersToInclude = (StartContentUploadResponse -> HashMap Text Text)
-> (StartContentUploadResponse
    -> HashMap Text Text -> StartContentUploadResponse)
-> Lens
     StartContentUploadResponse
     StartContentUploadResponse
     (HashMap Text Text)
     (HashMap Text Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentUploadResponse' {HashMap Text Text
headersToInclude :: HashMap Text Text
$sel:headersToInclude:StartContentUploadResponse' :: StartContentUploadResponse -> HashMap Text Text
headersToInclude} -> HashMap Text Text
headersToInclude) (\s :: StartContentUploadResponse
s@StartContentUploadResponse' {} HashMap Text Text
a -> StartContentUploadResponse
s {$sel:headersToInclude:StartContentUploadResponse' :: HashMap Text Text
headersToInclude = HashMap Text Text
a} :: StartContentUploadResponse) ((HashMap Text Text -> f (HashMap Text Text))
 -> StartContentUploadResponse -> f StartContentUploadResponse)
-> ((HashMap Text Text -> f (HashMap Text Text))
    -> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> StartContentUploadResponse
-> f StartContentUploadResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The URL of the upload.
startContentUploadResponse_url :: Lens.Lens' StartContentUploadResponse Prelude.Text
startContentUploadResponse_url :: (Text -> f Text)
-> StartContentUploadResponse -> f StartContentUploadResponse
startContentUploadResponse_url = (StartContentUploadResponse -> Sensitive Text)
-> (StartContentUploadResponse
    -> Sensitive Text -> StartContentUploadResponse)
-> Lens
     StartContentUploadResponse
     StartContentUploadResponse
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentUploadResponse' {Sensitive Text
url :: Sensitive Text
$sel:url:StartContentUploadResponse' :: StartContentUploadResponse -> Sensitive Text
url} -> Sensitive Text
url) (\s :: StartContentUploadResponse
s@StartContentUploadResponse' {} Sensitive Text
a -> StartContentUploadResponse
s {$sel:url:StartContentUploadResponse' :: Sensitive Text
url = Sensitive Text
a} :: StartContentUploadResponse) ((Sensitive Text -> f (Sensitive Text))
 -> StartContentUploadResponse -> f StartContentUploadResponse)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> StartContentUploadResponse
-> f StartContentUploadResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The expiration time of the URL as an epoch timestamp.
startContentUploadResponse_urlExpiry :: Lens.Lens' StartContentUploadResponse Prelude.UTCTime
startContentUploadResponse_urlExpiry :: (UTCTime -> f UTCTime)
-> StartContentUploadResponse -> f StartContentUploadResponse
startContentUploadResponse_urlExpiry = (StartContentUploadResponse -> POSIX)
-> (StartContentUploadResponse
    -> POSIX -> StartContentUploadResponse)
-> Lens
     StartContentUploadResponse StartContentUploadResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentUploadResponse' {POSIX
urlExpiry :: POSIX
$sel:urlExpiry:StartContentUploadResponse' :: StartContentUploadResponse -> POSIX
urlExpiry} -> POSIX
urlExpiry) (\s :: StartContentUploadResponse
s@StartContentUploadResponse' {} POSIX
a -> StartContentUploadResponse
s {$sel:urlExpiry:StartContentUploadResponse' :: POSIX
urlExpiry = POSIX
a} :: StartContentUploadResponse) ((POSIX -> f POSIX)
 -> StartContentUploadResponse -> f StartContentUploadResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> StartContentUploadResponse
-> f StartContentUploadResponse
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 StartContentUploadResponse