{-# 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.SnowDeviceManagement.ListDeviceResources
-- 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)
--
-- Returns a list of the Amazon Web Services resources available for a
-- device. Currently, Amazon EC2 instances are the only supported resource
-- type.
--
-- This operation returns paginated results.
module Amazonka.SnowDeviceManagement.ListDeviceResources
  ( -- * Creating a Request
    ListDeviceResources (..),
    newListDeviceResources,

    -- * Request Lenses
    listDeviceResources_nextToken,
    listDeviceResources_type,
    listDeviceResources_maxResults,
    listDeviceResources_managedDeviceId,

    -- * Destructuring the Response
    ListDeviceResourcesResponse (..),
    newListDeviceResourcesResponse,

    -- * Response Lenses
    listDeviceResourcesResponse_resources,
    listDeviceResourcesResponse_nextToken,
    listDeviceResourcesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListDeviceResources' smart constructor.
data ListDeviceResources = ListDeviceResources'
  { -- | A pagination token to continue to the next page of results.
    ListDeviceResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A structure used to filter the results by type of resource.
    ListDeviceResources -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of resources per page.
    ListDeviceResources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the managed device that you are listing the resources of.
    ListDeviceResources -> Text
managedDeviceId :: Prelude.Text
  }
  deriving (ListDeviceResources -> ListDeviceResources -> Bool
(ListDeviceResources -> ListDeviceResources -> Bool)
-> (ListDeviceResources -> ListDeviceResources -> Bool)
-> Eq ListDeviceResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeviceResources -> ListDeviceResources -> Bool
$c/= :: ListDeviceResources -> ListDeviceResources -> Bool
== :: ListDeviceResources -> ListDeviceResources -> Bool
$c== :: ListDeviceResources -> ListDeviceResources -> Bool
Prelude.Eq, ReadPrec [ListDeviceResources]
ReadPrec ListDeviceResources
Int -> ReadS ListDeviceResources
ReadS [ListDeviceResources]
(Int -> ReadS ListDeviceResources)
-> ReadS [ListDeviceResources]
-> ReadPrec ListDeviceResources
-> ReadPrec [ListDeviceResources]
-> Read ListDeviceResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeviceResources]
$creadListPrec :: ReadPrec [ListDeviceResources]
readPrec :: ReadPrec ListDeviceResources
$creadPrec :: ReadPrec ListDeviceResources
readList :: ReadS [ListDeviceResources]
$creadList :: ReadS [ListDeviceResources]
readsPrec :: Int -> ReadS ListDeviceResources
$creadsPrec :: Int -> ReadS ListDeviceResources
Prelude.Read, Int -> ListDeviceResources -> ShowS
[ListDeviceResources] -> ShowS
ListDeviceResources -> String
(Int -> ListDeviceResources -> ShowS)
-> (ListDeviceResources -> String)
-> ([ListDeviceResources] -> ShowS)
-> Show ListDeviceResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeviceResources] -> ShowS
$cshowList :: [ListDeviceResources] -> ShowS
show :: ListDeviceResources -> String
$cshow :: ListDeviceResources -> String
showsPrec :: Int -> ListDeviceResources -> ShowS
$cshowsPrec :: Int -> ListDeviceResources -> ShowS
Prelude.Show, (forall x. ListDeviceResources -> Rep ListDeviceResources x)
-> (forall x. Rep ListDeviceResources x -> ListDeviceResources)
-> Generic ListDeviceResources
forall x. Rep ListDeviceResources x -> ListDeviceResources
forall x. ListDeviceResources -> Rep ListDeviceResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDeviceResources x -> ListDeviceResources
$cfrom :: forall x. ListDeviceResources -> Rep ListDeviceResources x
Prelude.Generic)

-- |
-- Create a value of 'ListDeviceResources' 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', 'listDeviceResources_nextToken' - A pagination token to continue to the next page of results.
--
-- 'type'', 'listDeviceResources_type' - A structure used to filter the results by type of resource.
--
-- 'maxResults', 'listDeviceResources_maxResults' - The maximum number of resources per page.
--
-- 'managedDeviceId', 'listDeviceResources_managedDeviceId' - The ID of the managed device that you are listing the resources of.
newListDeviceResources ::
  -- | 'managedDeviceId'
  Prelude.Text ->
  ListDeviceResources
newListDeviceResources :: Text -> ListDeviceResources
newListDeviceResources Text
pManagedDeviceId_ =
  ListDeviceResources' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> ListDeviceResources
ListDeviceResources'
    { $sel:nextToken:ListDeviceResources' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ListDeviceResources' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDeviceResources' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:managedDeviceId:ListDeviceResources' :: Text
managedDeviceId = Text
pManagedDeviceId_
    }

-- | A pagination token to continue to the next page of results.
listDeviceResources_nextToken :: Lens.Lens' ListDeviceResources (Prelude.Maybe Prelude.Text)
listDeviceResources_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeviceResources -> f ListDeviceResources
listDeviceResources_nextToken = (ListDeviceResources -> Maybe Text)
-> (ListDeviceResources -> Maybe Text -> ListDeviceResources)
-> Lens
     ListDeviceResources ListDeviceResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeviceResources' :: ListDeviceResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeviceResources
s@ListDeviceResources' {} Maybe Text
a -> ListDeviceResources
s {$sel:nextToken:ListDeviceResources' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeviceResources)

-- | A structure used to filter the results by type of resource.
listDeviceResources_type :: Lens.Lens' ListDeviceResources (Prelude.Maybe Prelude.Text)
listDeviceResources_type :: (Maybe Text -> f (Maybe Text))
-> ListDeviceResources -> f ListDeviceResources
listDeviceResources_type = (ListDeviceResources -> Maybe Text)
-> (ListDeviceResources -> Maybe Text -> ListDeviceResources)
-> Lens
     ListDeviceResources ListDeviceResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceResources' {Maybe Text
type' :: Maybe Text
$sel:type':ListDeviceResources' :: ListDeviceResources -> Maybe Text
type'} -> Maybe Text
type') (\s :: ListDeviceResources
s@ListDeviceResources' {} Maybe Text
a -> ListDeviceResources
s {$sel:type':ListDeviceResources' :: Maybe Text
type' = Maybe Text
a} :: ListDeviceResources)

-- | The maximum number of resources per page.
listDeviceResources_maxResults :: Lens.Lens' ListDeviceResources (Prelude.Maybe Prelude.Natural)
listDeviceResources_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDeviceResources -> f ListDeviceResources
listDeviceResources_maxResults = (ListDeviceResources -> Maybe Natural)
-> (ListDeviceResources -> Maybe Natural -> ListDeviceResources)
-> Lens
     ListDeviceResources
     ListDeviceResources
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceResources' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDeviceResources' :: ListDeviceResources -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDeviceResources
s@ListDeviceResources' {} Maybe Natural
a -> ListDeviceResources
s {$sel:maxResults:ListDeviceResources' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDeviceResources)

-- | The ID of the managed device that you are listing the resources of.
listDeviceResources_managedDeviceId :: Lens.Lens' ListDeviceResources Prelude.Text
listDeviceResources_managedDeviceId :: (Text -> f Text) -> ListDeviceResources -> f ListDeviceResources
listDeviceResources_managedDeviceId = (ListDeviceResources -> Text)
-> (ListDeviceResources -> Text -> ListDeviceResources)
-> Lens ListDeviceResources ListDeviceResources Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceResources' {Text
managedDeviceId :: Text
$sel:managedDeviceId:ListDeviceResources' :: ListDeviceResources -> Text
managedDeviceId} -> Text
managedDeviceId) (\s :: ListDeviceResources
s@ListDeviceResources' {} Text
a -> ListDeviceResources
s {$sel:managedDeviceId:ListDeviceResources' :: Text
managedDeviceId = Text
a} :: ListDeviceResources)

instance Core.AWSPager ListDeviceResources where
  page :: ListDeviceResources
-> AWSResponse ListDeviceResources -> Maybe ListDeviceResources
page ListDeviceResources
rq AWSResponse ListDeviceResources
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDeviceResources
ListDeviceResourcesResponse
rs
            ListDeviceResourcesResponse
-> Getting (First Text) ListDeviceResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDeviceResourcesResponse
-> Const (First Text) ListDeviceResourcesResponse
Lens' ListDeviceResourcesResponse (Maybe Text)
listDeviceResourcesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDeviceResourcesResponse
 -> Const (First Text) ListDeviceResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDeviceResourcesResponse 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 ListDeviceResources
forall a. Maybe a
Prelude.Nothing
    | Maybe [ResourceSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDeviceResources
ListDeviceResourcesResponse
rs
            ListDeviceResourcesResponse
-> Getting
     (First [ResourceSummary])
     ListDeviceResourcesResponse
     [ResourceSummary]
-> Maybe [ResourceSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ResourceSummary]
 -> Const (First [ResourceSummary]) (Maybe [ResourceSummary]))
-> ListDeviceResourcesResponse
-> Const (First [ResourceSummary]) ListDeviceResourcesResponse
Lens' ListDeviceResourcesResponse (Maybe [ResourceSummary])
listDeviceResourcesResponse_resources
              ((Maybe [ResourceSummary]
  -> Const (First [ResourceSummary]) (Maybe [ResourceSummary]))
 -> ListDeviceResourcesResponse
 -> Const (First [ResourceSummary]) ListDeviceResourcesResponse)
-> (([ResourceSummary]
     -> Const (First [ResourceSummary]) [ResourceSummary])
    -> Maybe [ResourceSummary]
    -> Const (First [ResourceSummary]) (Maybe [ResourceSummary]))
-> Getting
     (First [ResourceSummary])
     ListDeviceResourcesResponse
     [ResourceSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResourceSummary]
 -> Const (First [ResourceSummary]) [ResourceSummary])
-> Maybe [ResourceSummary]
-> Const (First [ResourceSummary]) (Maybe [ResourceSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDeviceResources
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDeviceResources -> Maybe ListDeviceResources
forall a. a -> Maybe a
Prelude.Just (ListDeviceResources -> Maybe ListDeviceResources)
-> ListDeviceResources -> Maybe ListDeviceResources
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDeviceResources
rq
          ListDeviceResources
-> (ListDeviceResources -> ListDeviceResources)
-> ListDeviceResources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDeviceResources -> Identity ListDeviceResources
Lens
  ListDeviceResources ListDeviceResources (Maybe Text) (Maybe Text)
listDeviceResources_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDeviceResources -> Identity ListDeviceResources)
-> Maybe Text -> ListDeviceResources -> ListDeviceResources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDeviceResources
ListDeviceResourcesResponse
rs
          ListDeviceResourcesResponse
-> Getting (First Text) ListDeviceResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDeviceResourcesResponse
-> Const (First Text) ListDeviceResourcesResponse
Lens' ListDeviceResourcesResponse (Maybe Text)
listDeviceResourcesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDeviceResourcesResponse
 -> Const (First Text) ListDeviceResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDeviceResourcesResponse 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 ListDeviceResources where
  type
    AWSResponse ListDeviceResources =
      ListDeviceResourcesResponse
  request :: ListDeviceResources -> Request ListDeviceResources
request = Service -> ListDeviceResources -> Request ListDeviceResources
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDeviceResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDeviceResources)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDeviceResources))
-> Logger
-> Service
-> Proxy ListDeviceResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDeviceResources)))
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 [ResourceSummary]
-> Maybe Text -> Int -> ListDeviceResourcesResponse
ListDeviceResourcesResponse'
            (Maybe [ResourceSummary]
 -> Maybe Text -> Int -> ListDeviceResourcesResponse)
-> Either String (Maybe [ResourceSummary])
-> Either String (Maybe Text -> Int -> ListDeviceResourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ResourceSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"resources" Either String (Maybe (Maybe [ResourceSummary]))
-> Maybe [ResourceSummary]
-> Either String (Maybe [ResourceSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ResourceSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListDeviceResourcesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDeviceResourcesResponse)
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
"nextToken")
            Either String (Int -> ListDeviceResourcesResponse)
-> Either String Int -> Either String ListDeviceResourcesResponse
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 ListDeviceResources

instance Prelude.NFData ListDeviceResources

instance Core.ToHeaders ListDeviceResources where
  toHeaders :: ListDeviceResources -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDeviceResources -> 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 ListDeviceResources where
  toPath :: ListDeviceResources -> ByteString
toPath ListDeviceResources' {Maybe Natural
Maybe Text
Text
managedDeviceId :: Text
maxResults :: Maybe Natural
type' :: Maybe Text
nextToken :: Maybe Text
$sel:managedDeviceId:ListDeviceResources' :: ListDeviceResources -> Text
$sel:maxResults:ListDeviceResources' :: ListDeviceResources -> Maybe Natural
$sel:type':ListDeviceResources' :: ListDeviceResources -> Maybe Text
$sel:nextToken:ListDeviceResources' :: ListDeviceResources -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/managed-device/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
managedDeviceId,
        ByteString
"/resources"
      ]

instance Core.ToQuery ListDeviceResources where
  toQuery :: ListDeviceResources -> QueryString
toQuery ListDeviceResources' {Maybe Natural
Maybe Text
Text
managedDeviceId :: Text
maxResults :: Maybe Natural
type' :: Maybe Text
nextToken :: Maybe Text
$sel:managedDeviceId:ListDeviceResources' :: ListDeviceResources -> Text
$sel:maxResults:ListDeviceResources' :: ListDeviceResources -> Maybe Natural
$sel:type':ListDeviceResources' :: ListDeviceResources -> Maybe Text
$sel:nextToken:ListDeviceResources' :: ListDeviceResources -> 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
"type" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
type',
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListDeviceResourcesResponse' smart constructor.
data ListDeviceResourcesResponse = ListDeviceResourcesResponse'
  { -- | A structure defining the resource\'s type, Amazon Resource Name (ARN),
    -- and ID.
    ListDeviceResourcesResponse -> Maybe [ResourceSummary]
resources :: Prelude.Maybe [ResourceSummary],
    -- | A pagination token to continue to the next page of results.
    ListDeviceResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDeviceResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDeviceResourcesResponse -> ListDeviceResourcesResponse -> Bool
(ListDeviceResourcesResponse
 -> ListDeviceResourcesResponse -> Bool)
-> (ListDeviceResourcesResponse
    -> ListDeviceResourcesResponse -> Bool)
-> Eq ListDeviceResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeviceResourcesResponse -> ListDeviceResourcesResponse -> Bool
$c/= :: ListDeviceResourcesResponse -> ListDeviceResourcesResponse -> Bool
== :: ListDeviceResourcesResponse -> ListDeviceResourcesResponse -> Bool
$c== :: ListDeviceResourcesResponse -> ListDeviceResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListDeviceResourcesResponse]
ReadPrec ListDeviceResourcesResponse
Int -> ReadS ListDeviceResourcesResponse
ReadS [ListDeviceResourcesResponse]
(Int -> ReadS ListDeviceResourcesResponse)
-> ReadS [ListDeviceResourcesResponse]
-> ReadPrec ListDeviceResourcesResponse
-> ReadPrec [ListDeviceResourcesResponse]
-> Read ListDeviceResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeviceResourcesResponse]
$creadListPrec :: ReadPrec [ListDeviceResourcesResponse]
readPrec :: ReadPrec ListDeviceResourcesResponse
$creadPrec :: ReadPrec ListDeviceResourcesResponse
readList :: ReadS [ListDeviceResourcesResponse]
$creadList :: ReadS [ListDeviceResourcesResponse]
readsPrec :: Int -> ReadS ListDeviceResourcesResponse
$creadsPrec :: Int -> ReadS ListDeviceResourcesResponse
Prelude.Read, Int -> ListDeviceResourcesResponse -> ShowS
[ListDeviceResourcesResponse] -> ShowS
ListDeviceResourcesResponse -> String
(Int -> ListDeviceResourcesResponse -> ShowS)
-> (ListDeviceResourcesResponse -> String)
-> ([ListDeviceResourcesResponse] -> ShowS)
-> Show ListDeviceResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeviceResourcesResponse] -> ShowS
$cshowList :: [ListDeviceResourcesResponse] -> ShowS
show :: ListDeviceResourcesResponse -> String
$cshow :: ListDeviceResourcesResponse -> String
showsPrec :: Int -> ListDeviceResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListDeviceResourcesResponse -> ShowS
Prelude.Show, (forall x.
 ListDeviceResourcesResponse -> Rep ListDeviceResourcesResponse x)
-> (forall x.
    Rep ListDeviceResourcesResponse x -> ListDeviceResourcesResponse)
-> Generic ListDeviceResourcesResponse
forall x.
Rep ListDeviceResourcesResponse x -> ListDeviceResourcesResponse
forall x.
ListDeviceResourcesResponse -> Rep ListDeviceResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeviceResourcesResponse x -> ListDeviceResourcesResponse
$cfrom :: forall x.
ListDeviceResourcesResponse -> Rep ListDeviceResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDeviceResourcesResponse' 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:
--
-- 'resources', 'listDeviceResourcesResponse_resources' - A structure defining the resource\'s type, Amazon Resource Name (ARN),
-- and ID.
--
-- 'nextToken', 'listDeviceResourcesResponse_nextToken' - A pagination token to continue to the next page of results.
--
-- 'httpStatus', 'listDeviceResourcesResponse_httpStatus' - The response's http status code.
newListDeviceResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDeviceResourcesResponse
newListDeviceResourcesResponse :: Int -> ListDeviceResourcesResponse
newListDeviceResourcesResponse Int
pHttpStatus_ =
  ListDeviceResourcesResponse' :: Maybe [ResourceSummary]
-> Maybe Text -> Int -> ListDeviceResourcesResponse
ListDeviceResourcesResponse'
    { $sel:resources:ListDeviceResourcesResponse' :: Maybe [ResourceSummary]
resources =
        Maybe [ResourceSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDeviceResourcesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDeviceResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A structure defining the resource\'s type, Amazon Resource Name (ARN),
-- and ID.
listDeviceResourcesResponse_resources :: Lens.Lens' ListDeviceResourcesResponse (Prelude.Maybe [ResourceSummary])
listDeviceResourcesResponse_resources :: (Maybe [ResourceSummary] -> f (Maybe [ResourceSummary]))
-> ListDeviceResourcesResponse -> f ListDeviceResourcesResponse
listDeviceResourcesResponse_resources = (ListDeviceResourcesResponse -> Maybe [ResourceSummary])
-> (ListDeviceResourcesResponse
    -> Maybe [ResourceSummary] -> ListDeviceResourcesResponse)
-> Lens' ListDeviceResourcesResponse (Maybe [ResourceSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceResourcesResponse' {Maybe [ResourceSummary]
resources :: Maybe [ResourceSummary]
$sel:resources:ListDeviceResourcesResponse' :: ListDeviceResourcesResponse -> Maybe [ResourceSummary]
resources} -> Maybe [ResourceSummary]
resources) (\s :: ListDeviceResourcesResponse
s@ListDeviceResourcesResponse' {} Maybe [ResourceSummary]
a -> ListDeviceResourcesResponse
s {$sel:resources:ListDeviceResourcesResponse' :: Maybe [ResourceSummary]
resources = Maybe [ResourceSummary]
a} :: ListDeviceResourcesResponse) ((Maybe [ResourceSummary] -> f (Maybe [ResourceSummary]))
 -> ListDeviceResourcesResponse -> f ListDeviceResourcesResponse)
-> ((Maybe [ResourceSummary] -> f (Maybe [ResourceSummary]))
    -> Maybe [ResourceSummary] -> f (Maybe [ResourceSummary]))
-> (Maybe [ResourceSummary] -> f (Maybe [ResourceSummary]))
-> ListDeviceResourcesResponse
-> f ListDeviceResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourceSummary]
  [ResourceSummary]
  [ResourceSummary]
  [ResourceSummary]
-> Iso
     (Maybe [ResourceSummary])
     (Maybe [ResourceSummary])
     (Maybe [ResourceSummary])
     (Maybe [ResourceSummary])
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
  [ResourceSummary]
  [ResourceSummary]
  [ResourceSummary]
  [ResourceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A pagination token to continue to the next page of results.
listDeviceResourcesResponse_nextToken :: Lens.Lens' ListDeviceResourcesResponse (Prelude.Maybe Prelude.Text)
listDeviceResourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeviceResourcesResponse -> f ListDeviceResourcesResponse
listDeviceResourcesResponse_nextToken = (ListDeviceResourcesResponse -> Maybe Text)
-> (ListDeviceResourcesResponse
    -> Maybe Text -> ListDeviceResourcesResponse)
-> Lens' ListDeviceResourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeviceResourcesResponse' :: ListDeviceResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeviceResourcesResponse
s@ListDeviceResourcesResponse' {} Maybe Text
a -> ListDeviceResourcesResponse
s {$sel:nextToken:ListDeviceResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeviceResourcesResponse)

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

instance Prelude.NFData ListDeviceResourcesResponse