{-# 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.Lightsail.Types.NetworkProtocol
-- 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)
module Amazonka.Lightsail.Types.NetworkProtocol
  ( NetworkProtocol
      ( ..,
        NetworkProtocol_All,
        NetworkProtocol_Icmp,
        NetworkProtocol_Tcp,
        NetworkProtocol_Udp
      ),
  )
where

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

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

pattern NetworkProtocol_All :: NetworkProtocol
pattern $bNetworkProtocol_All :: NetworkProtocol
$mNetworkProtocol_All :: forall r. NetworkProtocol -> (Void# -> r) -> (Void# -> r) -> r
NetworkProtocol_All = NetworkProtocol' "all"

pattern NetworkProtocol_Icmp :: NetworkProtocol
pattern $bNetworkProtocol_Icmp :: NetworkProtocol
$mNetworkProtocol_Icmp :: forall r. NetworkProtocol -> (Void# -> r) -> (Void# -> r) -> r
NetworkProtocol_Icmp = NetworkProtocol' "icmp"

pattern NetworkProtocol_Tcp :: NetworkProtocol
pattern $bNetworkProtocol_Tcp :: NetworkProtocol
$mNetworkProtocol_Tcp :: forall r. NetworkProtocol -> (Void# -> r) -> (Void# -> r) -> r
NetworkProtocol_Tcp = NetworkProtocol' "tcp"

pattern NetworkProtocol_Udp :: NetworkProtocol
pattern $bNetworkProtocol_Udp :: NetworkProtocol
$mNetworkProtocol_Udp :: forall r. NetworkProtocol -> (Void# -> r) -> (Void# -> r) -> r
NetworkProtocol_Udp = NetworkProtocol' "udp"

{-# COMPLETE
  NetworkProtocol_All,
  NetworkProtocol_Icmp,
  NetworkProtocol_Tcp,
  NetworkProtocol_Udp,
  NetworkProtocol'
  #-}