parseSubscriptionStateEnter :: BSERValue -> Parser SubscriptionStateEnter
parseSubscriptionStateEnter (BSERObject o) = do
    clockId <- parseClockId o
    root <- o .: "root"
    subscription <- o .: "subscription"
    state <- o .: "state-enter"
    let metadata = case M.lookup "metadata" o of
            Nothing -> Nothing
            Just v -> Just v
    pure SubscriptionStateEnter
      { _SubscriptionStateEnter_Clock = clockId
      , _SubscriptionStateEnter_Root = root
      , _SubscriptionStateEnter_Subscription = SubscriptionName subscription
      , _SubscriptionStateEnter_State = StateName state
      , _SubscriptionStateEnter_Metadata = metadata
      }
parseSubscriptionStateEnter :: BSERValue -> Parser SubscriptionStateEnter
parseSubscriptionStateEnter (BSERObject o) = do
    clockId <- parseClockId o
    root <- o .: "root"
    subscription <- o .: "subscription"
    state <- o .: "state-enter"
    let metadata = case M.lookup "metadata" o of
            Nothing -> Nothing
            Just v -> Just v
    pure SubscriptionStateEnter
      { _SubscriptionStateEnter_Clock = clockId
      , _SubscriptionStateEnter_Root = root
      , _SubscriptionStateEnter_Subscription = SubscriptionName subscription
      , _SubscriptionStateEnter_State = StateName state
      , _SubscriptionStateEnter_Metadata = metadata
      }
parseSubscriptionStateEnter (BSERObject o) = do
    clockId <- parseClockId o
    root <- o .: "root"
    subscription <- o .: "subscription"
    state <- o .: "state-enter"
    let metadata = case M.lookup "metadata" o of
            Nothing -> Nothing
            Just v -> Just v
    pure SubscriptionStateEnter
      { _SubscriptionStateEnter_Clock = clockId
      , _SubscriptionStateEnter_Root = root
      , _SubscriptionStateEnter_Subscription = SubscriptionName subscription
      , _SubscriptionStateEnter_State = StateName state
      , _SubscriptionStateEnter_Metadata = metadata
      }