{-# 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.DescribeOptionGroupOptions
-- 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 all available options.
--
-- This operation returns paginated results.
module Amazonka.RDS.DescribeOptionGroupOptions
  ( -- * Creating a Request
    DescribeOptionGroupOptions (..),
    newDescribeOptionGroupOptions,

    -- * Request Lenses
    describeOptionGroupOptions_filters,
    describeOptionGroupOptions_majorEngineVersion,
    describeOptionGroupOptions_marker,
    describeOptionGroupOptions_maxRecords,
    describeOptionGroupOptions_engineName,

    -- * Destructuring the Response
    DescribeOptionGroupOptionsResponse (..),
    newDescribeOptionGroupOptionsResponse,

    -- * Response Lenses
    describeOptionGroupOptionsResponse_optionGroupOptions,
    describeOptionGroupOptionsResponse_marker,
    describeOptionGroupOptionsResponse_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:/ 'newDescribeOptionGroupOptions' smart constructor.
data DescribeOptionGroupOptions = DescribeOptionGroupOptions'
  { -- | This parameter isn\'t currently supported.
    DescribeOptionGroupOptions -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | If specified, filters the results to include only options for the
    -- specified major engine version.
    DescribeOptionGroupOptions -> Maybe Text
majorEngineVersion :: Prelude.Maybe Prelude.Text,
    -- | 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@.
    DescribeOptionGroupOptions -> 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.
    DescribeOptionGroupOptions -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | A required parameter. Options available for the given engine name are
    -- described.
    --
    -- Valid Values:
    --
    -- -   @mariadb@
    --
    -- -   @mysql@
    --
    -- -   @oracle-ee@
    --
    -- -   @oracle-ee-cdb@
    --
    -- -   @oracle-se2@
    --
    -- -   @oracle-se2-cdb@
    --
    -- -   @postgres@
    --
    -- -   @sqlserver-ee@
    --
    -- -   @sqlserver-se@
    --
    -- -   @sqlserver-ex@
    --
    -- -   @sqlserver-web@
    DescribeOptionGroupOptions -> Text
engineName :: Prelude.Text
  }
  deriving (DescribeOptionGroupOptions -> DescribeOptionGroupOptions -> Bool
(DescribeOptionGroupOptions -> DescribeOptionGroupOptions -> Bool)
-> (DescribeOptionGroupOptions
    -> DescribeOptionGroupOptions -> Bool)
-> Eq DescribeOptionGroupOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOptionGroupOptions -> DescribeOptionGroupOptions -> Bool
$c/= :: DescribeOptionGroupOptions -> DescribeOptionGroupOptions -> Bool
== :: DescribeOptionGroupOptions -> DescribeOptionGroupOptions -> Bool
$c== :: DescribeOptionGroupOptions -> DescribeOptionGroupOptions -> Bool
Prelude.Eq, ReadPrec [DescribeOptionGroupOptions]
ReadPrec DescribeOptionGroupOptions
Int -> ReadS DescribeOptionGroupOptions
ReadS [DescribeOptionGroupOptions]
(Int -> ReadS DescribeOptionGroupOptions)
-> ReadS [DescribeOptionGroupOptions]
-> ReadPrec DescribeOptionGroupOptions
-> ReadPrec [DescribeOptionGroupOptions]
-> Read DescribeOptionGroupOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOptionGroupOptions]
$creadListPrec :: ReadPrec [DescribeOptionGroupOptions]
readPrec :: ReadPrec DescribeOptionGroupOptions
$creadPrec :: ReadPrec DescribeOptionGroupOptions
readList :: ReadS [DescribeOptionGroupOptions]
$creadList :: ReadS [DescribeOptionGroupOptions]
readsPrec :: Int -> ReadS DescribeOptionGroupOptions
$creadsPrec :: Int -> ReadS DescribeOptionGroupOptions
Prelude.Read, Int -> DescribeOptionGroupOptions -> ShowS
[DescribeOptionGroupOptions] -> ShowS
DescribeOptionGroupOptions -> String
(Int -> DescribeOptionGroupOptions -> ShowS)
-> (DescribeOptionGroupOptions -> String)
-> ([DescribeOptionGroupOptions] -> ShowS)
-> Show DescribeOptionGroupOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOptionGroupOptions] -> ShowS
$cshowList :: [DescribeOptionGroupOptions] -> ShowS
show :: DescribeOptionGroupOptions -> String
$cshow :: DescribeOptionGroupOptions -> String
showsPrec :: Int -> DescribeOptionGroupOptions -> ShowS
$cshowsPrec :: Int -> DescribeOptionGroupOptions -> ShowS
Prelude.Show, (forall x.
 DescribeOptionGroupOptions -> Rep DescribeOptionGroupOptions x)
-> (forall x.
    Rep DescribeOptionGroupOptions x -> DescribeOptionGroupOptions)
-> Generic DescribeOptionGroupOptions
forall x.
Rep DescribeOptionGroupOptions x -> DescribeOptionGroupOptions
forall x.
DescribeOptionGroupOptions -> Rep DescribeOptionGroupOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeOptionGroupOptions x -> DescribeOptionGroupOptions
$cfrom :: forall x.
DescribeOptionGroupOptions -> Rep DescribeOptionGroupOptions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeOptionGroupOptions' 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', 'describeOptionGroupOptions_filters' - This parameter isn\'t currently supported.
--
-- 'majorEngineVersion', 'describeOptionGroupOptions_majorEngineVersion' - If specified, filters the results to include only options for the
-- specified major engine version.
--
-- 'marker', 'describeOptionGroupOptions_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@.
--
-- 'maxRecords', 'describeOptionGroupOptions_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.
--
-- 'engineName', 'describeOptionGroupOptions_engineName' - A required parameter. Options available for the given engine name are
-- described.
--
-- Valid Values:
--
-- -   @mariadb@
--
-- -   @mysql@
--
-- -   @oracle-ee@
--
-- -   @oracle-ee-cdb@
--
-- -   @oracle-se2@
--
-- -   @oracle-se2-cdb@
--
-- -   @postgres@
--
-- -   @sqlserver-ee@
--
-- -   @sqlserver-se@
--
-- -   @sqlserver-ex@
--
-- -   @sqlserver-web@
newDescribeOptionGroupOptions ::
  -- | 'engineName'
  Prelude.Text ->
  DescribeOptionGroupOptions
newDescribeOptionGroupOptions :: Text -> DescribeOptionGroupOptions
newDescribeOptionGroupOptions Text
pEngineName_ =
  DescribeOptionGroupOptions' :: Maybe [Filter]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> DescribeOptionGroupOptions
DescribeOptionGroupOptions'
    { $sel:filters:DescribeOptionGroupOptions' :: Maybe [Filter]
filters =
        Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:majorEngineVersion:DescribeOptionGroupOptions' :: Maybe Text
majorEngineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeOptionGroupOptions' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeOptionGroupOptions' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:engineName:DescribeOptionGroupOptions' :: Text
engineName = Text
pEngineName_
    }

-- | This parameter isn\'t currently supported.
describeOptionGroupOptions_filters :: Lens.Lens' DescribeOptionGroupOptions (Prelude.Maybe [Filter])
describeOptionGroupOptions_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeOptionGroupOptions -> f DescribeOptionGroupOptions
describeOptionGroupOptions_filters = (DescribeOptionGroupOptions -> Maybe [Filter])
-> (DescribeOptionGroupOptions
    -> Maybe [Filter] -> DescribeOptionGroupOptions)
-> Lens
     DescribeOptionGroupOptions
     DescribeOptionGroupOptions
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupOptions' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeOptionGroupOptions
s@DescribeOptionGroupOptions' {} Maybe [Filter]
a -> DescribeOptionGroupOptions
s {$sel:filters:DescribeOptionGroupOptions' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeOptionGroupOptions) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeOptionGroupOptions -> f DescribeOptionGroupOptions)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeOptionGroupOptions
-> f DescribeOptionGroupOptions
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

-- | If specified, filters the results to include only options for the
-- specified major engine version.
describeOptionGroupOptions_majorEngineVersion :: Lens.Lens' DescribeOptionGroupOptions (Prelude.Maybe Prelude.Text)
describeOptionGroupOptions_majorEngineVersion :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroupOptions -> f DescribeOptionGroupOptions
describeOptionGroupOptions_majorEngineVersion = (DescribeOptionGroupOptions -> Maybe Text)
-> (DescribeOptionGroupOptions
    -> Maybe Text -> DescribeOptionGroupOptions)
-> Lens
     DescribeOptionGroupOptions
     DescribeOptionGroupOptions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupOptions' {Maybe Text
majorEngineVersion :: Maybe Text
$sel:majorEngineVersion:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Maybe Text
majorEngineVersion} -> Maybe Text
majorEngineVersion) (\s :: DescribeOptionGroupOptions
s@DescribeOptionGroupOptions' {} Maybe Text
a -> DescribeOptionGroupOptions
s {$sel:majorEngineVersion:DescribeOptionGroupOptions' :: Maybe Text
majorEngineVersion = Maybe Text
a} :: DescribeOptionGroupOptions)

-- | 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@.
describeOptionGroupOptions_marker :: Lens.Lens' DescribeOptionGroupOptions (Prelude.Maybe Prelude.Text)
describeOptionGroupOptions_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroupOptions -> f DescribeOptionGroupOptions
describeOptionGroupOptions_marker = (DescribeOptionGroupOptions -> Maybe Text)
-> (DescribeOptionGroupOptions
    -> Maybe Text -> DescribeOptionGroupOptions)
-> Lens
     DescribeOptionGroupOptions
     DescribeOptionGroupOptions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupOptions' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeOptionGroupOptions
s@DescribeOptionGroupOptions' {} Maybe Text
a -> DescribeOptionGroupOptions
s {$sel:marker:DescribeOptionGroupOptions' :: Maybe Text
marker = Maybe Text
a} :: DescribeOptionGroupOptions)

-- | 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.
describeOptionGroupOptions_maxRecords :: Lens.Lens' DescribeOptionGroupOptions (Prelude.Maybe Prelude.Int)
describeOptionGroupOptions_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeOptionGroupOptions -> f DescribeOptionGroupOptions
describeOptionGroupOptions_maxRecords = (DescribeOptionGroupOptions -> Maybe Int)
-> (DescribeOptionGroupOptions
    -> Maybe Int -> DescribeOptionGroupOptions)
-> Lens
     DescribeOptionGroupOptions
     DescribeOptionGroupOptions
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupOptions' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeOptionGroupOptions
s@DescribeOptionGroupOptions' {} Maybe Int
a -> DescribeOptionGroupOptions
s {$sel:maxRecords:DescribeOptionGroupOptions' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeOptionGroupOptions)

-- | A required parameter. Options available for the given engine name are
-- described.
--
-- Valid Values:
--
-- -   @mariadb@
--
-- -   @mysql@
--
-- -   @oracle-ee@
--
-- -   @oracle-ee-cdb@
--
-- -   @oracle-se2@
--
-- -   @oracle-se2-cdb@
--
-- -   @postgres@
--
-- -   @sqlserver-ee@
--
-- -   @sqlserver-se@
--
-- -   @sqlserver-ex@
--
-- -   @sqlserver-web@
describeOptionGroupOptions_engineName :: Lens.Lens' DescribeOptionGroupOptions Prelude.Text
describeOptionGroupOptions_engineName :: (Text -> f Text)
-> DescribeOptionGroupOptions -> f DescribeOptionGroupOptions
describeOptionGroupOptions_engineName = (DescribeOptionGroupOptions -> Text)
-> (DescribeOptionGroupOptions
    -> Text -> DescribeOptionGroupOptions)
-> Lens
     DescribeOptionGroupOptions DescribeOptionGroupOptions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupOptions' {Text
engineName :: Text
$sel:engineName:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Text
engineName} -> Text
engineName) (\s :: DescribeOptionGroupOptions
s@DescribeOptionGroupOptions' {} Text
a -> DescribeOptionGroupOptions
s {$sel:engineName:DescribeOptionGroupOptions' :: Text
engineName = Text
a} :: DescribeOptionGroupOptions)

instance Core.AWSPager DescribeOptionGroupOptions where
  page :: DescribeOptionGroupOptions
-> AWSResponse DescribeOptionGroupOptions
-> Maybe DescribeOptionGroupOptions
page DescribeOptionGroupOptions
rq AWSResponse DescribeOptionGroupOptions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeOptionGroupOptions
DescribeOptionGroupOptionsResponse
rs
            DescribeOptionGroupOptionsResponse
-> Getting (First Text) DescribeOptionGroupOptionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeOptionGroupOptionsResponse
-> Const (First Text) DescribeOptionGroupOptionsResponse
Lens' DescribeOptionGroupOptionsResponse (Maybe Text)
describeOptionGroupOptionsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeOptionGroupOptionsResponse
 -> Const (First Text) DescribeOptionGroupOptionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeOptionGroupOptionsResponse 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 DescribeOptionGroupOptions
forall a. Maybe a
Prelude.Nothing
    | Maybe [OptionGroupOption] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeOptionGroupOptions
DescribeOptionGroupOptionsResponse
rs
            DescribeOptionGroupOptionsResponse
-> Getting
     (First [OptionGroupOption])
     DescribeOptionGroupOptionsResponse
     [OptionGroupOption]
-> Maybe [OptionGroupOption]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [OptionGroupOption]
 -> Const (First [OptionGroupOption]) (Maybe [OptionGroupOption]))
-> DescribeOptionGroupOptionsResponse
-> Const
     (First [OptionGroupOption]) DescribeOptionGroupOptionsResponse
Lens'
  DescribeOptionGroupOptionsResponse (Maybe [OptionGroupOption])
describeOptionGroupOptionsResponse_optionGroupOptions
              ((Maybe [OptionGroupOption]
  -> Const (First [OptionGroupOption]) (Maybe [OptionGroupOption]))
 -> DescribeOptionGroupOptionsResponse
 -> Const
      (First [OptionGroupOption]) DescribeOptionGroupOptionsResponse)
-> (([OptionGroupOption]
     -> Const (First [OptionGroupOption]) [OptionGroupOption])
    -> Maybe [OptionGroupOption]
    -> Const (First [OptionGroupOption]) (Maybe [OptionGroupOption]))
-> Getting
     (First [OptionGroupOption])
     DescribeOptionGroupOptionsResponse
     [OptionGroupOption]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([OptionGroupOption]
 -> Const (First [OptionGroupOption]) [OptionGroupOption])
-> Maybe [OptionGroupOption]
-> Const (First [OptionGroupOption]) (Maybe [OptionGroupOption])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeOptionGroupOptions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeOptionGroupOptions -> Maybe DescribeOptionGroupOptions
forall a. a -> Maybe a
Prelude.Just (DescribeOptionGroupOptions -> Maybe DescribeOptionGroupOptions)
-> DescribeOptionGroupOptions -> Maybe DescribeOptionGroupOptions
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeOptionGroupOptions
rq
          DescribeOptionGroupOptions
-> (DescribeOptionGroupOptions -> DescribeOptionGroupOptions)
-> DescribeOptionGroupOptions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeOptionGroupOptions
-> Identity DescribeOptionGroupOptions
Lens
  DescribeOptionGroupOptions
  DescribeOptionGroupOptions
  (Maybe Text)
  (Maybe Text)
describeOptionGroupOptions_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeOptionGroupOptions
 -> Identity DescribeOptionGroupOptions)
-> Maybe Text
-> DescribeOptionGroupOptions
-> DescribeOptionGroupOptions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeOptionGroupOptions
DescribeOptionGroupOptionsResponse
rs
          DescribeOptionGroupOptionsResponse
-> Getting (First Text) DescribeOptionGroupOptionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeOptionGroupOptionsResponse
-> Const (First Text) DescribeOptionGroupOptionsResponse
Lens' DescribeOptionGroupOptionsResponse (Maybe Text)
describeOptionGroupOptionsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeOptionGroupOptionsResponse
 -> Const (First Text) DescribeOptionGroupOptionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeOptionGroupOptionsResponse 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 DescribeOptionGroupOptions where
  type
    AWSResponse DescribeOptionGroupOptions =
      DescribeOptionGroupOptionsResponse
  request :: DescribeOptionGroupOptions -> Request DescribeOptionGroupOptions
request = Service
-> DescribeOptionGroupOptions -> Request DescribeOptionGroupOptions
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeOptionGroupOptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeOptionGroupOptions)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeOptionGroupOptions))
-> Logger
-> Service
-> Proxy DescribeOptionGroupOptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeOptionGroupOptions)))
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
"DescribeOptionGroupOptionsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [OptionGroupOption]
-> Maybe Text -> Int -> DescribeOptionGroupOptionsResponse
DescribeOptionGroupOptionsResponse'
            (Maybe [OptionGroupOption]
 -> Maybe Text -> Int -> DescribeOptionGroupOptionsResponse)
-> Either String (Maybe [OptionGroupOption])
-> Either
     String (Maybe Text -> Int -> DescribeOptionGroupOptionsResponse)
forall (f :: * -> *) a b. Functor 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
"OptionGroupOptions"
                            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 [OptionGroupOption]))
-> Either String (Maybe [OptionGroupOption])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [OptionGroupOption])
-> [Node] -> Either String (Maybe [OptionGroupOption])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [OptionGroupOption]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"OptionGroupOption")
                        )
            Either
  String (Maybe Text -> Int -> DescribeOptionGroupOptionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeOptionGroupOptionsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> DescribeOptionGroupOptionsResponse)
-> Either String Int
-> Either String DescribeOptionGroupOptionsResponse
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 DescribeOptionGroupOptions

instance Prelude.NFData DescribeOptionGroupOptions

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

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

instance Core.ToQuery DescribeOptionGroupOptions where
  toQuery :: DescribeOptionGroupOptions -> QueryString
toQuery DescribeOptionGroupOptions' {Maybe Int
Maybe [Filter]
Maybe Text
Text
engineName :: Text
maxRecords :: Maybe Int
marker :: Maybe Text
majorEngineVersion :: Maybe Text
filters :: Maybe [Filter]
$sel:engineName:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Text
$sel:maxRecords:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Maybe Int
$sel:marker:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Maybe Text
$sel:majorEngineVersion:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> Maybe Text
$sel:filters:DescribeOptionGroupOptions' :: DescribeOptionGroupOptions -> 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
"DescribeOptionGroupOptions" :: 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
"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
"EngineName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
engineName
      ]

-- |
--
-- /See:/ 'newDescribeOptionGroupOptionsResponse' smart constructor.
data DescribeOptionGroupOptionsResponse = DescribeOptionGroupOptionsResponse'
  { DescribeOptionGroupOptionsResponse -> Maybe [OptionGroupOption]
optionGroupOptions :: Prelude.Maybe [OptionGroupOption],
    -- | 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@.
    DescribeOptionGroupOptionsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeOptionGroupOptionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeOptionGroupOptionsResponse
-> DescribeOptionGroupOptionsResponse -> Bool
(DescribeOptionGroupOptionsResponse
 -> DescribeOptionGroupOptionsResponse -> Bool)
-> (DescribeOptionGroupOptionsResponse
    -> DescribeOptionGroupOptionsResponse -> Bool)
-> Eq DescribeOptionGroupOptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOptionGroupOptionsResponse
-> DescribeOptionGroupOptionsResponse -> Bool
$c/= :: DescribeOptionGroupOptionsResponse
-> DescribeOptionGroupOptionsResponse -> Bool
== :: DescribeOptionGroupOptionsResponse
-> DescribeOptionGroupOptionsResponse -> Bool
$c== :: DescribeOptionGroupOptionsResponse
-> DescribeOptionGroupOptionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeOptionGroupOptionsResponse]
ReadPrec DescribeOptionGroupOptionsResponse
Int -> ReadS DescribeOptionGroupOptionsResponse
ReadS [DescribeOptionGroupOptionsResponse]
(Int -> ReadS DescribeOptionGroupOptionsResponse)
-> ReadS [DescribeOptionGroupOptionsResponse]
-> ReadPrec DescribeOptionGroupOptionsResponse
-> ReadPrec [DescribeOptionGroupOptionsResponse]
-> Read DescribeOptionGroupOptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOptionGroupOptionsResponse]
$creadListPrec :: ReadPrec [DescribeOptionGroupOptionsResponse]
readPrec :: ReadPrec DescribeOptionGroupOptionsResponse
$creadPrec :: ReadPrec DescribeOptionGroupOptionsResponse
readList :: ReadS [DescribeOptionGroupOptionsResponse]
$creadList :: ReadS [DescribeOptionGroupOptionsResponse]
readsPrec :: Int -> ReadS DescribeOptionGroupOptionsResponse
$creadsPrec :: Int -> ReadS DescribeOptionGroupOptionsResponse
Prelude.Read, Int -> DescribeOptionGroupOptionsResponse -> ShowS
[DescribeOptionGroupOptionsResponse] -> ShowS
DescribeOptionGroupOptionsResponse -> String
(Int -> DescribeOptionGroupOptionsResponse -> ShowS)
-> (DescribeOptionGroupOptionsResponse -> String)
-> ([DescribeOptionGroupOptionsResponse] -> ShowS)
-> Show DescribeOptionGroupOptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOptionGroupOptionsResponse] -> ShowS
$cshowList :: [DescribeOptionGroupOptionsResponse] -> ShowS
show :: DescribeOptionGroupOptionsResponse -> String
$cshow :: DescribeOptionGroupOptionsResponse -> String
showsPrec :: Int -> DescribeOptionGroupOptionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeOptionGroupOptionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeOptionGroupOptionsResponse
 -> Rep DescribeOptionGroupOptionsResponse x)
-> (forall x.
    Rep DescribeOptionGroupOptionsResponse x
    -> DescribeOptionGroupOptionsResponse)
-> Generic DescribeOptionGroupOptionsResponse
forall x.
Rep DescribeOptionGroupOptionsResponse x
-> DescribeOptionGroupOptionsResponse
forall x.
DescribeOptionGroupOptionsResponse
-> Rep DescribeOptionGroupOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeOptionGroupOptionsResponse x
-> DescribeOptionGroupOptionsResponse
$cfrom :: forall x.
DescribeOptionGroupOptionsResponse
-> Rep DescribeOptionGroupOptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeOptionGroupOptionsResponse' 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:
--
-- 'optionGroupOptions', 'describeOptionGroupOptionsResponse_optionGroupOptions' - Undocumented member.
--
-- 'marker', 'describeOptionGroupOptionsResponse_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@.
--
-- 'httpStatus', 'describeOptionGroupOptionsResponse_httpStatus' - The response's http status code.
newDescribeOptionGroupOptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeOptionGroupOptionsResponse
newDescribeOptionGroupOptionsResponse :: Int -> DescribeOptionGroupOptionsResponse
newDescribeOptionGroupOptionsResponse Int
pHttpStatus_ =
  DescribeOptionGroupOptionsResponse' :: Maybe [OptionGroupOption]
-> Maybe Text -> Int -> DescribeOptionGroupOptionsResponse
DescribeOptionGroupOptionsResponse'
    { $sel:optionGroupOptions:DescribeOptionGroupOptionsResponse' :: Maybe [OptionGroupOption]
optionGroupOptions =
        Maybe [OptionGroupOption]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeOptionGroupOptionsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeOptionGroupOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
describeOptionGroupOptionsResponse_optionGroupOptions :: Lens.Lens' DescribeOptionGroupOptionsResponse (Prelude.Maybe [OptionGroupOption])
describeOptionGroupOptionsResponse_optionGroupOptions :: (Maybe [OptionGroupOption] -> f (Maybe [OptionGroupOption]))
-> DescribeOptionGroupOptionsResponse
-> f DescribeOptionGroupOptionsResponse
describeOptionGroupOptionsResponse_optionGroupOptions = (DescribeOptionGroupOptionsResponse -> Maybe [OptionGroupOption])
-> (DescribeOptionGroupOptionsResponse
    -> Maybe [OptionGroupOption] -> DescribeOptionGroupOptionsResponse)
-> Lens'
     DescribeOptionGroupOptionsResponse (Maybe [OptionGroupOption])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupOptionsResponse' {Maybe [OptionGroupOption]
optionGroupOptions :: Maybe [OptionGroupOption]
$sel:optionGroupOptions:DescribeOptionGroupOptionsResponse' :: DescribeOptionGroupOptionsResponse -> Maybe [OptionGroupOption]
optionGroupOptions} -> Maybe [OptionGroupOption]
optionGroupOptions) (\s :: DescribeOptionGroupOptionsResponse
s@DescribeOptionGroupOptionsResponse' {} Maybe [OptionGroupOption]
a -> DescribeOptionGroupOptionsResponse
s {$sel:optionGroupOptions:DescribeOptionGroupOptionsResponse' :: Maybe [OptionGroupOption]
optionGroupOptions = Maybe [OptionGroupOption]
a} :: DescribeOptionGroupOptionsResponse) ((Maybe [OptionGroupOption] -> f (Maybe [OptionGroupOption]))
 -> DescribeOptionGroupOptionsResponse
 -> f DescribeOptionGroupOptionsResponse)
-> ((Maybe [OptionGroupOption] -> f (Maybe [OptionGroupOption]))
    -> Maybe [OptionGroupOption] -> f (Maybe [OptionGroupOption]))
-> (Maybe [OptionGroupOption] -> f (Maybe [OptionGroupOption]))
-> DescribeOptionGroupOptionsResponse
-> f DescribeOptionGroupOptionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OptionGroupOption]
  [OptionGroupOption]
  [OptionGroupOption]
  [OptionGroupOption]
-> Iso
     (Maybe [OptionGroupOption])
     (Maybe [OptionGroupOption])
     (Maybe [OptionGroupOption])
     (Maybe [OptionGroupOption])
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
  [OptionGroupOption]
  [OptionGroupOption]
  [OptionGroupOption]
  [OptionGroupOption]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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@.
describeOptionGroupOptionsResponse_marker :: Lens.Lens' DescribeOptionGroupOptionsResponse (Prelude.Maybe Prelude.Text)
describeOptionGroupOptionsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeOptionGroupOptionsResponse
-> f DescribeOptionGroupOptionsResponse
describeOptionGroupOptionsResponse_marker = (DescribeOptionGroupOptionsResponse -> Maybe Text)
-> (DescribeOptionGroupOptionsResponse
    -> Maybe Text -> DescribeOptionGroupOptionsResponse)
-> Lens' DescribeOptionGroupOptionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOptionGroupOptionsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeOptionGroupOptionsResponse' :: DescribeOptionGroupOptionsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeOptionGroupOptionsResponse
s@DescribeOptionGroupOptionsResponse' {} Maybe Text
a -> DescribeOptionGroupOptionsResponse
s {$sel:marker:DescribeOptionGroupOptionsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeOptionGroupOptionsResponse)

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

instance
  Prelude.NFData
    DescribeOptionGroupOptionsResponse