{-# 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.OpenSearch.DescribeReservedInstances
-- 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 reserved OpenSearch instances for this
-- account.
module Amazonka.OpenSearch.DescribeReservedInstances
  ( -- * Creating a Request
    DescribeReservedInstances (..),
    newDescribeReservedInstances,

    -- * Request Lenses
    describeReservedInstances_nextToken,
    describeReservedInstances_reservedInstanceId,
    describeReservedInstances_maxResults,

    -- * Destructuring the Response
    DescribeReservedInstancesResponse (..),
    newDescribeReservedInstancesResponse,

    -- * Response Lenses
    describeReservedInstancesResponse_nextToken,
    describeReservedInstancesResponse_reservedInstances,
    describeReservedInstancesResponse_httpStatus,
  )
where

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

-- | Container for parameters to @DescribeReservedInstances@
--
-- /See:/ 'newDescribeReservedInstances' smart constructor.
data DescribeReservedInstances = DescribeReservedInstances'
  { -- | Provides an identifier to allow retrieval of paginated results.
    DescribeReservedInstances -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The reserved instance identifier filter value. Use this parameter to
    -- show only the reservation that matches the specified reserved OpenSearch
    -- instance ID.
    DescribeReservedInstances -> Maybe Text
reservedInstanceId :: Prelude.Maybe Prelude.Text,
    -- | Set this value to limit the number of results returned. If not
    -- specified, defaults to 100.
    DescribeReservedInstances -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeReservedInstances -> DescribeReservedInstances -> Bool
(DescribeReservedInstances -> DescribeReservedInstances -> Bool)
-> (DescribeReservedInstances -> DescribeReservedInstances -> Bool)
-> Eq DescribeReservedInstances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReservedInstances -> DescribeReservedInstances -> Bool
$c/= :: DescribeReservedInstances -> DescribeReservedInstances -> Bool
== :: DescribeReservedInstances -> DescribeReservedInstances -> Bool
$c== :: DescribeReservedInstances -> DescribeReservedInstances -> Bool
Prelude.Eq, ReadPrec [DescribeReservedInstances]
ReadPrec DescribeReservedInstances
Int -> ReadS DescribeReservedInstances
ReadS [DescribeReservedInstances]
(Int -> ReadS DescribeReservedInstances)
-> ReadS [DescribeReservedInstances]
-> ReadPrec DescribeReservedInstances
-> ReadPrec [DescribeReservedInstances]
-> Read DescribeReservedInstances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReservedInstances]
$creadListPrec :: ReadPrec [DescribeReservedInstances]
readPrec :: ReadPrec DescribeReservedInstances
$creadPrec :: ReadPrec DescribeReservedInstances
readList :: ReadS [DescribeReservedInstances]
$creadList :: ReadS [DescribeReservedInstances]
readsPrec :: Int -> ReadS DescribeReservedInstances
$creadsPrec :: Int -> ReadS DescribeReservedInstances
Prelude.Read, Int -> DescribeReservedInstances -> ShowS
[DescribeReservedInstances] -> ShowS
DescribeReservedInstances -> String
(Int -> DescribeReservedInstances -> ShowS)
-> (DescribeReservedInstances -> String)
-> ([DescribeReservedInstances] -> ShowS)
-> Show DescribeReservedInstances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReservedInstances] -> ShowS
$cshowList :: [DescribeReservedInstances] -> ShowS
show :: DescribeReservedInstances -> String
$cshow :: DescribeReservedInstances -> String
showsPrec :: Int -> DescribeReservedInstances -> ShowS
$cshowsPrec :: Int -> DescribeReservedInstances -> ShowS
Prelude.Show, (forall x.
 DescribeReservedInstances -> Rep DescribeReservedInstances x)
-> (forall x.
    Rep DescribeReservedInstances x -> DescribeReservedInstances)
-> Generic DescribeReservedInstances
forall x.
Rep DescribeReservedInstances x -> DescribeReservedInstances
forall x.
DescribeReservedInstances -> Rep DescribeReservedInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReservedInstances x -> DescribeReservedInstances
$cfrom :: forall x.
DescribeReservedInstances -> Rep DescribeReservedInstances x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReservedInstances' 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', 'describeReservedInstances_nextToken' - Provides an identifier to allow retrieval of paginated results.
--
-- 'reservedInstanceId', 'describeReservedInstances_reservedInstanceId' - The reserved instance identifier filter value. Use this parameter to
-- show only the reservation that matches the specified reserved OpenSearch
-- instance ID.
--
-- 'maxResults', 'describeReservedInstances_maxResults' - Set this value to limit the number of results returned. If not
-- specified, defaults to 100.
newDescribeReservedInstances ::
  DescribeReservedInstances
newDescribeReservedInstances :: DescribeReservedInstances
newDescribeReservedInstances =
  DescribeReservedInstances' :: Maybe Text -> Maybe Text -> Maybe Int -> DescribeReservedInstances
DescribeReservedInstances'
    { $sel:nextToken:DescribeReservedInstances' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedInstanceId:DescribeReservedInstances' :: Maybe Text
reservedInstanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeReservedInstances' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Provides an identifier to allow retrieval of paginated results.
describeReservedInstances_nextToken :: Lens.Lens' DescribeReservedInstances (Prelude.Maybe Prelude.Text)
describeReservedInstances_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedInstances -> f DescribeReservedInstances
describeReservedInstances_nextToken = (DescribeReservedInstances -> Maybe Text)
-> (DescribeReservedInstances
    -> Maybe Text -> DescribeReservedInstances)
-> Lens
     DescribeReservedInstances
     DescribeReservedInstances
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedInstances' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeReservedInstances' :: DescribeReservedInstances -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeReservedInstances
s@DescribeReservedInstances' {} Maybe Text
a -> DescribeReservedInstances
s {$sel:nextToken:DescribeReservedInstances' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeReservedInstances)

-- | The reserved instance identifier filter value. Use this parameter to
-- show only the reservation that matches the specified reserved OpenSearch
-- instance ID.
describeReservedInstances_reservedInstanceId :: Lens.Lens' DescribeReservedInstances (Prelude.Maybe Prelude.Text)
describeReservedInstances_reservedInstanceId :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedInstances -> f DescribeReservedInstances
describeReservedInstances_reservedInstanceId = (DescribeReservedInstances -> Maybe Text)
-> (DescribeReservedInstances
    -> Maybe Text -> DescribeReservedInstances)
-> Lens
     DescribeReservedInstances
     DescribeReservedInstances
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedInstances' {Maybe Text
reservedInstanceId :: Maybe Text
$sel:reservedInstanceId:DescribeReservedInstances' :: DescribeReservedInstances -> Maybe Text
reservedInstanceId} -> Maybe Text
reservedInstanceId) (\s :: DescribeReservedInstances
s@DescribeReservedInstances' {} Maybe Text
a -> DescribeReservedInstances
s {$sel:reservedInstanceId:DescribeReservedInstances' :: Maybe Text
reservedInstanceId = Maybe Text
a} :: DescribeReservedInstances)

-- | Set this value to limit the number of results returned. If not
-- specified, defaults to 100.
describeReservedInstances_maxResults :: Lens.Lens' DescribeReservedInstances (Prelude.Maybe Prelude.Int)
describeReservedInstances_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeReservedInstances -> f DescribeReservedInstances
describeReservedInstances_maxResults = (DescribeReservedInstances -> Maybe Int)
-> (DescribeReservedInstances
    -> Maybe Int -> DescribeReservedInstances)
-> Lens
     DescribeReservedInstances
     DescribeReservedInstances
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedInstances' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeReservedInstances' :: DescribeReservedInstances -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeReservedInstances
s@DescribeReservedInstances' {} Maybe Int
a -> DescribeReservedInstances
s {$sel:maxResults:DescribeReservedInstances' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeReservedInstances)

instance Core.AWSRequest DescribeReservedInstances where
  type
    AWSResponse DescribeReservedInstances =
      DescribeReservedInstancesResponse
  request :: DescribeReservedInstances -> Request DescribeReservedInstances
request = Service
-> DescribeReservedInstances -> Request DescribeReservedInstances
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeReservedInstances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeReservedInstances)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeReservedInstances))
-> Logger
-> Service
-> Proxy DescribeReservedInstances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeReservedInstances)))
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 [ReservedInstance]
-> Int
-> DescribeReservedInstancesResponse
DescribeReservedInstancesResponse'
            (Maybe Text
 -> Maybe [ReservedInstance]
 -> Int
 -> DescribeReservedInstancesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ReservedInstance]
      -> Int -> DescribeReservedInstancesResponse)
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 [ReservedInstance]
   -> Int -> DescribeReservedInstancesResponse)
-> Either String (Maybe [ReservedInstance])
-> Either String (Int -> DescribeReservedInstancesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ReservedInstance]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReservedInstances"
                            Either String (Maybe (Maybe [ReservedInstance]))
-> Maybe [ReservedInstance]
-> Either String (Maybe [ReservedInstance])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReservedInstance]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeReservedInstancesResponse)
-> Either String Int
-> Either String DescribeReservedInstancesResponse
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 DescribeReservedInstances

instance Prelude.NFData DescribeReservedInstances

instance Core.ToHeaders DescribeReservedInstances where
  toHeaders :: DescribeReservedInstances -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeReservedInstances -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DescribeReservedInstances where
  toPath :: DescribeReservedInstances -> ByteString
toPath =
    ByteString -> DescribeReservedInstances -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/2021-01-01/opensearch/reservedInstances"

instance Core.ToQuery DescribeReservedInstances where
  toQuery :: DescribeReservedInstances -> QueryString
toQuery DescribeReservedInstances' {Maybe Int
Maybe Text
maxResults :: Maybe Int
reservedInstanceId :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:DescribeReservedInstances' :: DescribeReservedInstances -> Maybe Int
$sel:reservedInstanceId:DescribeReservedInstances' :: DescribeReservedInstances -> Maybe Text
$sel:nextToken:DescribeReservedInstances' :: DescribeReservedInstances -> 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
"reservationId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
reservedInstanceId,
        ByteString
"maxResults" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxResults
      ]

-- | Container for results from @DescribeReservedInstances@
--
-- /See:/ 'newDescribeReservedInstancesResponse' smart constructor.
data DescribeReservedInstancesResponse = DescribeReservedInstancesResponse'
  { -- | Provides an identifier to allow retrieval of paginated results.
    DescribeReservedInstancesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of reserved OpenSearch instances.
    DescribeReservedInstancesResponse -> Maybe [ReservedInstance]
reservedInstances :: Prelude.Maybe [ReservedInstance],
    -- | The response's http status code.
    DescribeReservedInstancesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeReservedInstancesResponse
-> DescribeReservedInstancesResponse -> Bool
(DescribeReservedInstancesResponse
 -> DescribeReservedInstancesResponse -> Bool)
-> (DescribeReservedInstancesResponse
    -> DescribeReservedInstancesResponse -> Bool)
-> Eq DescribeReservedInstancesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReservedInstancesResponse
-> DescribeReservedInstancesResponse -> Bool
$c/= :: DescribeReservedInstancesResponse
-> DescribeReservedInstancesResponse -> Bool
== :: DescribeReservedInstancesResponse
-> DescribeReservedInstancesResponse -> Bool
$c== :: DescribeReservedInstancesResponse
-> DescribeReservedInstancesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReservedInstancesResponse]
ReadPrec DescribeReservedInstancesResponse
Int -> ReadS DescribeReservedInstancesResponse
ReadS [DescribeReservedInstancesResponse]
(Int -> ReadS DescribeReservedInstancesResponse)
-> ReadS [DescribeReservedInstancesResponse]
-> ReadPrec DescribeReservedInstancesResponse
-> ReadPrec [DescribeReservedInstancesResponse]
-> Read DescribeReservedInstancesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReservedInstancesResponse]
$creadListPrec :: ReadPrec [DescribeReservedInstancesResponse]
readPrec :: ReadPrec DescribeReservedInstancesResponse
$creadPrec :: ReadPrec DescribeReservedInstancesResponse
readList :: ReadS [DescribeReservedInstancesResponse]
$creadList :: ReadS [DescribeReservedInstancesResponse]
readsPrec :: Int -> ReadS DescribeReservedInstancesResponse
$creadsPrec :: Int -> ReadS DescribeReservedInstancesResponse
Prelude.Read, Int -> DescribeReservedInstancesResponse -> ShowS
[DescribeReservedInstancesResponse] -> ShowS
DescribeReservedInstancesResponse -> String
(Int -> DescribeReservedInstancesResponse -> ShowS)
-> (DescribeReservedInstancesResponse -> String)
-> ([DescribeReservedInstancesResponse] -> ShowS)
-> Show DescribeReservedInstancesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReservedInstancesResponse] -> ShowS
$cshowList :: [DescribeReservedInstancesResponse] -> ShowS
show :: DescribeReservedInstancesResponse -> String
$cshow :: DescribeReservedInstancesResponse -> String
showsPrec :: Int -> DescribeReservedInstancesResponse -> ShowS
$cshowsPrec :: Int -> DescribeReservedInstancesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeReservedInstancesResponse
 -> Rep DescribeReservedInstancesResponse x)
-> (forall x.
    Rep DescribeReservedInstancesResponse x
    -> DescribeReservedInstancesResponse)
-> Generic DescribeReservedInstancesResponse
forall x.
Rep DescribeReservedInstancesResponse x
-> DescribeReservedInstancesResponse
forall x.
DescribeReservedInstancesResponse
-> Rep DescribeReservedInstancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReservedInstancesResponse x
-> DescribeReservedInstancesResponse
$cfrom :: forall x.
DescribeReservedInstancesResponse
-> Rep DescribeReservedInstancesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReservedInstancesResponse' 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', 'describeReservedInstancesResponse_nextToken' - Provides an identifier to allow retrieval of paginated results.
--
-- 'reservedInstances', 'describeReservedInstancesResponse_reservedInstances' - List of reserved OpenSearch instances.
--
-- 'httpStatus', 'describeReservedInstancesResponse_httpStatus' - The response's http status code.
newDescribeReservedInstancesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeReservedInstancesResponse
newDescribeReservedInstancesResponse :: Int -> DescribeReservedInstancesResponse
newDescribeReservedInstancesResponse Int
pHttpStatus_ =
  DescribeReservedInstancesResponse' :: Maybe Text
-> Maybe [ReservedInstance]
-> Int
-> DescribeReservedInstancesResponse
DescribeReservedInstancesResponse'
    { $sel:nextToken:DescribeReservedInstancesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedInstances:DescribeReservedInstancesResponse' :: Maybe [ReservedInstance]
reservedInstances = Maybe [ReservedInstance]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeReservedInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Provides an identifier to allow retrieval of paginated results.
describeReservedInstancesResponse_nextToken :: Lens.Lens' DescribeReservedInstancesResponse (Prelude.Maybe Prelude.Text)
describeReservedInstancesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedInstancesResponse
-> f DescribeReservedInstancesResponse
describeReservedInstancesResponse_nextToken = (DescribeReservedInstancesResponse -> Maybe Text)
-> (DescribeReservedInstancesResponse
    -> Maybe Text -> DescribeReservedInstancesResponse)
-> Lens
     DescribeReservedInstancesResponse
     DescribeReservedInstancesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedInstancesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeReservedInstancesResponse' :: DescribeReservedInstancesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeReservedInstancesResponse
s@DescribeReservedInstancesResponse' {} Maybe Text
a -> DescribeReservedInstancesResponse
s {$sel:nextToken:DescribeReservedInstancesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeReservedInstancesResponse)

-- | List of reserved OpenSearch instances.
describeReservedInstancesResponse_reservedInstances :: Lens.Lens' DescribeReservedInstancesResponse (Prelude.Maybe [ReservedInstance])
describeReservedInstancesResponse_reservedInstances :: (Maybe [ReservedInstance] -> f (Maybe [ReservedInstance]))
-> DescribeReservedInstancesResponse
-> f DescribeReservedInstancesResponse
describeReservedInstancesResponse_reservedInstances = (DescribeReservedInstancesResponse -> Maybe [ReservedInstance])
-> (DescribeReservedInstancesResponse
    -> Maybe [ReservedInstance] -> DescribeReservedInstancesResponse)
-> Lens
     DescribeReservedInstancesResponse
     DescribeReservedInstancesResponse
     (Maybe [ReservedInstance])
     (Maybe [ReservedInstance])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedInstancesResponse' {Maybe [ReservedInstance]
reservedInstances :: Maybe [ReservedInstance]
$sel:reservedInstances:DescribeReservedInstancesResponse' :: DescribeReservedInstancesResponse -> Maybe [ReservedInstance]
reservedInstances} -> Maybe [ReservedInstance]
reservedInstances) (\s :: DescribeReservedInstancesResponse
s@DescribeReservedInstancesResponse' {} Maybe [ReservedInstance]
a -> DescribeReservedInstancesResponse
s {$sel:reservedInstances:DescribeReservedInstancesResponse' :: Maybe [ReservedInstance]
reservedInstances = Maybe [ReservedInstance]
a} :: DescribeReservedInstancesResponse) ((Maybe [ReservedInstance] -> f (Maybe [ReservedInstance]))
 -> DescribeReservedInstancesResponse
 -> f DescribeReservedInstancesResponse)
-> ((Maybe [ReservedInstance] -> f (Maybe [ReservedInstance]))
    -> Maybe [ReservedInstance] -> f (Maybe [ReservedInstance]))
-> (Maybe [ReservedInstance] -> f (Maybe [ReservedInstance]))
-> DescribeReservedInstancesResponse
-> f DescribeReservedInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReservedInstance]
  [ReservedInstance]
  [ReservedInstance]
  [ReservedInstance]
-> Iso
     (Maybe [ReservedInstance])
     (Maybe [ReservedInstance])
     (Maybe [ReservedInstance])
     (Maybe [ReservedInstance])
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
  [ReservedInstance]
  [ReservedInstance]
  [ReservedInstance]
  [ReservedInstance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeReservedInstancesResponse