{-# 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.PrivateNetworks.ListNetworkResources
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists network resources. Add filters to your request to return a more
-- specific list of results. Use filters to match the Amazon Resource Name
-- (ARN) of an order or the status of network resources.
--
-- If you specify multiple filters, filters are joined with an OR, and the
-- request returns results that match all of the specified filters.
--
-- This operation returns paginated results.
module Amazonka.PrivateNetworks.ListNetworkResources
  ( -- * Creating a Request
    ListNetworkResources (..),
    newListNetworkResources,

    -- * Request Lenses
    listNetworkResources_filters,
    listNetworkResources_maxResults,
    listNetworkResources_startToken,
    listNetworkResources_networkArn,

    -- * Destructuring the Response
    ListNetworkResourcesResponse (..),
    newListNetworkResourcesResponse,

    -- * Response Lenses
    listNetworkResourcesResponse_networkResources,
    listNetworkResourcesResponse_nextToken,
    listNetworkResourcesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.PrivateNetworks.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListNetworkResources' smart constructor.
data ListNetworkResources = ListNetworkResources'
  { -- | The filters.
    --
    -- -   @ORDER@ - The Amazon Resource Name (ARN) of the order.
    --
    -- -   @STATUS@ - The status (@AVAILABLE@ | @DELETED@ | @DELETING@ |
    --     @PENDING@ | @PENDING_RETURN@ | @PROVISIONING@ | @SHIPPED@).
    --
    -- Filter values are case sensitive. If you specify multiple values for a
    -- filter, the values are joined with an @OR@, and the request returns all
    -- results that match any of the specified values.
    ListNetworkResources
-> Maybe (HashMap NetworkResourceFilterKeys [Text])
filters :: Prelude.Maybe (Prelude.HashMap NetworkResourceFilterKeys [Prelude.Text]),
    -- | The maximum number of results to return.
    ListNetworkResources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    ListNetworkResources -> Maybe Text
startToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the network.
    ListNetworkResources -> Text
networkArn :: Prelude.Text
  }
  deriving (ListNetworkResources -> ListNetworkResources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNetworkResources -> ListNetworkResources -> Bool
$c/= :: ListNetworkResources -> ListNetworkResources -> Bool
== :: ListNetworkResources -> ListNetworkResources -> Bool
$c== :: ListNetworkResources -> ListNetworkResources -> Bool
Prelude.Eq, ReadPrec [ListNetworkResources]
ReadPrec ListNetworkResources
Int -> ReadS ListNetworkResources
ReadS [ListNetworkResources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNetworkResources]
$creadListPrec :: ReadPrec [ListNetworkResources]
readPrec :: ReadPrec ListNetworkResources
$creadPrec :: ReadPrec ListNetworkResources
readList :: ReadS [ListNetworkResources]
$creadList :: ReadS [ListNetworkResources]
readsPrec :: Int -> ReadS ListNetworkResources
$creadsPrec :: Int -> ReadS ListNetworkResources
Prelude.Read, Int -> ListNetworkResources -> ShowS
[ListNetworkResources] -> ShowS
ListNetworkResources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNetworkResources] -> ShowS
$cshowList :: [ListNetworkResources] -> ShowS
show :: ListNetworkResources -> String
$cshow :: ListNetworkResources -> String
showsPrec :: Int -> ListNetworkResources -> ShowS
$cshowsPrec :: Int -> ListNetworkResources -> ShowS
Prelude.Show, forall x. Rep ListNetworkResources x -> ListNetworkResources
forall x. ListNetworkResources -> Rep ListNetworkResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListNetworkResources x -> ListNetworkResources
$cfrom :: forall x. ListNetworkResources -> Rep ListNetworkResources x
Prelude.Generic)

-- |
-- Create a value of 'ListNetworkResources' 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:
--
-- 'filters', 'listNetworkResources_filters' - The filters.
--
-- -   @ORDER@ - The Amazon Resource Name (ARN) of the order.
--
-- -   @STATUS@ - The status (@AVAILABLE@ | @DELETED@ | @DELETING@ |
--     @PENDING@ | @PENDING_RETURN@ | @PROVISIONING@ | @SHIPPED@).
--
-- Filter values are case sensitive. If you specify multiple values for a
-- filter, the values are joined with an @OR@, and the request returns all
-- results that match any of the specified values.
--
-- 'maxResults', 'listNetworkResources_maxResults' - The maximum number of results to return.
--
-- 'startToken', 'listNetworkResources_startToken' - The token for the next page of results.
--
-- 'networkArn', 'listNetworkResources_networkArn' - The Amazon Resource Name (ARN) of the network.
newListNetworkResources ::
  -- | 'networkArn'
  Prelude.Text ->
  ListNetworkResources
newListNetworkResources :: Text -> ListNetworkResources
newListNetworkResources Text
pNetworkArn_ =
  ListNetworkResources'
    { $sel:filters:ListNetworkResources' :: Maybe (HashMap NetworkResourceFilterKeys [Text])
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListNetworkResources' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:startToken:ListNetworkResources' :: Maybe Text
startToken = forall a. Maybe a
Prelude.Nothing,
      $sel:networkArn:ListNetworkResources' :: Text
networkArn = Text
pNetworkArn_
    }

-- | The filters.
--
-- -   @ORDER@ - The Amazon Resource Name (ARN) of the order.
--
-- -   @STATUS@ - The status (@AVAILABLE@ | @DELETED@ | @DELETING@ |
--     @PENDING@ | @PENDING_RETURN@ | @PROVISIONING@ | @SHIPPED@).
--
-- Filter values are case sensitive. If you specify multiple values for a
-- filter, the values are joined with an @OR@, and the request returns all
-- results that match any of the specified values.
listNetworkResources_filters :: Lens.Lens' ListNetworkResources (Prelude.Maybe (Prelude.HashMap NetworkResourceFilterKeys [Prelude.Text]))
listNetworkResources_filters :: Lens'
  ListNetworkResources
  (Maybe (HashMap NetworkResourceFilterKeys [Text]))
listNetworkResources_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNetworkResources' {Maybe (HashMap NetworkResourceFilterKeys [Text])
filters :: Maybe (HashMap NetworkResourceFilterKeys [Text])
$sel:filters:ListNetworkResources' :: ListNetworkResources
-> Maybe (HashMap NetworkResourceFilterKeys [Text])
filters} -> Maybe (HashMap NetworkResourceFilterKeys [Text])
filters) (\s :: ListNetworkResources
s@ListNetworkResources' {} Maybe (HashMap NetworkResourceFilterKeys [Text])
a -> ListNetworkResources
s {$sel:filters:ListNetworkResources' :: Maybe (HashMap NetworkResourceFilterKeys [Text])
filters = Maybe (HashMap NetworkResourceFilterKeys [Text])
a} :: ListNetworkResources) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to return.
listNetworkResources_maxResults :: Lens.Lens' ListNetworkResources (Prelude.Maybe Prelude.Natural)
listNetworkResources_maxResults :: Lens' ListNetworkResources (Maybe Natural)
listNetworkResources_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNetworkResources' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListNetworkResources' :: ListNetworkResources -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListNetworkResources
s@ListNetworkResources' {} Maybe Natural
a -> ListNetworkResources
s {$sel:maxResults:ListNetworkResources' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListNetworkResources)

-- | The token for the next page of results.
listNetworkResources_startToken :: Lens.Lens' ListNetworkResources (Prelude.Maybe Prelude.Text)
listNetworkResources_startToken :: Lens' ListNetworkResources (Maybe Text)
listNetworkResources_startToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNetworkResources' {Maybe Text
startToken :: Maybe Text
$sel:startToken:ListNetworkResources' :: ListNetworkResources -> Maybe Text
startToken} -> Maybe Text
startToken) (\s :: ListNetworkResources
s@ListNetworkResources' {} Maybe Text
a -> ListNetworkResources
s {$sel:startToken:ListNetworkResources' :: Maybe Text
startToken = Maybe Text
a} :: ListNetworkResources)

-- | The Amazon Resource Name (ARN) of the network.
listNetworkResources_networkArn :: Lens.Lens' ListNetworkResources Prelude.Text
listNetworkResources_networkArn :: Lens' ListNetworkResources Text
listNetworkResources_networkArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNetworkResources' {Text
networkArn :: Text
$sel:networkArn:ListNetworkResources' :: ListNetworkResources -> Text
networkArn} -> Text
networkArn) (\s :: ListNetworkResources
s@ListNetworkResources' {} Text
a -> ListNetworkResources
s {$sel:networkArn:ListNetworkResources' :: Text
networkArn = Text
a} :: ListNetworkResources)

instance Core.AWSPager ListNetworkResources where
  page :: ListNetworkResources
-> AWSResponse ListNetworkResources -> Maybe ListNetworkResources
page ListNetworkResources
rq AWSResponse ListNetworkResources
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNetworkResources
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNetworkResourcesResponse (Maybe Text)
listNetworkResourcesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListNetworkResources
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNetworkResourcesResponse (Maybe [NetworkResource])
listNetworkResourcesResponse_networkResources
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListNetworkResources
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListNetworkResources (Maybe Text)
listNetworkResources_startToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListNetworkResources
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListNetworkResourcesResponse (Maybe Text)
listNetworkResourcesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListNetworkResources where
  type
    AWSResponse ListNetworkResources =
      ListNetworkResourcesResponse
  request :: (Service -> Service)
-> ListNetworkResources -> Request ListNetworkResources
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListNetworkResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListNetworkResources)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [NetworkResource]
-> Maybe Text -> Int -> ListNetworkResourcesResponse
ListNetworkResourcesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"networkResources"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListNetworkResources where
  hashWithSalt :: Int -> ListNetworkResources -> Int
hashWithSalt Int
_salt ListNetworkResources' {Maybe Natural
Maybe Text
Maybe (HashMap NetworkResourceFilterKeys [Text])
Text
networkArn :: Text
startToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (HashMap NetworkResourceFilterKeys [Text])
$sel:networkArn:ListNetworkResources' :: ListNetworkResources -> Text
$sel:startToken:ListNetworkResources' :: ListNetworkResources -> Maybe Text
$sel:maxResults:ListNetworkResources' :: ListNetworkResources -> Maybe Natural
$sel:filters:ListNetworkResources' :: ListNetworkResources
-> Maybe (HashMap NetworkResourceFilterKeys [Text])
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap NetworkResourceFilterKeys [Text])
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
startToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkArn

instance Prelude.NFData ListNetworkResources where
  rnf :: ListNetworkResources -> ()
rnf ListNetworkResources' {Maybe Natural
Maybe Text
Maybe (HashMap NetworkResourceFilterKeys [Text])
Text
networkArn :: Text
startToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (HashMap NetworkResourceFilterKeys [Text])
$sel:networkArn:ListNetworkResources' :: ListNetworkResources -> Text
$sel:startToken:ListNetworkResources' :: ListNetworkResources -> Maybe Text
$sel:maxResults:ListNetworkResources' :: ListNetworkResources -> Maybe Natural
$sel:filters:ListNetworkResources' :: ListNetworkResources
-> Maybe (HashMap NetworkResourceFilterKeys [Text])
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap NetworkResourceFilterKeys [Text])
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
startToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkArn

instance Data.ToHeaders ListNetworkResources where
  toHeaders :: ListNetworkResources -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListNetworkResources where
  toJSON :: ListNetworkResources -> Value
toJSON ListNetworkResources' {Maybe Natural
Maybe Text
Maybe (HashMap NetworkResourceFilterKeys [Text])
Text
networkArn :: Text
startToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (HashMap NetworkResourceFilterKeys [Text])
$sel:networkArn:ListNetworkResources' :: ListNetworkResources -> Text
$sel:startToken:ListNetworkResources' :: ListNetworkResources -> Maybe Text
$sel:maxResults:ListNetworkResources' :: ListNetworkResources -> Maybe Natural
$sel:filters:ListNetworkResources' :: ListNetworkResources
-> Maybe (HashMap NetworkResourceFilterKeys [Text])
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap NetworkResourceFilterKeys [Text])
filters,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"startToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
startToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"networkArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
networkArn)
          ]
      )

instance Data.ToPath ListNetworkResources where
  toPath :: ListNetworkResources -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/v1/network-resources"

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

-- | /See:/ 'newListNetworkResourcesResponse' smart constructor.
data ListNetworkResourcesResponse = ListNetworkResourcesResponse'
  { -- | Information about network resources.
    ListNetworkResourcesResponse -> Maybe [NetworkResource]
networkResources :: Prelude.Maybe [NetworkResource],
    -- | The token for the next page of results.
    ListNetworkResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListNetworkResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListNetworkResourcesResponse
-> ListNetworkResourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNetworkResourcesResponse
-> ListNetworkResourcesResponse -> Bool
$c/= :: ListNetworkResourcesResponse
-> ListNetworkResourcesResponse -> Bool
== :: ListNetworkResourcesResponse
-> ListNetworkResourcesResponse -> Bool
$c== :: ListNetworkResourcesResponse
-> ListNetworkResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListNetworkResourcesResponse]
ReadPrec ListNetworkResourcesResponse
Int -> ReadS ListNetworkResourcesResponse
ReadS [ListNetworkResourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNetworkResourcesResponse]
$creadListPrec :: ReadPrec [ListNetworkResourcesResponse]
readPrec :: ReadPrec ListNetworkResourcesResponse
$creadPrec :: ReadPrec ListNetworkResourcesResponse
readList :: ReadS [ListNetworkResourcesResponse]
$creadList :: ReadS [ListNetworkResourcesResponse]
readsPrec :: Int -> ReadS ListNetworkResourcesResponse
$creadsPrec :: Int -> ReadS ListNetworkResourcesResponse
Prelude.Read, Int -> ListNetworkResourcesResponse -> ShowS
[ListNetworkResourcesResponse] -> ShowS
ListNetworkResourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNetworkResourcesResponse] -> ShowS
$cshowList :: [ListNetworkResourcesResponse] -> ShowS
show :: ListNetworkResourcesResponse -> String
$cshow :: ListNetworkResourcesResponse -> String
showsPrec :: Int -> ListNetworkResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListNetworkResourcesResponse -> ShowS
Prelude.Show, forall x.
Rep ListNetworkResourcesResponse x -> ListNetworkResourcesResponse
forall x.
ListNetworkResourcesResponse -> Rep ListNetworkResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListNetworkResourcesResponse x -> ListNetworkResourcesResponse
$cfrom :: forall x.
ListNetworkResourcesResponse -> Rep ListNetworkResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListNetworkResourcesResponse' 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:
--
-- 'networkResources', 'listNetworkResourcesResponse_networkResources' - Information about network resources.
--
-- 'nextToken', 'listNetworkResourcesResponse_nextToken' - The token for the next page of results.
--
-- 'httpStatus', 'listNetworkResourcesResponse_httpStatus' - The response's http status code.
newListNetworkResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListNetworkResourcesResponse
newListNetworkResourcesResponse :: Int -> ListNetworkResourcesResponse
newListNetworkResourcesResponse Int
pHttpStatus_ =
  ListNetworkResourcesResponse'
    { $sel:networkResources:ListNetworkResourcesResponse' :: Maybe [NetworkResource]
networkResources =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNetworkResourcesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListNetworkResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about network resources.
listNetworkResourcesResponse_networkResources :: Lens.Lens' ListNetworkResourcesResponse (Prelude.Maybe [NetworkResource])
listNetworkResourcesResponse_networkResources :: Lens' ListNetworkResourcesResponse (Maybe [NetworkResource])
listNetworkResourcesResponse_networkResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNetworkResourcesResponse' {Maybe [NetworkResource]
networkResources :: Maybe [NetworkResource]
$sel:networkResources:ListNetworkResourcesResponse' :: ListNetworkResourcesResponse -> Maybe [NetworkResource]
networkResources} -> Maybe [NetworkResource]
networkResources) (\s :: ListNetworkResourcesResponse
s@ListNetworkResourcesResponse' {} Maybe [NetworkResource]
a -> ListNetworkResourcesResponse
s {$sel:networkResources:ListNetworkResourcesResponse' :: Maybe [NetworkResource]
networkResources = Maybe [NetworkResource]
a} :: ListNetworkResourcesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next page of results.
listNetworkResourcesResponse_nextToken :: Lens.Lens' ListNetworkResourcesResponse (Prelude.Maybe Prelude.Text)
listNetworkResourcesResponse_nextToken :: Lens' ListNetworkResourcesResponse (Maybe Text)
listNetworkResourcesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNetworkResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNetworkResourcesResponse' :: ListNetworkResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNetworkResourcesResponse
s@ListNetworkResourcesResponse' {} Maybe Text
a -> ListNetworkResourcesResponse
s {$sel:nextToken:ListNetworkResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListNetworkResourcesResponse)

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

instance Prelude.NFData ListNetworkResourcesResponse where
  rnf :: ListNetworkResourcesResponse -> ()
rnf ListNetworkResourcesResponse' {Int
Maybe [NetworkResource]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
networkResources :: Maybe [NetworkResource]
$sel:httpStatus:ListNetworkResourcesResponse' :: ListNetworkResourcesResponse -> Int
$sel:nextToken:ListNetworkResourcesResponse' :: ListNetworkResourcesResponse -> Maybe Text
$sel:networkResources:ListNetworkResourcesResponse' :: ListNetworkResourcesResponse -> Maybe [NetworkResource]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkResource]
networkResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus