{-# 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.IoTWireless.Types.BatteryLevel
-- 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.IoTWireless.Types.BatteryLevel
  ( BatteryLevel
      ( ..,
        BatteryLevel_Critical,
        BatteryLevel_Low,
        BatteryLevel_Normal
      ),
  )
where

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

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

pattern BatteryLevel_Critical :: BatteryLevel
pattern $bBatteryLevel_Critical :: BatteryLevel
$mBatteryLevel_Critical :: forall r. BatteryLevel -> (Void# -> r) -> (Void# -> r) -> r
BatteryLevel_Critical = BatteryLevel' "critical"

pattern BatteryLevel_Low :: BatteryLevel
pattern $bBatteryLevel_Low :: BatteryLevel
$mBatteryLevel_Low :: forall r. BatteryLevel -> (Void# -> r) -> (Void# -> r) -> r
BatteryLevel_Low = BatteryLevel' "low"

pattern BatteryLevel_Normal :: BatteryLevel
pattern $bBatteryLevel_Normal :: BatteryLevel
$mBatteryLevel_Normal :: forall r. BatteryLevel -> (Void# -> r) -> (Void# -> r) -> r
BatteryLevel_Normal = BatteryLevel' "normal"

{-# COMPLETE
  BatteryLevel_Critical,
  BatteryLevel_Low,
  BatteryLevel_Normal,
  BatteryLevel'
  #-}