{-# 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.NetworkInterfaceCountRequest
-- 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.NetworkInterfaceCountRequest 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

-- | The minimum and maximum number of network interfaces.
--
-- /See:/ 'newNetworkInterfaceCountRequest' smart constructor.
data NetworkInterfaceCountRequest = NetworkInterfaceCountRequest'
  { -- | The maximum number of network interfaces. To specify no maximum limit,
    -- omit this parameter.
    NetworkInterfaceCountRequest -> Maybe Int
max :: Prelude.Maybe Prelude.Int,
    -- | The minimum number of network interfaces. To specify no minimum limit,
    -- omit this parameter.
    NetworkInterfaceCountRequest -> Maybe Int
min :: Prelude.Maybe Prelude.Int
  }
  deriving (NetworkInterfaceCountRequest
-> NetworkInterfaceCountRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkInterfaceCountRequest
-> NetworkInterfaceCountRequest -> Bool
$c/= :: NetworkInterfaceCountRequest
-> NetworkInterfaceCountRequest -> Bool
== :: NetworkInterfaceCountRequest
-> NetworkInterfaceCountRequest -> Bool
$c== :: NetworkInterfaceCountRequest
-> NetworkInterfaceCountRequest -> Bool
Prelude.Eq, ReadPrec [NetworkInterfaceCountRequest]
ReadPrec NetworkInterfaceCountRequest
Int -> ReadS NetworkInterfaceCountRequest
ReadS [NetworkInterfaceCountRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkInterfaceCountRequest]
$creadListPrec :: ReadPrec [NetworkInterfaceCountRequest]
readPrec :: ReadPrec NetworkInterfaceCountRequest
$creadPrec :: ReadPrec NetworkInterfaceCountRequest
readList :: ReadS [NetworkInterfaceCountRequest]
$creadList :: ReadS [NetworkInterfaceCountRequest]
readsPrec :: Int -> ReadS NetworkInterfaceCountRequest
$creadsPrec :: Int -> ReadS NetworkInterfaceCountRequest
Prelude.Read, Int -> NetworkInterfaceCountRequest -> ShowS
[NetworkInterfaceCountRequest] -> ShowS
NetworkInterfaceCountRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkInterfaceCountRequest] -> ShowS
$cshowList :: [NetworkInterfaceCountRequest] -> ShowS
show :: NetworkInterfaceCountRequest -> String
$cshow :: NetworkInterfaceCountRequest -> String
showsPrec :: Int -> NetworkInterfaceCountRequest -> ShowS
$cshowsPrec :: Int -> NetworkInterfaceCountRequest -> ShowS
Prelude.Show, forall x.
Rep NetworkInterfaceCountRequest x -> NetworkInterfaceCountRequest
forall x.
NetworkInterfaceCountRequest -> Rep NetworkInterfaceCountRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NetworkInterfaceCountRequest x -> NetworkInterfaceCountRequest
$cfrom :: forall x.
NetworkInterfaceCountRequest -> Rep NetworkInterfaceCountRequest x
Prelude.Generic)

-- |
-- Create a value of 'NetworkInterfaceCountRequest' 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:
--
-- 'max', 'networkInterfaceCountRequest_max' - The maximum number of network interfaces. To specify no maximum limit,
-- omit this parameter.
--
-- 'min', 'networkInterfaceCountRequest_min' - The minimum number of network interfaces. To specify no minimum limit,
-- omit this parameter.
newNetworkInterfaceCountRequest ::
  NetworkInterfaceCountRequest
newNetworkInterfaceCountRequest :: NetworkInterfaceCountRequest
newNetworkInterfaceCountRequest =
  NetworkInterfaceCountRequest'
    { $sel:max:NetworkInterfaceCountRequest' :: Maybe Int
max =
        forall a. Maybe a
Prelude.Nothing,
      $sel:min:NetworkInterfaceCountRequest' :: Maybe Int
min = forall a. Maybe a
Prelude.Nothing
    }

-- | The maximum number of network interfaces. To specify no maximum limit,
-- omit this parameter.
networkInterfaceCountRequest_max :: Lens.Lens' NetworkInterfaceCountRequest (Prelude.Maybe Prelude.Int)
networkInterfaceCountRequest_max :: Lens' NetworkInterfaceCountRequest (Maybe Int)
networkInterfaceCountRequest_max = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInterfaceCountRequest' {Maybe Int
max :: Maybe Int
$sel:max:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
max} -> Maybe Int
max) (\s :: NetworkInterfaceCountRequest
s@NetworkInterfaceCountRequest' {} Maybe Int
a -> NetworkInterfaceCountRequest
s {$sel:max:NetworkInterfaceCountRequest' :: Maybe Int
max = Maybe Int
a} :: NetworkInterfaceCountRequest)

-- | The minimum number of network interfaces. To specify no minimum limit,
-- omit this parameter.
networkInterfaceCountRequest_min :: Lens.Lens' NetworkInterfaceCountRequest (Prelude.Maybe Prelude.Int)
networkInterfaceCountRequest_min :: Lens' NetworkInterfaceCountRequest (Maybe Int)
networkInterfaceCountRequest_min = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInterfaceCountRequest' {Maybe Int
min :: Maybe Int
$sel:min:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
min} -> Maybe Int
min) (\s :: NetworkInterfaceCountRequest
s@NetworkInterfaceCountRequest' {} Maybe Int
a -> NetworkInterfaceCountRequest
s {$sel:min:NetworkInterfaceCountRequest' :: Maybe Int
min = Maybe Int
a} :: NetworkInterfaceCountRequest)

instance
  Prelude.Hashable
    NetworkInterfaceCountRequest
  where
  hashWithSalt :: Int -> NetworkInterfaceCountRequest -> Int
hashWithSalt Int
_salt NetworkInterfaceCountRequest' {Maybe Int
min :: Maybe Int
max :: Maybe Int
$sel:min:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
$sel:max:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
max
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
min

instance Prelude.NFData NetworkInterfaceCountRequest where
  rnf :: NetworkInterfaceCountRequest -> ()
rnf NetworkInterfaceCountRequest' {Maybe Int
min :: Maybe Int
max :: Maybe Int
$sel:min:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
$sel:max:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
max seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
min

instance Data.ToQuery NetworkInterfaceCountRequest where
  toQuery :: NetworkInterfaceCountRequest -> QueryString
toQuery NetworkInterfaceCountRequest' {Maybe Int
min :: Maybe Int
max :: Maybe Int
$sel:min:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
$sel:max:NetworkInterfaceCountRequest' :: NetworkInterfaceCountRequest -> Maybe Int
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"Max" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
max, ByteString
"Min" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
min]