{-# 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.DataExchange.GetAsset
-- 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)
--
-- This operation returns information about an asset.
module Amazonka.DataExchange.GetAsset
  ( -- * Creating a Request
    GetAsset (..),
    newGetAsset,

    -- * Request Lenses
    getAsset_revisionId,
    getAsset_assetId,
    getAsset_dataSetId,

    -- * Destructuring the Response
    GetAssetResponse (..),
    newGetAssetResponse,

    -- * Response Lenses
    getAssetResponse_arn,
    getAssetResponse_createdAt,
    getAssetResponse_sourceId,
    getAssetResponse_dataSetId,
    getAssetResponse_name,
    getAssetResponse_assetDetails,
    getAssetResponse_id,
    getAssetResponse_assetType,
    getAssetResponse_updatedAt,
    getAssetResponse_revisionId,
    getAssetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataExchange.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:/ 'newGetAsset' smart constructor.
data GetAsset = GetAsset'
  { -- | The unique identifier for a revision.
    GetAsset -> Text
revisionId :: Prelude.Text,
    -- | The unique identifier for an asset.
    GetAsset -> Text
assetId :: Prelude.Text,
    -- | The unique identifier for a data set.
    GetAsset -> Text
dataSetId :: Prelude.Text
  }
  deriving (GetAsset -> GetAsset -> Bool
(GetAsset -> GetAsset -> Bool)
-> (GetAsset -> GetAsset -> Bool) -> Eq GetAsset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAsset -> GetAsset -> Bool
$c/= :: GetAsset -> GetAsset -> Bool
== :: GetAsset -> GetAsset -> Bool
$c== :: GetAsset -> GetAsset -> Bool
Prelude.Eq, ReadPrec [GetAsset]
ReadPrec GetAsset
Int -> ReadS GetAsset
ReadS [GetAsset]
(Int -> ReadS GetAsset)
-> ReadS [GetAsset]
-> ReadPrec GetAsset
-> ReadPrec [GetAsset]
-> Read GetAsset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAsset]
$creadListPrec :: ReadPrec [GetAsset]
readPrec :: ReadPrec GetAsset
$creadPrec :: ReadPrec GetAsset
readList :: ReadS [GetAsset]
$creadList :: ReadS [GetAsset]
readsPrec :: Int -> ReadS GetAsset
$creadsPrec :: Int -> ReadS GetAsset
Prelude.Read, Int -> GetAsset -> ShowS
[GetAsset] -> ShowS
GetAsset -> String
(Int -> GetAsset -> ShowS)
-> (GetAsset -> String) -> ([GetAsset] -> ShowS) -> Show GetAsset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAsset] -> ShowS
$cshowList :: [GetAsset] -> ShowS
show :: GetAsset -> String
$cshow :: GetAsset -> String
showsPrec :: Int -> GetAsset -> ShowS
$cshowsPrec :: Int -> GetAsset -> ShowS
Prelude.Show, (forall x. GetAsset -> Rep GetAsset x)
-> (forall x. Rep GetAsset x -> GetAsset) -> Generic GetAsset
forall x. Rep GetAsset x -> GetAsset
forall x. GetAsset -> Rep GetAsset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAsset x -> GetAsset
$cfrom :: forall x. GetAsset -> Rep GetAsset x
Prelude.Generic)

-- |
-- Create a value of 'GetAsset' 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:
--
-- 'revisionId', 'getAsset_revisionId' - The unique identifier for a revision.
--
-- 'assetId', 'getAsset_assetId' - The unique identifier for an asset.
--
-- 'dataSetId', 'getAsset_dataSetId' - The unique identifier for a data set.
newGetAsset ::
  -- | 'revisionId'
  Prelude.Text ->
  -- | 'assetId'
  Prelude.Text ->
  -- | 'dataSetId'
  Prelude.Text ->
  GetAsset
newGetAsset :: Text -> Text -> Text -> GetAsset
newGetAsset Text
pRevisionId_ Text
pAssetId_ Text
pDataSetId_ =
  GetAsset' :: Text -> Text -> Text -> GetAsset
GetAsset'
    { $sel:revisionId:GetAsset' :: Text
revisionId = Text
pRevisionId_,
      $sel:assetId:GetAsset' :: Text
assetId = Text
pAssetId_,
      $sel:dataSetId:GetAsset' :: Text
dataSetId = Text
pDataSetId_
    }

-- | The unique identifier for a revision.
getAsset_revisionId :: Lens.Lens' GetAsset Prelude.Text
getAsset_revisionId :: (Text -> f Text) -> GetAsset -> f GetAsset
getAsset_revisionId = (GetAsset -> Text)
-> (GetAsset -> Text -> GetAsset)
-> Lens GetAsset GetAsset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAsset' {Text
revisionId :: Text
$sel:revisionId:GetAsset' :: GetAsset -> Text
revisionId} -> Text
revisionId) (\s :: GetAsset
s@GetAsset' {} Text
a -> GetAsset
s {$sel:revisionId:GetAsset' :: Text
revisionId = Text
a} :: GetAsset)

-- | The unique identifier for an asset.
getAsset_assetId :: Lens.Lens' GetAsset Prelude.Text
getAsset_assetId :: (Text -> f Text) -> GetAsset -> f GetAsset
getAsset_assetId = (GetAsset -> Text)
-> (GetAsset -> Text -> GetAsset)
-> Lens GetAsset GetAsset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAsset' {Text
assetId :: Text
$sel:assetId:GetAsset' :: GetAsset -> Text
assetId} -> Text
assetId) (\s :: GetAsset
s@GetAsset' {} Text
a -> GetAsset
s {$sel:assetId:GetAsset' :: Text
assetId = Text
a} :: GetAsset)

-- | The unique identifier for a data set.
getAsset_dataSetId :: Lens.Lens' GetAsset Prelude.Text
getAsset_dataSetId :: (Text -> f Text) -> GetAsset -> f GetAsset
getAsset_dataSetId = (GetAsset -> Text)
-> (GetAsset -> Text -> GetAsset)
-> Lens GetAsset GetAsset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAsset' {Text
dataSetId :: Text
$sel:dataSetId:GetAsset' :: GetAsset -> Text
dataSetId} -> Text
dataSetId) (\s :: GetAsset
s@GetAsset' {} Text
a -> GetAsset
s {$sel:dataSetId:GetAsset' :: Text
dataSetId = Text
a} :: GetAsset)

instance Core.AWSRequest GetAsset where
  type AWSResponse GetAsset = GetAssetResponse
  request :: GetAsset -> Request GetAsset
request = Service -> GetAsset -> Request GetAsset
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAsset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAsset)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAsset))
-> Logger
-> Service
-> Proxy GetAsset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAsset)))
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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AssetDetails
-> Maybe Text
-> Maybe AssetType
-> Maybe POSIX
-> Maybe Text
-> Int
-> GetAssetResponse
GetAssetResponse'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AssetDetails
 -> Maybe Text
 -> Maybe AssetType
 -> Maybe POSIX
 -> Maybe Text
 -> Int
 -> GetAssetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AssetDetails
      -> Maybe Text
      -> Maybe AssetType
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> GetAssetResponse)
forall (f :: * -> *) a b. Functor 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
"Arn")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AssetDetails
   -> Maybe Text
   -> Maybe AssetType
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> GetAssetResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AssetDetails
      -> Maybe Text
      -> Maybe AssetType
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> GetAssetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedAt")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AssetDetails
   -> Maybe Text
   -> Maybe AssetType
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> GetAssetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe AssetDetails
      -> Maybe Text
      -> Maybe AssetType
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> GetAssetResponse)
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
"SourceId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe AssetDetails
   -> Maybe Text
   -> Maybe AssetType
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> GetAssetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe AssetDetails
      -> Maybe Text
      -> Maybe AssetType
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> GetAssetResponse)
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
"DataSetId")
            Either
  String
  (Maybe Text
   -> Maybe AssetDetails
   -> Maybe Text
   -> Maybe AssetType
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> GetAssetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe AssetDetails
      -> Maybe Text
      -> Maybe AssetType
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> GetAssetResponse)
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
"Name")
            Either
  String
  (Maybe AssetDetails
   -> Maybe Text
   -> Maybe AssetType
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> GetAssetResponse)
-> Either String (Maybe AssetDetails)
-> Either
     String
     (Maybe Text
      -> Maybe AssetType
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> GetAssetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AssetDetails)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssetDetails")
            Either
  String
  (Maybe Text
   -> Maybe AssetType
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> GetAssetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe AssetType
      -> Maybe POSIX -> Maybe Text -> Int -> GetAssetResponse)
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
"Id")
            Either
  String
  (Maybe AssetType
   -> Maybe POSIX -> Maybe Text -> Int -> GetAssetResponse)
-> Either String (Maybe AssetType)
-> Either
     String (Maybe POSIX -> Maybe Text -> Int -> GetAssetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AssetType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssetType")
            Either
  String (Maybe POSIX -> Maybe Text -> Int -> GetAssetResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe Text -> Int -> GetAssetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UpdatedAt")
            Either String (Maybe Text -> Int -> GetAssetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetAssetResponse)
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
"RevisionId")
            Either String (Int -> GetAssetResponse)
-> Either String Int -> Either String GetAssetResponse
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 GetAsset

instance Prelude.NFData GetAsset

instance Core.ToHeaders GetAsset where
  toHeaders :: GetAsset -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAsset -> 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.ToPath GetAsset where
  toPath :: GetAsset -> ByteString
toPath GetAsset' {Text
dataSetId :: Text
assetId :: Text
revisionId :: Text
$sel:dataSetId:GetAsset' :: GetAsset -> Text
$sel:assetId:GetAsset' :: GetAsset -> Text
$sel:revisionId:GetAsset' :: GetAsset -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/data-sets/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dataSetId,
        ByteString
"/revisions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
revisionId,
        ByteString
"/assets/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assetId
      ]

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

-- | /See:/ 'newGetAssetResponse' smart constructor.
data GetAssetResponse = GetAssetResponse'
  { -- | The ARN for the asset.
    GetAssetResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the asset was created, in ISO 8601 format.
    GetAssetResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The asset ID of the owned asset corresponding to the entitled asset
    -- being viewed. This parameter is returned when an asset owner is viewing
    -- the entitled copy of its owned asset.
    GetAssetResponse -> Maybe Text
sourceId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the data set associated with this asset.
    GetAssetResponse -> Maybe Text
dataSetId :: Prelude.Maybe Prelude.Text,
    -- | The name of the asset. When importing from Amazon S3, the S3 object key
    -- is used as the asset name. When exporting to Amazon S3, the asset name
    -- is used as default target S3 object key.
    GetAssetResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Information about the asset.
    GetAssetResponse -> Maybe AssetDetails
assetDetails :: Prelude.Maybe AssetDetails,
    -- | The unique identifier for the asset.
    GetAssetResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The type of asset that is added to a data set.
    GetAssetResponse -> Maybe AssetType
assetType :: Prelude.Maybe AssetType,
    -- | The date and time that the asset was last updated, in ISO 8601 format.
    GetAssetResponse -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | The unique identifier for the revision associated with this asset.
    GetAssetResponse -> Maybe Text
revisionId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetAssetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAssetResponse -> GetAssetResponse -> Bool
(GetAssetResponse -> GetAssetResponse -> Bool)
-> (GetAssetResponse -> GetAssetResponse -> Bool)
-> Eq GetAssetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAssetResponse -> GetAssetResponse -> Bool
$c/= :: GetAssetResponse -> GetAssetResponse -> Bool
== :: GetAssetResponse -> GetAssetResponse -> Bool
$c== :: GetAssetResponse -> GetAssetResponse -> Bool
Prelude.Eq, ReadPrec [GetAssetResponse]
ReadPrec GetAssetResponse
Int -> ReadS GetAssetResponse
ReadS [GetAssetResponse]
(Int -> ReadS GetAssetResponse)
-> ReadS [GetAssetResponse]
-> ReadPrec GetAssetResponse
-> ReadPrec [GetAssetResponse]
-> Read GetAssetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAssetResponse]
$creadListPrec :: ReadPrec [GetAssetResponse]
readPrec :: ReadPrec GetAssetResponse
$creadPrec :: ReadPrec GetAssetResponse
readList :: ReadS [GetAssetResponse]
$creadList :: ReadS [GetAssetResponse]
readsPrec :: Int -> ReadS GetAssetResponse
$creadsPrec :: Int -> ReadS GetAssetResponse
Prelude.Read, Int -> GetAssetResponse -> ShowS
[GetAssetResponse] -> ShowS
GetAssetResponse -> String
(Int -> GetAssetResponse -> ShowS)
-> (GetAssetResponse -> String)
-> ([GetAssetResponse] -> ShowS)
-> Show GetAssetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAssetResponse] -> ShowS
$cshowList :: [GetAssetResponse] -> ShowS
show :: GetAssetResponse -> String
$cshow :: GetAssetResponse -> String
showsPrec :: Int -> GetAssetResponse -> ShowS
$cshowsPrec :: Int -> GetAssetResponse -> ShowS
Prelude.Show, (forall x. GetAssetResponse -> Rep GetAssetResponse x)
-> (forall x. Rep GetAssetResponse x -> GetAssetResponse)
-> Generic GetAssetResponse
forall x. Rep GetAssetResponse x -> GetAssetResponse
forall x. GetAssetResponse -> Rep GetAssetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAssetResponse x -> GetAssetResponse
$cfrom :: forall x. GetAssetResponse -> Rep GetAssetResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAssetResponse' 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:
--
-- 'arn', 'getAssetResponse_arn' - The ARN for the asset.
--
-- 'createdAt', 'getAssetResponse_createdAt' - The date and time that the asset was created, in ISO 8601 format.
--
-- 'sourceId', 'getAssetResponse_sourceId' - The asset ID of the owned asset corresponding to the entitled asset
-- being viewed. This parameter is returned when an asset owner is viewing
-- the entitled copy of its owned asset.
--
-- 'dataSetId', 'getAssetResponse_dataSetId' - The unique identifier for the data set associated with this asset.
--
-- 'name', 'getAssetResponse_name' - The name of the asset. When importing from Amazon S3, the S3 object key
-- is used as the asset name. When exporting to Amazon S3, the asset name
-- is used as default target S3 object key.
--
-- 'assetDetails', 'getAssetResponse_assetDetails' - Information about the asset.
--
-- 'id', 'getAssetResponse_id' - The unique identifier for the asset.
--
-- 'assetType', 'getAssetResponse_assetType' - The type of asset that is added to a data set.
--
-- 'updatedAt', 'getAssetResponse_updatedAt' - The date and time that the asset was last updated, in ISO 8601 format.
--
-- 'revisionId', 'getAssetResponse_revisionId' - The unique identifier for the revision associated with this asset.
--
-- 'httpStatus', 'getAssetResponse_httpStatus' - The response's http status code.
newGetAssetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAssetResponse
newGetAssetResponse :: Int -> GetAssetResponse
newGetAssetResponse Int
pHttpStatus_ =
  GetAssetResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AssetDetails
-> Maybe Text
-> Maybe AssetType
-> Maybe POSIX
-> Maybe Text
-> Int
-> GetAssetResponse
GetAssetResponse'
    { $sel:arn:GetAssetResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:GetAssetResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceId:GetAssetResponse' :: Maybe Text
sourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetId:GetAssetResponse' :: Maybe Text
dataSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetAssetResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:assetDetails:GetAssetResponse' :: Maybe AssetDetails
assetDetails = Maybe AssetDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetAssetResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:assetType:GetAssetResponse' :: Maybe AssetType
assetType = Maybe AssetType
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:GetAssetResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionId:GetAssetResponse' :: Maybe Text
revisionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAssetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN for the asset.
getAssetResponse_arn :: Lens.Lens' GetAssetResponse (Prelude.Maybe Prelude.Text)
getAssetResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_arn = (GetAssetResponse -> Maybe Text)
-> (GetAssetResponse -> Maybe Text -> GetAssetResponse)
-> Lens GetAssetResponse GetAssetResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetAssetResponse' :: GetAssetResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe Text
a -> GetAssetResponse
s {$sel:arn:GetAssetResponse' :: Maybe Text
arn = Maybe Text
a} :: GetAssetResponse)

-- | The date and time that the asset was created, in ISO 8601 format.
getAssetResponse_createdAt :: Lens.Lens' GetAssetResponse (Prelude.Maybe Prelude.UTCTime)
getAssetResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_createdAt = (GetAssetResponse -> Maybe POSIX)
-> (GetAssetResponse -> Maybe POSIX -> GetAssetResponse)
-> Lens
     GetAssetResponse GetAssetResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:GetAssetResponse' :: GetAssetResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe POSIX
a -> GetAssetResponse
s {$sel:createdAt:GetAssetResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: GetAssetResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetAssetResponse -> f GetAssetResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetAssetResponse
-> f GetAssetResponse
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 asset ID of the owned asset corresponding to the entitled asset
-- being viewed. This parameter is returned when an asset owner is viewing
-- the entitled copy of its owned asset.
getAssetResponse_sourceId :: Lens.Lens' GetAssetResponse (Prelude.Maybe Prelude.Text)
getAssetResponse_sourceId :: (Maybe Text -> f (Maybe Text))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_sourceId = (GetAssetResponse -> Maybe Text)
-> (GetAssetResponse -> Maybe Text -> GetAssetResponse)
-> Lens GetAssetResponse GetAssetResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe Text
sourceId :: Maybe Text
$sel:sourceId:GetAssetResponse' :: GetAssetResponse -> Maybe Text
sourceId} -> Maybe Text
sourceId) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe Text
a -> GetAssetResponse
s {$sel:sourceId:GetAssetResponse' :: Maybe Text
sourceId = Maybe Text
a} :: GetAssetResponse)

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

-- | The name of the asset. When importing from Amazon S3, the S3 object key
-- is used as the asset name. When exporting to Amazon S3, the asset name
-- is used as default target S3 object key.
getAssetResponse_name :: Lens.Lens' GetAssetResponse (Prelude.Maybe Prelude.Text)
getAssetResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_name = (GetAssetResponse -> Maybe Text)
-> (GetAssetResponse -> Maybe Text -> GetAssetResponse)
-> Lens GetAssetResponse GetAssetResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetAssetResponse' :: GetAssetResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe Text
a -> GetAssetResponse
s {$sel:name:GetAssetResponse' :: Maybe Text
name = Maybe Text
a} :: GetAssetResponse)

-- | Information about the asset.
getAssetResponse_assetDetails :: Lens.Lens' GetAssetResponse (Prelude.Maybe AssetDetails)
getAssetResponse_assetDetails :: (Maybe AssetDetails -> f (Maybe AssetDetails))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_assetDetails = (GetAssetResponse -> Maybe AssetDetails)
-> (GetAssetResponse -> Maybe AssetDetails -> GetAssetResponse)
-> Lens
     GetAssetResponse
     GetAssetResponse
     (Maybe AssetDetails)
     (Maybe AssetDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe AssetDetails
assetDetails :: Maybe AssetDetails
$sel:assetDetails:GetAssetResponse' :: GetAssetResponse -> Maybe AssetDetails
assetDetails} -> Maybe AssetDetails
assetDetails) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe AssetDetails
a -> GetAssetResponse
s {$sel:assetDetails:GetAssetResponse' :: Maybe AssetDetails
assetDetails = Maybe AssetDetails
a} :: GetAssetResponse)

-- | The unique identifier for the asset.
getAssetResponse_id :: Lens.Lens' GetAssetResponse (Prelude.Maybe Prelude.Text)
getAssetResponse_id :: (Maybe Text -> f (Maybe Text))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_id = (GetAssetResponse -> Maybe Text)
-> (GetAssetResponse -> Maybe Text -> GetAssetResponse)
-> Lens GetAssetResponse GetAssetResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe Text
id :: Maybe Text
$sel:id:GetAssetResponse' :: GetAssetResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe Text
a -> GetAssetResponse
s {$sel:id:GetAssetResponse' :: Maybe Text
id = Maybe Text
a} :: GetAssetResponse)

-- | The type of asset that is added to a data set.
getAssetResponse_assetType :: Lens.Lens' GetAssetResponse (Prelude.Maybe AssetType)
getAssetResponse_assetType :: (Maybe AssetType -> f (Maybe AssetType))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_assetType = (GetAssetResponse -> Maybe AssetType)
-> (GetAssetResponse -> Maybe AssetType -> GetAssetResponse)
-> Lens
     GetAssetResponse
     GetAssetResponse
     (Maybe AssetType)
     (Maybe AssetType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe AssetType
assetType :: Maybe AssetType
$sel:assetType:GetAssetResponse' :: GetAssetResponse -> Maybe AssetType
assetType} -> Maybe AssetType
assetType) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe AssetType
a -> GetAssetResponse
s {$sel:assetType:GetAssetResponse' :: Maybe AssetType
assetType = Maybe AssetType
a} :: GetAssetResponse)

-- | The date and time that the asset was last updated, in ISO 8601 format.
getAssetResponse_updatedAt :: Lens.Lens' GetAssetResponse (Prelude.Maybe Prelude.UTCTime)
getAssetResponse_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_updatedAt = (GetAssetResponse -> Maybe POSIX)
-> (GetAssetResponse -> Maybe POSIX -> GetAssetResponse)
-> Lens
     GetAssetResponse GetAssetResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:GetAssetResponse' :: GetAssetResponse -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe POSIX
a -> GetAssetResponse
s {$sel:updatedAt:GetAssetResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: GetAssetResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetAssetResponse -> f GetAssetResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetAssetResponse
-> f GetAssetResponse
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 revision associated with this asset.
getAssetResponse_revisionId :: Lens.Lens' GetAssetResponse (Prelude.Maybe Prelude.Text)
getAssetResponse_revisionId :: (Maybe Text -> f (Maybe Text))
-> GetAssetResponse -> f GetAssetResponse
getAssetResponse_revisionId = (GetAssetResponse -> Maybe Text)
-> (GetAssetResponse -> Maybe Text -> GetAssetResponse)
-> Lens GetAssetResponse GetAssetResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetResponse' {Maybe Text
revisionId :: Maybe Text
$sel:revisionId:GetAssetResponse' :: GetAssetResponse -> Maybe Text
revisionId} -> Maybe Text
revisionId) (\s :: GetAssetResponse
s@GetAssetResponse' {} Maybe Text
a -> GetAssetResponse
s {$sel:revisionId:GetAssetResponse' :: Maybe Text
revisionId = Maybe Text
a} :: GetAssetResponse)

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

instance Prelude.NFData GetAssetResponse