{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Sidewalk device battery level.
newtype BatteryLevel = BatteryLevel'
  { BatteryLevel -> Text
fromBatteryLevel ::
      Data.Text
  }
  deriving stock
    ( Int -> BatteryLevel -> ShowS
[BatteryLevel] -> ShowS
BatteryLevel -> String
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]
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
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
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
Prelude.Ord,
      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
    ( Eq BatteryLevel
Int -> BatteryLevel -> Int
BatteryLevel -> Int
forall a. Eq 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 -> ()
forall a. (a -> ()) -> NFData a
rnf :: BatteryLevel -> ()
$crnf :: BatteryLevel -> ()
Prelude.NFData,
      Text -> Either String BatteryLevel
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String BatteryLevel
$cfromText :: Text -> Either String BatteryLevel
Data.FromText,
      BatteryLevel -> Text
forall a. (a -> Text) -> ToText a
toText :: BatteryLevel -> Text
$ctoText :: BatteryLevel -> Text
Data.ToText,
      BatteryLevel -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: BatteryLevel -> ByteString
$ctoBS :: BatteryLevel -> ByteString
Data.ToByteString,
      BatteryLevel -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: BatteryLevel -> ByteStringBuilder
$cbuild :: BatteryLevel -> ByteStringBuilder
Data.ToLog,
      HeaderName -> BatteryLevel -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> BatteryLevel -> [Header]
$ctoHeader :: HeaderName -> BatteryLevel -> [Header]
Data.ToHeader,
      BatteryLevel -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: BatteryLevel -> QueryString
$ctoQuery :: BatteryLevel -> QueryString
Data.ToQuery,
      Value -> Parser [BatteryLevel]
Value -> Parser 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
Data.FromJSON,
      FromJSONKeyFunction [BatteryLevel]
FromJSONKeyFunction BatteryLevel
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [BatteryLevel]
$cfromJSONKeyList :: FromJSONKeyFunction [BatteryLevel]
fromJSONKey :: FromJSONKeyFunction BatteryLevel
$cfromJSONKey :: FromJSONKeyFunction BatteryLevel
Data.FromJSONKey,
      [BatteryLevel] -> Encoding
[BatteryLevel] -> Value
BatteryLevel -> Encoding
BatteryLevel -> Value
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
Data.ToJSON,
      ToJSONKeyFunction [BatteryLevel]
ToJSONKeyFunction BatteryLevel
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [BatteryLevel]
$ctoJSONKeyList :: ToJSONKeyFunction [BatteryLevel]
toJSONKey :: ToJSONKeyFunction BatteryLevel
$ctoJSONKey :: ToJSONKeyFunction BatteryLevel
Data.ToJSONKey,
      [Node] -> Either String BatteryLevel
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String BatteryLevel
$cparseXML :: [Node] -> Either String BatteryLevel
Data.FromXML,
      BatteryLevel -> XML
forall a. (a -> XML) -> ToXML a
toXML :: BatteryLevel -> XML
$ctoXML :: BatteryLevel -> XML
Data.ToXML
    )

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

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

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

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