{-# 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.EC2.DescribeDhcpOptions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes one or more of your DHCP options sets.
--
-- For more information, see
-- <https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html DHCP options sets>
-- in the /Amazon Virtual Private Cloud User Guide/.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeDhcpOptions
  ( -- * Creating a Request
    DescribeDhcpOptions (..),
    newDescribeDhcpOptions,

    -- * Request Lenses
    describeDhcpOptions_dhcpOptionsIds,
    describeDhcpOptions_dryRun,
    describeDhcpOptions_filters,
    describeDhcpOptions_maxResults,
    describeDhcpOptions_nextToken,

    -- * Destructuring the Response
    DescribeDhcpOptionsResponse (..),
    newDescribeDhcpOptionsResponse,

    -- * Response Lenses
    describeDhcpOptionsResponse_dhcpOptions,
    describeDhcpOptionsResponse_nextToken,
    describeDhcpOptionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeDhcpOptions' smart constructor.
data DescribeDhcpOptions = DescribeDhcpOptions'
  { -- | The IDs of one or more DHCP options sets.
    --
    -- Default: Describes all your DHCP options sets.
    DescribeDhcpOptions -> Maybe [Text]
dhcpOptionsIds :: Prelude.Maybe [Prelude.Text],
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribeDhcpOptions -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @dhcp-options-id@ - The ID of a DHCP options set.
    --
    -- -   @key@ - The key for one of the options (for example, @domain-name@).
    --
    -- -   @value@ - The value for one of the options.
    --
    -- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
    --     DHCP options set.
    --
    -- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
    --     resource. Use the tag key in the filter name and the tag value as
    --     the filter value. For example, to find all resources that have a tag
    --     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
    --     the filter name and @TeamA@ for the filter value.
    --
    -- -   @tag-key@ - The key of a tag assigned to the resource. Use this
    --     filter to find all resources assigned a tag with a specific key,
    --     regardless of the tag value.
    DescribeDhcpOptions -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    DescribeDhcpOptions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeDhcpOptions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeDhcpOptions -> DescribeDhcpOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDhcpOptions -> DescribeDhcpOptions -> Bool
$c/= :: DescribeDhcpOptions -> DescribeDhcpOptions -> Bool
== :: DescribeDhcpOptions -> DescribeDhcpOptions -> Bool
$c== :: DescribeDhcpOptions -> DescribeDhcpOptions -> Bool
Prelude.Eq, ReadPrec [DescribeDhcpOptions]
ReadPrec DescribeDhcpOptions
Int -> ReadS DescribeDhcpOptions
ReadS [DescribeDhcpOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDhcpOptions]
$creadListPrec :: ReadPrec [DescribeDhcpOptions]
readPrec :: ReadPrec DescribeDhcpOptions
$creadPrec :: ReadPrec DescribeDhcpOptions
readList :: ReadS [DescribeDhcpOptions]
$creadList :: ReadS [DescribeDhcpOptions]
readsPrec :: Int -> ReadS DescribeDhcpOptions
$creadsPrec :: Int -> ReadS DescribeDhcpOptions
Prelude.Read, Int -> DescribeDhcpOptions -> ShowS
[DescribeDhcpOptions] -> ShowS
DescribeDhcpOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDhcpOptions] -> ShowS
$cshowList :: [DescribeDhcpOptions] -> ShowS
show :: DescribeDhcpOptions -> String
$cshow :: DescribeDhcpOptions -> String
showsPrec :: Int -> DescribeDhcpOptions -> ShowS
$cshowsPrec :: Int -> DescribeDhcpOptions -> ShowS
Prelude.Show, forall x. Rep DescribeDhcpOptions x -> DescribeDhcpOptions
forall x. DescribeDhcpOptions -> Rep DescribeDhcpOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDhcpOptions x -> DescribeDhcpOptions
$cfrom :: forall x. DescribeDhcpOptions -> Rep DescribeDhcpOptions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDhcpOptions' 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:
--
-- 'dhcpOptionsIds', 'describeDhcpOptions_dhcpOptionsIds' - The IDs of one or more DHCP options sets.
--
-- Default: Describes all your DHCP options sets.
--
-- 'dryRun', 'describeDhcpOptions_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeDhcpOptions_filters' - One or more filters.
--
-- -   @dhcp-options-id@ - The ID of a DHCP options set.
--
-- -   @key@ - The key for one of the options (for example, @domain-name@).
--
-- -   @value@ - The value for one of the options.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     DHCP options set.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- 'maxResults', 'describeDhcpOptions_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- 'nextToken', 'describeDhcpOptions_nextToken' - The token for the next page of results.
newDescribeDhcpOptions ::
  DescribeDhcpOptions
newDescribeDhcpOptions :: DescribeDhcpOptions
newDescribeDhcpOptions =
  DescribeDhcpOptions'
    { $sel:dhcpOptionsIds:DescribeDhcpOptions' :: Maybe [Text]
dhcpOptionsIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:DescribeDhcpOptions' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeDhcpOptions' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeDhcpOptions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeDhcpOptions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The IDs of one or more DHCP options sets.
--
-- Default: Describes all your DHCP options sets.
describeDhcpOptions_dhcpOptionsIds :: Lens.Lens' DescribeDhcpOptions (Prelude.Maybe [Prelude.Text])
describeDhcpOptions_dhcpOptionsIds :: Lens' DescribeDhcpOptions (Maybe [Text])
describeDhcpOptions_dhcpOptionsIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDhcpOptions' {Maybe [Text]
dhcpOptionsIds :: Maybe [Text]
$sel:dhcpOptionsIds:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Text]
dhcpOptionsIds} -> Maybe [Text]
dhcpOptionsIds) (\s :: DescribeDhcpOptions
s@DescribeDhcpOptions' {} Maybe [Text]
a -> DescribeDhcpOptions
s {$sel:dhcpOptionsIds:DescribeDhcpOptions' :: Maybe [Text]
dhcpOptionsIds = Maybe [Text]
a} :: DescribeDhcpOptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeDhcpOptions_dryRun :: Lens.Lens' DescribeDhcpOptions (Prelude.Maybe Prelude.Bool)
describeDhcpOptions_dryRun :: Lens' DescribeDhcpOptions (Maybe Bool)
describeDhcpOptions_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDhcpOptions' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeDhcpOptions
s@DescribeDhcpOptions' {} Maybe Bool
a -> DescribeDhcpOptions
s {$sel:dryRun:DescribeDhcpOptions' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeDhcpOptions)

-- | One or more filters.
--
-- -   @dhcp-options-id@ - The ID of a DHCP options set.
--
-- -   @key@ - The key for one of the options (for example, @domain-name@).
--
-- -   @value@ - The value for one of the options.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     DHCP options set.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
describeDhcpOptions_filters :: Lens.Lens' DescribeDhcpOptions (Prelude.Maybe [Filter])
describeDhcpOptions_filters :: Lens' DescribeDhcpOptions (Maybe [Filter])
describeDhcpOptions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDhcpOptions' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeDhcpOptions
s@DescribeDhcpOptions' {} Maybe [Filter]
a -> DescribeDhcpOptions
s {$sel:filters:DescribeDhcpOptions' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeDhcpOptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
describeDhcpOptions_maxResults :: Lens.Lens' DescribeDhcpOptions (Prelude.Maybe Prelude.Natural)
describeDhcpOptions_maxResults :: Lens' DescribeDhcpOptions (Maybe Natural)
describeDhcpOptions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDhcpOptions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeDhcpOptions
s@DescribeDhcpOptions' {} Maybe Natural
a -> DescribeDhcpOptions
s {$sel:maxResults:DescribeDhcpOptions' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeDhcpOptions)

-- | The token for the next page of results.
describeDhcpOptions_nextToken :: Lens.Lens' DescribeDhcpOptions (Prelude.Maybe Prelude.Text)
describeDhcpOptions_nextToken :: Lens' DescribeDhcpOptions (Maybe Text)
describeDhcpOptions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDhcpOptions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDhcpOptions
s@DescribeDhcpOptions' {} Maybe Text
a -> DescribeDhcpOptions
s {$sel:nextToken:DescribeDhcpOptions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDhcpOptions)

instance Core.AWSPager DescribeDhcpOptions where
  page :: DescribeDhcpOptions
-> AWSResponse DescribeDhcpOptions -> Maybe DescribeDhcpOptions
page DescribeDhcpOptions
rq AWSResponse DescribeDhcpOptions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDhcpOptions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDhcpOptionsResponse (Maybe Text)
describeDhcpOptionsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDhcpOptions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDhcpOptionsResponse (Maybe [DhcpOptions])
describeDhcpOptionsResponse_dhcpOptions
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeDhcpOptions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeDhcpOptions (Maybe Text)
describeDhcpOptions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDhcpOptions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDhcpOptionsResponse (Maybe Text)
describeDhcpOptionsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeDhcpOptions where
  type
    AWSResponse DescribeDhcpOptions =
      DescribeDhcpOptionsResponse
  request :: (Service -> Service)
-> DescribeDhcpOptions -> Request DescribeDhcpOptions
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeDhcpOptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDhcpOptions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [DhcpOptions]
-> Maybe Text -> Int -> DescribeDhcpOptionsResponse
DescribeDhcpOptionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"dhcpOptionsSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeDhcpOptions where
  hashWithSalt :: Int -> DescribeDhcpOptions -> Int
hashWithSalt Int
_salt DescribeDhcpOptions' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
dhcpOptionsIds :: Maybe [Text]
$sel:nextToken:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Text
$sel:maxResults:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Natural
$sel:filters:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Filter]
$sel:dryRun:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Bool
$sel:dhcpOptionsIds:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
dhcpOptionsIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeDhcpOptions where
  rnf :: DescribeDhcpOptions -> ()
rnf DescribeDhcpOptions' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
dhcpOptionsIds :: Maybe [Text]
$sel:nextToken:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Text
$sel:maxResults:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Natural
$sel:filters:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Filter]
$sel:dryRun:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Bool
$sel:dhcpOptionsIds:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
dhcpOptionsIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

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

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

instance Data.ToQuery DescribeDhcpOptions where
  toQuery :: DescribeDhcpOptions -> QueryString
toQuery DescribeDhcpOptions' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
dhcpOptionsIds :: Maybe [Text]
$sel:nextToken:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Text
$sel:maxResults:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Natural
$sel:filters:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Filter]
$sel:dryRun:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe Bool
$sel:dhcpOptionsIds:DescribeDhcpOptions' :: DescribeDhcpOptions -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeDhcpOptions" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"DhcpOptionsId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
dhcpOptionsIds
          ),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newDescribeDhcpOptionsResponse' smart constructor.
data DescribeDhcpOptionsResponse = DescribeDhcpOptionsResponse'
  { -- | Information about one or more DHCP options sets.
    DescribeDhcpOptionsResponse -> Maybe [DhcpOptions]
dhcpOptions :: Prelude.Maybe [DhcpOptions],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeDhcpOptionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeDhcpOptionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDhcpOptionsResponse -> DescribeDhcpOptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDhcpOptionsResponse -> DescribeDhcpOptionsResponse -> Bool
$c/= :: DescribeDhcpOptionsResponse -> DescribeDhcpOptionsResponse -> Bool
== :: DescribeDhcpOptionsResponse -> DescribeDhcpOptionsResponse -> Bool
$c== :: DescribeDhcpOptionsResponse -> DescribeDhcpOptionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDhcpOptionsResponse]
ReadPrec DescribeDhcpOptionsResponse
Int -> ReadS DescribeDhcpOptionsResponse
ReadS [DescribeDhcpOptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDhcpOptionsResponse]
$creadListPrec :: ReadPrec [DescribeDhcpOptionsResponse]
readPrec :: ReadPrec DescribeDhcpOptionsResponse
$creadPrec :: ReadPrec DescribeDhcpOptionsResponse
readList :: ReadS [DescribeDhcpOptionsResponse]
$creadList :: ReadS [DescribeDhcpOptionsResponse]
readsPrec :: Int -> ReadS DescribeDhcpOptionsResponse
$creadsPrec :: Int -> ReadS DescribeDhcpOptionsResponse
Prelude.Read, Int -> DescribeDhcpOptionsResponse -> ShowS
[DescribeDhcpOptionsResponse] -> ShowS
DescribeDhcpOptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDhcpOptionsResponse] -> ShowS
$cshowList :: [DescribeDhcpOptionsResponse] -> ShowS
show :: DescribeDhcpOptionsResponse -> String
$cshow :: DescribeDhcpOptionsResponse -> String
showsPrec :: Int -> DescribeDhcpOptionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeDhcpOptionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeDhcpOptionsResponse x -> DescribeDhcpOptionsResponse
forall x.
DescribeDhcpOptionsResponse -> Rep DescribeDhcpOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDhcpOptionsResponse x -> DescribeDhcpOptionsResponse
$cfrom :: forall x.
DescribeDhcpOptionsResponse -> Rep DescribeDhcpOptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDhcpOptionsResponse' 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:
--
-- 'dhcpOptions', 'describeDhcpOptionsResponse_dhcpOptions' - Information about one or more DHCP options sets.
--
-- 'nextToken', 'describeDhcpOptionsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeDhcpOptionsResponse_httpStatus' - The response's http status code.
newDescribeDhcpOptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDhcpOptionsResponse
newDescribeDhcpOptionsResponse :: Int -> DescribeDhcpOptionsResponse
newDescribeDhcpOptionsResponse Int
pHttpStatus_ =
  DescribeDhcpOptionsResponse'
    { $sel:dhcpOptions:DescribeDhcpOptionsResponse' :: Maybe [DhcpOptions]
dhcpOptions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeDhcpOptionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDhcpOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about one or more DHCP options sets.
describeDhcpOptionsResponse_dhcpOptions :: Lens.Lens' DescribeDhcpOptionsResponse (Prelude.Maybe [DhcpOptions])
describeDhcpOptionsResponse_dhcpOptions :: Lens' DescribeDhcpOptionsResponse (Maybe [DhcpOptions])
describeDhcpOptionsResponse_dhcpOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDhcpOptionsResponse' {Maybe [DhcpOptions]
dhcpOptions :: Maybe [DhcpOptions]
$sel:dhcpOptions:DescribeDhcpOptionsResponse' :: DescribeDhcpOptionsResponse -> Maybe [DhcpOptions]
dhcpOptions} -> Maybe [DhcpOptions]
dhcpOptions) (\s :: DescribeDhcpOptionsResponse
s@DescribeDhcpOptionsResponse' {} Maybe [DhcpOptions]
a -> DescribeDhcpOptionsResponse
s {$sel:dhcpOptions:DescribeDhcpOptionsResponse' :: Maybe [DhcpOptions]
dhcpOptions = Maybe [DhcpOptions]
a} :: DescribeDhcpOptionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeDhcpOptionsResponse_nextToken :: Lens.Lens' DescribeDhcpOptionsResponse (Prelude.Maybe Prelude.Text)
describeDhcpOptionsResponse_nextToken :: Lens' DescribeDhcpOptionsResponse (Maybe Text)
describeDhcpOptionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDhcpOptionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDhcpOptionsResponse' :: DescribeDhcpOptionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDhcpOptionsResponse
s@DescribeDhcpOptionsResponse' {} Maybe Text
a -> DescribeDhcpOptionsResponse
s {$sel:nextToken:DescribeDhcpOptionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDhcpOptionsResponse)

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

instance Prelude.NFData DescribeDhcpOptionsResponse where
  rnf :: DescribeDhcpOptionsResponse -> ()
rnf DescribeDhcpOptionsResponse' {Int
Maybe [DhcpOptions]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
dhcpOptions :: Maybe [DhcpOptions]
$sel:httpStatus:DescribeDhcpOptionsResponse' :: DescribeDhcpOptionsResponse -> Int
$sel:nextToken:DescribeDhcpOptionsResponse' :: DescribeDhcpOptionsResponse -> Maybe Text
$sel:dhcpOptions:DescribeDhcpOptionsResponse' :: DescribeDhcpOptionsResponse -> Maybe [DhcpOptions]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DhcpOptions]
dhcpOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus