{-# 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.AlexaBusiness.SearchNetworkProfiles
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Searches network profiles and lists the ones that meet a set of filter
-- and sort criteria.
module Amazonka.AlexaBusiness.SearchNetworkProfiles
  ( -- * Creating a Request
    SearchNetworkProfiles (..),
    newSearchNetworkProfiles,

    -- * Request Lenses
    searchNetworkProfiles_filters,
    searchNetworkProfiles_maxResults,
    searchNetworkProfiles_nextToken,
    searchNetworkProfiles_sortCriteria,

    -- * Destructuring the Response
    SearchNetworkProfilesResponse (..),
    newSearchNetworkProfilesResponse,

    -- * Response Lenses
    searchNetworkProfilesResponse_networkProfiles,
    searchNetworkProfilesResponse_nextToken,
    searchNetworkProfilesResponse_totalCount,
    searchNetworkProfilesResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newSearchNetworkProfiles' smart constructor.
data SearchNetworkProfiles = SearchNetworkProfiles'
  { -- | The filters to use to list a specified set of network profiles. Valid
    -- filters are NetworkProfileName, Ssid, and SecurityType.
    SearchNetworkProfiles -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to include in the response. If more
    -- results exist than the specified MaxResults value, a token is included
    -- in the response so that the remaining results can be retrieved.
    SearchNetworkProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | An optional token returned from a prior request. Use this token for
    -- pagination of results from this action. If this parameter is specified,
    -- the response includes only results beyond the token, up to the value
    -- specified by MaxResults.
    SearchNetworkProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sort order to use to list the specified set of network profiles.
    -- Valid sort criteria includes NetworkProfileName, Ssid, and SecurityType.
    SearchNetworkProfiles -> Maybe [Sort]
sortCriteria :: Prelude.Maybe [Sort]
  }
  deriving (SearchNetworkProfiles -> SearchNetworkProfiles -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchNetworkProfiles -> SearchNetworkProfiles -> Bool
$c/= :: SearchNetworkProfiles -> SearchNetworkProfiles -> Bool
== :: SearchNetworkProfiles -> SearchNetworkProfiles -> Bool
$c== :: SearchNetworkProfiles -> SearchNetworkProfiles -> Bool
Prelude.Eq, ReadPrec [SearchNetworkProfiles]
ReadPrec SearchNetworkProfiles
Int -> ReadS SearchNetworkProfiles
ReadS [SearchNetworkProfiles]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchNetworkProfiles]
$creadListPrec :: ReadPrec [SearchNetworkProfiles]
readPrec :: ReadPrec SearchNetworkProfiles
$creadPrec :: ReadPrec SearchNetworkProfiles
readList :: ReadS [SearchNetworkProfiles]
$creadList :: ReadS [SearchNetworkProfiles]
readsPrec :: Int -> ReadS SearchNetworkProfiles
$creadsPrec :: Int -> ReadS SearchNetworkProfiles
Prelude.Read, Int -> SearchNetworkProfiles -> ShowS
[SearchNetworkProfiles] -> ShowS
SearchNetworkProfiles -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchNetworkProfiles] -> ShowS
$cshowList :: [SearchNetworkProfiles] -> ShowS
show :: SearchNetworkProfiles -> String
$cshow :: SearchNetworkProfiles -> String
showsPrec :: Int -> SearchNetworkProfiles -> ShowS
$cshowsPrec :: Int -> SearchNetworkProfiles -> ShowS
Prelude.Show, forall x. Rep SearchNetworkProfiles x -> SearchNetworkProfiles
forall x. SearchNetworkProfiles -> Rep SearchNetworkProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchNetworkProfiles x -> SearchNetworkProfiles
$cfrom :: forall x. SearchNetworkProfiles -> Rep SearchNetworkProfiles x
Prelude.Generic)

-- |
-- Create a value of 'SearchNetworkProfiles' 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', 'searchNetworkProfiles_filters' - The filters to use to list a specified set of network profiles. Valid
-- filters are NetworkProfileName, Ssid, and SecurityType.
--
-- 'maxResults', 'searchNetworkProfiles_maxResults' - The maximum number of results to include in the response. If more
-- results exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
--
-- 'nextToken', 'searchNetworkProfiles_nextToken' - An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by MaxResults.
--
-- 'sortCriteria', 'searchNetworkProfiles_sortCriteria' - The sort order to use to list the specified set of network profiles.
-- Valid sort criteria includes NetworkProfileName, Ssid, and SecurityType.
newSearchNetworkProfiles ::
  SearchNetworkProfiles
newSearchNetworkProfiles :: SearchNetworkProfiles
newSearchNetworkProfiles =
  SearchNetworkProfiles'
    { $sel:filters:SearchNetworkProfiles' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchNetworkProfiles' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchNetworkProfiles' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortCriteria:SearchNetworkProfiles' :: Maybe [Sort]
sortCriteria = forall a. Maybe a
Prelude.Nothing
    }

-- | The filters to use to list a specified set of network profiles. Valid
-- filters are NetworkProfileName, Ssid, and SecurityType.
searchNetworkProfiles_filters :: Lens.Lens' SearchNetworkProfiles (Prelude.Maybe [Filter])
searchNetworkProfiles_filters :: Lens' SearchNetworkProfiles (Maybe [Filter])
searchNetworkProfiles_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchNetworkProfiles' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: SearchNetworkProfiles
s@SearchNetworkProfiles' {} Maybe [Filter]
a -> SearchNetworkProfiles
s {$sel:filters:SearchNetworkProfiles' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: SearchNetworkProfiles) 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 include in the response. If more
-- results exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
searchNetworkProfiles_maxResults :: Lens.Lens' SearchNetworkProfiles (Prelude.Maybe Prelude.Natural)
searchNetworkProfiles_maxResults :: Lens' SearchNetworkProfiles (Maybe Natural)
searchNetworkProfiles_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchNetworkProfiles' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchNetworkProfiles
s@SearchNetworkProfiles' {} Maybe Natural
a -> SearchNetworkProfiles
s {$sel:maxResults:SearchNetworkProfiles' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchNetworkProfiles)

-- | An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by MaxResults.
searchNetworkProfiles_nextToken :: Lens.Lens' SearchNetworkProfiles (Prelude.Maybe Prelude.Text)
searchNetworkProfiles_nextToken :: Lens' SearchNetworkProfiles (Maybe Text)
searchNetworkProfiles_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchNetworkProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchNetworkProfiles
s@SearchNetworkProfiles' {} Maybe Text
a -> SearchNetworkProfiles
s {$sel:nextToken:SearchNetworkProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: SearchNetworkProfiles)

-- | The sort order to use to list the specified set of network profiles.
-- Valid sort criteria includes NetworkProfileName, Ssid, and SecurityType.
searchNetworkProfiles_sortCriteria :: Lens.Lens' SearchNetworkProfiles (Prelude.Maybe [Sort])
searchNetworkProfiles_sortCriteria :: Lens' SearchNetworkProfiles (Maybe [Sort])
searchNetworkProfiles_sortCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchNetworkProfiles' {Maybe [Sort]
sortCriteria :: Maybe [Sort]
$sel:sortCriteria:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Sort]
sortCriteria} -> Maybe [Sort]
sortCriteria) (\s :: SearchNetworkProfiles
s@SearchNetworkProfiles' {} Maybe [Sort]
a -> SearchNetworkProfiles
s {$sel:sortCriteria:SearchNetworkProfiles' :: Maybe [Sort]
sortCriteria = Maybe [Sort]
a} :: SearchNetworkProfiles) 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

instance Core.AWSRequest SearchNetworkProfiles where
  type
    AWSResponse SearchNetworkProfiles =
      SearchNetworkProfilesResponse
  request :: (Service -> Service)
-> SearchNetworkProfiles -> Request SearchNetworkProfiles
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 SearchNetworkProfiles
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchNetworkProfiles)))
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 [NetworkProfileData]
-> Maybe Text -> Maybe Int -> Int -> SearchNetworkProfilesResponse
SearchNetworkProfilesResponse'
            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
"NetworkProfiles"
                            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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TotalCount")
            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 SearchNetworkProfiles where
  hashWithSalt :: Int -> SearchNetworkProfiles -> Int
hashWithSalt Int
_salt SearchNetworkProfiles' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Sort]
$sel:nextToken:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Text
$sel:maxResults:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Natural
$sel:filters:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Sort]
sortCriteria

instance Prelude.NFData SearchNetworkProfiles where
  rnf :: SearchNetworkProfiles -> ()
rnf SearchNetworkProfiles' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Sort]
$sel:nextToken:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Text
$sel:maxResults:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Natural
$sel:filters:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
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
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Sort]
sortCriteria

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

instance Data.ToJSON SearchNetworkProfiles where
  toJSON :: SearchNetworkProfiles -> Value
toJSON SearchNetworkProfiles' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Sort]
$sel:nextToken:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Text
$sel:maxResults:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe Natural
$sel:filters:SearchNetworkProfiles' :: SearchNetworkProfiles -> Maybe [Filter]
..} =
    [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 [Filter]
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
"NextToken" 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
nextToken,
            (Key
"SortCriteria" 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 [Sort]
sortCriteria
          ]
      )

instance Data.ToPath SearchNetworkProfiles where
  toPath :: SearchNetworkProfiles -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newSearchNetworkProfilesResponse' smart constructor.
data SearchNetworkProfilesResponse = SearchNetworkProfilesResponse'
  { -- | The network profiles that meet the specified set of filter criteria, in
    -- sort order. It is a list of NetworkProfileData objects.
    SearchNetworkProfilesResponse -> Maybe [NetworkProfileData]
networkProfiles :: Prelude.Maybe [NetworkProfileData],
    -- | An optional token returned from a prior request. Use this token for
    -- pagination of results from this action. If this parameter is specified,
    -- the response includes only results beyond the token, up to the value
    -- specified by MaxResults.
    SearchNetworkProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The total number of network profiles returned.
    SearchNetworkProfilesResponse -> Maybe Int
totalCount :: Prelude.Maybe Prelude.Int,
    -- | The response's http status code.
    SearchNetworkProfilesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchNetworkProfilesResponse
-> SearchNetworkProfilesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchNetworkProfilesResponse
-> SearchNetworkProfilesResponse -> Bool
$c/= :: SearchNetworkProfilesResponse
-> SearchNetworkProfilesResponse -> Bool
== :: SearchNetworkProfilesResponse
-> SearchNetworkProfilesResponse -> Bool
$c== :: SearchNetworkProfilesResponse
-> SearchNetworkProfilesResponse -> Bool
Prelude.Eq, ReadPrec [SearchNetworkProfilesResponse]
ReadPrec SearchNetworkProfilesResponse
Int -> ReadS SearchNetworkProfilesResponse
ReadS [SearchNetworkProfilesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchNetworkProfilesResponse]
$creadListPrec :: ReadPrec [SearchNetworkProfilesResponse]
readPrec :: ReadPrec SearchNetworkProfilesResponse
$creadPrec :: ReadPrec SearchNetworkProfilesResponse
readList :: ReadS [SearchNetworkProfilesResponse]
$creadList :: ReadS [SearchNetworkProfilesResponse]
readsPrec :: Int -> ReadS SearchNetworkProfilesResponse
$creadsPrec :: Int -> ReadS SearchNetworkProfilesResponse
Prelude.Read, Int -> SearchNetworkProfilesResponse -> ShowS
[SearchNetworkProfilesResponse] -> ShowS
SearchNetworkProfilesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchNetworkProfilesResponse] -> ShowS
$cshowList :: [SearchNetworkProfilesResponse] -> ShowS
show :: SearchNetworkProfilesResponse -> String
$cshow :: SearchNetworkProfilesResponse -> String
showsPrec :: Int -> SearchNetworkProfilesResponse -> ShowS
$cshowsPrec :: Int -> SearchNetworkProfilesResponse -> ShowS
Prelude.Show, forall x.
Rep SearchNetworkProfilesResponse x
-> SearchNetworkProfilesResponse
forall x.
SearchNetworkProfilesResponse
-> Rep SearchNetworkProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchNetworkProfilesResponse x
-> SearchNetworkProfilesResponse
$cfrom :: forall x.
SearchNetworkProfilesResponse
-> Rep SearchNetworkProfilesResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchNetworkProfilesResponse' 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:
--
-- 'networkProfiles', 'searchNetworkProfilesResponse_networkProfiles' - The network profiles that meet the specified set of filter criteria, in
-- sort order. It is a list of NetworkProfileData objects.
--
-- 'nextToken', 'searchNetworkProfilesResponse_nextToken' - An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by MaxResults.
--
-- 'totalCount', 'searchNetworkProfilesResponse_totalCount' - The total number of network profiles returned.
--
-- 'httpStatus', 'searchNetworkProfilesResponse_httpStatus' - The response's http status code.
newSearchNetworkProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchNetworkProfilesResponse
newSearchNetworkProfilesResponse :: Int -> SearchNetworkProfilesResponse
newSearchNetworkProfilesResponse Int
pHttpStatus_ =
  SearchNetworkProfilesResponse'
    { $sel:networkProfiles:SearchNetworkProfilesResponse' :: Maybe [NetworkProfileData]
networkProfiles =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchNetworkProfilesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:totalCount:SearchNetworkProfilesResponse' :: Maybe Int
totalCount = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchNetworkProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The network profiles that meet the specified set of filter criteria, in
-- sort order. It is a list of NetworkProfileData objects.
searchNetworkProfilesResponse_networkProfiles :: Lens.Lens' SearchNetworkProfilesResponse (Prelude.Maybe [NetworkProfileData])
searchNetworkProfilesResponse_networkProfiles :: Lens' SearchNetworkProfilesResponse (Maybe [NetworkProfileData])
searchNetworkProfilesResponse_networkProfiles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchNetworkProfilesResponse' {Maybe [NetworkProfileData]
networkProfiles :: Maybe [NetworkProfileData]
$sel:networkProfiles:SearchNetworkProfilesResponse' :: SearchNetworkProfilesResponse -> Maybe [NetworkProfileData]
networkProfiles} -> Maybe [NetworkProfileData]
networkProfiles) (\s :: SearchNetworkProfilesResponse
s@SearchNetworkProfilesResponse' {} Maybe [NetworkProfileData]
a -> SearchNetworkProfilesResponse
s {$sel:networkProfiles:SearchNetworkProfilesResponse' :: Maybe [NetworkProfileData]
networkProfiles = Maybe [NetworkProfileData]
a} :: SearchNetworkProfilesResponse) 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

-- | An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by MaxResults.
searchNetworkProfilesResponse_nextToken :: Lens.Lens' SearchNetworkProfilesResponse (Prelude.Maybe Prelude.Text)
searchNetworkProfilesResponse_nextToken :: Lens' SearchNetworkProfilesResponse (Maybe Text)
searchNetworkProfilesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchNetworkProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchNetworkProfilesResponse' :: SearchNetworkProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchNetworkProfilesResponse
s@SearchNetworkProfilesResponse' {} Maybe Text
a -> SearchNetworkProfilesResponse
s {$sel:nextToken:SearchNetworkProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchNetworkProfilesResponse)

-- | The total number of network profiles returned.
searchNetworkProfilesResponse_totalCount :: Lens.Lens' SearchNetworkProfilesResponse (Prelude.Maybe Prelude.Int)
searchNetworkProfilesResponse_totalCount :: Lens' SearchNetworkProfilesResponse (Maybe Int)
searchNetworkProfilesResponse_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchNetworkProfilesResponse' {Maybe Int
totalCount :: Maybe Int
$sel:totalCount:SearchNetworkProfilesResponse' :: SearchNetworkProfilesResponse -> Maybe Int
totalCount} -> Maybe Int
totalCount) (\s :: SearchNetworkProfilesResponse
s@SearchNetworkProfilesResponse' {} Maybe Int
a -> SearchNetworkProfilesResponse
s {$sel:totalCount:SearchNetworkProfilesResponse' :: Maybe Int
totalCount = Maybe Int
a} :: SearchNetworkProfilesResponse)

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

instance Prelude.NFData SearchNetworkProfilesResponse where
  rnf :: SearchNetworkProfilesResponse -> ()
rnf SearchNetworkProfilesResponse' {Int
Maybe Int
Maybe [NetworkProfileData]
Maybe Text
httpStatus :: Int
totalCount :: Maybe Int
nextToken :: Maybe Text
networkProfiles :: Maybe [NetworkProfileData]
$sel:httpStatus:SearchNetworkProfilesResponse' :: SearchNetworkProfilesResponse -> Int
$sel:totalCount:SearchNetworkProfilesResponse' :: SearchNetworkProfilesResponse -> Maybe Int
$sel:nextToken:SearchNetworkProfilesResponse' :: SearchNetworkProfilesResponse -> Maybe Text
$sel:networkProfiles:SearchNetworkProfilesResponse' :: SearchNetworkProfilesResponse -> Maybe [NetworkProfileData]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkProfileData]
networkProfiles
      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 Maybe Int
totalCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus