{-# 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.RDS.DescribeOptionGroups
-- 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)
--
-- Describes the available option groups.
--
-- This operation returns paginated results.
module Amazonka.RDS.DescribeOptionGroups
  ( -- * Creating a Request
    DescribeOptionGroups (..),
    newDescribeOptionGroups,

    -- * Request Lenses
    describeOptionGroups_filters,
    describeOptionGroups_engineName,
    describeOptionGroups_majorEngineVersion,
    describeOptionGroups_marker,
    describeOptionGroups_maxRecords,
    describeOptionGroups_optionGroupName,

    -- * Destructuring the Response
    DescribeOptionGroupsResponse (..),
    newDescribeOptionGroupsResponse,

    -- * Response Lenses
    describeOptionGroupsResponse_marker,
    describeOptionGroupsResponse_optionGroupsList,
    describeOptionGroupsResponse_httpStatus,
  )
where

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

-- |
--
-- /See:/ 'newDescribeOptionGroups' smart constructor.
data DescribeOptionGroups = DescribeOptionGroups'
  { -- | This parameter isn\'t currently supported.
    DescribeOptionGroups -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | Filters the list of option groups to only include groups associated with
    -- a specific database engine.
    --
    -- Valid Values:
    --
    -- -   @mariadb@
    --
    -- -   @mysql@
    --
    -- -   @oracle-ee@
    --
    -- -   @oracle-ee-cdb@
    --
    -- -   @oracle-se2@
    --
    -- -   @oracle-se2-cdb@
    --
    -- -   @postgres@
    --
    -- -   @sqlserver-ee@
    --
    -- -   @sqlserver-se@
    --
    -- -   @sqlserver-ex@
    --
    -- -   @sqlserver-web@
    DescribeOptionGroups -> Maybe Text
engineName :: Prelude.Maybe Prelude.Text,
    -- | Filters the list of option groups to only include groups associated with
    -- a specific database engine version. If specified, then EngineName must
    -- also be specified.
    DescribeOptionGroups -> Maybe Text
majorEngineVersion :: Prelude.Maybe Prelude.Text,
    -- | An optional pagination token provided by a previous DescribeOptionGroups
    -- request. If this parameter is specified, the response includes only
    -- records beyond the marker, up to the value specified by @MaxRecords@.
    DescribeOptionGroups -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so that you can retrieve the
    -- remaining results.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribeOptionGroups -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The name of the option group to describe. Can\'t be supplied together
    -- with EngineName or MajorEngineVersion.
    DescribeOptionGroups -> Maybe Text
optionGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeOptionGroups -> DescribeOptionGroups -> Bool
(DescribeOptionGroups -> DescribeOptionGroups -> Bool)
-> (DescribeOptionGroups -> DescribeOptionGroups -> Bool)
-> Eq DescribeOptionGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOptionGroups -> DescribeOptionGroups -> Bool
$c/= :: DescribeOptionGroups -> DescribeOptionGroups -> Bool
== :: DescribeOptionGroups -> DescribeOptionGroups -> Bool
$c== :: DescribeOptionGroups -> DescribeOptionGroups -> Bool
Prelude.Eq, ReadPrec [DescribeOptionGroups]
ReadPrec DescribeOptionGroups
Int -> ReadS DescribeOptionGroups
ReadS [DescribeOptionGroups]
(Int -> ReadS DescribeOptionGroups)
-> ReadS [DescribeOptionGroups]
-> ReadPrec DescribeOptionGroups
-> ReadPrec [DescribeOptionGroups]
-> Read DescribeOptionGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOptionGroups]
$creadListPrec :: ReadPrec [DescribeOptionGroups]
readPrec :: ReadPrec DescribeOptionGroups
$creadPrec :: ReadPrec DescribeOptionGroups
readList :: ReadS [DescribeOptionGroups]
$creadList :: ReadS [DescribeOptionGroups]
readsPrec :: Int -> ReadS DescribeOptionGroups
$creadsPrec :: Int -> ReadS DescribeOptionGroups
Prelude.Read, Int -> DescribeOptionGroups -> ShowS
[DescribeOptionGroups] -> ShowS
DescribeOptionGroups -> String
(Int -> DescribeOptionGroups -> ShowS)
-> (DescribeOptionGroups -> String)
-> ([DescribeOptionGroups] -> ShowS)
-> Show DescribeOptionGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOptionGroups] -> ShowS
$cshowList :: [DescribeOptionGroups] -> ShowS
show :: DescribeOptionGroups -> String
$cshow :: DescribeOptionGroups -> String
showsPrec :: Int -> DescribeOptionGroups -> ShowS
$cshowsPrec :: Int -> DescribeOptionGroups -> ShowS
Prelude.Show, (forall x. DescribeOptionGroups -> Rep DescribeOptionGroups x)
-> (forall x. Rep DescribeOptionGroups x -> DescribeOptionGroups)
-> Generic DescribeOptionGroups
forall x. Rep DescribeOptionGroups x -> DescribeOptionGroups
forall x. DescribeOptionGroups -> Rep DescribeOptionGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeOptionGroups x -> DescribeOptionGroups
$cfrom :: forall x. DescribeOptionGroups -> Rep DescribeOptionGroups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeOptionGroups' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'filters', 'describeOptionGroups_filters' - This parameter isn\'t currently supported.
--
-- 'engineName', 'describeOptionGroups_engineName' - Filters the list of option groups to only include groups associated with
-- a specific database engine.
--
-- Valid Values:
--
-- -   @mariadb@
--
-- -   @mysql@
--
-- -   @oracle-ee@
--
-- -   @oracle-ee-cdb@
--
-- -   @oracle-se2@
--
-- -   @oracle-se2-cdb@
--
-- -   @postgres@
--
-- -   @sqlserver-ee@
--
-- -   @sqlserver-se@
--
-- -   @sqlserver-ex@
--
-- -   @sqlserver-web@
--
-- 'majorEngineVersion', 'describeOptionGroups_majorEngineVersion' - Filters the list of option groups to only include groups associated with
-- a specific database engine version. If specified, then EngineName must
-- also be specified.
--
-- 'marker', 'describeOptionGroups_marker' - An optional pagination token provided by a previous DescribeOptionGroups
-- request. If this parameter is specified, the response includes only
-- records beyond the marker, up to the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeOptionGroups_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
--
-- 'optionGroupName', 'describeOptionGroups_optionGroupName' - The name of the option group to describe. Can\'t be supplied together
-- with EngineName or MajorEngineVersion.
newDescribeOptionGroups ::
  DescribeOptionGroups
newDescribeOptionGroups :: DescribeOptionGroups
newDescribeOptionGroups =
  DescribeOptionGroups' :: Maybe [Filter]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> DescribeOptionGroups
DescribeOptionGroups'
    { $sel:filters:DescribeOptionGroups' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:engineName:DescribeOptionGroups' :: Maybe Text
engineName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:majorEngineVersion:DescribeOptionGroups' :: Maybe Text
majorEngineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeOptionGroups' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeOptionGroups' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:optionGroupName:DescribeOptionGroups' :: Maybe Text
optionGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | This parameter isn\'t currently supported.
describeOptionGroups_filters :: Lens.Lens' DescribeOptionGroups (Prelude.Maybe [Filter])
describeOptionGroups_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeOptionGroups -> f DescribeOptionGroups
describeOptionGroups_filters = (DescribeOptionGroups -> Maybe [Filter])
-> (DescribeOptionGroups -> Maybe [Filter] -> DescribeOptionGroups)
-> Lens
     DescribeOptionGroups
     DescribeOptionGroups
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroups' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeOptionGroups
s@DescribeOptionGroups' {} Maybe [Filter]
a -> DescribeOptionGroups
s {$sel:filters:DescribeOptionGroups' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeOptionGroups) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeOptionGroups -> f DescribeOptionGroups)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeOptionGroups
-> f DescribeOptionGroups
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Filters the list of option groups to only include groups associated with
-- a specific database engine.
--
-- Valid Values:
--
-- -   @mariadb@
--
-- -   @mysql@
--
-- -   @oracle-ee@
--
-- -   @oracle-ee-cdb@
--
-- -   @oracle-se2@
--
-- -   @oracle-se2-cdb@
--
-- -   @postgres@
--
-- -   @sqlserver-ee@
--
-- -   @sqlserver-se@
--
-- -   @sqlserver-ex@
--
-- -   @sqlserver-web@
describeOptionGroups_engineName :: Lens.Lens' DescribeOptionGroups (Prelude.Maybe Prelude.Text)
describeOptionGroups_engineName :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroups -> f DescribeOptionGroups
describeOptionGroups_engineName = (DescribeOptionGroups -> Maybe Text)
-> (DescribeOptionGroups -> Maybe Text -> DescribeOptionGroups)
-> Lens
     DescribeOptionGroups DescribeOptionGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroups' {Maybe Text
engineName :: Maybe Text
$sel:engineName:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
engineName} -> Maybe Text
engineName) (\s :: DescribeOptionGroups
s@DescribeOptionGroups' {} Maybe Text
a -> DescribeOptionGroups
s {$sel:engineName:DescribeOptionGroups' :: Maybe Text
engineName = Maybe Text
a} :: DescribeOptionGroups)

-- | Filters the list of option groups to only include groups associated with
-- a specific database engine version. If specified, then EngineName must
-- also be specified.
describeOptionGroups_majorEngineVersion :: Lens.Lens' DescribeOptionGroups (Prelude.Maybe Prelude.Text)
describeOptionGroups_majorEngineVersion :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroups -> f DescribeOptionGroups
describeOptionGroups_majorEngineVersion = (DescribeOptionGroups -> Maybe Text)
-> (DescribeOptionGroups -> Maybe Text -> DescribeOptionGroups)
-> Lens
     DescribeOptionGroups DescribeOptionGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroups' {Maybe Text
majorEngineVersion :: Maybe Text
$sel:majorEngineVersion:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
majorEngineVersion} -> Maybe Text
majorEngineVersion) (\s :: DescribeOptionGroups
s@DescribeOptionGroups' {} Maybe Text
a -> DescribeOptionGroups
s {$sel:majorEngineVersion:DescribeOptionGroups' :: Maybe Text
majorEngineVersion = Maybe Text
a} :: DescribeOptionGroups)

-- | An optional pagination token provided by a previous DescribeOptionGroups
-- request. If this parameter is specified, the response includes only
-- records beyond the marker, up to the value specified by @MaxRecords@.
describeOptionGroups_marker :: Lens.Lens' DescribeOptionGroups (Prelude.Maybe Prelude.Text)
describeOptionGroups_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroups -> f DescribeOptionGroups
describeOptionGroups_marker = (DescribeOptionGroups -> Maybe Text)
-> (DescribeOptionGroups -> Maybe Text -> DescribeOptionGroups)
-> Lens
     DescribeOptionGroups DescribeOptionGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroups' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeOptionGroups
s@DescribeOptionGroups' {} Maybe Text
a -> DescribeOptionGroups
s {$sel:marker:DescribeOptionGroups' :: Maybe Text
marker = Maybe Text
a} :: DescribeOptionGroups)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describeOptionGroups_maxRecords :: Lens.Lens' DescribeOptionGroups (Prelude.Maybe Prelude.Int)
describeOptionGroups_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeOptionGroups -> f DescribeOptionGroups
describeOptionGroups_maxRecords = (DescribeOptionGroups -> Maybe Int)
-> (DescribeOptionGroups -> Maybe Int -> DescribeOptionGroups)
-> Lens
     DescribeOptionGroups DescribeOptionGroups (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroups' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeOptionGroups
s@DescribeOptionGroups' {} Maybe Int
a -> DescribeOptionGroups
s {$sel:maxRecords:DescribeOptionGroups' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeOptionGroups)

-- | The name of the option group to describe. Can\'t be supplied together
-- with EngineName or MajorEngineVersion.
describeOptionGroups_optionGroupName :: Lens.Lens' DescribeOptionGroups (Prelude.Maybe Prelude.Text)
describeOptionGroups_optionGroupName :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroups -> f DescribeOptionGroups
describeOptionGroups_optionGroupName = (DescribeOptionGroups -> Maybe Text)
-> (DescribeOptionGroups -> Maybe Text -> DescribeOptionGroups)
-> Lens
     DescribeOptionGroups DescribeOptionGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroups' {Maybe Text
optionGroupName :: Maybe Text
$sel:optionGroupName:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
optionGroupName} -> Maybe Text
optionGroupName) (\s :: DescribeOptionGroups
s@DescribeOptionGroups' {} Maybe Text
a -> DescribeOptionGroups
s {$sel:optionGroupName:DescribeOptionGroups' :: Maybe Text
optionGroupName = Maybe Text
a} :: DescribeOptionGroups)

instance Core.AWSPager DescribeOptionGroups where
  page :: DescribeOptionGroups
-> AWSResponse DescribeOptionGroups -> Maybe DescribeOptionGroups
page DescribeOptionGroups
rq AWSResponse DescribeOptionGroups
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeOptionGroups
DescribeOptionGroupsResponse
rs
            DescribeOptionGroupsResponse
-> Getting (First Text) DescribeOptionGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeOptionGroupsResponse
-> Const (First Text) DescribeOptionGroupsResponse
Lens' DescribeOptionGroupsResponse (Maybe Text)
describeOptionGroupsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeOptionGroupsResponse
 -> Const (First Text) DescribeOptionGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeOptionGroupsResponse 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 DescribeOptionGroups
forall a. Maybe a
Prelude.Nothing
    | Maybe [OptionGroup] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeOptionGroups
DescribeOptionGroupsResponse
rs
            DescribeOptionGroupsResponse
-> Getting
     (First [OptionGroup]) DescribeOptionGroupsResponse [OptionGroup]
-> Maybe [OptionGroup]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [OptionGroup]
 -> Const (First [OptionGroup]) (Maybe [OptionGroup]))
-> DescribeOptionGroupsResponse
-> Const (First [OptionGroup]) DescribeOptionGroupsResponse
Lens' DescribeOptionGroupsResponse (Maybe [OptionGroup])
describeOptionGroupsResponse_optionGroupsList
              ((Maybe [OptionGroup]
  -> Const (First [OptionGroup]) (Maybe [OptionGroup]))
 -> DescribeOptionGroupsResponse
 -> Const (First [OptionGroup]) DescribeOptionGroupsResponse)
-> (([OptionGroup] -> Const (First [OptionGroup]) [OptionGroup])
    -> Maybe [OptionGroup]
    -> Const (First [OptionGroup]) (Maybe [OptionGroup]))
-> Getting
     (First [OptionGroup]) DescribeOptionGroupsResponse [OptionGroup]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([OptionGroup] -> Const (First [OptionGroup]) [OptionGroup])
-> Maybe [OptionGroup]
-> Const (First [OptionGroup]) (Maybe [OptionGroup])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeOptionGroups
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeOptionGroups -> Maybe DescribeOptionGroups
forall a. a -> Maybe a
Prelude.Just (DescribeOptionGroups -> Maybe DescribeOptionGroups)
-> DescribeOptionGroups -> Maybe DescribeOptionGroups
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeOptionGroups
rq
          DescribeOptionGroups
-> (DescribeOptionGroups -> DescribeOptionGroups)
-> DescribeOptionGroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeOptionGroups -> Identity DescribeOptionGroups
Lens
  DescribeOptionGroups DescribeOptionGroups (Maybe Text) (Maybe Text)
describeOptionGroups_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeOptionGroups -> Identity DescribeOptionGroups)
-> Maybe Text -> DescribeOptionGroups -> DescribeOptionGroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeOptionGroups
DescribeOptionGroupsResponse
rs
          DescribeOptionGroupsResponse
-> Getting (First Text) DescribeOptionGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeOptionGroupsResponse
-> Const (First Text) DescribeOptionGroupsResponse
Lens' DescribeOptionGroupsResponse (Maybe Text)
describeOptionGroupsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeOptionGroupsResponse
 -> Const (First Text) DescribeOptionGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeOptionGroupsResponse 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 DescribeOptionGroups where
  type
    AWSResponse DescribeOptionGroups =
      DescribeOptionGroupsResponse
  request :: DescribeOptionGroups -> Request DescribeOptionGroups
request = Service -> DescribeOptionGroups -> Request DescribeOptionGroups
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeOptionGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeOptionGroups)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeOptionGroups))
-> Logger
-> Service
-> Proxy DescribeOptionGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeOptionGroups)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeOptionGroupsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [OptionGroup] -> Int -> DescribeOptionGroupsResponse
DescribeOptionGroupsResponse'
            (Maybe Text
 -> Maybe [OptionGroup] -> Int -> DescribeOptionGroupsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [OptionGroup] -> Int -> DescribeOptionGroupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            Either
  String (Maybe [OptionGroup] -> Int -> DescribeOptionGroupsResponse)
-> Either String (Maybe [OptionGroup])
-> Either String (Int -> DescribeOptionGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OptionGroupsList"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [OptionGroup]))
-> Either String (Maybe [OptionGroup])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [OptionGroup])
-> [Node] -> Either String (Maybe [OptionGroup])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [OptionGroup]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"OptionGroup")
                        )
            Either String (Int -> DescribeOptionGroupsResponse)
-> Either String Int -> Either String DescribeOptionGroupsResponse
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 DescribeOptionGroups

instance Prelude.NFData DescribeOptionGroups

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

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

instance Core.ToQuery DescribeOptionGroups where
  toQuery :: DescribeOptionGroups -> QueryString
toQuery DescribeOptionGroups' {Maybe Int
Maybe [Filter]
Maybe Text
optionGroupName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
majorEngineVersion :: Maybe Text
engineName :: Maybe Text
filters :: Maybe [Filter]
$sel:optionGroupName:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
$sel:maxRecords:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Int
$sel:marker:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
$sel:majorEngineVersion:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
$sel:engineName:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe Text
$sel:filters:DescribeOptionGroups' :: DescribeOptionGroups -> Maybe [Filter]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeOptionGroups" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"Filters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Filter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Filter" ([Filter] -> QueryString) -> Maybe [Filter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"EngineName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
engineName,
        ByteString
"MajorEngineVersion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
majorEngineVersion,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords,
        ByteString
"OptionGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
optionGroupName
      ]

-- | List of option groups.
--
-- /See:/ 'newDescribeOptionGroupsResponse' smart constructor.
data DescribeOptionGroupsResponse = DescribeOptionGroupsResponse'
  { -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeOptionGroupsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | List of option groups.
    DescribeOptionGroupsResponse -> Maybe [OptionGroup]
optionGroupsList :: Prelude.Maybe [OptionGroup],
    -- | The response's http status code.
    DescribeOptionGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeOptionGroupsResponse
-> DescribeOptionGroupsResponse -> Bool
(DescribeOptionGroupsResponse
 -> DescribeOptionGroupsResponse -> Bool)
-> (DescribeOptionGroupsResponse
    -> DescribeOptionGroupsResponse -> Bool)
-> Eq DescribeOptionGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOptionGroupsResponse
-> DescribeOptionGroupsResponse -> Bool
$c/= :: DescribeOptionGroupsResponse
-> DescribeOptionGroupsResponse -> Bool
== :: DescribeOptionGroupsResponse
-> DescribeOptionGroupsResponse -> Bool
$c== :: DescribeOptionGroupsResponse
-> DescribeOptionGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeOptionGroupsResponse]
ReadPrec DescribeOptionGroupsResponse
Int -> ReadS DescribeOptionGroupsResponse
ReadS [DescribeOptionGroupsResponse]
(Int -> ReadS DescribeOptionGroupsResponse)
-> ReadS [DescribeOptionGroupsResponse]
-> ReadPrec DescribeOptionGroupsResponse
-> ReadPrec [DescribeOptionGroupsResponse]
-> Read DescribeOptionGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOptionGroupsResponse]
$creadListPrec :: ReadPrec [DescribeOptionGroupsResponse]
readPrec :: ReadPrec DescribeOptionGroupsResponse
$creadPrec :: ReadPrec DescribeOptionGroupsResponse
readList :: ReadS [DescribeOptionGroupsResponse]
$creadList :: ReadS [DescribeOptionGroupsResponse]
readsPrec :: Int -> ReadS DescribeOptionGroupsResponse
$creadsPrec :: Int -> ReadS DescribeOptionGroupsResponse
Prelude.Read, Int -> DescribeOptionGroupsResponse -> ShowS
[DescribeOptionGroupsResponse] -> ShowS
DescribeOptionGroupsResponse -> String
(Int -> DescribeOptionGroupsResponse -> ShowS)
-> (DescribeOptionGroupsResponse -> String)
-> ([DescribeOptionGroupsResponse] -> ShowS)
-> Show DescribeOptionGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOptionGroupsResponse] -> ShowS
$cshowList :: [DescribeOptionGroupsResponse] -> ShowS
show :: DescribeOptionGroupsResponse -> String
$cshow :: DescribeOptionGroupsResponse -> String
showsPrec :: Int -> DescribeOptionGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeOptionGroupsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeOptionGroupsResponse -> Rep DescribeOptionGroupsResponse x)
-> (forall x.
    Rep DescribeOptionGroupsResponse x -> DescribeOptionGroupsResponse)
-> Generic DescribeOptionGroupsResponse
forall x.
Rep DescribeOptionGroupsResponse x -> DescribeOptionGroupsResponse
forall x.
DescribeOptionGroupsResponse -> Rep DescribeOptionGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeOptionGroupsResponse x -> DescribeOptionGroupsResponse
$cfrom :: forall x.
DescribeOptionGroupsResponse -> Rep DescribeOptionGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeOptionGroupsResponse' 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:
--
-- 'marker', 'describeOptionGroupsResponse_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'optionGroupsList', 'describeOptionGroupsResponse_optionGroupsList' - List of option groups.
--
-- 'httpStatus', 'describeOptionGroupsResponse_httpStatus' - The response's http status code.
newDescribeOptionGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeOptionGroupsResponse
newDescribeOptionGroupsResponse :: Int -> DescribeOptionGroupsResponse
newDescribeOptionGroupsResponse Int
pHttpStatus_ =
  DescribeOptionGroupsResponse' :: Maybe Text
-> Maybe [OptionGroup] -> Int -> DescribeOptionGroupsResponse
DescribeOptionGroupsResponse'
    { $sel:marker:DescribeOptionGroupsResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:optionGroupsList:DescribeOptionGroupsResponse' :: Maybe [OptionGroup]
optionGroupsList = Maybe [OptionGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeOptionGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeOptionGroupsResponse_marker :: Lens.Lens' DescribeOptionGroupsResponse (Prelude.Maybe Prelude.Text)
describeOptionGroupsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroupsResponse -> f DescribeOptionGroupsResponse
describeOptionGroupsResponse_marker = (DescribeOptionGroupsResponse -> Maybe Text)
-> (DescribeOptionGroupsResponse
    -> Maybe Text -> DescribeOptionGroupsResponse)
-> Lens' DescribeOptionGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeOptionGroupsResponse' :: DescribeOptionGroupsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeOptionGroupsResponse
s@DescribeOptionGroupsResponse' {} Maybe Text
a -> DescribeOptionGroupsResponse
s {$sel:marker:DescribeOptionGroupsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeOptionGroupsResponse)

-- | List of option groups.
describeOptionGroupsResponse_optionGroupsList :: Lens.Lens' DescribeOptionGroupsResponse (Prelude.Maybe [OptionGroup])
describeOptionGroupsResponse_optionGroupsList :: (Maybe [OptionGroup] -> f (Maybe [OptionGroup]))
-> DescribeOptionGroupsResponse -> f DescribeOptionGroupsResponse
describeOptionGroupsResponse_optionGroupsList = (DescribeOptionGroupsResponse -> Maybe [OptionGroup])
-> (DescribeOptionGroupsResponse
    -> Maybe [OptionGroup] -> DescribeOptionGroupsResponse)
-> Lens' DescribeOptionGroupsResponse (Maybe [OptionGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupsResponse' {Maybe [OptionGroup]
optionGroupsList :: Maybe [OptionGroup]
$sel:optionGroupsList:DescribeOptionGroupsResponse' :: DescribeOptionGroupsResponse -> Maybe [OptionGroup]
optionGroupsList} -> Maybe [OptionGroup]
optionGroupsList) (\s :: DescribeOptionGroupsResponse
s@DescribeOptionGroupsResponse' {} Maybe [OptionGroup]
a -> DescribeOptionGroupsResponse
s {$sel:optionGroupsList:DescribeOptionGroupsResponse' :: Maybe [OptionGroup]
optionGroupsList = Maybe [OptionGroup]
a} :: DescribeOptionGroupsResponse) ((Maybe [OptionGroup] -> f (Maybe [OptionGroup]))
 -> DescribeOptionGroupsResponse -> f DescribeOptionGroupsResponse)
-> ((Maybe [OptionGroup] -> f (Maybe [OptionGroup]))
    -> Maybe [OptionGroup] -> f (Maybe [OptionGroup]))
-> (Maybe [OptionGroup] -> f (Maybe [OptionGroup]))
-> DescribeOptionGroupsResponse
-> f DescribeOptionGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [OptionGroup] [OptionGroup] [OptionGroup] [OptionGroup]
-> Iso
     (Maybe [OptionGroup])
     (Maybe [OptionGroup])
     (Maybe [OptionGroup])
     (Maybe [OptionGroup])
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 [OptionGroup] [OptionGroup] [OptionGroup] [OptionGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeOptionGroupsResponse