{-# 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.Lightsail.GetDiskSnapshots
-- 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 information about all block storage disk snapshots in your AWS
-- account and region.
--
-- This operation returns paginated results.
module Amazonka.Lightsail.GetDiskSnapshots
  ( -- * Creating a Request
    GetDiskSnapshots (..),
    newGetDiskSnapshots,

    -- * Request Lenses
    getDiskSnapshots_pageToken,

    -- * Destructuring the Response
    GetDiskSnapshotsResponse (..),
    newGetDiskSnapshotsResponse,

    -- * Response Lenses
    getDiskSnapshotsResponse_nextPageToken,
    getDiskSnapshotsResponse_diskSnapshots,
    getDiskSnapshotsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetDiskSnapshots' smart constructor.
data GetDiskSnapshots = GetDiskSnapshots'
  { -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetDiskSnapshots@ request. If
    -- your results are paginated, the response will return a next page token
    -- that you can specify as the page token in a subsequent request.
    GetDiskSnapshots -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetDiskSnapshots -> GetDiskSnapshots -> Bool
(GetDiskSnapshots -> GetDiskSnapshots -> Bool)
-> (GetDiskSnapshots -> GetDiskSnapshots -> Bool)
-> Eq GetDiskSnapshots
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDiskSnapshots -> GetDiskSnapshots -> Bool
$c/= :: GetDiskSnapshots -> GetDiskSnapshots -> Bool
== :: GetDiskSnapshots -> GetDiskSnapshots -> Bool
$c== :: GetDiskSnapshots -> GetDiskSnapshots -> Bool
Prelude.Eq, ReadPrec [GetDiskSnapshots]
ReadPrec GetDiskSnapshots
Int -> ReadS GetDiskSnapshots
ReadS [GetDiskSnapshots]
(Int -> ReadS GetDiskSnapshots)
-> ReadS [GetDiskSnapshots]
-> ReadPrec GetDiskSnapshots
-> ReadPrec [GetDiskSnapshots]
-> Read GetDiskSnapshots
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDiskSnapshots]
$creadListPrec :: ReadPrec [GetDiskSnapshots]
readPrec :: ReadPrec GetDiskSnapshots
$creadPrec :: ReadPrec GetDiskSnapshots
readList :: ReadS [GetDiskSnapshots]
$creadList :: ReadS [GetDiskSnapshots]
readsPrec :: Int -> ReadS GetDiskSnapshots
$creadsPrec :: Int -> ReadS GetDiskSnapshots
Prelude.Read, Int -> GetDiskSnapshots -> ShowS
[GetDiskSnapshots] -> ShowS
GetDiskSnapshots -> String
(Int -> GetDiskSnapshots -> ShowS)
-> (GetDiskSnapshots -> String)
-> ([GetDiskSnapshots] -> ShowS)
-> Show GetDiskSnapshots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDiskSnapshots] -> ShowS
$cshowList :: [GetDiskSnapshots] -> ShowS
show :: GetDiskSnapshots -> String
$cshow :: GetDiskSnapshots -> String
showsPrec :: Int -> GetDiskSnapshots -> ShowS
$cshowsPrec :: Int -> GetDiskSnapshots -> ShowS
Prelude.Show, (forall x. GetDiskSnapshots -> Rep GetDiskSnapshots x)
-> (forall x. Rep GetDiskSnapshots x -> GetDiskSnapshots)
-> Generic GetDiskSnapshots
forall x. Rep GetDiskSnapshots x -> GetDiskSnapshots
forall x. GetDiskSnapshots -> Rep GetDiskSnapshots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDiskSnapshots x -> GetDiskSnapshots
$cfrom :: forall x. GetDiskSnapshots -> Rep GetDiskSnapshots x
Prelude.Generic)

-- |
-- Create a value of 'GetDiskSnapshots' 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:
--
-- 'pageToken', 'getDiskSnapshots_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetDiskSnapshots@ request. If
-- your results are paginated, the response will return a next page token
-- that you can specify as the page token in a subsequent request.
newGetDiskSnapshots ::
  GetDiskSnapshots
newGetDiskSnapshots :: GetDiskSnapshots
newGetDiskSnapshots =
  GetDiskSnapshots' :: Maybe Text -> GetDiskSnapshots
GetDiskSnapshots' {$sel:pageToken:GetDiskSnapshots' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetDiskSnapshots@ request. If
-- your results are paginated, the response will return a next page token
-- that you can specify as the page token in a subsequent request.
getDiskSnapshots_pageToken :: Lens.Lens' GetDiskSnapshots (Prelude.Maybe Prelude.Text)
getDiskSnapshots_pageToken :: (Maybe Text -> f (Maybe Text))
-> GetDiskSnapshots -> f GetDiskSnapshots
getDiskSnapshots_pageToken = (GetDiskSnapshots -> Maybe Text)
-> (GetDiskSnapshots -> Maybe Text -> GetDiskSnapshots)
-> Lens GetDiskSnapshots GetDiskSnapshots (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDiskSnapshots' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetDiskSnapshots' :: GetDiskSnapshots -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetDiskSnapshots
s@GetDiskSnapshots' {} Maybe Text
a -> GetDiskSnapshots
s {$sel:pageToken:GetDiskSnapshots' :: Maybe Text
pageToken = Maybe Text
a} :: GetDiskSnapshots)

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

instance Prelude.NFData GetDiskSnapshots

instance Core.ToHeaders GetDiskSnapshots where
  toHeaders :: GetDiskSnapshots -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetDiskSnapshots -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetDiskSnapshots" ::
                          Prelude.ByteString
                      ),
            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.ToJSON GetDiskSnapshots where
  toJSON :: GetDiskSnapshots -> Value
toJSON GetDiskSnapshots' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetDiskSnapshots' :: GetDiskSnapshots -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"pageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken]
      )

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

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

-- | /See:/ 'newGetDiskSnapshotsResponse' smart constructor.
data GetDiskSnapshotsResponse = GetDiskSnapshotsResponse'
  { -- | The token to advance to the next page of results from your request.
    --
    -- A next page token is not returned if there are no more results to
    -- display.
    --
    -- To get the next page of results, perform another @GetDiskSnapshots@
    -- request and specify the next page token using the @pageToken@ parameter.
    GetDiskSnapshotsResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects containing information about all block storage disk
    -- snapshots.
    GetDiskSnapshotsResponse -> Maybe [DiskSnapshot]
diskSnapshots :: Prelude.Maybe [DiskSnapshot],
    -- | The response's http status code.
    GetDiskSnapshotsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDiskSnapshotsResponse -> GetDiskSnapshotsResponse -> Bool
(GetDiskSnapshotsResponse -> GetDiskSnapshotsResponse -> Bool)
-> (GetDiskSnapshotsResponse -> GetDiskSnapshotsResponse -> Bool)
-> Eq GetDiskSnapshotsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDiskSnapshotsResponse -> GetDiskSnapshotsResponse -> Bool
$c/= :: GetDiskSnapshotsResponse -> GetDiskSnapshotsResponse -> Bool
== :: GetDiskSnapshotsResponse -> GetDiskSnapshotsResponse -> Bool
$c== :: GetDiskSnapshotsResponse -> GetDiskSnapshotsResponse -> Bool
Prelude.Eq, ReadPrec [GetDiskSnapshotsResponse]
ReadPrec GetDiskSnapshotsResponse
Int -> ReadS GetDiskSnapshotsResponse
ReadS [GetDiskSnapshotsResponse]
(Int -> ReadS GetDiskSnapshotsResponse)
-> ReadS [GetDiskSnapshotsResponse]
-> ReadPrec GetDiskSnapshotsResponse
-> ReadPrec [GetDiskSnapshotsResponse]
-> Read GetDiskSnapshotsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDiskSnapshotsResponse]
$creadListPrec :: ReadPrec [GetDiskSnapshotsResponse]
readPrec :: ReadPrec GetDiskSnapshotsResponse
$creadPrec :: ReadPrec GetDiskSnapshotsResponse
readList :: ReadS [GetDiskSnapshotsResponse]
$creadList :: ReadS [GetDiskSnapshotsResponse]
readsPrec :: Int -> ReadS GetDiskSnapshotsResponse
$creadsPrec :: Int -> ReadS GetDiskSnapshotsResponse
Prelude.Read, Int -> GetDiskSnapshotsResponse -> ShowS
[GetDiskSnapshotsResponse] -> ShowS
GetDiskSnapshotsResponse -> String
(Int -> GetDiskSnapshotsResponse -> ShowS)
-> (GetDiskSnapshotsResponse -> String)
-> ([GetDiskSnapshotsResponse] -> ShowS)
-> Show GetDiskSnapshotsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDiskSnapshotsResponse] -> ShowS
$cshowList :: [GetDiskSnapshotsResponse] -> ShowS
show :: GetDiskSnapshotsResponse -> String
$cshow :: GetDiskSnapshotsResponse -> String
showsPrec :: Int -> GetDiskSnapshotsResponse -> ShowS
$cshowsPrec :: Int -> GetDiskSnapshotsResponse -> ShowS
Prelude.Show, (forall x.
 GetDiskSnapshotsResponse -> Rep GetDiskSnapshotsResponse x)
-> (forall x.
    Rep GetDiskSnapshotsResponse x -> GetDiskSnapshotsResponse)
-> Generic GetDiskSnapshotsResponse
forall x.
Rep GetDiskSnapshotsResponse x -> GetDiskSnapshotsResponse
forall x.
GetDiskSnapshotsResponse -> Rep GetDiskSnapshotsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDiskSnapshotsResponse x -> GetDiskSnapshotsResponse
$cfrom :: forall x.
GetDiskSnapshotsResponse -> Rep GetDiskSnapshotsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDiskSnapshotsResponse' 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:
--
-- 'nextPageToken', 'getDiskSnapshotsResponse_nextPageToken' - The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another @GetDiskSnapshots@
-- request and specify the next page token using the @pageToken@ parameter.
--
-- 'diskSnapshots', 'getDiskSnapshotsResponse_diskSnapshots' - An array of objects containing information about all block storage disk
-- snapshots.
--
-- 'httpStatus', 'getDiskSnapshotsResponse_httpStatus' - The response's http status code.
newGetDiskSnapshotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDiskSnapshotsResponse
newGetDiskSnapshotsResponse :: Int -> GetDiskSnapshotsResponse
newGetDiskSnapshotsResponse Int
pHttpStatus_ =
  GetDiskSnapshotsResponse' :: Maybe Text
-> Maybe [DiskSnapshot] -> Int -> GetDiskSnapshotsResponse
GetDiskSnapshotsResponse'
    { $sel:nextPageToken:GetDiskSnapshotsResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:diskSnapshots:GetDiskSnapshotsResponse' :: Maybe [DiskSnapshot]
diskSnapshots = Maybe [DiskSnapshot]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDiskSnapshotsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another @GetDiskSnapshots@
-- request and specify the next page token using the @pageToken@ parameter.
getDiskSnapshotsResponse_nextPageToken :: Lens.Lens' GetDiskSnapshotsResponse (Prelude.Maybe Prelude.Text)
getDiskSnapshotsResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetDiskSnapshotsResponse -> f GetDiskSnapshotsResponse
getDiskSnapshotsResponse_nextPageToken = (GetDiskSnapshotsResponse -> Maybe Text)
-> (GetDiskSnapshotsResponse
    -> Maybe Text -> GetDiskSnapshotsResponse)
-> Lens' GetDiskSnapshotsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDiskSnapshotsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetDiskSnapshotsResponse' :: GetDiskSnapshotsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetDiskSnapshotsResponse
s@GetDiskSnapshotsResponse' {} Maybe Text
a -> GetDiskSnapshotsResponse
s {$sel:nextPageToken:GetDiskSnapshotsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetDiskSnapshotsResponse)

-- | An array of objects containing information about all block storage disk
-- snapshots.
getDiskSnapshotsResponse_diskSnapshots :: Lens.Lens' GetDiskSnapshotsResponse (Prelude.Maybe [DiskSnapshot])
getDiskSnapshotsResponse_diskSnapshots :: (Maybe [DiskSnapshot] -> f (Maybe [DiskSnapshot]))
-> GetDiskSnapshotsResponse -> f GetDiskSnapshotsResponse
getDiskSnapshotsResponse_diskSnapshots = (GetDiskSnapshotsResponse -> Maybe [DiskSnapshot])
-> (GetDiskSnapshotsResponse
    -> Maybe [DiskSnapshot] -> GetDiskSnapshotsResponse)
-> Lens' GetDiskSnapshotsResponse (Maybe [DiskSnapshot])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDiskSnapshotsResponse' {Maybe [DiskSnapshot]
diskSnapshots :: Maybe [DiskSnapshot]
$sel:diskSnapshots:GetDiskSnapshotsResponse' :: GetDiskSnapshotsResponse -> Maybe [DiskSnapshot]
diskSnapshots} -> Maybe [DiskSnapshot]
diskSnapshots) (\s :: GetDiskSnapshotsResponse
s@GetDiskSnapshotsResponse' {} Maybe [DiskSnapshot]
a -> GetDiskSnapshotsResponse
s {$sel:diskSnapshots:GetDiskSnapshotsResponse' :: Maybe [DiskSnapshot]
diskSnapshots = Maybe [DiskSnapshot]
a} :: GetDiskSnapshotsResponse) ((Maybe [DiskSnapshot] -> f (Maybe [DiskSnapshot]))
 -> GetDiskSnapshotsResponse -> f GetDiskSnapshotsResponse)
-> ((Maybe [DiskSnapshot] -> f (Maybe [DiskSnapshot]))
    -> Maybe [DiskSnapshot] -> f (Maybe [DiskSnapshot]))
-> (Maybe [DiskSnapshot] -> f (Maybe [DiskSnapshot]))
-> GetDiskSnapshotsResponse
-> f GetDiskSnapshotsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DiskSnapshot] [DiskSnapshot] [DiskSnapshot] [DiskSnapshot]
-> Iso
     (Maybe [DiskSnapshot])
     (Maybe [DiskSnapshot])
     (Maybe [DiskSnapshot])
     (Maybe [DiskSnapshot])
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 [DiskSnapshot] [DiskSnapshot] [DiskSnapshot] [DiskSnapshot]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetDiskSnapshotsResponse