{-# 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.NetworkManager.GetSites
-- 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)
--
-- Gets information about one or more of your sites in a global network.
--
-- This operation returns paginated results.
module Amazonka.NetworkManager.GetSites
  ( -- * Creating a Request
    GetSites (..),
    newGetSites,

    -- * Request Lenses
    getSites_nextToken,
    getSites_siteIds,
    getSites_maxResults,
    getSites_globalNetworkId,

    -- * Destructuring the Response
    GetSitesResponse (..),
    newGetSitesResponse,

    -- * Response Lenses
    getSitesResponse_nextToken,
    getSitesResponse_sites,
    getSitesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetSites' smart constructor.
data GetSites = GetSites'
  { -- | The token for the next page of results.
    GetSites -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more site IDs. The maximum is 10.
    GetSites -> Maybe [Text]
siteIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return.
    GetSites -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the global network.
    GetSites -> Text
globalNetworkId :: Prelude.Text
  }
  deriving (GetSites -> GetSites -> Bool
(GetSites -> GetSites -> Bool)
-> (GetSites -> GetSites -> Bool) -> Eq GetSites
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSites -> GetSites -> Bool
$c/= :: GetSites -> GetSites -> Bool
== :: GetSites -> GetSites -> Bool
$c== :: GetSites -> GetSites -> Bool
Prelude.Eq, ReadPrec [GetSites]
ReadPrec GetSites
Int -> ReadS GetSites
ReadS [GetSites]
(Int -> ReadS GetSites)
-> ReadS [GetSites]
-> ReadPrec GetSites
-> ReadPrec [GetSites]
-> Read GetSites
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSites]
$creadListPrec :: ReadPrec [GetSites]
readPrec :: ReadPrec GetSites
$creadPrec :: ReadPrec GetSites
readList :: ReadS [GetSites]
$creadList :: ReadS [GetSites]
readsPrec :: Int -> ReadS GetSites
$creadsPrec :: Int -> ReadS GetSites
Prelude.Read, Int -> GetSites -> ShowS
[GetSites] -> ShowS
GetSites -> String
(Int -> GetSites -> ShowS)
-> (GetSites -> String) -> ([GetSites] -> ShowS) -> Show GetSites
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSites] -> ShowS
$cshowList :: [GetSites] -> ShowS
show :: GetSites -> String
$cshow :: GetSites -> String
showsPrec :: Int -> GetSites -> ShowS
$cshowsPrec :: Int -> GetSites -> ShowS
Prelude.Show, (forall x. GetSites -> Rep GetSites x)
-> (forall x. Rep GetSites x -> GetSites) -> Generic GetSites
forall x. Rep GetSites x -> GetSites
forall x. GetSites -> Rep GetSites x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSites x -> GetSites
$cfrom :: forall x. GetSites -> Rep GetSites x
Prelude.Generic)

-- |
-- Create a value of 'GetSites' 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', 'getSites_nextToken' - The token for the next page of results.
--
-- 'siteIds', 'getSites_siteIds' - One or more site IDs. The maximum is 10.
--
-- 'maxResults', 'getSites_maxResults' - The maximum number of results to return.
--
-- 'globalNetworkId', 'getSites_globalNetworkId' - The ID of the global network.
newGetSites ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  GetSites
newGetSites :: Text -> GetSites
newGetSites Text
pGlobalNetworkId_ =
  GetSites' :: Maybe Text -> Maybe [Text] -> Maybe Natural -> Text -> GetSites
GetSites'
    { $sel:nextToken:GetSites' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:siteIds:GetSites' :: Maybe [Text]
siteIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetSites' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:GetSites' :: Text
globalNetworkId = Text
pGlobalNetworkId_
    }

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

-- | One or more site IDs. The maximum is 10.
getSites_siteIds :: Lens.Lens' GetSites (Prelude.Maybe [Prelude.Text])
getSites_siteIds :: (Maybe [Text] -> f (Maybe [Text])) -> GetSites -> f GetSites
getSites_siteIds = (GetSites -> Maybe [Text])
-> (GetSites -> Maybe [Text] -> GetSites)
-> Lens GetSites GetSites (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSites' {Maybe [Text]
siteIds :: Maybe [Text]
$sel:siteIds:GetSites' :: GetSites -> Maybe [Text]
siteIds} -> Maybe [Text]
siteIds) (\s :: GetSites
s@GetSites' {} Maybe [Text]
a -> GetSites
s {$sel:siteIds:GetSites' :: Maybe [Text]
siteIds = Maybe [Text]
a} :: GetSites) ((Maybe [Text] -> f (Maybe [Text])) -> GetSites -> f GetSites)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetSites
-> f GetSites
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
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.
getSites_maxResults :: Lens.Lens' GetSites (Prelude.Maybe Prelude.Natural)
getSites_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> GetSites -> f GetSites
getSites_maxResults = (GetSites -> Maybe Natural)
-> (GetSites -> Maybe Natural -> GetSites)
-> Lens GetSites GetSites (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSites' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetSites' :: GetSites -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetSites
s@GetSites' {} Maybe Natural
a -> GetSites
s {$sel:maxResults:GetSites' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetSites)

-- | The ID of the global network.
getSites_globalNetworkId :: Lens.Lens' GetSites Prelude.Text
getSites_globalNetworkId :: (Text -> f Text) -> GetSites -> f GetSites
getSites_globalNetworkId = (GetSites -> Text)
-> (GetSites -> Text -> GetSites)
-> Lens GetSites GetSites Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSites' {Text
globalNetworkId :: Text
$sel:globalNetworkId:GetSites' :: GetSites -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: GetSites
s@GetSites' {} Text
a -> GetSites
s {$sel:globalNetworkId:GetSites' :: Text
globalNetworkId = Text
a} :: GetSites)

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

instance Prelude.NFData GetSites

instance Core.ToHeaders GetSites where
  toHeaders :: GetSites -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSites -> 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 GetSites where
  toPath :: GetSites -> ByteString
toPath GetSites' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
maxResults :: Maybe Natural
siteIds :: Maybe [Text]
nextToken :: Maybe Text
$sel:globalNetworkId:GetSites' :: GetSites -> Text
$sel:maxResults:GetSites' :: GetSites -> Maybe Natural
$sel:siteIds:GetSites' :: GetSites -> Maybe [Text]
$sel:nextToken:GetSites' :: GetSites -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
globalNetworkId,
        ByteString
"/sites"
      ]

instance Core.ToQuery GetSites where
  toQuery :: GetSites -> QueryString
toQuery GetSites' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
maxResults :: Maybe Natural
siteIds :: Maybe [Text]
nextToken :: Maybe Text
$sel:globalNetworkId:GetSites' :: GetSites -> Text
$sel:maxResults:GetSites' :: GetSites -> Maybe Natural
$sel:siteIds:GetSites' :: GetSites -> Maybe [Text]
$sel:nextToken:GetSites' :: GetSites -> 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
"siteIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
siteIds),
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newGetSitesResponse' smart constructor.
data GetSitesResponse = GetSitesResponse'
  { -- | The token for the next page of results.
    GetSitesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sites.
    GetSitesResponse -> Maybe [Site]
sites :: Prelude.Maybe [Site],
    -- | The response's http status code.
    GetSitesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSitesResponse -> GetSitesResponse -> Bool
(GetSitesResponse -> GetSitesResponse -> Bool)
-> (GetSitesResponse -> GetSitesResponse -> Bool)
-> Eq GetSitesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSitesResponse -> GetSitesResponse -> Bool
$c/= :: GetSitesResponse -> GetSitesResponse -> Bool
== :: GetSitesResponse -> GetSitesResponse -> Bool
$c== :: GetSitesResponse -> GetSitesResponse -> Bool
Prelude.Eq, Int -> GetSitesResponse -> ShowS
[GetSitesResponse] -> ShowS
GetSitesResponse -> String
(Int -> GetSitesResponse -> ShowS)
-> (GetSitesResponse -> String)
-> ([GetSitesResponse] -> ShowS)
-> Show GetSitesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSitesResponse] -> ShowS
$cshowList :: [GetSitesResponse] -> ShowS
show :: GetSitesResponse -> String
$cshow :: GetSitesResponse -> String
showsPrec :: Int -> GetSitesResponse -> ShowS
$cshowsPrec :: Int -> GetSitesResponse -> ShowS
Prelude.Show, (forall x. GetSitesResponse -> Rep GetSitesResponse x)
-> (forall x. Rep GetSitesResponse x -> GetSitesResponse)
-> Generic GetSitesResponse
forall x. Rep GetSitesResponse x -> GetSitesResponse
forall x. GetSitesResponse -> Rep GetSitesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSitesResponse x -> GetSitesResponse
$cfrom :: forall x. GetSitesResponse -> Rep GetSitesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSitesResponse' 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', 'getSitesResponse_nextToken' - The token for the next page of results.
--
-- 'sites', 'getSitesResponse_sites' - The sites.
--
-- 'httpStatus', 'getSitesResponse_httpStatus' - The response's http status code.
newGetSitesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSitesResponse
newGetSitesResponse :: Int -> GetSitesResponse
newGetSitesResponse Int
pHttpStatus_ =
  GetSitesResponse' :: Maybe Text -> Maybe [Site] -> Int -> GetSitesResponse
GetSitesResponse'
    { $sel:nextToken:GetSitesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sites:GetSitesResponse' :: Maybe [Site]
sites = Maybe [Site]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSitesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The sites.
getSitesResponse_sites :: Lens.Lens' GetSitesResponse (Prelude.Maybe [Site])
getSitesResponse_sites :: (Maybe [Site] -> f (Maybe [Site]))
-> GetSitesResponse -> f GetSitesResponse
getSitesResponse_sites = (GetSitesResponse -> Maybe [Site])
-> (GetSitesResponse -> Maybe [Site] -> GetSitesResponse)
-> Lens' GetSitesResponse (Maybe [Site])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSitesResponse' {Maybe [Site]
sites :: Maybe [Site]
$sel:sites:GetSitesResponse' :: GetSitesResponse -> Maybe [Site]
sites} -> Maybe [Site]
sites) (\s :: GetSitesResponse
s@GetSitesResponse' {} Maybe [Site]
a -> GetSitesResponse
s {$sel:sites:GetSitesResponse' :: Maybe [Site]
sites = Maybe [Site]
a} :: GetSitesResponse) ((Maybe [Site] -> f (Maybe [Site]))
 -> GetSitesResponse -> f GetSitesResponse)
-> ((Maybe [Site] -> f (Maybe [Site]))
    -> Maybe [Site] -> f (Maybe [Site]))
-> (Maybe [Site] -> f (Maybe [Site]))
-> GetSitesResponse
-> f GetSitesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Site] [Site] [Site] [Site]
-> Iso (Maybe [Site]) (Maybe [Site]) (Maybe [Site]) (Maybe [Site])
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 [Site] [Site] [Site] [Site]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetSitesResponse