{-# 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.ListAssetRelationships
-- 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 a paginated list of asset relationships for an asset. You can
-- use this operation to identify an asset\'s root asset and all associated
-- assets between that asset and its root.
--
-- This operation returns paginated results.
module Amazonka.IoTSiteWise.ListAssetRelationships
  ( -- * Creating a Request
    ListAssetRelationships (..),
    newListAssetRelationships,

    -- * Request Lenses
    listAssetRelationships_nextToken,
    listAssetRelationships_maxResults,
    listAssetRelationships_assetId,
    listAssetRelationships_traversalType,

    -- * Destructuring the Response
    ListAssetRelationshipsResponse (..),
    newListAssetRelationshipsResponse,

    -- * Response Lenses
    listAssetRelationshipsResponse_nextToken,
    listAssetRelationshipsResponse_httpStatus,
    listAssetRelationshipsResponse_assetRelationshipSummaries,
  )
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:/ 'newListAssetRelationships' smart constructor.
data ListAssetRelationships = ListAssetRelationships'
  { -- | The token to be used for the next set of paginated results.
    ListAssetRelationships -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return for each paginated request.
    ListAssetRelationships -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the asset.
    ListAssetRelationships -> Text
assetId :: Prelude.Text,
    -- | The type of traversal to use to identify asset relationships. Choose the
    -- following option:
    --
    -- -   @PATH_TO_ROOT@ – Identify the asset\'s parent assets up to the root
    --     asset. The asset that you specify in @assetId@ is the first result
    --     in the list of @assetRelationshipSummaries@, and the root asset is
    --     the last result.
    ListAssetRelationships -> TraversalType
traversalType :: TraversalType
  }
  deriving (ListAssetRelationships -> ListAssetRelationships -> Bool
(ListAssetRelationships -> ListAssetRelationships -> Bool)
-> (ListAssetRelationships -> ListAssetRelationships -> Bool)
-> Eq ListAssetRelationships
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssetRelationships -> ListAssetRelationships -> Bool
$c/= :: ListAssetRelationships -> ListAssetRelationships -> Bool
== :: ListAssetRelationships -> ListAssetRelationships -> Bool
$c== :: ListAssetRelationships -> ListAssetRelationships -> Bool
Prelude.Eq, ReadPrec [ListAssetRelationships]
ReadPrec ListAssetRelationships
Int -> ReadS ListAssetRelationships
ReadS [ListAssetRelationships]
(Int -> ReadS ListAssetRelationships)
-> ReadS [ListAssetRelationships]
-> ReadPrec ListAssetRelationships
-> ReadPrec [ListAssetRelationships]
-> Read ListAssetRelationships
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssetRelationships]
$creadListPrec :: ReadPrec [ListAssetRelationships]
readPrec :: ReadPrec ListAssetRelationships
$creadPrec :: ReadPrec ListAssetRelationships
readList :: ReadS [ListAssetRelationships]
$creadList :: ReadS [ListAssetRelationships]
readsPrec :: Int -> ReadS ListAssetRelationships
$creadsPrec :: Int -> ReadS ListAssetRelationships
Prelude.Read, Int -> ListAssetRelationships -> ShowS
[ListAssetRelationships] -> ShowS
ListAssetRelationships -> String
(Int -> ListAssetRelationships -> ShowS)
-> (ListAssetRelationships -> String)
-> ([ListAssetRelationships] -> ShowS)
-> Show ListAssetRelationships
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssetRelationships] -> ShowS
$cshowList :: [ListAssetRelationships] -> ShowS
show :: ListAssetRelationships -> String
$cshow :: ListAssetRelationships -> String
showsPrec :: Int -> ListAssetRelationships -> ShowS
$cshowsPrec :: Int -> ListAssetRelationships -> ShowS
Prelude.Show, (forall x. ListAssetRelationships -> Rep ListAssetRelationships x)
-> (forall x.
    Rep ListAssetRelationships x -> ListAssetRelationships)
-> Generic ListAssetRelationships
forall x. Rep ListAssetRelationships x -> ListAssetRelationships
forall x. ListAssetRelationships -> Rep ListAssetRelationships x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssetRelationships x -> ListAssetRelationships
$cfrom :: forall x. ListAssetRelationships -> Rep ListAssetRelationships x
Prelude.Generic)

-- |
-- Create a value of 'ListAssetRelationships' 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:
--
-- 'nextToken', 'listAssetRelationships_nextToken' - The token to be used for the next set of paginated results.
--
-- 'maxResults', 'listAssetRelationships_maxResults' - The maximum number of results to return for each paginated request.
--
-- 'assetId', 'listAssetRelationships_assetId' - The ID of the asset.
--
-- 'traversalType', 'listAssetRelationships_traversalType' - The type of traversal to use to identify asset relationships. Choose the
-- following option:
--
-- -   @PATH_TO_ROOT@ – Identify the asset\'s parent assets up to the root
--     asset. The asset that you specify in @assetId@ is the first result
--     in the list of @assetRelationshipSummaries@, and the root asset is
--     the last result.
newListAssetRelationships ::
  -- | 'assetId'
  Prelude.Text ->
  -- | 'traversalType'
  TraversalType ->
  ListAssetRelationships
newListAssetRelationships :: Text -> TraversalType -> ListAssetRelationships
newListAssetRelationships Text
pAssetId_ TraversalType
pTraversalType_ =
  ListAssetRelationships' :: Maybe Text
-> Maybe Natural -> Text -> TraversalType -> ListAssetRelationships
ListAssetRelationships'
    { $sel:nextToken:ListAssetRelationships' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAssetRelationships' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:assetId:ListAssetRelationships' :: Text
assetId = Text
pAssetId_,
      $sel:traversalType:ListAssetRelationships' :: TraversalType
traversalType = TraversalType
pTraversalType_
    }

-- | The token to be used for the next set of paginated results.
listAssetRelationships_nextToken :: Lens.Lens' ListAssetRelationships (Prelude.Maybe Prelude.Text)
listAssetRelationships_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssetRelationships -> f ListAssetRelationships
listAssetRelationships_nextToken = (ListAssetRelationships -> Maybe Text)
-> (ListAssetRelationships -> Maybe Text -> ListAssetRelationships)
-> Lens
     ListAssetRelationships
     ListAssetRelationships
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssetRelationships' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssetRelationships' :: ListAssetRelationships -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssetRelationships
s@ListAssetRelationships' {} Maybe Text
a -> ListAssetRelationships
s {$sel:nextToken:ListAssetRelationships' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssetRelationships)

-- | The maximum number of results to return for each paginated request.
listAssetRelationships_maxResults :: Lens.Lens' ListAssetRelationships (Prelude.Maybe Prelude.Natural)
listAssetRelationships_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAssetRelationships -> f ListAssetRelationships
listAssetRelationships_maxResults = (ListAssetRelationships -> Maybe Natural)
-> (ListAssetRelationships
    -> Maybe Natural -> ListAssetRelationships)
-> Lens
     ListAssetRelationships
     ListAssetRelationships
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssetRelationships' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAssetRelationships' :: ListAssetRelationships -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAssetRelationships
s@ListAssetRelationships' {} Maybe Natural
a -> ListAssetRelationships
s {$sel:maxResults:ListAssetRelationships' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAssetRelationships)

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

-- | The type of traversal to use to identify asset relationships. Choose the
-- following option:
--
-- -   @PATH_TO_ROOT@ – Identify the asset\'s parent assets up to the root
--     asset. The asset that you specify in @assetId@ is the first result
--     in the list of @assetRelationshipSummaries@, and the root asset is
--     the last result.
listAssetRelationships_traversalType :: Lens.Lens' ListAssetRelationships TraversalType
listAssetRelationships_traversalType :: (TraversalType -> f TraversalType)
-> ListAssetRelationships -> f ListAssetRelationships
listAssetRelationships_traversalType = (ListAssetRelationships -> TraversalType)
-> (ListAssetRelationships
    -> TraversalType -> ListAssetRelationships)
-> Lens
     ListAssetRelationships
     ListAssetRelationships
     TraversalType
     TraversalType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssetRelationships' {TraversalType
traversalType :: TraversalType
$sel:traversalType:ListAssetRelationships' :: ListAssetRelationships -> TraversalType
traversalType} -> TraversalType
traversalType) (\s :: ListAssetRelationships
s@ListAssetRelationships' {} TraversalType
a -> ListAssetRelationships
s {$sel:traversalType:ListAssetRelationships' :: TraversalType
traversalType = TraversalType
a} :: ListAssetRelationships)

instance Core.AWSPager ListAssetRelationships where
  page :: ListAssetRelationships
-> AWSResponse ListAssetRelationships
-> Maybe ListAssetRelationships
page ListAssetRelationships
rq AWSResponse ListAssetRelationships
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssetRelationships
ListAssetRelationshipsResponse
rs
            ListAssetRelationshipsResponse
-> Getting (First Text) ListAssetRelationshipsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssetRelationshipsResponse
-> Const (First Text) ListAssetRelationshipsResponse
Lens' ListAssetRelationshipsResponse (Maybe Text)
listAssetRelationshipsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssetRelationshipsResponse
 -> Const (First Text) ListAssetRelationshipsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssetRelationshipsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAssetRelationships
forall a. Maybe a
Prelude.Nothing
    | [AssetRelationshipSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssetRelationships
ListAssetRelationshipsResponse
rs
            ListAssetRelationshipsResponse
-> Getting
     [AssetRelationshipSummary]
     ListAssetRelationshipsResponse
     [AssetRelationshipSummary]
-> [AssetRelationshipSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [AssetRelationshipSummary]
  ListAssetRelationshipsResponse
  [AssetRelationshipSummary]
Lens' ListAssetRelationshipsResponse [AssetRelationshipSummary]
listAssetRelationshipsResponse_assetRelationshipSummaries
        ) =
      Maybe ListAssetRelationships
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAssetRelationships -> Maybe ListAssetRelationships
forall a. a -> Maybe a
Prelude.Just (ListAssetRelationships -> Maybe ListAssetRelationships)
-> ListAssetRelationships -> Maybe ListAssetRelationships
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAssetRelationships
rq
          ListAssetRelationships
-> (ListAssetRelationships -> ListAssetRelationships)
-> ListAssetRelationships
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAssetRelationships -> Identity ListAssetRelationships
Lens
  ListAssetRelationships
  ListAssetRelationships
  (Maybe Text)
  (Maybe Text)
listAssetRelationships_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAssetRelationships -> Identity ListAssetRelationships)
-> Maybe Text -> ListAssetRelationships -> ListAssetRelationships
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssetRelationships
ListAssetRelationshipsResponse
rs
          ListAssetRelationshipsResponse
-> Getting (First Text) ListAssetRelationshipsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssetRelationshipsResponse
-> Const (First Text) ListAssetRelationshipsResponse
Lens' ListAssetRelationshipsResponse (Maybe Text)
listAssetRelationshipsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssetRelationshipsResponse
 -> Const (First Text) ListAssetRelationshipsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssetRelationshipsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListAssetRelationships where
  type
    AWSResponse ListAssetRelationships =
      ListAssetRelationshipsResponse
  request :: ListAssetRelationships -> Request ListAssetRelationships
request = Service -> ListAssetRelationships -> Request ListAssetRelationships
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAssetRelationships
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssetRelationships)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAssetRelationships))
-> Logger
-> Service
-> Proxy ListAssetRelationships
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssetRelationships)))
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
-> Int
-> [AssetRelationshipSummary]
-> ListAssetRelationshipsResponse
ListAssetRelationshipsResponse'
            (Maybe Text
 -> Int
 -> [AssetRelationshipSummary]
 -> ListAssetRelationshipsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [AssetRelationshipSummary] -> ListAssetRelationshipsResponse)
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
"nextToken")
            Either
  String
  (Int
   -> [AssetRelationshipSummary] -> ListAssetRelationshipsResponse)
-> Either String Int
-> Either
     String
     ([AssetRelationshipSummary] -> ListAssetRelationshipsResponse)
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
  ([AssetRelationshipSummary] -> ListAssetRelationshipsResponse)
-> Either String [AssetRelationshipSummary]
-> Either String ListAssetRelationshipsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AssetRelationshipSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assetRelationshipSummaries"
                            Either String (Maybe [AssetRelationshipSummary])
-> [AssetRelationshipSummary]
-> Either String [AssetRelationshipSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AssetRelationshipSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListAssetRelationships

instance Prelude.NFData ListAssetRelationships

instance Core.ToHeaders ListAssetRelationships where
  toHeaders :: ListAssetRelationships -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAssetRelationships -> 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 ListAssetRelationships where
  toPath :: ListAssetRelationships -> ByteString
toPath ListAssetRelationships' {Maybe Natural
Maybe Text
Text
TraversalType
traversalType :: TraversalType
assetId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:traversalType:ListAssetRelationships' :: ListAssetRelationships -> TraversalType
$sel:assetId:ListAssetRelationships' :: ListAssetRelationships -> Text
$sel:maxResults:ListAssetRelationships' :: ListAssetRelationships -> Maybe Natural
$sel:nextToken:ListAssetRelationships' :: ListAssetRelationships -> Maybe 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,
        ByteString
"/assetRelationships"
      ]

instance Core.ToQuery ListAssetRelationships where
  toQuery :: ListAssetRelationships -> QueryString
toQuery ListAssetRelationships' {Maybe Natural
Maybe Text
Text
TraversalType
traversalType :: TraversalType
assetId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:traversalType:ListAssetRelationships' :: ListAssetRelationships -> TraversalType
$sel:assetId:ListAssetRelationships' :: ListAssetRelationships -> Text
$sel:maxResults:ListAssetRelationships' :: ListAssetRelationships -> Maybe Natural
$sel:nextToken:ListAssetRelationships' :: ListAssetRelationships -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
        ByteString
"traversalType" ByteString -> TraversalType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: TraversalType
traversalType
      ]

-- | /See:/ 'newListAssetRelationshipsResponse' smart constructor.
data ListAssetRelationshipsResponse = ListAssetRelationshipsResponse'
  { -- | The token for the next set of results, or null if there are no
    -- additional results.
    ListAssetRelationshipsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAssetRelationshipsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list that summarizes each asset relationship.
    ListAssetRelationshipsResponse -> [AssetRelationshipSummary]
assetRelationshipSummaries :: [AssetRelationshipSummary]
  }
  deriving (ListAssetRelationshipsResponse
-> ListAssetRelationshipsResponse -> Bool
(ListAssetRelationshipsResponse
 -> ListAssetRelationshipsResponse -> Bool)
-> (ListAssetRelationshipsResponse
    -> ListAssetRelationshipsResponse -> Bool)
-> Eq ListAssetRelationshipsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssetRelationshipsResponse
-> ListAssetRelationshipsResponse -> Bool
$c/= :: ListAssetRelationshipsResponse
-> ListAssetRelationshipsResponse -> Bool
== :: ListAssetRelationshipsResponse
-> ListAssetRelationshipsResponse -> Bool
$c== :: ListAssetRelationshipsResponse
-> ListAssetRelationshipsResponse -> Bool
Prelude.Eq, ReadPrec [ListAssetRelationshipsResponse]
ReadPrec ListAssetRelationshipsResponse
Int -> ReadS ListAssetRelationshipsResponse
ReadS [ListAssetRelationshipsResponse]
(Int -> ReadS ListAssetRelationshipsResponse)
-> ReadS [ListAssetRelationshipsResponse]
-> ReadPrec ListAssetRelationshipsResponse
-> ReadPrec [ListAssetRelationshipsResponse]
-> Read ListAssetRelationshipsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssetRelationshipsResponse]
$creadListPrec :: ReadPrec [ListAssetRelationshipsResponse]
readPrec :: ReadPrec ListAssetRelationshipsResponse
$creadPrec :: ReadPrec ListAssetRelationshipsResponse
readList :: ReadS [ListAssetRelationshipsResponse]
$creadList :: ReadS [ListAssetRelationshipsResponse]
readsPrec :: Int -> ReadS ListAssetRelationshipsResponse
$creadsPrec :: Int -> ReadS ListAssetRelationshipsResponse
Prelude.Read, Int -> ListAssetRelationshipsResponse -> ShowS
[ListAssetRelationshipsResponse] -> ShowS
ListAssetRelationshipsResponse -> String
(Int -> ListAssetRelationshipsResponse -> ShowS)
-> (ListAssetRelationshipsResponse -> String)
-> ([ListAssetRelationshipsResponse] -> ShowS)
-> Show ListAssetRelationshipsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssetRelationshipsResponse] -> ShowS
$cshowList :: [ListAssetRelationshipsResponse] -> ShowS
show :: ListAssetRelationshipsResponse -> String
$cshow :: ListAssetRelationshipsResponse -> String
showsPrec :: Int -> ListAssetRelationshipsResponse -> ShowS
$cshowsPrec :: Int -> ListAssetRelationshipsResponse -> ShowS
Prelude.Show, (forall x.
 ListAssetRelationshipsResponse
 -> Rep ListAssetRelationshipsResponse x)
-> (forall x.
    Rep ListAssetRelationshipsResponse x
    -> ListAssetRelationshipsResponse)
-> Generic ListAssetRelationshipsResponse
forall x.
Rep ListAssetRelationshipsResponse x
-> ListAssetRelationshipsResponse
forall x.
ListAssetRelationshipsResponse
-> Rep ListAssetRelationshipsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssetRelationshipsResponse x
-> ListAssetRelationshipsResponse
$cfrom :: forall x.
ListAssetRelationshipsResponse
-> Rep ListAssetRelationshipsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAssetRelationshipsResponse' 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:
--
-- 'nextToken', 'listAssetRelationshipsResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'listAssetRelationshipsResponse_httpStatus' - The response's http status code.
--
-- 'assetRelationshipSummaries', 'listAssetRelationshipsResponse_assetRelationshipSummaries' - A list that summarizes each asset relationship.
newListAssetRelationshipsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssetRelationshipsResponse
newListAssetRelationshipsResponse :: Int -> ListAssetRelationshipsResponse
newListAssetRelationshipsResponse Int
pHttpStatus_ =
  ListAssetRelationshipsResponse' :: Maybe Text
-> Int
-> [AssetRelationshipSummary]
-> ListAssetRelationshipsResponse
ListAssetRelationshipsResponse'
    { $sel:nextToken:ListAssetRelationshipsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAssetRelationshipsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:assetRelationshipSummaries:ListAssetRelationshipsResponse' :: [AssetRelationshipSummary]
assetRelationshipSummaries = [AssetRelationshipSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The token for the next set of results, or null if there are no
-- additional results.
listAssetRelationshipsResponse_nextToken :: Lens.Lens' ListAssetRelationshipsResponse (Prelude.Maybe Prelude.Text)
listAssetRelationshipsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssetRelationshipsResponse
-> f ListAssetRelationshipsResponse
listAssetRelationshipsResponse_nextToken = (ListAssetRelationshipsResponse -> Maybe Text)
-> (ListAssetRelationshipsResponse
    -> Maybe Text -> ListAssetRelationshipsResponse)
-> Lens' ListAssetRelationshipsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssetRelationshipsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssetRelationshipsResponse' :: ListAssetRelationshipsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssetRelationshipsResponse
s@ListAssetRelationshipsResponse' {} Maybe Text
a -> ListAssetRelationshipsResponse
s {$sel:nextToken:ListAssetRelationshipsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssetRelationshipsResponse)

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

-- | A list that summarizes each asset relationship.
listAssetRelationshipsResponse_assetRelationshipSummaries :: Lens.Lens' ListAssetRelationshipsResponse [AssetRelationshipSummary]
listAssetRelationshipsResponse_assetRelationshipSummaries :: ([AssetRelationshipSummary] -> f [AssetRelationshipSummary])
-> ListAssetRelationshipsResponse
-> f ListAssetRelationshipsResponse
listAssetRelationshipsResponse_assetRelationshipSummaries = (ListAssetRelationshipsResponse -> [AssetRelationshipSummary])
-> (ListAssetRelationshipsResponse
    -> [AssetRelationshipSummary] -> ListAssetRelationshipsResponse)
-> Lens' ListAssetRelationshipsResponse [AssetRelationshipSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssetRelationshipsResponse' {[AssetRelationshipSummary]
assetRelationshipSummaries :: [AssetRelationshipSummary]
$sel:assetRelationshipSummaries:ListAssetRelationshipsResponse' :: ListAssetRelationshipsResponse -> [AssetRelationshipSummary]
assetRelationshipSummaries} -> [AssetRelationshipSummary]
assetRelationshipSummaries) (\s :: ListAssetRelationshipsResponse
s@ListAssetRelationshipsResponse' {} [AssetRelationshipSummary]
a -> ListAssetRelationshipsResponse
s {$sel:assetRelationshipSummaries:ListAssetRelationshipsResponse' :: [AssetRelationshipSummary]
assetRelationshipSummaries = [AssetRelationshipSummary]
a} :: ListAssetRelationshipsResponse) (([AssetRelationshipSummary] -> f [AssetRelationshipSummary])
 -> ListAssetRelationshipsResponse
 -> f ListAssetRelationshipsResponse)
-> (([AssetRelationshipSummary] -> f [AssetRelationshipSummary])
    -> [AssetRelationshipSummary] -> f [AssetRelationshipSummary])
-> ([AssetRelationshipSummary] -> f [AssetRelationshipSummary])
-> ListAssetRelationshipsResponse
-> f ListAssetRelationshipsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetRelationshipSummary] -> f [AssetRelationshipSummary])
-> [AssetRelationshipSummary] -> f [AssetRelationshipSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListAssetRelationshipsResponse