{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.Chime.Types.SipRule
-- 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.Chime.Types.SipRule where

import Amazonka.Chime.Types.SipRuleTargetApplication
import Amazonka.Chime.Types.SipRuleTriggerType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The SIP rule details, including name, triggers, and target applications.
-- An AWS account can have multiple SIP rules.
--
-- /See:/ 'newSipRule' smart constructor.
data SipRule = SipRule'
  { -- | Indicates whether the SIP rule is enabled or disabled. You must disable
    -- a rule before you can delete it.
    SipRule -> Maybe Bool
disabled :: Prelude.Maybe Prelude.Bool,
    -- | Target SIP media application and other details, such as priority and AWS
    -- Region, to be specified in the SIP rule. Only one SIP rule per AWS
    -- Region can be provided.
    SipRule -> Maybe (NonEmpty SipRuleTargetApplication)
targetApplications :: Prelude.Maybe (Prelude.NonEmpty SipRuleTargetApplication),
    -- | The type of trigger assigned to the SIP rule in @TriggerValue@,
    -- currently @RequestUriHostname@ or @ToPhoneNumber@.
    SipRule -> Maybe SipRuleTriggerType
triggerType :: Prelude.Maybe SipRuleTriggerType,
    -- | The time at which the SIP rule was last updated, in ISO 8601 format.
    SipRule -> Maybe POSIX
updatedTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The name of the SIP rule.
    SipRule -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | If @TriggerType@ is @RequestUriHostname@, then the value can be the
    -- outbound host name of the Amazon Chime Voice Connector. If @TriggerType@
    -- is @ToPhoneNumber@, then the value can be a customer-owned phone number
    -- in E164 format. @SipRule@ is triggered when a SIP rule requests host
    -- name or @ToPhoneNumber@ matches in the incoming SIP request.
    SipRule -> Maybe Text
triggerValue :: Prelude.Maybe Prelude.Text,
    -- | The time at which the SIP rule was created, in ISO 8601 format.
    SipRule -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The SIP rule ID.
    SipRule -> Maybe Text
sipRuleId :: Prelude.Maybe Prelude.Text
  }
  deriving (SipRule -> SipRule -> Bool
(SipRule -> SipRule -> Bool)
-> (SipRule -> SipRule -> Bool) -> Eq SipRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SipRule -> SipRule -> Bool
$c/= :: SipRule -> SipRule -> Bool
== :: SipRule -> SipRule -> Bool
$c== :: SipRule -> SipRule -> Bool
Prelude.Eq, ReadPrec [SipRule]
ReadPrec SipRule
Int -> ReadS SipRule
ReadS [SipRule]
(Int -> ReadS SipRule)
-> ReadS [SipRule]
-> ReadPrec SipRule
-> ReadPrec [SipRule]
-> Read SipRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SipRule]
$creadListPrec :: ReadPrec [SipRule]
readPrec :: ReadPrec SipRule
$creadPrec :: ReadPrec SipRule
readList :: ReadS [SipRule]
$creadList :: ReadS [SipRule]
readsPrec :: Int -> ReadS SipRule
$creadsPrec :: Int -> ReadS SipRule
Prelude.Read, Int -> SipRule -> ShowS
[SipRule] -> ShowS
SipRule -> String
(Int -> SipRule -> ShowS)
-> (SipRule -> String) -> ([SipRule] -> ShowS) -> Show SipRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SipRule] -> ShowS
$cshowList :: [SipRule] -> ShowS
show :: SipRule -> String
$cshow :: SipRule -> String
showsPrec :: Int -> SipRule -> ShowS
$cshowsPrec :: Int -> SipRule -> ShowS
Prelude.Show, (forall x. SipRule -> Rep SipRule x)
-> (forall x. Rep SipRule x -> SipRule) -> Generic SipRule
forall x. Rep SipRule x -> SipRule
forall x. SipRule -> Rep SipRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SipRule x -> SipRule
$cfrom :: forall x. SipRule -> Rep SipRule x
Prelude.Generic)

-- |
-- Create a value of 'SipRule' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'disabled', 'sipRule_disabled' - Indicates whether the SIP rule is enabled or disabled. You must disable
-- a rule before you can delete it.
--
-- 'targetApplications', 'sipRule_targetApplications' - Target SIP media application and other details, such as priority and AWS
-- Region, to be specified in the SIP rule. Only one SIP rule per AWS
-- Region can be provided.
--
-- 'triggerType', 'sipRule_triggerType' - The type of trigger assigned to the SIP rule in @TriggerValue@,
-- currently @RequestUriHostname@ or @ToPhoneNumber@.
--
-- 'updatedTimestamp', 'sipRule_updatedTimestamp' - The time at which the SIP rule was last updated, in ISO 8601 format.
--
-- 'name', 'sipRule_name' - The name of the SIP rule.
--
-- 'triggerValue', 'sipRule_triggerValue' - If @TriggerType@ is @RequestUriHostname@, then the value can be the
-- outbound host name of the Amazon Chime Voice Connector. If @TriggerType@
-- is @ToPhoneNumber@, then the value can be a customer-owned phone number
-- in E164 format. @SipRule@ is triggered when a SIP rule requests host
-- name or @ToPhoneNumber@ matches in the incoming SIP request.
--
-- 'createdTimestamp', 'sipRule_createdTimestamp' - The time at which the SIP rule was created, in ISO 8601 format.
--
-- 'sipRuleId', 'sipRule_sipRuleId' - The SIP rule ID.
newSipRule ::
  SipRule
newSipRule :: SipRule
newSipRule =
  SipRule' :: Maybe Bool
-> Maybe (NonEmpty SipRuleTargetApplication)
-> Maybe SipRuleTriggerType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> SipRule
SipRule'
    { $sel:disabled:SipRule' :: Maybe Bool
disabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:targetApplications:SipRule' :: Maybe (NonEmpty SipRuleTargetApplication)
targetApplications = Maybe (NonEmpty SipRuleTargetApplication)
forall a. Maybe a
Prelude.Nothing,
      $sel:triggerType:SipRule' :: Maybe SipRuleTriggerType
triggerType = Maybe SipRuleTriggerType
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedTimestamp:SipRule' :: Maybe POSIX
updatedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:SipRule' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:triggerValue:SipRule' :: Maybe Text
triggerValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:SipRule' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sipRuleId:SipRule' :: Maybe Text
sipRuleId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the SIP rule is enabled or disabled. You must disable
-- a rule before you can delete it.
sipRule_disabled :: Lens.Lens' SipRule (Prelude.Maybe Prelude.Bool)
sipRule_disabled :: (Maybe Bool -> f (Maybe Bool)) -> SipRule -> f SipRule
sipRule_disabled = (SipRule -> Maybe Bool)
-> (SipRule -> Maybe Bool -> SipRule)
-> Lens SipRule SipRule (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe Bool
disabled :: Maybe Bool
$sel:disabled:SipRule' :: SipRule -> Maybe Bool
disabled} -> Maybe Bool
disabled) (\s :: SipRule
s@SipRule' {} Maybe Bool
a -> SipRule
s {$sel:disabled:SipRule' :: Maybe Bool
disabled = Maybe Bool
a} :: SipRule)

-- | Target SIP media application and other details, such as priority and AWS
-- Region, to be specified in the SIP rule. Only one SIP rule per AWS
-- Region can be provided.
sipRule_targetApplications :: Lens.Lens' SipRule (Prelude.Maybe (Prelude.NonEmpty SipRuleTargetApplication))
sipRule_targetApplications :: (Maybe (NonEmpty SipRuleTargetApplication)
 -> f (Maybe (NonEmpty SipRuleTargetApplication)))
-> SipRule -> f SipRule
sipRule_targetApplications = (SipRule -> Maybe (NonEmpty SipRuleTargetApplication))
-> (SipRule
    -> Maybe (NonEmpty SipRuleTargetApplication) -> SipRule)
-> Lens
     SipRule
     SipRule
     (Maybe (NonEmpty SipRuleTargetApplication))
     (Maybe (NonEmpty SipRuleTargetApplication))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe (NonEmpty SipRuleTargetApplication)
targetApplications :: Maybe (NonEmpty SipRuleTargetApplication)
$sel:targetApplications:SipRule' :: SipRule -> Maybe (NonEmpty SipRuleTargetApplication)
targetApplications} -> Maybe (NonEmpty SipRuleTargetApplication)
targetApplications) (\s :: SipRule
s@SipRule' {} Maybe (NonEmpty SipRuleTargetApplication)
a -> SipRule
s {$sel:targetApplications:SipRule' :: Maybe (NonEmpty SipRuleTargetApplication)
targetApplications = Maybe (NonEmpty SipRuleTargetApplication)
a} :: SipRule) ((Maybe (NonEmpty SipRuleTargetApplication)
  -> f (Maybe (NonEmpty SipRuleTargetApplication)))
 -> SipRule -> f SipRule)
-> ((Maybe (NonEmpty SipRuleTargetApplication)
     -> f (Maybe (NonEmpty SipRuleTargetApplication)))
    -> Maybe (NonEmpty SipRuleTargetApplication)
    -> f (Maybe (NonEmpty SipRuleTargetApplication)))
-> (Maybe (NonEmpty SipRuleTargetApplication)
    -> f (Maybe (NonEmpty SipRuleTargetApplication)))
-> SipRule
-> f SipRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty SipRuleTargetApplication)
  (NonEmpty SipRuleTargetApplication)
  (NonEmpty SipRuleTargetApplication)
  (NonEmpty SipRuleTargetApplication)
-> Iso
     (Maybe (NonEmpty SipRuleTargetApplication))
     (Maybe (NonEmpty SipRuleTargetApplication))
     (Maybe (NonEmpty SipRuleTargetApplication))
     (Maybe (NonEmpty SipRuleTargetApplication))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty SipRuleTargetApplication)
  (NonEmpty SipRuleTargetApplication)
  (NonEmpty SipRuleTargetApplication)
  (NonEmpty SipRuleTargetApplication)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of trigger assigned to the SIP rule in @TriggerValue@,
-- currently @RequestUriHostname@ or @ToPhoneNumber@.
sipRule_triggerType :: Lens.Lens' SipRule (Prelude.Maybe SipRuleTriggerType)
sipRule_triggerType :: (Maybe SipRuleTriggerType -> f (Maybe SipRuleTriggerType))
-> SipRule -> f SipRule
sipRule_triggerType = (SipRule -> Maybe SipRuleTriggerType)
-> (SipRule -> Maybe SipRuleTriggerType -> SipRule)
-> Lens
     SipRule
     SipRule
     (Maybe SipRuleTriggerType)
     (Maybe SipRuleTriggerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe SipRuleTriggerType
triggerType :: Maybe SipRuleTriggerType
$sel:triggerType:SipRule' :: SipRule -> Maybe SipRuleTriggerType
triggerType} -> Maybe SipRuleTriggerType
triggerType) (\s :: SipRule
s@SipRule' {} Maybe SipRuleTriggerType
a -> SipRule
s {$sel:triggerType:SipRule' :: Maybe SipRuleTriggerType
triggerType = Maybe SipRuleTriggerType
a} :: SipRule)

-- | The time at which the SIP rule was last updated, in ISO 8601 format.
sipRule_updatedTimestamp :: Lens.Lens' SipRule (Prelude.Maybe Prelude.UTCTime)
sipRule_updatedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> SipRule -> f SipRule
sipRule_updatedTimestamp = (SipRule -> Maybe POSIX)
-> (SipRule -> Maybe POSIX -> SipRule)
-> Lens SipRule SipRule (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe POSIX
updatedTimestamp :: Maybe POSIX
$sel:updatedTimestamp:SipRule' :: SipRule -> Maybe POSIX
updatedTimestamp} -> Maybe POSIX
updatedTimestamp) (\s :: SipRule
s@SipRule' {} Maybe POSIX
a -> SipRule
s {$sel:updatedTimestamp:SipRule' :: Maybe POSIX
updatedTimestamp = Maybe POSIX
a} :: SipRule) ((Maybe POSIX -> f (Maybe POSIX)) -> SipRule -> f SipRule)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SipRule
-> f SipRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the SIP rule.
sipRule_name :: Lens.Lens' SipRule (Prelude.Maybe Prelude.Text)
sipRule_name :: (Maybe Text -> f (Maybe Text)) -> SipRule -> f SipRule
sipRule_name = (SipRule -> Maybe Text)
-> (SipRule -> Maybe Text -> SipRule)
-> Lens SipRule SipRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe Text
name :: Maybe Text
$sel:name:SipRule' :: SipRule -> Maybe Text
name} -> Maybe Text
name) (\s :: SipRule
s@SipRule' {} Maybe Text
a -> SipRule
s {$sel:name:SipRule' :: Maybe Text
name = Maybe Text
a} :: SipRule)

-- | If @TriggerType@ is @RequestUriHostname@, then the value can be the
-- outbound host name of the Amazon Chime Voice Connector. If @TriggerType@
-- is @ToPhoneNumber@, then the value can be a customer-owned phone number
-- in E164 format. @SipRule@ is triggered when a SIP rule requests host
-- name or @ToPhoneNumber@ matches in the incoming SIP request.
sipRule_triggerValue :: Lens.Lens' SipRule (Prelude.Maybe Prelude.Text)
sipRule_triggerValue :: (Maybe Text -> f (Maybe Text)) -> SipRule -> f SipRule
sipRule_triggerValue = (SipRule -> Maybe Text)
-> (SipRule -> Maybe Text -> SipRule)
-> Lens SipRule SipRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe Text
triggerValue :: Maybe Text
$sel:triggerValue:SipRule' :: SipRule -> Maybe Text
triggerValue} -> Maybe Text
triggerValue) (\s :: SipRule
s@SipRule' {} Maybe Text
a -> SipRule
s {$sel:triggerValue:SipRule' :: Maybe Text
triggerValue = Maybe Text
a} :: SipRule)

-- | The time at which the SIP rule was created, in ISO 8601 format.
sipRule_createdTimestamp :: Lens.Lens' SipRule (Prelude.Maybe Prelude.UTCTime)
sipRule_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> SipRule -> f SipRule
sipRule_createdTimestamp = (SipRule -> Maybe POSIX)
-> (SipRule -> Maybe POSIX -> SipRule)
-> Lens SipRule SipRule (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:SipRule' :: SipRule -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: SipRule
s@SipRule' {} Maybe POSIX
a -> SipRule
s {$sel:createdTimestamp:SipRule' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: SipRule) ((Maybe POSIX -> f (Maybe POSIX)) -> SipRule -> f SipRule)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SipRule
-> f SipRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The SIP rule ID.
sipRule_sipRuleId :: Lens.Lens' SipRule (Prelude.Maybe Prelude.Text)
sipRule_sipRuleId :: (Maybe Text -> f (Maybe Text)) -> SipRule -> f SipRule
sipRule_sipRuleId = (SipRule -> Maybe Text)
-> (SipRule -> Maybe Text -> SipRule)
-> Lens SipRule SipRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SipRule' {Maybe Text
sipRuleId :: Maybe Text
$sel:sipRuleId:SipRule' :: SipRule -> Maybe Text
sipRuleId} -> Maybe Text
sipRuleId) (\s :: SipRule
s@SipRule' {} Maybe Text
a -> SipRule
s {$sel:sipRuleId:SipRule' :: Maybe Text
sipRuleId = Maybe Text
a} :: SipRule)

instance Core.FromJSON SipRule where
  parseJSON :: Value -> Parser SipRule
parseJSON =
    String -> (Object -> Parser SipRule) -> Value -> Parser SipRule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SipRule"
      ( \Object
x ->
          Maybe Bool
-> Maybe (NonEmpty SipRuleTargetApplication)
-> Maybe SipRuleTriggerType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> SipRule
SipRule'
            (Maybe Bool
 -> Maybe (NonEmpty SipRuleTargetApplication)
 -> Maybe SipRuleTriggerType
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> SipRule)
-> Parser (Maybe Bool)
-> Parser
     (Maybe (NonEmpty SipRuleTargetApplication)
      -> Maybe SipRuleTriggerType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> SipRule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Disabled")
            Parser
  (Maybe (NonEmpty SipRuleTargetApplication)
   -> Maybe SipRuleTriggerType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> SipRule)
-> Parser (Maybe (NonEmpty SipRuleTargetApplication))
-> Parser
     (Maybe SipRuleTriggerType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> SipRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (NonEmpty SipRuleTargetApplication))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetApplications")
            Parser
  (Maybe SipRuleTriggerType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> SipRule)
-> Parser (Maybe SipRuleTriggerType)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> SipRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SipRuleTriggerType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TriggerType")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> SipRule)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe POSIX -> Maybe Text -> SipRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpdatedTimestamp")
            Parser
  (Maybe Text -> Maybe Text -> Maybe POSIX -> Maybe Text -> SipRule)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> SipRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> SipRule)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> SipRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TriggerValue")
            Parser (Maybe POSIX -> Maybe Text -> SipRule)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> SipRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTimestamp")
            Parser (Maybe Text -> SipRule)
-> Parser (Maybe Text) -> Parser SipRule
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SipRuleId")
      )

instance Prelude.Hashable SipRule

instance Prelude.NFData SipRule