{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WAFV2.Types.IPAddressVersion
-- 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.WAFV2.Types.IPAddressVersion
  ( IPAddressVersion
      ( ..,
        IPAddressVersion_IPV4,
        IPAddressVersion_IPV6
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

newtype IPAddressVersion = IPAddressVersion'
  { IPAddressVersion -> Text
fromIPAddressVersion ::
      Data.Text
  }
  deriving stock
    ( Int -> IPAddressVersion -> ShowS
[IPAddressVersion] -> ShowS
IPAddressVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IPAddressVersion] -> ShowS
$cshowList :: [IPAddressVersion] -> ShowS
show :: IPAddressVersion -> String
$cshow :: IPAddressVersion -> String
showsPrec :: Int -> IPAddressVersion -> ShowS
$cshowsPrec :: Int -> IPAddressVersion -> ShowS
Prelude.Show,
      ReadPrec [IPAddressVersion]
ReadPrec IPAddressVersion
Int -> ReadS IPAddressVersion
ReadS [IPAddressVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IPAddressVersion]
$creadListPrec :: ReadPrec [IPAddressVersion]
readPrec :: ReadPrec IPAddressVersion
$creadPrec :: ReadPrec IPAddressVersion
readList :: ReadS [IPAddressVersion]
$creadList :: ReadS [IPAddressVersion]
readsPrec :: Int -> ReadS IPAddressVersion
$creadsPrec :: Int -> ReadS IPAddressVersion
Prelude.Read,
      IPAddressVersion -> IPAddressVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IPAddressVersion -> IPAddressVersion -> Bool
$c/= :: IPAddressVersion -> IPAddressVersion -> Bool
== :: IPAddressVersion -> IPAddressVersion -> Bool
$c== :: IPAddressVersion -> IPAddressVersion -> Bool
Prelude.Eq,
      Eq IPAddressVersion
IPAddressVersion -> IPAddressVersion -> Bool
IPAddressVersion -> IPAddressVersion -> Ordering
IPAddressVersion -> IPAddressVersion -> IPAddressVersion
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: IPAddressVersion -> IPAddressVersion -> IPAddressVersion
$cmin :: IPAddressVersion -> IPAddressVersion -> IPAddressVersion
max :: IPAddressVersion -> IPAddressVersion -> IPAddressVersion
$cmax :: IPAddressVersion -> IPAddressVersion -> IPAddressVersion
>= :: IPAddressVersion -> IPAddressVersion -> Bool
$c>= :: IPAddressVersion -> IPAddressVersion -> Bool
> :: IPAddressVersion -> IPAddressVersion -> Bool
$c> :: IPAddressVersion -> IPAddressVersion -> Bool
<= :: IPAddressVersion -> IPAddressVersion -> Bool
$c<= :: IPAddressVersion -> IPAddressVersion -> Bool
< :: IPAddressVersion -> IPAddressVersion -> Bool
$c< :: IPAddressVersion -> IPAddressVersion -> Bool
compare :: IPAddressVersion -> IPAddressVersion -> Ordering
$ccompare :: IPAddressVersion -> IPAddressVersion -> Ordering
Prelude.Ord,
      forall x. Rep IPAddressVersion x -> IPAddressVersion
forall x. IPAddressVersion -> Rep IPAddressVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IPAddressVersion x -> IPAddressVersion
$cfrom :: forall x. IPAddressVersion -> Rep IPAddressVersion x
Prelude.Generic
    )
  deriving newtype
    ( Eq IPAddressVersion
Int -> IPAddressVersion -> Int
IPAddressVersion -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: IPAddressVersion -> Int
$chash :: IPAddressVersion -> Int
hashWithSalt :: Int -> IPAddressVersion -> Int
$chashWithSalt :: Int -> IPAddressVersion -> Int
Prelude.Hashable,
      IPAddressVersion -> ()
forall a. (a -> ()) -> NFData a
rnf :: IPAddressVersion -> ()
$crnf :: IPAddressVersion -> ()
Prelude.NFData,
      Text -> Either String IPAddressVersion
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String IPAddressVersion
$cfromText :: Text -> Either String IPAddressVersion
Data.FromText,
      IPAddressVersion -> Text
forall a. (a -> Text) -> ToText a
toText :: IPAddressVersion -> Text
$ctoText :: IPAddressVersion -> Text
Data.ToText,
      IPAddressVersion -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: IPAddressVersion -> ByteString
$ctoBS :: IPAddressVersion -> ByteString
Data.ToByteString,
      IPAddressVersion -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: IPAddressVersion -> ByteStringBuilder
$cbuild :: IPAddressVersion -> ByteStringBuilder
Data.ToLog,
      HeaderName -> IPAddressVersion -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> IPAddressVersion -> [Header]
$ctoHeader :: HeaderName -> IPAddressVersion -> [Header]
Data.ToHeader,
      IPAddressVersion -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: IPAddressVersion -> QueryString
$ctoQuery :: IPAddressVersion -> QueryString
Data.ToQuery,
      Value -> Parser [IPAddressVersion]
Value -> Parser IPAddressVersion
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [IPAddressVersion]
$cparseJSONList :: Value -> Parser [IPAddressVersion]
parseJSON :: Value -> Parser IPAddressVersion
$cparseJSON :: Value -> Parser IPAddressVersion
Data.FromJSON,
      FromJSONKeyFunction [IPAddressVersion]
FromJSONKeyFunction IPAddressVersion
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [IPAddressVersion]
$cfromJSONKeyList :: FromJSONKeyFunction [IPAddressVersion]
fromJSONKey :: FromJSONKeyFunction IPAddressVersion
$cfromJSONKey :: FromJSONKeyFunction IPAddressVersion
Data.FromJSONKey,
      [IPAddressVersion] -> Encoding
[IPAddressVersion] -> Value
IPAddressVersion -> Encoding
IPAddressVersion -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [IPAddressVersion] -> Encoding
$ctoEncodingList :: [IPAddressVersion] -> Encoding
toJSONList :: [IPAddressVersion] -> Value
$ctoJSONList :: [IPAddressVersion] -> Value
toEncoding :: IPAddressVersion -> Encoding
$ctoEncoding :: IPAddressVersion -> Encoding
toJSON :: IPAddressVersion -> Value
$ctoJSON :: IPAddressVersion -> Value
Data.ToJSON,
      ToJSONKeyFunction [IPAddressVersion]
ToJSONKeyFunction IPAddressVersion
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [IPAddressVersion]
$ctoJSONKeyList :: ToJSONKeyFunction [IPAddressVersion]
toJSONKey :: ToJSONKeyFunction IPAddressVersion
$ctoJSONKey :: ToJSONKeyFunction IPAddressVersion
Data.ToJSONKey,
      [Node] -> Either String IPAddressVersion
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String IPAddressVersion
$cparseXML :: [Node] -> Either String IPAddressVersion
Data.FromXML,
      IPAddressVersion -> XML
forall a. (a -> XML) -> ToXML a
toXML :: IPAddressVersion -> XML
$ctoXML :: IPAddressVersion -> XML
Data.ToXML
    )

pattern IPAddressVersion_IPV4 :: IPAddressVersion
pattern $bIPAddressVersion_IPV4 :: IPAddressVersion
$mIPAddressVersion_IPV4 :: forall {r}. IPAddressVersion -> ((# #) -> r) -> ((# #) -> r) -> r
IPAddressVersion_IPV4 = IPAddressVersion' "IPV4"

pattern IPAddressVersion_IPV6 :: IPAddressVersion
pattern $bIPAddressVersion_IPV6 :: IPAddressVersion
$mIPAddressVersion_IPV6 :: forall {r}. IPAddressVersion -> ((# #) -> r) -> ((# #) -> r) -> r
IPAddressVersion_IPV6 = IPAddressVersion' "IPV6"

{-# COMPLETE
  IPAddressVersion_IPV4,
  IPAddressVersion_IPV6,
  IPAddressVersion'
  #-}