{-# 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.Pinpoint.Types.ActivityResponse
-- 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.ActivityResponse where

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

-- | Provides information about an activity that was performed by a campaign.
--
-- /See:/ 'newActivityResponse' smart constructor.
data ActivityResponse = ActivityResponse'
  { -- | The current status of the activity. Possible values are: PENDING,
    -- INITIALIZING, RUNNING, PAUSED, CANCELLED, and COMPLETED.
    ActivityResponse -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | The actual start time, in ISO 8601 format, of the activity.
    ActivityResponse -> Maybe Text
start :: Prelude.Maybe Prelude.Text,
    -- | The total number of time zones that were completed.
    ActivityResponse -> Maybe Int
timezonesCompletedCount :: Prelude.Maybe Prelude.Int,
    -- | The total number of unique time zones that are in the segment for the
    -- campaign.
    ActivityResponse -> Maybe Int
timezonesTotalCount :: Prelude.Maybe Prelude.Int,
    -- | Specifies whether the activity succeeded. Possible values are SUCCESS
    -- and FAIL.
    ActivityResponse -> Maybe Text
result :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the campaign treatment that the activity
    -- applies to. A treatment is a variation of a campaign that\'s used for
    -- A\/B testing of a campaign.
    ActivityResponse -> Maybe Text
treatmentId :: Prelude.Maybe Prelude.Text,
    -- | The total number of endpoints that the campaign successfully delivered
    -- messages to.
    ActivityResponse -> Maybe Int
successfulEndpointCount :: Prelude.Maybe Prelude.Int,
    -- | The actual time, in ISO 8601 format, when the activity was marked
    -- CANCELLED or COMPLETED.
    ActivityResponse -> Maybe Text
end :: Prelude.Maybe Prelude.Text,
    -- | The total number of endpoints that the campaign attempted to deliver
    -- messages to.
    ActivityResponse -> Maybe Int
totalEndpointCount :: Prelude.Maybe Prelude.Int,
    -- | The scheduled start time, in ISO 8601 format, for the activity.
    ActivityResponse -> Maybe Text
scheduledStart :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the campaign that the activity applies to.
    ActivityResponse -> Text
campaignId :: Prelude.Text,
    -- | The unique identifier for the activity.
    ActivityResponse -> Text
id :: Prelude.Text,
    -- | The unique identifier for the application that the campaign applies to.
    ActivityResponse -> Text
applicationId :: Prelude.Text
  }
  deriving (ActivityResponse -> ActivityResponse -> Bool
(ActivityResponse -> ActivityResponse -> Bool)
-> (ActivityResponse -> ActivityResponse -> Bool)
-> Eq ActivityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivityResponse -> ActivityResponse -> Bool
$c/= :: ActivityResponse -> ActivityResponse -> Bool
== :: ActivityResponse -> ActivityResponse -> Bool
$c== :: ActivityResponse -> ActivityResponse -> Bool
Prelude.Eq, ReadPrec [ActivityResponse]
ReadPrec ActivityResponse
Int -> ReadS ActivityResponse
ReadS [ActivityResponse]
(Int -> ReadS ActivityResponse)
-> ReadS [ActivityResponse]
-> ReadPrec ActivityResponse
-> ReadPrec [ActivityResponse]
-> Read ActivityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActivityResponse]
$creadListPrec :: ReadPrec [ActivityResponse]
readPrec :: ReadPrec ActivityResponse
$creadPrec :: ReadPrec ActivityResponse
readList :: ReadS [ActivityResponse]
$creadList :: ReadS [ActivityResponse]
readsPrec :: Int -> ReadS ActivityResponse
$creadsPrec :: Int -> ReadS ActivityResponse
Prelude.Read, Int -> ActivityResponse -> ShowS
[ActivityResponse] -> ShowS
ActivityResponse -> String
(Int -> ActivityResponse -> ShowS)
-> (ActivityResponse -> String)
-> ([ActivityResponse] -> ShowS)
-> Show ActivityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivityResponse] -> ShowS
$cshowList :: [ActivityResponse] -> ShowS
show :: ActivityResponse -> String
$cshow :: ActivityResponse -> String
showsPrec :: Int -> ActivityResponse -> ShowS
$cshowsPrec :: Int -> ActivityResponse -> ShowS
Prelude.Show, (forall x. ActivityResponse -> Rep ActivityResponse x)
-> (forall x. Rep ActivityResponse x -> ActivityResponse)
-> Generic ActivityResponse
forall x. Rep ActivityResponse x -> ActivityResponse
forall x. ActivityResponse -> Rep ActivityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActivityResponse x -> ActivityResponse
$cfrom :: forall x. ActivityResponse -> Rep ActivityResponse x
Prelude.Generic)

-- |
-- Create a value of 'ActivityResponse' 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:
--
-- 'state', 'activityResponse_state' - The current status of the activity. Possible values are: PENDING,
-- INITIALIZING, RUNNING, PAUSED, CANCELLED, and COMPLETED.
--
-- 'start', 'activityResponse_start' - The actual start time, in ISO 8601 format, of the activity.
--
-- 'timezonesCompletedCount', 'activityResponse_timezonesCompletedCount' - The total number of time zones that were completed.
--
-- 'timezonesTotalCount', 'activityResponse_timezonesTotalCount' - The total number of unique time zones that are in the segment for the
-- campaign.
--
-- 'result', 'activityResponse_result' - Specifies whether the activity succeeded. Possible values are SUCCESS
-- and FAIL.
--
-- 'treatmentId', 'activityResponse_treatmentId' - The unique identifier for the campaign treatment that the activity
-- applies to. A treatment is a variation of a campaign that\'s used for
-- A\/B testing of a campaign.
--
-- 'successfulEndpointCount', 'activityResponse_successfulEndpointCount' - The total number of endpoints that the campaign successfully delivered
-- messages to.
--
-- 'end', 'activityResponse_end' - The actual time, in ISO 8601 format, when the activity was marked
-- CANCELLED or COMPLETED.
--
-- 'totalEndpointCount', 'activityResponse_totalEndpointCount' - The total number of endpoints that the campaign attempted to deliver
-- messages to.
--
-- 'scheduledStart', 'activityResponse_scheduledStart' - The scheduled start time, in ISO 8601 format, for the activity.
--
-- 'campaignId', 'activityResponse_campaignId' - The unique identifier for the campaign that the activity applies to.
--
-- 'id', 'activityResponse_id' - The unique identifier for the activity.
--
-- 'applicationId', 'activityResponse_applicationId' - The unique identifier for the application that the campaign applies to.
newActivityResponse ::
  -- | 'campaignId'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  ActivityResponse
newActivityResponse :: Text -> Text -> Text -> ActivityResponse
newActivityResponse Text
pCampaignId_ Text
pId_ Text
pApplicationId_ =
  ActivityResponse' :: Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Text
-> Text
-> Text
-> ActivityResponse
ActivityResponse'
    { $sel:state:ActivityResponse' :: Maybe Text
state = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:start:ActivityResponse' :: Maybe Text
start = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timezonesCompletedCount:ActivityResponse' :: Maybe Int
timezonesCompletedCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:timezonesTotalCount:ActivityResponse' :: Maybe Int
timezonesTotalCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:result:ActivityResponse' :: Maybe Text
result = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:treatmentId:ActivityResponse' :: Maybe Text
treatmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:successfulEndpointCount:ActivityResponse' :: Maybe Int
successfulEndpointCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:end:ActivityResponse' :: Maybe Text
end = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:totalEndpointCount:ActivityResponse' :: Maybe Int
totalEndpointCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduledStart:ActivityResponse' :: Maybe Text
scheduledStart = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:campaignId:ActivityResponse' :: Text
campaignId = Text
pCampaignId_,
      $sel:id:ActivityResponse' :: Text
id = Text
pId_,
      $sel:applicationId:ActivityResponse' :: Text
applicationId = Text
pApplicationId_
    }

-- | The current status of the activity. Possible values are: PENDING,
-- INITIALIZING, RUNNING, PAUSED, CANCELLED, and COMPLETED.
activityResponse_state :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Text)
activityResponse_state :: (Maybe Text -> f (Maybe Text))
-> ActivityResponse -> f ActivityResponse
activityResponse_state = (ActivityResponse -> Maybe Text)
-> (ActivityResponse -> Maybe Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Text
state :: Maybe Text
$sel:state:ActivityResponse' :: ActivityResponse -> Maybe Text
state} -> Maybe Text
state) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Text
a -> ActivityResponse
s {$sel:state:ActivityResponse' :: Maybe Text
state = Maybe Text
a} :: ActivityResponse)

-- | The actual start time, in ISO 8601 format, of the activity.
activityResponse_start :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Text)
activityResponse_start :: (Maybe Text -> f (Maybe Text))
-> ActivityResponse -> f ActivityResponse
activityResponse_start = (ActivityResponse -> Maybe Text)
-> (ActivityResponse -> Maybe Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Text
start :: Maybe Text
$sel:start:ActivityResponse' :: ActivityResponse -> Maybe Text
start} -> Maybe Text
start) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Text
a -> ActivityResponse
s {$sel:start:ActivityResponse' :: Maybe Text
start = Maybe Text
a} :: ActivityResponse)

-- | The total number of time zones that were completed.
activityResponse_timezonesCompletedCount :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Int)
activityResponse_timezonesCompletedCount :: (Maybe Int -> f (Maybe Int))
-> ActivityResponse -> f ActivityResponse
activityResponse_timezonesCompletedCount = (ActivityResponse -> Maybe Int)
-> (ActivityResponse -> Maybe Int -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Int
timezonesCompletedCount :: Maybe Int
$sel:timezonesCompletedCount:ActivityResponse' :: ActivityResponse -> Maybe Int
timezonesCompletedCount} -> Maybe Int
timezonesCompletedCount) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Int
a -> ActivityResponse
s {$sel:timezonesCompletedCount:ActivityResponse' :: Maybe Int
timezonesCompletedCount = Maybe Int
a} :: ActivityResponse)

-- | The total number of unique time zones that are in the segment for the
-- campaign.
activityResponse_timezonesTotalCount :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Int)
activityResponse_timezonesTotalCount :: (Maybe Int -> f (Maybe Int))
-> ActivityResponse -> f ActivityResponse
activityResponse_timezonesTotalCount = (ActivityResponse -> Maybe Int)
-> (ActivityResponse -> Maybe Int -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Int
timezonesTotalCount :: Maybe Int
$sel:timezonesTotalCount:ActivityResponse' :: ActivityResponse -> Maybe Int
timezonesTotalCount} -> Maybe Int
timezonesTotalCount) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Int
a -> ActivityResponse
s {$sel:timezonesTotalCount:ActivityResponse' :: Maybe Int
timezonesTotalCount = Maybe Int
a} :: ActivityResponse)

-- | Specifies whether the activity succeeded. Possible values are SUCCESS
-- and FAIL.
activityResponse_result :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Text)
activityResponse_result :: (Maybe Text -> f (Maybe Text))
-> ActivityResponse -> f ActivityResponse
activityResponse_result = (ActivityResponse -> Maybe Text)
-> (ActivityResponse -> Maybe Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Text
result :: Maybe Text
$sel:result:ActivityResponse' :: ActivityResponse -> Maybe Text
result} -> Maybe Text
result) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Text
a -> ActivityResponse
s {$sel:result:ActivityResponse' :: Maybe Text
result = Maybe Text
a} :: ActivityResponse)

-- | The unique identifier for the campaign treatment that the activity
-- applies to. A treatment is a variation of a campaign that\'s used for
-- A\/B testing of a campaign.
activityResponse_treatmentId :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Text)
activityResponse_treatmentId :: (Maybe Text -> f (Maybe Text))
-> ActivityResponse -> f ActivityResponse
activityResponse_treatmentId = (ActivityResponse -> Maybe Text)
-> (ActivityResponse -> Maybe Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Text
treatmentId :: Maybe Text
$sel:treatmentId:ActivityResponse' :: ActivityResponse -> Maybe Text
treatmentId} -> Maybe Text
treatmentId) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Text
a -> ActivityResponse
s {$sel:treatmentId:ActivityResponse' :: Maybe Text
treatmentId = Maybe Text
a} :: ActivityResponse)

-- | The total number of endpoints that the campaign successfully delivered
-- messages to.
activityResponse_successfulEndpointCount :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Int)
activityResponse_successfulEndpointCount :: (Maybe Int -> f (Maybe Int))
-> ActivityResponse -> f ActivityResponse
activityResponse_successfulEndpointCount = (ActivityResponse -> Maybe Int)
-> (ActivityResponse -> Maybe Int -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Int
successfulEndpointCount :: Maybe Int
$sel:successfulEndpointCount:ActivityResponse' :: ActivityResponse -> Maybe Int
successfulEndpointCount} -> Maybe Int
successfulEndpointCount) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Int
a -> ActivityResponse
s {$sel:successfulEndpointCount:ActivityResponse' :: Maybe Int
successfulEndpointCount = Maybe Int
a} :: ActivityResponse)

-- | The actual time, in ISO 8601 format, when the activity was marked
-- CANCELLED or COMPLETED.
activityResponse_end :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Text)
activityResponse_end :: (Maybe Text -> f (Maybe Text))
-> ActivityResponse -> f ActivityResponse
activityResponse_end = (ActivityResponse -> Maybe Text)
-> (ActivityResponse -> Maybe Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Text
end :: Maybe Text
$sel:end:ActivityResponse' :: ActivityResponse -> Maybe Text
end} -> Maybe Text
end) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Text
a -> ActivityResponse
s {$sel:end:ActivityResponse' :: Maybe Text
end = Maybe Text
a} :: ActivityResponse)

-- | The total number of endpoints that the campaign attempted to deliver
-- messages to.
activityResponse_totalEndpointCount :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Int)
activityResponse_totalEndpointCount :: (Maybe Int -> f (Maybe Int))
-> ActivityResponse -> f ActivityResponse
activityResponse_totalEndpointCount = (ActivityResponse -> Maybe Int)
-> (ActivityResponse -> Maybe Int -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Int
totalEndpointCount :: Maybe Int
$sel:totalEndpointCount:ActivityResponse' :: ActivityResponse -> Maybe Int
totalEndpointCount} -> Maybe Int
totalEndpointCount) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Int
a -> ActivityResponse
s {$sel:totalEndpointCount:ActivityResponse' :: Maybe Int
totalEndpointCount = Maybe Int
a} :: ActivityResponse)

-- | The scheduled start time, in ISO 8601 format, for the activity.
activityResponse_scheduledStart :: Lens.Lens' ActivityResponse (Prelude.Maybe Prelude.Text)
activityResponse_scheduledStart :: (Maybe Text -> f (Maybe Text))
-> ActivityResponse -> f ActivityResponse
activityResponse_scheduledStart = (ActivityResponse -> Maybe Text)
-> (ActivityResponse -> Maybe Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Maybe Text
scheduledStart :: Maybe Text
$sel:scheduledStart:ActivityResponse' :: ActivityResponse -> Maybe Text
scheduledStart} -> Maybe Text
scheduledStart) (\s :: ActivityResponse
s@ActivityResponse' {} Maybe Text
a -> ActivityResponse
s {$sel:scheduledStart:ActivityResponse' :: Maybe Text
scheduledStart = Maybe Text
a} :: ActivityResponse)

-- | The unique identifier for the campaign that the activity applies to.
activityResponse_campaignId :: Lens.Lens' ActivityResponse Prelude.Text
activityResponse_campaignId :: (Text -> f Text) -> ActivityResponse -> f ActivityResponse
activityResponse_campaignId = (ActivityResponse -> Text)
-> (ActivityResponse -> Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Text
campaignId :: Text
$sel:campaignId:ActivityResponse' :: ActivityResponse -> Text
campaignId} -> Text
campaignId) (\s :: ActivityResponse
s@ActivityResponse' {} Text
a -> ActivityResponse
s {$sel:campaignId:ActivityResponse' :: Text
campaignId = Text
a} :: ActivityResponse)

-- | The unique identifier for the activity.
activityResponse_id :: Lens.Lens' ActivityResponse Prelude.Text
activityResponse_id :: (Text -> f Text) -> ActivityResponse -> f ActivityResponse
activityResponse_id = (ActivityResponse -> Text)
-> (ActivityResponse -> Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Text
id :: Text
$sel:id:ActivityResponse' :: ActivityResponse -> Text
id} -> Text
id) (\s :: ActivityResponse
s@ActivityResponse' {} Text
a -> ActivityResponse
s {$sel:id:ActivityResponse' :: Text
id = Text
a} :: ActivityResponse)

-- | The unique identifier for the application that the campaign applies to.
activityResponse_applicationId :: Lens.Lens' ActivityResponse Prelude.Text
activityResponse_applicationId :: (Text -> f Text) -> ActivityResponse -> f ActivityResponse
activityResponse_applicationId = (ActivityResponse -> Text)
-> (ActivityResponse -> Text -> ActivityResponse)
-> Lens ActivityResponse ActivityResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityResponse' {Text
applicationId :: Text
$sel:applicationId:ActivityResponse' :: ActivityResponse -> Text
applicationId} -> Text
applicationId) (\s :: ActivityResponse
s@ActivityResponse' {} Text
a -> ActivityResponse
s {$sel:applicationId:ActivityResponse' :: Text
applicationId = Text
a} :: ActivityResponse)

instance Core.FromJSON ActivityResponse where
  parseJSON :: Value -> Parser ActivityResponse
parseJSON =
    String
-> (Object -> Parser ActivityResponse)
-> Value
-> Parser ActivityResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActivityResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Text
-> Text
-> Text
-> ActivityResponse
ActivityResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Text
 -> Text
 -> Text
 -> ActivityResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> ActivityResponse)
forall (f :: * -> *) a b. Functor 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
"State")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> ActivityResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> ActivityResponse)
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
"Start")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> ActivityResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> ActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimezonesCompletedCount")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> ActivityResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> ActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimezonesTotalCount")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> ActivityResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> ActivityResponse)
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
"Result")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> ActivityResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> ActivityResponse)
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
"TreatmentId")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> ActivityResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> ActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SuccessfulEndpointCount")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> ActivityResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text -> Text -> Text -> Text -> ActivityResponse)
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
"End")
            Parser
  (Maybe Int
   -> Maybe Text -> Text -> Text -> Text -> ActivityResponse)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Text -> Text -> Text -> ActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalEndpointCount")
            Parser (Maybe Text -> Text -> Text -> Text -> ActivityResponse)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> Text -> ActivityResponse)
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
"ScheduledStart")
            Parser (Text -> Text -> Text -> ActivityResponse)
-> Parser Text -> Parser (Text -> Text -> ActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CampaignId")
            Parser (Text -> Text -> ActivityResponse)
-> Parser Text -> Parser (Text -> ActivityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
            Parser (Text -> ActivityResponse)
-> Parser Text -> Parser ActivityResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationId")
      )

instance Prelude.Hashable ActivityResponse

instance Prelude.NFData ActivityResponse