{-# 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.Pinpoint.Types.Duration
-- 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.Pinpoint.Types.Duration
  ( Duration
      ( ..,
        Duration_DAY_14,
        Duration_DAY_30,
        Duration_DAY_7,
        Duration_HR_24
      ),
  )
where

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

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

pattern Duration_DAY_14 :: Duration
pattern $bDuration_DAY_14 :: Duration
$mDuration_DAY_14 :: forall r. Duration -> (Void# -> r) -> (Void# -> r) -> r
Duration_DAY_14 = Duration' "DAY_14"

pattern Duration_DAY_30 :: Duration
pattern $bDuration_DAY_30 :: Duration
$mDuration_DAY_30 :: forall r. Duration -> (Void# -> r) -> (Void# -> r) -> r
Duration_DAY_30 = Duration' "DAY_30"

pattern Duration_DAY_7 :: Duration
pattern $bDuration_DAY_7 :: Duration
$mDuration_DAY_7 :: forall r. Duration -> (Void# -> r) -> (Void# -> r) -> r
Duration_DAY_7 = Duration' "DAY_7"

pattern Duration_HR_24 :: Duration
pattern $bDuration_HR_24 :: Duration
$mDuration_HR_24 :: forall r. Duration -> (Void# -> r) -> (Void# -> r) -> r
Duration_HR_24 = Duration' "HR_24"

{-# COMPLETE
  Duration_DAY_14,
  Duration_DAY_30,
  Duration_DAY_7,
  Duration_HR_24,
  Duration'
  #-}