{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The details of the export to signed URL response.
--
-- /See:/ 'newExportAssetToSignedUrlResponseDetails' smart constructor.
data ExportAssetToSignedUrlResponseDetails = ExportAssetToSignedUrlResponseDetails'
  { -- | The signed URL for the export request.
    ExportAssetToSignedUrlResponseDetails -> Maybe Text
signedUrl :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the signed URL expires, in ISO 8601 format.
    ExportAssetToSignedUrlResponseDetails -> Maybe POSIX
signedUrlExpiresAt :: Prelude.Maybe Core.POSIX,
    -- | The unique identifier for the data set associated with this export job.
    ExportAssetToSignedUrlResponseDetails -> Text
dataSetId :: Prelude.Text,
    -- | The unique identifier for the asset associated with this export job.
    ExportAssetToSignedUrlResponseDetails -> Text
assetId :: Prelude.Text,
    -- | The unique identifier for the revision associated with this export
    -- response.
    ExportAssetToSignedUrlResponseDetails -> Text
revisionId :: Prelude.Text
  }
  deriving (ExportAssetToSignedUrlResponseDetails
-> ExportAssetToSignedUrlResponseDetails -> Bool
(ExportAssetToSignedUrlResponseDetails
 -> ExportAssetToSignedUrlResponseDetails -> Bool)
-> (ExportAssetToSignedUrlResponseDetails
    -> ExportAssetToSignedUrlResponseDetails -> Bool)
-> Eq ExportAssetToSignedUrlResponseDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportAssetToSignedUrlResponseDetails
-> ExportAssetToSignedUrlResponseDetails -> Bool
$c/= :: ExportAssetToSignedUrlResponseDetails
-> ExportAssetToSignedUrlResponseDetails -> Bool
== :: ExportAssetToSignedUrlResponseDetails
-> ExportAssetToSignedUrlResponseDetails -> Bool
$c== :: ExportAssetToSignedUrlResponseDetails
-> ExportAssetToSignedUrlResponseDetails -> Bool
Prelude.Eq, ReadPrec [ExportAssetToSignedUrlResponseDetails]
ReadPrec ExportAssetToSignedUrlResponseDetails
Int -> ReadS ExportAssetToSignedUrlResponseDetails
ReadS [ExportAssetToSignedUrlResponseDetails]
(Int -> ReadS ExportAssetToSignedUrlResponseDetails)
-> ReadS [ExportAssetToSignedUrlResponseDetails]
-> ReadPrec ExportAssetToSignedUrlResponseDetails
-> ReadPrec [ExportAssetToSignedUrlResponseDetails]
-> Read ExportAssetToSignedUrlResponseDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportAssetToSignedUrlResponseDetails]
$creadListPrec :: ReadPrec [ExportAssetToSignedUrlResponseDetails]
readPrec :: ReadPrec ExportAssetToSignedUrlResponseDetails
$creadPrec :: ReadPrec ExportAssetToSignedUrlResponseDetails
readList :: ReadS [ExportAssetToSignedUrlResponseDetails]
$creadList :: ReadS [ExportAssetToSignedUrlResponseDetails]
readsPrec :: Int -> ReadS ExportAssetToSignedUrlResponseDetails
$creadsPrec :: Int -> ReadS ExportAssetToSignedUrlResponseDetails
Prelude.Read, Int -> ExportAssetToSignedUrlResponseDetails -> ShowS
[ExportAssetToSignedUrlResponseDetails] -> ShowS
ExportAssetToSignedUrlResponseDetails -> String
(Int -> ExportAssetToSignedUrlResponseDetails -> ShowS)
-> (ExportAssetToSignedUrlResponseDetails -> String)
-> ([ExportAssetToSignedUrlResponseDetails] -> ShowS)
-> Show ExportAssetToSignedUrlResponseDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportAssetToSignedUrlResponseDetails] -> ShowS
$cshowList :: [ExportAssetToSignedUrlResponseDetails] -> ShowS
show :: ExportAssetToSignedUrlResponseDetails -> String
$cshow :: ExportAssetToSignedUrlResponseDetails -> String
showsPrec :: Int -> ExportAssetToSignedUrlResponseDetails -> ShowS
$cshowsPrec :: Int -> ExportAssetToSignedUrlResponseDetails -> ShowS
Prelude.Show, (forall x.
 ExportAssetToSignedUrlResponseDetails
 -> Rep ExportAssetToSignedUrlResponseDetails x)
-> (forall x.
    Rep ExportAssetToSignedUrlResponseDetails x
    -> ExportAssetToSignedUrlResponseDetails)
-> Generic ExportAssetToSignedUrlResponseDetails
forall x.
Rep ExportAssetToSignedUrlResponseDetails x
-> ExportAssetToSignedUrlResponseDetails
forall x.
ExportAssetToSignedUrlResponseDetails
-> Rep ExportAssetToSignedUrlResponseDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportAssetToSignedUrlResponseDetails x
-> ExportAssetToSignedUrlResponseDetails
$cfrom :: forall x.
ExportAssetToSignedUrlResponseDetails
-> Rep ExportAssetToSignedUrlResponseDetails x
Prelude.Generic)

-- |
-- Create a value of 'ExportAssetToSignedUrlResponseDetails' 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:
--
-- 'signedUrl', 'exportAssetToSignedUrlResponseDetails_signedUrl' - The signed URL for the export request.
--
-- 'signedUrlExpiresAt', 'exportAssetToSignedUrlResponseDetails_signedUrlExpiresAt' - The date and time that the signed URL expires, in ISO 8601 format.
--
-- 'dataSetId', 'exportAssetToSignedUrlResponseDetails_dataSetId' - The unique identifier for the data set associated with this export job.
--
-- 'assetId', 'exportAssetToSignedUrlResponseDetails_assetId' - The unique identifier for the asset associated with this export job.
--
-- 'revisionId', 'exportAssetToSignedUrlResponseDetails_revisionId' - The unique identifier for the revision associated with this export
-- response.
newExportAssetToSignedUrlResponseDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  -- | 'assetId'
  Prelude.Text ->
  -- | 'revisionId'
  Prelude.Text ->
  ExportAssetToSignedUrlResponseDetails
newExportAssetToSignedUrlResponseDetails :: Text -> Text -> Text -> ExportAssetToSignedUrlResponseDetails
newExportAssetToSignedUrlResponseDetails
  Text
pDataSetId_
  Text
pAssetId_
  Text
pRevisionId_ =
    ExportAssetToSignedUrlResponseDetails' :: Maybe Text
-> Maybe POSIX
-> Text
-> Text
-> Text
-> ExportAssetToSignedUrlResponseDetails
ExportAssetToSignedUrlResponseDetails'
      { $sel:signedUrl:ExportAssetToSignedUrlResponseDetails' :: Maybe Text
signedUrl =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:signedUrlExpiresAt:ExportAssetToSignedUrlResponseDetails' :: Maybe POSIX
signedUrlExpiresAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:dataSetId:ExportAssetToSignedUrlResponseDetails' :: Text
dataSetId = Text
pDataSetId_,
        $sel:assetId:ExportAssetToSignedUrlResponseDetails' :: Text
assetId = Text
pAssetId_,
        $sel:revisionId:ExportAssetToSignedUrlResponseDetails' :: Text
revisionId = Text
pRevisionId_
      }

-- | The signed URL for the export request.
exportAssetToSignedUrlResponseDetails_signedUrl :: Lens.Lens' ExportAssetToSignedUrlResponseDetails (Prelude.Maybe Prelude.Text)
exportAssetToSignedUrlResponseDetails_signedUrl :: (Maybe Text -> f (Maybe Text))
-> ExportAssetToSignedUrlResponseDetails
-> f ExportAssetToSignedUrlResponseDetails
exportAssetToSignedUrlResponseDetails_signedUrl = (ExportAssetToSignedUrlResponseDetails -> Maybe Text)
-> (ExportAssetToSignedUrlResponseDetails
    -> Maybe Text -> ExportAssetToSignedUrlResponseDetails)
-> Lens
     ExportAssetToSignedUrlResponseDetails
     ExportAssetToSignedUrlResponseDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetToSignedUrlResponseDetails' {Maybe Text
signedUrl :: Maybe Text
$sel:signedUrl:ExportAssetToSignedUrlResponseDetails' :: ExportAssetToSignedUrlResponseDetails -> Maybe Text
signedUrl} -> Maybe Text
signedUrl) (\s :: ExportAssetToSignedUrlResponseDetails
s@ExportAssetToSignedUrlResponseDetails' {} Maybe Text
a -> ExportAssetToSignedUrlResponseDetails
s {$sel:signedUrl:ExportAssetToSignedUrlResponseDetails' :: Maybe Text
signedUrl = Maybe Text
a} :: ExportAssetToSignedUrlResponseDetails)

-- | The date and time that the signed URL expires, in ISO 8601 format.
exportAssetToSignedUrlResponseDetails_signedUrlExpiresAt :: Lens.Lens' ExportAssetToSignedUrlResponseDetails (Prelude.Maybe Prelude.UTCTime)
exportAssetToSignedUrlResponseDetails_signedUrlExpiresAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ExportAssetToSignedUrlResponseDetails
-> f ExportAssetToSignedUrlResponseDetails
exportAssetToSignedUrlResponseDetails_signedUrlExpiresAt = (ExportAssetToSignedUrlResponseDetails -> Maybe POSIX)
-> (ExportAssetToSignedUrlResponseDetails
    -> Maybe POSIX -> ExportAssetToSignedUrlResponseDetails)
-> Lens
     ExportAssetToSignedUrlResponseDetails
     ExportAssetToSignedUrlResponseDetails
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetToSignedUrlResponseDetails' {Maybe POSIX
signedUrlExpiresAt :: Maybe POSIX
$sel:signedUrlExpiresAt:ExportAssetToSignedUrlResponseDetails' :: ExportAssetToSignedUrlResponseDetails -> Maybe POSIX
signedUrlExpiresAt} -> Maybe POSIX
signedUrlExpiresAt) (\s :: ExportAssetToSignedUrlResponseDetails
s@ExportAssetToSignedUrlResponseDetails' {} Maybe POSIX
a -> ExportAssetToSignedUrlResponseDetails
s {$sel:signedUrlExpiresAt:ExportAssetToSignedUrlResponseDetails' :: Maybe POSIX
signedUrlExpiresAt = Maybe POSIX
a} :: ExportAssetToSignedUrlResponseDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> ExportAssetToSignedUrlResponseDetails
 -> f ExportAssetToSignedUrlResponseDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExportAssetToSignedUrlResponseDetails
-> f ExportAssetToSignedUrlResponseDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The unique identifier for the data set associated with this export job.
exportAssetToSignedUrlResponseDetails_dataSetId :: Lens.Lens' ExportAssetToSignedUrlResponseDetails Prelude.Text
exportAssetToSignedUrlResponseDetails_dataSetId :: (Text -> f Text)
-> ExportAssetToSignedUrlResponseDetails
-> f ExportAssetToSignedUrlResponseDetails
exportAssetToSignedUrlResponseDetails_dataSetId = (ExportAssetToSignedUrlResponseDetails -> Text)
-> (ExportAssetToSignedUrlResponseDetails
    -> Text -> ExportAssetToSignedUrlResponseDetails)
-> Lens
     ExportAssetToSignedUrlResponseDetails
     ExportAssetToSignedUrlResponseDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetToSignedUrlResponseDetails' {Text
dataSetId :: Text
$sel:dataSetId:ExportAssetToSignedUrlResponseDetails' :: ExportAssetToSignedUrlResponseDetails -> Text
dataSetId} -> Text
dataSetId) (\s :: ExportAssetToSignedUrlResponseDetails
s@ExportAssetToSignedUrlResponseDetails' {} Text
a -> ExportAssetToSignedUrlResponseDetails
s {$sel:dataSetId:ExportAssetToSignedUrlResponseDetails' :: Text
dataSetId = Text
a} :: ExportAssetToSignedUrlResponseDetails)

-- | The unique identifier for the asset associated with this export job.
exportAssetToSignedUrlResponseDetails_assetId :: Lens.Lens' ExportAssetToSignedUrlResponseDetails Prelude.Text
exportAssetToSignedUrlResponseDetails_assetId :: (Text -> f Text)
-> ExportAssetToSignedUrlResponseDetails
-> f ExportAssetToSignedUrlResponseDetails
exportAssetToSignedUrlResponseDetails_assetId = (ExportAssetToSignedUrlResponseDetails -> Text)
-> (ExportAssetToSignedUrlResponseDetails
    -> Text -> ExportAssetToSignedUrlResponseDetails)
-> Lens
     ExportAssetToSignedUrlResponseDetails
     ExportAssetToSignedUrlResponseDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetToSignedUrlResponseDetails' {Text
assetId :: Text
$sel:assetId:ExportAssetToSignedUrlResponseDetails' :: ExportAssetToSignedUrlResponseDetails -> Text
assetId} -> Text
assetId) (\s :: ExportAssetToSignedUrlResponseDetails
s@ExportAssetToSignedUrlResponseDetails' {} Text
a -> ExportAssetToSignedUrlResponseDetails
s {$sel:assetId:ExportAssetToSignedUrlResponseDetails' :: Text
assetId = Text
a} :: ExportAssetToSignedUrlResponseDetails)

-- | The unique identifier for the revision associated with this export
-- response.
exportAssetToSignedUrlResponseDetails_revisionId :: Lens.Lens' ExportAssetToSignedUrlResponseDetails Prelude.Text
exportAssetToSignedUrlResponseDetails_revisionId :: (Text -> f Text)
-> ExportAssetToSignedUrlResponseDetails
-> f ExportAssetToSignedUrlResponseDetails
exportAssetToSignedUrlResponseDetails_revisionId = (ExportAssetToSignedUrlResponseDetails -> Text)
-> (ExportAssetToSignedUrlResponseDetails
    -> Text -> ExportAssetToSignedUrlResponseDetails)
-> Lens
     ExportAssetToSignedUrlResponseDetails
     ExportAssetToSignedUrlResponseDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetToSignedUrlResponseDetails' {Text
revisionId :: Text
$sel:revisionId:ExportAssetToSignedUrlResponseDetails' :: ExportAssetToSignedUrlResponseDetails -> Text
revisionId} -> Text
revisionId) (\s :: ExportAssetToSignedUrlResponseDetails
s@ExportAssetToSignedUrlResponseDetails' {} Text
a -> ExportAssetToSignedUrlResponseDetails
s {$sel:revisionId:ExportAssetToSignedUrlResponseDetails' :: Text
revisionId = Text
a} :: ExportAssetToSignedUrlResponseDetails)

instance
  Core.FromJSON
    ExportAssetToSignedUrlResponseDetails
  where
  parseJSON :: Value -> Parser ExportAssetToSignedUrlResponseDetails
parseJSON =
    String
-> (Object -> Parser ExportAssetToSignedUrlResponseDetails)
-> Value
-> Parser ExportAssetToSignedUrlResponseDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExportAssetToSignedUrlResponseDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Text
-> Text
-> Text
-> ExportAssetToSignedUrlResponseDetails
ExportAssetToSignedUrlResponseDetails'
            (Maybe Text
 -> Maybe POSIX
 -> Text
 -> Text
 -> Text
 -> ExportAssetToSignedUrlResponseDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Text -> Text -> Text -> ExportAssetToSignedUrlResponseDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SignedUrl")
            Parser
  (Maybe POSIX
   -> Text -> Text -> Text -> ExportAssetToSignedUrlResponseDetails)
-> Parser (Maybe POSIX)
-> Parser
     (Text -> Text -> Text -> ExportAssetToSignedUrlResponseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SignedUrlExpiresAt")
            Parser
  (Text -> Text -> Text -> ExportAssetToSignedUrlResponseDetails)
-> Parser Text
-> Parser (Text -> Text -> ExportAssetToSignedUrlResponseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DataSetId")
            Parser (Text -> Text -> ExportAssetToSignedUrlResponseDetails)
-> Parser Text
-> Parser (Text -> ExportAssetToSignedUrlResponseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AssetId")
            Parser (Text -> ExportAssetToSignedUrlResponseDetails)
-> Parser Text -> Parser ExportAssetToSignedUrlResponseDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RevisionId")
      )

instance
  Prelude.Hashable
    ExportAssetToSignedUrlResponseDetails

instance
  Prelude.NFData
    ExportAssetToSignedUrlResponseDetails