{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.NewDhcpConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.NewDhcpConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | /See:/ 'newNewDhcpConfiguration' smart constructor.
data NewDhcpConfiguration = NewDhcpConfiguration'
  { NewDhcpConfiguration -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
    NewDhcpConfiguration -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text]
  }
  deriving (NewDhcpConfiguration -> NewDhcpConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewDhcpConfiguration -> NewDhcpConfiguration -> Bool
$c/= :: NewDhcpConfiguration -> NewDhcpConfiguration -> Bool
== :: NewDhcpConfiguration -> NewDhcpConfiguration -> Bool
$c== :: NewDhcpConfiguration -> NewDhcpConfiguration -> Bool
Prelude.Eq, ReadPrec [NewDhcpConfiguration]
ReadPrec NewDhcpConfiguration
Int -> ReadS NewDhcpConfiguration
ReadS [NewDhcpConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewDhcpConfiguration]
$creadListPrec :: ReadPrec [NewDhcpConfiguration]
readPrec :: ReadPrec NewDhcpConfiguration
$creadPrec :: ReadPrec NewDhcpConfiguration
readList :: ReadS [NewDhcpConfiguration]
$creadList :: ReadS [NewDhcpConfiguration]
readsPrec :: Int -> ReadS NewDhcpConfiguration
$creadsPrec :: Int -> ReadS NewDhcpConfiguration
Prelude.Read, Int -> NewDhcpConfiguration -> ShowS
[NewDhcpConfiguration] -> ShowS
NewDhcpConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewDhcpConfiguration] -> ShowS
$cshowList :: [NewDhcpConfiguration] -> ShowS
show :: NewDhcpConfiguration -> String
$cshow :: NewDhcpConfiguration -> String
showsPrec :: Int -> NewDhcpConfiguration -> ShowS
$cshowsPrec :: Int -> NewDhcpConfiguration -> ShowS
Prelude.Show, forall x. Rep NewDhcpConfiguration x -> NewDhcpConfiguration
forall x. NewDhcpConfiguration -> Rep NewDhcpConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NewDhcpConfiguration x -> NewDhcpConfiguration
$cfrom :: forall x. NewDhcpConfiguration -> Rep NewDhcpConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'NewDhcpConfiguration' 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:
--
-- 'key', 'newDhcpConfiguration_key' - Undocumented member.
--
-- 'values', 'newDhcpConfiguration_values' - Undocumented member.
newNewDhcpConfiguration ::
  NewDhcpConfiguration
newNewDhcpConfiguration :: NewDhcpConfiguration
newNewDhcpConfiguration =
  NewDhcpConfiguration'
    { $sel:key:NewDhcpConfiguration' :: Maybe Text
key = forall a. Maybe a
Prelude.Nothing,
      $sel:values:NewDhcpConfiguration' :: Maybe [Text]
values = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
newDhcpConfiguration_key :: Lens.Lens' NewDhcpConfiguration (Prelude.Maybe Prelude.Text)
newDhcpConfiguration_key :: Lens' NewDhcpConfiguration (Maybe Text)
newDhcpConfiguration_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewDhcpConfiguration' {Maybe Text
key :: Maybe Text
$sel:key:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe Text
key} -> Maybe Text
key) (\s :: NewDhcpConfiguration
s@NewDhcpConfiguration' {} Maybe Text
a -> NewDhcpConfiguration
s {$sel:key:NewDhcpConfiguration' :: Maybe Text
key = Maybe Text
a} :: NewDhcpConfiguration)

-- | Undocumented member.
newDhcpConfiguration_values :: Lens.Lens' NewDhcpConfiguration (Prelude.Maybe [Prelude.Text])
newDhcpConfiguration_values :: Lens' NewDhcpConfiguration (Maybe [Text])
newDhcpConfiguration_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewDhcpConfiguration' {Maybe [Text]
values :: Maybe [Text]
$sel:values:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: NewDhcpConfiguration
s@NewDhcpConfiguration' {} Maybe [Text]
a -> NewDhcpConfiguration
s {$sel:values:NewDhcpConfiguration' :: Maybe [Text]
values = Maybe [Text]
a} :: NewDhcpConfiguration) 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

instance Prelude.Hashable NewDhcpConfiguration where
  hashWithSalt :: Int -> NewDhcpConfiguration -> Int
hashWithSalt Int
_salt NewDhcpConfiguration' {Maybe [Text]
Maybe Text
values :: Maybe [Text]
key :: Maybe Text
$sel:values:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe [Text]
$sel:key:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
key
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
values

instance Prelude.NFData NewDhcpConfiguration where
  rnf :: NewDhcpConfiguration -> ()
rnf NewDhcpConfiguration' {Maybe [Text]
Maybe Text
values :: Maybe [Text]
key :: Maybe Text
$sel:values:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe [Text]
$sel:key:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
key seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
values

instance Data.ToQuery NewDhcpConfiguration where
  toQuery :: NewDhcpConfiguration -> QueryString
toQuery NewDhcpConfiguration' {Maybe [Text]
Maybe Text
values :: Maybe [Text]
key :: Maybe Text
$sel:values:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe [Text]
$sel:key:NewDhcpConfiguration' :: NewDhcpConfiguration -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Key" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
key,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Value" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
values)
      ]