{-# 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.IoTSiteWise.DescribeAsset
-- 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)
--
-- Retrieves information about an asset.
module Amazonka.IoTSiteWise.DescribeAsset
  ( -- * Creating a Request
    DescribeAsset (..),
    newDescribeAsset,

    -- * Request Lenses
    describeAsset_assetId,

    -- * Destructuring the Response
    DescribeAssetResponse (..),
    newDescribeAssetResponse,

    -- * Response Lenses
    describeAssetResponse_assetCompositeModels,
    describeAssetResponse_httpStatus,
    describeAssetResponse_assetId,
    describeAssetResponse_assetArn,
    describeAssetResponse_assetName,
    describeAssetResponse_assetModelId,
    describeAssetResponse_assetProperties,
    describeAssetResponse_assetHierarchies,
    describeAssetResponse_assetCreationDate,
    describeAssetResponse_assetLastUpdateDate,
    describeAssetResponse_assetStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.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:/ 'newDescribeAsset' smart constructor.
data DescribeAsset = DescribeAsset'
  { -- | The ID of the asset.
    DescribeAsset -> Text
assetId :: Prelude.Text
  }
  deriving (DescribeAsset -> DescribeAsset -> Bool
(DescribeAsset -> DescribeAsset -> Bool)
-> (DescribeAsset -> DescribeAsset -> Bool) -> Eq DescribeAsset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAsset -> DescribeAsset -> Bool
$c/= :: DescribeAsset -> DescribeAsset -> Bool
== :: DescribeAsset -> DescribeAsset -> Bool
$c== :: DescribeAsset -> DescribeAsset -> Bool
Prelude.Eq, ReadPrec [DescribeAsset]
ReadPrec DescribeAsset
Int -> ReadS DescribeAsset
ReadS [DescribeAsset]
(Int -> ReadS DescribeAsset)
-> ReadS [DescribeAsset]
-> ReadPrec DescribeAsset
-> ReadPrec [DescribeAsset]
-> Read DescribeAsset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAsset]
$creadListPrec :: ReadPrec [DescribeAsset]
readPrec :: ReadPrec DescribeAsset
$creadPrec :: ReadPrec DescribeAsset
readList :: ReadS [DescribeAsset]
$creadList :: ReadS [DescribeAsset]
readsPrec :: Int -> ReadS DescribeAsset
$creadsPrec :: Int -> ReadS DescribeAsset
Prelude.Read, Int -> DescribeAsset -> ShowS
[DescribeAsset] -> ShowS
DescribeAsset -> String
(Int -> DescribeAsset -> ShowS)
-> (DescribeAsset -> String)
-> ([DescribeAsset] -> ShowS)
-> Show DescribeAsset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAsset] -> ShowS
$cshowList :: [DescribeAsset] -> ShowS
show :: DescribeAsset -> String
$cshow :: DescribeAsset -> String
showsPrec :: Int -> DescribeAsset -> ShowS
$cshowsPrec :: Int -> DescribeAsset -> ShowS
Prelude.Show, (forall x. DescribeAsset -> Rep DescribeAsset x)
-> (forall x. Rep DescribeAsset x -> DescribeAsset)
-> Generic DescribeAsset
forall x. Rep DescribeAsset x -> DescribeAsset
forall x. DescribeAsset -> Rep DescribeAsset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAsset x -> DescribeAsset
$cfrom :: forall x. DescribeAsset -> Rep DescribeAsset x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAsset' 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:
--
-- 'assetId', 'describeAsset_assetId' - The ID of the asset.
newDescribeAsset ::
  -- | 'assetId'
  Prelude.Text ->
  DescribeAsset
newDescribeAsset :: Text -> DescribeAsset
newDescribeAsset Text
pAssetId_ =
  DescribeAsset' :: Text -> DescribeAsset
DescribeAsset' {$sel:assetId:DescribeAsset' :: Text
assetId = Text
pAssetId_}

-- | The ID of the asset.
describeAsset_assetId :: Lens.Lens' DescribeAsset Prelude.Text
describeAsset_assetId :: (Text -> f Text) -> DescribeAsset -> f DescribeAsset
describeAsset_assetId = (DescribeAsset -> Text)
-> (DescribeAsset -> Text -> DescribeAsset)
-> Lens DescribeAsset DescribeAsset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAsset' {Text
assetId :: Text
$sel:assetId:DescribeAsset' :: DescribeAsset -> Text
assetId} -> Text
assetId) (\s :: DescribeAsset
s@DescribeAsset' {} Text
a -> DescribeAsset
s {$sel:assetId:DescribeAsset' :: Text
assetId = Text
a} :: DescribeAsset)

instance Core.AWSRequest DescribeAsset where
  type
    AWSResponse DescribeAsset =
      DescribeAssetResponse
  request :: DescribeAsset -> Request DescribeAsset
request = Service -> DescribeAsset -> Request DescribeAsset
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAsset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeAsset)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAsset))
-> Logger
-> Service
-> Proxy DescribeAsset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeAsset)))
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 [AssetCompositeModel]
-> Int
-> Text
-> Text
-> Text
-> Text
-> [AssetProperty]
-> [AssetHierarchy]
-> POSIX
-> POSIX
-> AssetStatus
-> DescribeAssetResponse
DescribeAssetResponse'
            (Maybe [AssetCompositeModel]
 -> Int
 -> Text
 -> Text
 -> Text
 -> Text
 -> [AssetProperty]
 -> [AssetHierarchy]
 -> POSIX
 -> POSIX
 -> AssetStatus
 -> DescribeAssetResponse)
-> Either String (Maybe [AssetCompositeModel])
-> Either
     String
     (Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> [AssetProperty]
      -> [AssetHierarchy]
      -> POSIX
      -> POSIX
      -> AssetStatus
      -> DescribeAssetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [AssetCompositeModel]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assetCompositeModels"
                            Either String (Maybe (Maybe [AssetCompositeModel]))
-> Maybe [AssetCompositeModel]
-> Either String (Maybe [AssetCompositeModel])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AssetCompositeModel]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> [AssetProperty]
   -> [AssetHierarchy]
   -> POSIX
   -> POSIX
   -> AssetStatus
   -> DescribeAssetResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text
      -> Text
      -> Text
      -> [AssetProperty]
      -> [AssetHierarchy]
      -> POSIX
      -> POSIX
      -> AssetStatus
      -> DescribeAssetResponse)
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
   -> Text
   -> Text
   -> Text
   -> [AssetProperty]
   -> [AssetHierarchy]
   -> POSIX
   -> POSIX
   -> AssetStatus
   -> DescribeAssetResponse)
-> Either String Text
-> Either
     String
     (Text
      -> Text
      -> Text
      -> [AssetProperty]
      -> [AssetHierarchy]
      -> POSIX
      -> POSIX
      -> AssetStatus
      -> DescribeAssetResponse)
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
"assetId")
            Either
  String
  (Text
   -> Text
   -> Text
   -> [AssetProperty]
   -> [AssetHierarchy]
   -> POSIX
   -> POSIX
   -> AssetStatus
   -> DescribeAssetResponse)
-> Either String Text
-> Either
     String
     (Text
      -> Text
      -> [AssetProperty]
      -> [AssetHierarchy]
      -> POSIX
      -> POSIX
      -> AssetStatus
      -> DescribeAssetResponse)
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
"assetArn")
            Either
  String
  (Text
   -> Text
   -> [AssetProperty]
   -> [AssetHierarchy]
   -> POSIX
   -> POSIX
   -> AssetStatus
   -> DescribeAssetResponse)
-> Either String Text
-> Either
     String
     (Text
      -> [AssetProperty]
      -> [AssetHierarchy]
      -> POSIX
      -> POSIX
      -> AssetStatus
      -> DescribeAssetResponse)
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
"assetName")
            Either
  String
  (Text
   -> [AssetProperty]
   -> [AssetHierarchy]
   -> POSIX
   -> POSIX
   -> AssetStatus
   -> DescribeAssetResponse)
-> Either String Text
-> Either
     String
     ([AssetProperty]
      -> [AssetHierarchy]
      -> POSIX
      -> POSIX
      -> AssetStatus
      -> DescribeAssetResponse)
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
"assetModelId")
            Either
  String
  ([AssetProperty]
   -> [AssetHierarchy]
   -> POSIX
   -> POSIX
   -> AssetStatus
   -> DescribeAssetResponse)
-> Either String [AssetProperty]
-> Either
     String
     ([AssetHierarchy]
      -> POSIX -> POSIX -> AssetStatus -> DescribeAssetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AssetProperty])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assetProperties"
                            Either String (Maybe [AssetProperty])
-> [AssetProperty] -> Either String [AssetProperty]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AssetProperty]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  ([AssetHierarchy]
   -> POSIX -> POSIX -> AssetStatus -> DescribeAssetResponse)
-> Either String [AssetHierarchy]
-> Either
     String (POSIX -> POSIX -> AssetStatus -> DescribeAssetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AssetHierarchy])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assetHierarchies"
                            Either String (Maybe [AssetHierarchy])
-> [AssetHierarchy] -> Either String [AssetHierarchy]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AssetHierarchy]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String (POSIX -> POSIX -> AssetStatus -> DescribeAssetResponse)
-> Either String POSIX
-> Either String (POSIX -> AssetStatus -> DescribeAssetResponse)
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
"assetCreationDate")
            Either String (POSIX -> AssetStatus -> DescribeAssetResponse)
-> Either String POSIX
-> Either String (AssetStatus -> DescribeAssetResponse)
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
"assetLastUpdateDate")
            Either String (AssetStatus -> DescribeAssetResponse)
-> Either String AssetStatus -> Either String DescribeAssetResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String AssetStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"assetStatus")
      )

instance Prelude.Hashable DescribeAsset

instance Prelude.NFData DescribeAsset

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

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

-- | /See:/ 'newDescribeAssetResponse' smart constructor.
data DescribeAssetResponse = DescribeAssetResponse'
  { -- | The composite models for the asset.
    DescribeAssetResponse -> Maybe [AssetCompositeModel]
assetCompositeModels :: Prelude.Maybe [AssetCompositeModel],
    -- | The response's http status code.
    DescribeAssetResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the asset.
    DescribeAssetResponse -> Text
assetId :: Prelude.Text,
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the asset, which has the following format.
    --
    -- @arn:${Partition}:iotsitewise:${Region}:${Account}:asset\/${AssetId}@
    DescribeAssetResponse -> Text
assetArn :: Prelude.Text,
    -- | The name of the asset.
    DescribeAssetResponse -> Text
assetName :: Prelude.Text,
    -- | The ID of the asset model that was used to create the asset.
    DescribeAssetResponse -> Text
assetModelId :: Prelude.Text,
    -- | The list of asset properties for the asset.
    --
    -- This object doesn\'t include properties that you define in composite
    -- models. You can find composite model properties in the
    -- @assetCompositeModels@ object.
    DescribeAssetResponse -> [AssetProperty]
assetProperties :: [AssetProperty],
    -- | A list of asset hierarchies that each contain a @hierarchyId@. A
    -- hierarchy specifies allowed parent\/child asset relationships.
    DescribeAssetResponse -> [AssetHierarchy]
assetHierarchies :: [AssetHierarchy],
    -- | The date the asset was created, in Unix epoch time.
    DescribeAssetResponse -> POSIX
assetCreationDate :: Core.POSIX,
    -- | The date the asset was last updated, in Unix epoch time.
    DescribeAssetResponse -> POSIX
assetLastUpdateDate :: Core.POSIX,
    -- | The current status of the asset, which contains a state and any error
    -- message.
    DescribeAssetResponse -> AssetStatus
assetStatus :: AssetStatus
  }
  deriving (DescribeAssetResponse -> DescribeAssetResponse -> Bool
(DescribeAssetResponse -> DescribeAssetResponse -> Bool)
-> (DescribeAssetResponse -> DescribeAssetResponse -> Bool)
-> Eq DescribeAssetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAssetResponse -> DescribeAssetResponse -> Bool
$c/= :: DescribeAssetResponse -> DescribeAssetResponse -> Bool
== :: DescribeAssetResponse -> DescribeAssetResponse -> Bool
$c== :: DescribeAssetResponse -> DescribeAssetResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAssetResponse]
ReadPrec DescribeAssetResponse
Int -> ReadS DescribeAssetResponse
ReadS [DescribeAssetResponse]
(Int -> ReadS DescribeAssetResponse)
-> ReadS [DescribeAssetResponse]
-> ReadPrec DescribeAssetResponse
-> ReadPrec [DescribeAssetResponse]
-> Read DescribeAssetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAssetResponse]
$creadListPrec :: ReadPrec [DescribeAssetResponse]
readPrec :: ReadPrec DescribeAssetResponse
$creadPrec :: ReadPrec DescribeAssetResponse
readList :: ReadS [DescribeAssetResponse]
$creadList :: ReadS [DescribeAssetResponse]
readsPrec :: Int -> ReadS DescribeAssetResponse
$creadsPrec :: Int -> ReadS DescribeAssetResponse
Prelude.Read, Int -> DescribeAssetResponse -> ShowS
[DescribeAssetResponse] -> ShowS
DescribeAssetResponse -> String
(Int -> DescribeAssetResponse -> ShowS)
-> (DescribeAssetResponse -> String)
-> ([DescribeAssetResponse] -> ShowS)
-> Show DescribeAssetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAssetResponse] -> ShowS
$cshowList :: [DescribeAssetResponse] -> ShowS
show :: DescribeAssetResponse -> String
$cshow :: DescribeAssetResponse -> String
showsPrec :: Int -> DescribeAssetResponse -> ShowS
$cshowsPrec :: Int -> DescribeAssetResponse -> ShowS
Prelude.Show, (forall x. DescribeAssetResponse -> Rep DescribeAssetResponse x)
-> (forall x. Rep DescribeAssetResponse x -> DescribeAssetResponse)
-> Generic DescribeAssetResponse
forall x. Rep DescribeAssetResponse x -> DescribeAssetResponse
forall x. DescribeAssetResponse -> Rep DescribeAssetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAssetResponse x -> DescribeAssetResponse
$cfrom :: forall x. DescribeAssetResponse -> Rep DescribeAssetResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAssetResponse' 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:
--
-- 'assetCompositeModels', 'describeAssetResponse_assetCompositeModels' - The composite models for the asset.
--
-- 'httpStatus', 'describeAssetResponse_httpStatus' - The response's http status code.
--
-- 'assetId', 'describeAssetResponse_assetId' - The ID of the asset.
--
-- 'assetArn', 'describeAssetResponse_assetArn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the asset, which has the following format.
--
-- @arn:${Partition}:iotsitewise:${Region}:${Account}:asset\/${AssetId}@
--
-- 'assetName', 'describeAssetResponse_assetName' - The name of the asset.
--
-- 'assetModelId', 'describeAssetResponse_assetModelId' - The ID of the asset model that was used to create the asset.
--
-- 'assetProperties', 'describeAssetResponse_assetProperties' - The list of asset properties for the asset.
--
-- This object doesn\'t include properties that you define in composite
-- models. You can find composite model properties in the
-- @assetCompositeModels@ object.
--
-- 'assetHierarchies', 'describeAssetResponse_assetHierarchies' - A list of asset hierarchies that each contain a @hierarchyId@. A
-- hierarchy specifies allowed parent\/child asset relationships.
--
-- 'assetCreationDate', 'describeAssetResponse_assetCreationDate' - The date the asset was created, in Unix epoch time.
--
-- 'assetLastUpdateDate', 'describeAssetResponse_assetLastUpdateDate' - The date the asset was last updated, in Unix epoch time.
--
-- 'assetStatus', 'describeAssetResponse_assetStatus' - The current status of the asset, which contains a state and any error
-- message.
newDescribeAssetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'assetId'
  Prelude.Text ->
  -- | 'assetArn'
  Prelude.Text ->
  -- | 'assetName'
  Prelude.Text ->
  -- | 'assetModelId'
  Prelude.Text ->
  -- | 'assetCreationDate'
  Prelude.UTCTime ->
  -- | 'assetLastUpdateDate'
  Prelude.UTCTime ->
  -- | 'assetStatus'
  AssetStatus ->
  DescribeAssetResponse
newDescribeAssetResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> AssetStatus
-> DescribeAssetResponse
newDescribeAssetResponse
  Int
pHttpStatus_
  Text
pAssetId_
  Text
pAssetArn_
  Text
pAssetName_
  Text
pAssetModelId_
  UTCTime
pAssetCreationDate_
  UTCTime
pAssetLastUpdateDate_
  AssetStatus
pAssetStatus_ =
    DescribeAssetResponse' :: Maybe [AssetCompositeModel]
-> Int
-> Text
-> Text
-> Text
-> Text
-> [AssetProperty]
-> [AssetHierarchy]
-> POSIX
-> POSIX
-> AssetStatus
-> DescribeAssetResponse
DescribeAssetResponse'
      { $sel:assetCompositeModels:DescribeAssetResponse' :: Maybe [AssetCompositeModel]
assetCompositeModels =
          Maybe [AssetCompositeModel]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeAssetResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:assetId:DescribeAssetResponse' :: Text
assetId = Text
pAssetId_,
        $sel:assetArn:DescribeAssetResponse' :: Text
assetArn = Text
pAssetArn_,
        $sel:assetName:DescribeAssetResponse' :: Text
assetName = Text
pAssetName_,
        $sel:assetModelId:DescribeAssetResponse' :: Text
assetModelId = Text
pAssetModelId_,
        $sel:assetProperties:DescribeAssetResponse' :: [AssetProperty]
assetProperties = [AssetProperty]
forall a. Monoid a => a
Prelude.mempty,
        $sel:assetHierarchies:DescribeAssetResponse' :: [AssetHierarchy]
assetHierarchies = [AssetHierarchy]
forall a. Monoid a => a
Prelude.mempty,
        $sel:assetCreationDate:DescribeAssetResponse' :: POSIX
assetCreationDate =
          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
pAssetCreationDate_,
        $sel:assetLastUpdateDate:DescribeAssetResponse' :: POSIX
assetLastUpdateDate =
          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
pAssetLastUpdateDate_,
        $sel:assetStatus:DescribeAssetResponse' :: AssetStatus
assetStatus = AssetStatus
pAssetStatus_
      }

-- | The composite models for the asset.
describeAssetResponse_assetCompositeModels :: Lens.Lens' DescribeAssetResponse (Prelude.Maybe [AssetCompositeModel])
describeAssetResponse_assetCompositeModels :: (Maybe [AssetCompositeModel] -> f (Maybe [AssetCompositeModel]))
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetCompositeModels = (DescribeAssetResponse -> Maybe [AssetCompositeModel])
-> (DescribeAssetResponse
    -> Maybe [AssetCompositeModel] -> DescribeAssetResponse)
-> Lens
     DescribeAssetResponse
     DescribeAssetResponse
     (Maybe [AssetCompositeModel])
     (Maybe [AssetCompositeModel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {Maybe [AssetCompositeModel]
assetCompositeModels :: Maybe [AssetCompositeModel]
$sel:assetCompositeModels:DescribeAssetResponse' :: DescribeAssetResponse -> Maybe [AssetCompositeModel]
assetCompositeModels} -> Maybe [AssetCompositeModel]
assetCompositeModels) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} Maybe [AssetCompositeModel]
a -> DescribeAssetResponse
s {$sel:assetCompositeModels:DescribeAssetResponse' :: Maybe [AssetCompositeModel]
assetCompositeModels = Maybe [AssetCompositeModel]
a} :: DescribeAssetResponse) ((Maybe [AssetCompositeModel] -> f (Maybe [AssetCompositeModel]))
 -> DescribeAssetResponse -> f DescribeAssetResponse)
-> ((Maybe [AssetCompositeModel]
     -> f (Maybe [AssetCompositeModel]))
    -> Maybe [AssetCompositeModel] -> f (Maybe [AssetCompositeModel]))
-> (Maybe [AssetCompositeModel] -> f (Maybe [AssetCompositeModel]))
-> DescribeAssetResponse
-> f DescribeAssetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AssetCompositeModel]
  [AssetCompositeModel]
  [AssetCompositeModel]
  [AssetCompositeModel]
-> Iso
     (Maybe [AssetCompositeModel])
     (Maybe [AssetCompositeModel])
     (Maybe [AssetCompositeModel])
     (Maybe [AssetCompositeModel])
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
  [AssetCompositeModel]
  [AssetCompositeModel]
  [AssetCompositeModel]
  [AssetCompositeModel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The ID of the asset.
describeAssetResponse_assetId :: Lens.Lens' DescribeAssetResponse Prelude.Text
describeAssetResponse_assetId :: (Text -> f Text)
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetId = (DescribeAssetResponse -> Text)
-> (DescribeAssetResponse -> Text -> DescribeAssetResponse)
-> Lens DescribeAssetResponse DescribeAssetResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {Text
assetId :: Text
$sel:assetId:DescribeAssetResponse' :: DescribeAssetResponse -> Text
assetId} -> Text
assetId) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} Text
a -> DescribeAssetResponse
s {$sel:assetId:DescribeAssetResponse' :: Text
assetId = Text
a} :: DescribeAssetResponse)

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the asset, which has the following format.
--
-- @arn:${Partition}:iotsitewise:${Region}:${Account}:asset\/${AssetId}@
describeAssetResponse_assetArn :: Lens.Lens' DescribeAssetResponse Prelude.Text
describeAssetResponse_assetArn :: (Text -> f Text)
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetArn = (DescribeAssetResponse -> Text)
-> (DescribeAssetResponse -> Text -> DescribeAssetResponse)
-> Lens DescribeAssetResponse DescribeAssetResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {Text
assetArn :: Text
$sel:assetArn:DescribeAssetResponse' :: DescribeAssetResponse -> Text
assetArn} -> Text
assetArn) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} Text
a -> DescribeAssetResponse
s {$sel:assetArn:DescribeAssetResponse' :: Text
assetArn = Text
a} :: DescribeAssetResponse)

-- | The name of the asset.
describeAssetResponse_assetName :: Lens.Lens' DescribeAssetResponse Prelude.Text
describeAssetResponse_assetName :: (Text -> f Text)
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetName = (DescribeAssetResponse -> Text)
-> (DescribeAssetResponse -> Text -> DescribeAssetResponse)
-> Lens DescribeAssetResponse DescribeAssetResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {Text
assetName :: Text
$sel:assetName:DescribeAssetResponse' :: DescribeAssetResponse -> Text
assetName} -> Text
assetName) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} Text
a -> DescribeAssetResponse
s {$sel:assetName:DescribeAssetResponse' :: Text
assetName = Text
a} :: DescribeAssetResponse)

-- | The ID of the asset model that was used to create the asset.
describeAssetResponse_assetModelId :: Lens.Lens' DescribeAssetResponse Prelude.Text
describeAssetResponse_assetModelId :: (Text -> f Text)
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetModelId = (DescribeAssetResponse -> Text)
-> (DescribeAssetResponse -> Text -> DescribeAssetResponse)
-> Lens DescribeAssetResponse DescribeAssetResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {Text
assetModelId :: Text
$sel:assetModelId:DescribeAssetResponse' :: DescribeAssetResponse -> Text
assetModelId} -> Text
assetModelId) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} Text
a -> DescribeAssetResponse
s {$sel:assetModelId:DescribeAssetResponse' :: Text
assetModelId = Text
a} :: DescribeAssetResponse)

-- | The list of asset properties for the asset.
--
-- This object doesn\'t include properties that you define in composite
-- models. You can find composite model properties in the
-- @assetCompositeModels@ object.
describeAssetResponse_assetProperties :: Lens.Lens' DescribeAssetResponse [AssetProperty]
describeAssetResponse_assetProperties :: ([AssetProperty] -> f [AssetProperty])
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetProperties = (DescribeAssetResponse -> [AssetProperty])
-> (DescribeAssetResponse
    -> [AssetProperty] -> DescribeAssetResponse)
-> Lens
     DescribeAssetResponse
     DescribeAssetResponse
     [AssetProperty]
     [AssetProperty]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {[AssetProperty]
assetProperties :: [AssetProperty]
$sel:assetProperties:DescribeAssetResponse' :: DescribeAssetResponse -> [AssetProperty]
assetProperties} -> [AssetProperty]
assetProperties) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} [AssetProperty]
a -> DescribeAssetResponse
s {$sel:assetProperties:DescribeAssetResponse' :: [AssetProperty]
assetProperties = [AssetProperty]
a} :: DescribeAssetResponse) (([AssetProperty] -> f [AssetProperty])
 -> DescribeAssetResponse -> f DescribeAssetResponse)
-> (([AssetProperty] -> f [AssetProperty])
    -> [AssetProperty] -> f [AssetProperty])
-> ([AssetProperty] -> f [AssetProperty])
-> DescribeAssetResponse
-> f DescribeAssetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetProperty] -> f [AssetProperty])
-> [AssetProperty] -> f [AssetProperty]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of asset hierarchies that each contain a @hierarchyId@. A
-- hierarchy specifies allowed parent\/child asset relationships.
describeAssetResponse_assetHierarchies :: Lens.Lens' DescribeAssetResponse [AssetHierarchy]
describeAssetResponse_assetHierarchies :: ([AssetHierarchy] -> f [AssetHierarchy])
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetHierarchies = (DescribeAssetResponse -> [AssetHierarchy])
-> (DescribeAssetResponse
    -> [AssetHierarchy] -> DescribeAssetResponse)
-> Lens
     DescribeAssetResponse
     DescribeAssetResponse
     [AssetHierarchy]
     [AssetHierarchy]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {[AssetHierarchy]
assetHierarchies :: [AssetHierarchy]
$sel:assetHierarchies:DescribeAssetResponse' :: DescribeAssetResponse -> [AssetHierarchy]
assetHierarchies} -> [AssetHierarchy]
assetHierarchies) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} [AssetHierarchy]
a -> DescribeAssetResponse
s {$sel:assetHierarchies:DescribeAssetResponse' :: [AssetHierarchy]
assetHierarchies = [AssetHierarchy]
a} :: DescribeAssetResponse) (([AssetHierarchy] -> f [AssetHierarchy])
 -> DescribeAssetResponse -> f DescribeAssetResponse)
-> (([AssetHierarchy] -> f [AssetHierarchy])
    -> [AssetHierarchy] -> f [AssetHierarchy])
-> ([AssetHierarchy] -> f [AssetHierarchy])
-> DescribeAssetResponse
-> f DescribeAssetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetHierarchy] -> f [AssetHierarchy])
-> [AssetHierarchy] -> f [AssetHierarchy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date the asset was created, in Unix epoch time.
describeAssetResponse_assetCreationDate :: Lens.Lens' DescribeAssetResponse Prelude.UTCTime
describeAssetResponse_assetCreationDate :: (UTCTime -> f UTCTime)
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetCreationDate = (DescribeAssetResponse -> POSIX)
-> (DescribeAssetResponse -> POSIX -> DescribeAssetResponse)
-> Lens DescribeAssetResponse DescribeAssetResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {POSIX
assetCreationDate :: POSIX
$sel:assetCreationDate:DescribeAssetResponse' :: DescribeAssetResponse -> POSIX
assetCreationDate} -> POSIX
assetCreationDate) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} POSIX
a -> DescribeAssetResponse
s {$sel:assetCreationDate:DescribeAssetResponse' :: POSIX
assetCreationDate = POSIX
a} :: DescribeAssetResponse) ((POSIX -> f POSIX)
 -> DescribeAssetResponse -> f DescribeAssetResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeAssetResponse
-> f DescribeAssetResponse
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

-- | The date the asset was last updated, in Unix epoch time.
describeAssetResponse_assetLastUpdateDate :: Lens.Lens' DescribeAssetResponse Prelude.UTCTime
describeAssetResponse_assetLastUpdateDate :: (UTCTime -> f UTCTime)
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetLastUpdateDate = (DescribeAssetResponse -> POSIX)
-> (DescribeAssetResponse -> POSIX -> DescribeAssetResponse)
-> Lens DescribeAssetResponse DescribeAssetResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {POSIX
assetLastUpdateDate :: POSIX
$sel:assetLastUpdateDate:DescribeAssetResponse' :: DescribeAssetResponse -> POSIX
assetLastUpdateDate} -> POSIX
assetLastUpdateDate) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} POSIX
a -> DescribeAssetResponse
s {$sel:assetLastUpdateDate:DescribeAssetResponse' :: POSIX
assetLastUpdateDate = POSIX
a} :: DescribeAssetResponse) ((POSIX -> f POSIX)
 -> DescribeAssetResponse -> f DescribeAssetResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeAssetResponse
-> f DescribeAssetResponse
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

-- | The current status of the asset, which contains a state and any error
-- message.
describeAssetResponse_assetStatus :: Lens.Lens' DescribeAssetResponse AssetStatus
describeAssetResponse_assetStatus :: (AssetStatus -> f AssetStatus)
-> DescribeAssetResponse -> f DescribeAssetResponse
describeAssetResponse_assetStatus = (DescribeAssetResponse -> AssetStatus)
-> (DescribeAssetResponse -> AssetStatus -> DescribeAssetResponse)
-> Lens
     DescribeAssetResponse DescribeAssetResponse AssetStatus AssetStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssetResponse' {AssetStatus
assetStatus :: AssetStatus
$sel:assetStatus:DescribeAssetResponse' :: DescribeAssetResponse -> AssetStatus
assetStatus} -> AssetStatus
assetStatus) (\s :: DescribeAssetResponse
s@DescribeAssetResponse' {} AssetStatus
a -> DescribeAssetResponse
s {$sel:assetStatus:DescribeAssetResponse' :: AssetStatus
assetStatus = AssetStatus
a} :: DescribeAssetResponse)

instance Prelude.NFData DescribeAssetResponse