{-# 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.FSx.DescribeBackups
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the description of a specific Amazon FSx backup, if a
-- @BackupIds@ value is provided for that backup. Otherwise, it returns all
-- backups owned by your Amazon Web Services account in the Amazon Web
-- Services Region of the endpoint that you\'re calling.
--
-- When retrieving all backups, you can optionally specify the @MaxResults@
-- parameter to limit the number of backups in a response. If more backups
-- remain, Amazon FSx returns a @NextToken@ value in the response. In this
-- case, send a later request with the @NextToken@ request parameter set to
-- the value of the @NextToken@ value from the last response.
--
-- This operation is used in an iterative process to retrieve a list of
-- your backups. @DescribeBackups@ is called first without a @NextToken@
-- value. Then the operation continues to be called with the @NextToken@
-- parameter set to the value of the last @NextToken@ value until a
-- response has no @NextToken@ value.
--
-- When using this operation, keep the following in mind:
--
-- -   The operation might return fewer than the @MaxResults@ value of
--     backup descriptions while still including a @NextToken@ value.
--
-- -   The order of the backups returned in the response of one
--     @DescribeBackups@ call and the order of the backups returned across
--     the responses of a multi-call iteration is unspecified.
--
-- This operation returns paginated results.
module Amazonka.FSx.DescribeBackups
  ( -- * Creating a Request
    DescribeBackups (..),
    newDescribeBackups,

    -- * Request Lenses
    describeBackups_backupIds,
    describeBackups_filters,
    describeBackups_maxResults,
    describeBackups_nextToken,

    -- * Destructuring the Response
    DescribeBackupsResponse (..),
    newDescribeBackupsResponse,

    -- * Response Lenses
    describeBackupsResponse_backups,
    describeBackupsResponse_nextToken,
    describeBackupsResponse_httpStatus,
  )
where

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

-- | The request object for the @DescribeBackups@ operation.
--
-- /See:/ 'newDescribeBackups' smart constructor.
data DescribeBackups = DescribeBackups'
  { -- | The IDs of the backups that you want to retrieve. This parameter value
    -- overrides any filters. If any IDs aren\'t found, a @BackupNotFound@
    -- error occurs.
    DescribeBackups -> Maybe [Text]
backupIds :: Prelude.Maybe [Prelude.Text],
    -- | The filters structure. The supported names are @file-system-id@,
    -- @backup-type@, @file-system-type@, and @volume-id@.
    DescribeBackups -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | Maximum number of backups to return in the response. This parameter
    -- value must be greater than 0. The number of items that Amazon FSx
    -- returns is the minimum of the @MaxResults@ parameter specified in the
    -- request and the service\'s internal maximum number of items per page.
    DescribeBackups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | An opaque pagination token returned from a previous @DescribeBackups@
    -- operation. If a token is present, the operation continues the list from
    -- where the returning call left off.
    DescribeBackups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeBackups -> DescribeBackups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBackups -> DescribeBackups -> Bool
$c/= :: DescribeBackups -> DescribeBackups -> Bool
== :: DescribeBackups -> DescribeBackups -> Bool
$c== :: DescribeBackups -> DescribeBackups -> Bool
Prelude.Eq, ReadPrec [DescribeBackups]
ReadPrec DescribeBackups
Int -> ReadS DescribeBackups
ReadS [DescribeBackups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBackups]
$creadListPrec :: ReadPrec [DescribeBackups]
readPrec :: ReadPrec DescribeBackups
$creadPrec :: ReadPrec DescribeBackups
readList :: ReadS [DescribeBackups]
$creadList :: ReadS [DescribeBackups]
readsPrec :: Int -> ReadS DescribeBackups
$creadsPrec :: Int -> ReadS DescribeBackups
Prelude.Read, Int -> DescribeBackups -> ShowS
[DescribeBackups] -> ShowS
DescribeBackups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBackups] -> ShowS
$cshowList :: [DescribeBackups] -> ShowS
show :: DescribeBackups -> String
$cshow :: DescribeBackups -> String
showsPrec :: Int -> DescribeBackups -> ShowS
$cshowsPrec :: Int -> DescribeBackups -> ShowS
Prelude.Show, forall x. Rep DescribeBackups x -> DescribeBackups
forall x. DescribeBackups -> Rep DescribeBackups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeBackups x -> DescribeBackups
$cfrom :: forall x. DescribeBackups -> Rep DescribeBackups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBackups' 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:
--
-- 'backupIds', 'describeBackups_backupIds' - The IDs of the backups that you want to retrieve. This parameter value
-- overrides any filters. If any IDs aren\'t found, a @BackupNotFound@
-- error occurs.
--
-- 'filters', 'describeBackups_filters' - The filters structure. The supported names are @file-system-id@,
-- @backup-type@, @file-system-type@, and @volume-id@.
--
-- 'maxResults', 'describeBackups_maxResults' - Maximum number of backups to return in the response. This parameter
-- value must be greater than 0. The number of items that Amazon FSx
-- returns is the minimum of the @MaxResults@ parameter specified in the
-- request and the service\'s internal maximum number of items per page.
--
-- 'nextToken', 'describeBackups_nextToken' - An opaque pagination token returned from a previous @DescribeBackups@
-- operation. If a token is present, the operation continues the list from
-- where the returning call left off.
newDescribeBackups ::
  DescribeBackups
newDescribeBackups :: DescribeBackups
newDescribeBackups =
  DescribeBackups'
    { $sel:backupIds:DescribeBackups' :: Maybe [Text]
backupIds = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeBackups' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeBackups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeBackups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The IDs of the backups that you want to retrieve. This parameter value
-- overrides any filters. If any IDs aren\'t found, a @BackupNotFound@
-- error occurs.
describeBackups_backupIds :: Lens.Lens' DescribeBackups (Prelude.Maybe [Prelude.Text])
describeBackups_backupIds :: Lens' DescribeBackups (Maybe [Text])
describeBackups_backupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBackups' {Maybe [Text]
backupIds :: Maybe [Text]
$sel:backupIds:DescribeBackups' :: DescribeBackups -> Maybe [Text]
backupIds} -> Maybe [Text]
backupIds) (\s :: DescribeBackups
s@DescribeBackups' {} Maybe [Text]
a -> DescribeBackups
s {$sel:backupIds:DescribeBackups' :: Maybe [Text]
backupIds = Maybe [Text]
a} :: DescribeBackups) 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 filters structure. The supported names are @file-system-id@,
-- @backup-type@, @file-system-type@, and @volume-id@.
describeBackups_filters :: Lens.Lens' DescribeBackups (Prelude.Maybe [Filter])
describeBackups_filters :: Lens' DescribeBackups (Maybe [Filter])
describeBackups_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBackups' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeBackups' :: DescribeBackups -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeBackups
s@DescribeBackups' {} Maybe [Filter]
a -> DescribeBackups
s {$sel:filters:DescribeBackups' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeBackups) 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

-- | Maximum number of backups to return in the response. This parameter
-- value must be greater than 0. The number of items that Amazon FSx
-- returns is the minimum of the @MaxResults@ parameter specified in the
-- request and the service\'s internal maximum number of items per page.
describeBackups_maxResults :: Lens.Lens' DescribeBackups (Prelude.Maybe Prelude.Natural)
describeBackups_maxResults :: Lens' DescribeBackups (Maybe Natural)
describeBackups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBackups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeBackups' :: DescribeBackups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeBackups
s@DescribeBackups' {} Maybe Natural
a -> DescribeBackups
s {$sel:maxResults:DescribeBackups' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeBackups)

-- | An opaque pagination token returned from a previous @DescribeBackups@
-- operation. If a token is present, the operation continues the list from
-- where the returning call left off.
describeBackups_nextToken :: Lens.Lens' DescribeBackups (Prelude.Maybe Prelude.Text)
describeBackups_nextToken :: Lens' DescribeBackups (Maybe Text)
describeBackups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBackups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeBackups' :: DescribeBackups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeBackups
s@DescribeBackups' {} Maybe Text
a -> DescribeBackups
s {$sel:nextToken:DescribeBackups' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeBackups)

instance Core.AWSPager DescribeBackups where
  page :: DescribeBackups
-> AWSResponse DescribeBackups -> Maybe DescribeBackups
page DescribeBackups
rq AWSResponse DescribeBackups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeBackups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeBackupsResponse (Maybe Text)
describeBackupsResponse_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 DescribeBackups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeBackupsResponse (Maybe [Backup])
describeBackupsResponse_backups
            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.$ DescribeBackups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeBackups (Maybe Text)
describeBackups_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeBackups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeBackupsResponse (Maybe Text)
describeBackupsResponse_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 DescribeBackups where
  type
    AWSResponse DescribeBackups =
      DescribeBackupsResponse
  request :: (Service -> Service) -> DescribeBackups -> Request DescribeBackups
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 DescribeBackups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeBackups)))
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 [Backup] -> Maybe Text -> Int -> DescribeBackupsResponse
DescribeBackupsResponse'
            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
"Backups" 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 DescribeBackups where
  hashWithSalt :: Int -> DescribeBackups -> Int
hashWithSalt Int
_salt DescribeBackups' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
backupIds :: Maybe [Text]
$sel:nextToken:DescribeBackups' :: DescribeBackups -> Maybe Text
$sel:maxResults:DescribeBackups' :: DescribeBackups -> Maybe Natural
$sel:filters:DescribeBackups' :: DescribeBackups -> Maybe [Filter]
$sel:backupIds:DescribeBackups' :: DescribeBackups -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
backupIds
      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

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

instance Data.ToHeaders DescribeBackups where
  toHeaders :: DescribeBackups -> 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
"AWSSimbaAPIService_v20180301.DescribeBackups" ::
                          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 DescribeBackups where
  toJSON :: DescribeBackups -> Value
toJSON DescribeBackups' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
backupIds :: Maybe [Text]
$sel:nextToken:DescribeBackups' :: DescribeBackups -> Maybe Text
$sel:maxResults:DescribeBackups' :: DescribeBackups -> Maybe Natural
$sel:filters:DescribeBackups' :: DescribeBackups -> Maybe [Filter]
$sel:backupIds:DescribeBackups' :: DescribeBackups -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BackupIds" 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]
backupIds,
            (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
          ]
      )

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

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

-- | Response object for the @DescribeBackups@ operation.
--
-- /See:/ 'newDescribeBackupsResponse' smart constructor.
data DescribeBackupsResponse = DescribeBackupsResponse'
  { -- | An array of backups.
    DescribeBackupsResponse -> Maybe [Backup]
backups :: Prelude.Maybe [Backup],
    -- | A @NextToken@ value is present if there are more backups than returned
    -- in the response. You can use the @NextToken@ value in the subsequent
    -- request to fetch the backups.
    DescribeBackupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeBackupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeBackupsResponse -> DescribeBackupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBackupsResponse -> DescribeBackupsResponse -> Bool
$c/= :: DescribeBackupsResponse -> DescribeBackupsResponse -> Bool
== :: DescribeBackupsResponse -> DescribeBackupsResponse -> Bool
$c== :: DescribeBackupsResponse -> DescribeBackupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeBackupsResponse]
ReadPrec DescribeBackupsResponse
Int -> ReadS DescribeBackupsResponse
ReadS [DescribeBackupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBackupsResponse]
$creadListPrec :: ReadPrec [DescribeBackupsResponse]
readPrec :: ReadPrec DescribeBackupsResponse
$creadPrec :: ReadPrec DescribeBackupsResponse
readList :: ReadS [DescribeBackupsResponse]
$creadList :: ReadS [DescribeBackupsResponse]
readsPrec :: Int -> ReadS DescribeBackupsResponse
$creadsPrec :: Int -> ReadS DescribeBackupsResponse
Prelude.Read, Int -> DescribeBackupsResponse -> ShowS
[DescribeBackupsResponse] -> ShowS
DescribeBackupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBackupsResponse] -> ShowS
$cshowList :: [DescribeBackupsResponse] -> ShowS
show :: DescribeBackupsResponse -> String
$cshow :: DescribeBackupsResponse -> String
showsPrec :: Int -> DescribeBackupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeBackupsResponse -> ShowS
Prelude.Show, forall x. Rep DescribeBackupsResponse x -> DescribeBackupsResponse
forall x. DescribeBackupsResponse -> Rep DescribeBackupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeBackupsResponse x -> DescribeBackupsResponse
$cfrom :: forall x. DescribeBackupsResponse -> Rep DescribeBackupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBackupsResponse' 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:
--
-- 'backups', 'describeBackupsResponse_backups' - An array of backups.
--
-- 'nextToken', 'describeBackupsResponse_nextToken' - A @NextToken@ value is present if there are more backups than returned
-- in the response. You can use the @NextToken@ value in the subsequent
-- request to fetch the backups.
--
-- 'httpStatus', 'describeBackupsResponse_httpStatus' - The response's http status code.
newDescribeBackupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeBackupsResponse
newDescribeBackupsResponse :: Int -> DescribeBackupsResponse
newDescribeBackupsResponse Int
pHttpStatus_ =
  DescribeBackupsResponse'
    { $sel:backups:DescribeBackupsResponse' :: Maybe [Backup]
backups = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeBackupsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeBackupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of backups.
describeBackupsResponse_backups :: Lens.Lens' DescribeBackupsResponse (Prelude.Maybe [Backup])
describeBackupsResponse_backups :: Lens' DescribeBackupsResponse (Maybe [Backup])
describeBackupsResponse_backups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBackupsResponse' {Maybe [Backup]
backups :: Maybe [Backup]
$sel:backups:DescribeBackupsResponse' :: DescribeBackupsResponse -> Maybe [Backup]
backups} -> Maybe [Backup]
backups) (\s :: DescribeBackupsResponse
s@DescribeBackupsResponse' {} Maybe [Backup]
a -> DescribeBackupsResponse
s {$sel:backups:DescribeBackupsResponse' :: Maybe [Backup]
backups = Maybe [Backup]
a} :: DescribeBackupsResponse) 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

-- | A @NextToken@ value is present if there are more backups than returned
-- in the response. You can use the @NextToken@ value in the subsequent
-- request to fetch the backups.
describeBackupsResponse_nextToken :: Lens.Lens' DescribeBackupsResponse (Prelude.Maybe Prelude.Text)
describeBackupsResponse_nextToken :: Lens' DescribeBackupsResponse (Maybe Text)
describeBackupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBackupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeBackupsResponse' :: DescribeBackupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeBackupsResponse
s@DescribeBackupsResponse' {} Maybe Text
a -> DescribeBackupsResponse
s {$sel:nextToken:DescribeBackupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeBackupsResponse)

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

instance Prelude.NFData DescribeBackupsResponse where
  rnf :: DescribeBackupsResponse -> ()
rnf DescribeBackupsResponse' {Int
Maybe [Backup]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
backups :: Maybe [Backup]
$sel:httpStatus:DescribeBackupsResponse' :: DescribeBackupsResponse -> Int
$sel:nextToken:DescribeBackupsResponse' :: DescribeBackupsResponse -> Maybe Text
$sel:backups:DescribeBackupsResponse' :: DescribeBackupsResponse -> Maybe [Backup]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Backup]
backups
      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