{-# 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.APNSChannelResponse
-- 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.APNSChannelResponse where

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

-- | Provides information about the status and settings of the APNs (Apple
-- Push Notification service) channel for an application.
--
-- /See:/ 'newAPNSChannelResponse' smart constructor.
data APNSChannelResponse = APNSChannelResponse'
  { -- | The date and time when the APNs channel was last modified.
    APNSChannelResponse -> Maybe Text
lastModifiedDate :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the APNs channel is enabled for the application.
    APNSChannelResponse -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether the APNs channel is configured to communicate with
    -- APNs by using APNs tokens. To provide an authentication key for APNs
    -- tokens, set the TokenKey property of the channel.
    APNSChannelResponse -> Maybe Bool
hasTokenKey :: Prelude.Maybe Prelude.Bool,
    -- | The default authentication method that Amazon Pinpoint uses to
    -- authenticate with APNs for this channel, key or certificate.
    APNSChannelResponse -> Maybe Text
defaultAuthenticationMethod :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the APNs channel is archived.
    APNSChannelResponse -> Maybe Bool
isArchived :: Prelude.Maybe Prelude.Bool,
    -- | The unique identifier for the application that the APNs channel applies
    -- to.
    APNSChannelResponse -> Maybe Text
applicationId :: Prelude.Maybe Prelude.Text,
    -- | The current version of the APNs channel.
    APNSChannelResponse -> Maybe Int
version :: Prelude.Maybe Prelude.Int,
    -- | (Deprecated) An identifier for the APNs channel. This property is
    -- retained only for backward compatibility.
    APNSChannelResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the APNs channel was enabled.
    APNSChannelResponse -> Maybe Text
creationDate :: Prelude.Maybe Prelude.Text,
    -- | The user who last modified the APNs channel.
    APNSChannelResponse -> Maybe Text
lastModifiedBy :: Prelude.Maybe Prelude.Text,
    -- | (Not used) This property is retained only for backward compatibility.
    APNSChannelResponse -> Maybe Bool
hasCredential :: Prelude.Maybe Prelude.Bool,
    -- | The type of messaging or notification platform for the channel. For the
    -- APNs channel, this value is APNS.
    APNSChannelResponse -> Text
platform :: Prelude.Text
  }
  deriving (APNSChannelResponse -> APNSChannelResponse -> Bool
(APNSChannelResponse -> APNSChannelResponse -> Bool)
-> (APNSChannelResponse -> APNSChannelResponse -> Bool)
-> Eq APNSChannelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: APNSChannelResponse -> APNSChannelResponse -> Bool
$c/= :: APNSChannelResponse -> APNSChannelResponse -> Bool
== :: APNSChannelResponse -> APNSChannelResponse -> Bool
$c== :: APNSChannelResponse -> APNSChannelResponse -> Bool
Prelude.Eq, ReadPrec [APNSChannelResponse]
ReadPrec APNSChannelResponse
Int -> ReadS APNSChannelResponse
ReadS [APNSChannelResponse]
(Int -> ReadS APNSChannelResponse)
-> ReadS [APNSChannelResponse]
-> ReadPrec APNSChannelResponse
-> ReadPrec [APNSChannelResponse]
-> Read APNSChannelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [APNSChannelResponse]
$creadListPrec :: ReadPrec [APNSChannelResponse]
readPrec :: ReadPrec APNSChannelResponse
$creadPrec :: ReadPrec APNSChannelResponse
readList :: ReadS [APNSChannelResponse]
$creadList :: ReadS [APNSChannelResponse]
readsPrec :: Int -> ReadS APNSChannelResponse
$creadsPrec :: Int -> ReadS APNSChannelResponse
Prelude.Read, Int -> APNSChannelResponse -> ShowS
[APNSChannelResponse] -> ShowS
APNSChannelResponse -> String
(Int -> APNSChannelResponse -> ShowS)
-> (APNSChannelResponse -> String)
-> ([APNSChannelResponse] -> ShowS)
-> Show APNSChannelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [APNSChannelResponse] -> ShowS
$cshowList :: [APNSChannelResponse] -> ShowS
show :: APNSChannelResponse -> String
$cshow :: APNSChannelResponse -> String
showsPrec :: Int -> APNSChannelResponse -> ShowS
$cshowsPrec :: Int -> APNSChannelResponse -> ShowS
Prelude.Show, (forall x. APNSChannelResponse -> Rep APNSChannelResponse x)
-> (forall x. Rep APNSChannelResponse x -> APNSChannelResponse)
-> Generic APNSChannelResponse
forall x. Rep APNSChannelResponse x -> APNSChannelResponse
forall x. APNSChannelResponse -> Rep APNSChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep APNSChannelResponse x -> APNSChannelResponse
$cfrom :: forall x. APNSChannelResponse -> Rep APNSChannelResponse x
Prelude.Generic)

-- |
-- Create a value of 'APNSChannelResponse' 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:
--
-- 'lastModifiedDate', 'aPNSChannelResponse_lastModifiedDate' - The date and time when the APNs channel was last modified.
--
-- 'enabled', 'aPNSChannelResponse_enabled' - Specifies whether the APNs channel is enabled for the application.
--
-- 'hasTokenKey', 'aPNSChannelResponse_hasTokenKey' - Specifies whether the APNs channel is configured to communicate with
-- APNs by using APNs tokens. To provide an authentication key for APNs
-- tokens, set the TokenKey property of the channel.
--
-- 'defaultAuthenticationMethod', 'aPNSChannelResponse_defaultAuthenticationMethod' - The default authentication method that Amazon Pinpoint uses to
-- authenticate with APNs for this channel, key or certificate.
--
-- 'isArchived', 'aPNSChannelResponse_isArchived' - Specifies whether the APNs channel is archived.
--
-- 'applicationId', 'aPNSChannelResponse_applicationId' - The unique identifier for the application that the APNs channel applies
-- to.
--
-- 'version', 'aPNSChannelResponse_version' - The current version of the APNs channel.
--
-- 'id', 'aPNSChannelResponse_id' - (Deprecated) An identifier for the APNs channel. This property is
-- retained only for backward compatibility.
--
-- 'creationDate', 'aPNSChannelResponse_creationDate' - The date and time when the APNs channel was enabled.
--
-- 'lastModifiedBy', 'aPNSChannelResponse_lastModifiedBy' - The user who last modified the APNs channel.
--
-- 'hasCredential', 'aPNSChannelResponse_hasCredential' - (Not used) This property is retained only for backward compatibility.
--
-- 'platform', 'aPNSChannelResponse_platform' - The type of messaging or notification platform for the channel. For the
-- APNs channel, this value is APNS.
newAPNSChannelResponse ::
  -- | 'platform'
  Prelude.Text ->
  APNSChannelResponse
newAPNSChannelResponse :: Text -> APNSChannelResponse
newAPNSChannelResponse Text
pPlatform_ =
  APNSChannelResponse' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> APNSChannelResponse
APNSChannelResponse'
    { $sel:lastModifiedDate:APNSChannelResponse' :: Maybe Text
lastModifiedDate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:APNSChannelResponse' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:hasTokenKey:APNSChannelResponse' :: Maybe Bool
hasTokenKey = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultAuthenticationMethod:APNSChannelResponse' :: Maybe Text
defaultAuthenticationMethod = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isArchived:APNSChannelResponse' :: Maybe Bool
isArchived = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationId:APNSChannelResponse' :: Maybe Text
applicationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:APNSChannelResponse' :: Maybe Int
version = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:id:APNSChannelResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:APNSChannelResponse' :: Maybe Text
creationDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedBy:APNSChannelResponse' :: Maybe Text
lastModifiedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hasCredential:APNSChannelResponse' :: Maybe Bool
hasCredential = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:platform:APNSChannelResponse' :: Text
platform = Text
pPlatform_
    }

-- | The date and time when the APNs channel was last modified.
aPNSChannelResponse_lastModifiedDate :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Text)
aPNSChannelResponse_lastModifiedDate :: (Maybe Text -> f (Maybe Text))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_lastModifiedDate = (APNSChannelResponse -> Maybe Text)
-> (APNSChannelResponse -> Maybe Text -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Text
lastModifiedDate :: Maybe Text
$sel:lastModifiedDate:APNSChannelResponse' :: APNSChannelResponse -> Maybe Text
lastModifiedDate} -> Maybe Text
lastModifiedDate) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Text
a -> APNSChannelResponse
s {$sel:lastModifiedDate:APNSChannelResponse' :: Maybe Text
lastModifiedDate = Maybe Text
a} :: APNSChannelResponse)

-- | Specifies whether the APNs channel is enabled for the application.
aPNSChannelResponse_enabled :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Bool)
aPNSChannelResponse_enabled :: (Maybe Bool -> f (Maybe Bool))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_enabled = (APNSChannelResponse -> Maybe Bool)
-> (APNSChannelResponse -> Maybe Bool -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:APNSChannelResponse' :: APNSChannelResponse -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Bool
a -> APNSChannelResponse
s {$sel:enabled:APNSChannelResponse' :: Maybe Bool
enabled = Maybe Bool
a} :: APNSChannelResponse)

-- | Specifies whether the APNs channel is configured to communicate with
-- APNs by using APNs tokens. To provide an authentication key for APNs
-- tokens, set the TokenKey property of the channel.
aPNSChannelResponse_hasTokenKey :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Bool)
aPNSChannelResponse_hasTokenKey :: (Maybe Bool -> f (Maybe Bool))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_hasTokenKey = (APNSChannelResponse -> Maybe Bool)
-> (APNSChannelResponse -> Maybe Bool -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Bool
hasTokenKey :: Maybe Bool
$sel:hasTokenKey:APNSChannelResponse' :: APNSChannelResponse -> Maybe Bool
hasTokenKey} -> Maybe Bool
hasTokenKey) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Bool
a -> APNSChannelResponse
s {$sel:hasTokenKey:APNSChannelResponse' :: Maybe Bool
hasTokenKey = Maybe Bool
a} :: APNSChannelResponse)

-- | The default authentication method that Amazon Pinpoint uses to
-- authenticate with APNs for this channel, key or certificate.
aPNSChannelResponse_defaultAuthenticationMethod :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Text)
aPNSChannelResponse_defaultAuthenticationMethod :: (Maybe Text -> f (Maybe Text))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_defaultAuthenticationMethod = (APNSChannelResponse -> Maybe Text)
-> (APNSChannelResponse -> Maybe Text -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Text
defaultAuthenticationMethod :: Maybe Text
$sel:defaultAuthenticationMethod:APNSChannelResponse' :: APNSChannelResponse -> Maybe Text
defaultAuthenticationMethod} -> Maybe Text
defaultAuthenticationMethod) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Text
a -> APNSChannelResponse
s {$sel:defaultAuthenticationMethod:APNSChannelResponse' :: Maybe Text
defaultAuthenticationMethod = Maybe Text
a} :: APNSChannelResponse)

-- | Specifies whether the APNs channel is archived.
aPNSChannelResponse_isArchived :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Bool)
aPNSChannelResponse_isArchived :: (Maybe Bool -> f (Maybe Bool))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_isArchived = (APNSChannelResponse -> Maybe Bool)
-> (APNSChannelResponse -> Maybe Bool -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Bool
isArchived :: Maybe Bool
$sel:isArchived:APNSChannelResponse' :: APNSChannelResponse -> Maybe Bool
isArchived} -> Maybe Bool
isArchived) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Bool
a -> APNSChannelResponse
s {$sel:isArchived:APNSChannelResponse' :: Maybe Bool
isArchived = Maybe Bool
a} :: APNSChannelResponse)

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

-- | The current version of the APNs channel.
aPNSChannelResponse_version :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Int)
aPNSChannelResponse_version :: (Maybe Int -> f (Maybe Int))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_version = (APNSChannelResponse -> Maybe Int)
-> (APNSChannelResponse -> Maybe Int -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Int
version :: Maybe Int
$sel:version:APNSChannelResponse' :: APNSChannelResponse -> Maybe Int
version} -> Maybe Int
version) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Int
a -> APNSChannelResponse
s {$sel:version:APNSChannelResponse' :: Maybe Int
version = Maybe Int
a} :: APNSChannelResponse)

-- | (Deprecated) An identifier for the APNs channel. This property is
-- retained only for backward compatibility.
aPNSChannelResponse_id :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Text)
aPNSChannelResponse_id :: (Maybe Text -> f (Maybe Text))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_id = (APNSChannelResponse -> Maybe Text)
-> (APNSChannelResponse -> Maybe Text -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Text
id :: Maybe Text
$sel:id:APNSChannelResponse' :: APNSChannelResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Text
a -> APNSChannelResponse
s {$sel:id:APNSChannelResponse' :: Maybe Text
id = Maybe Text
a} :: APNSChannelResponse)

-- | The date and time when the APNs channel was enabled.
aPNSChannelResponse_creationDate :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Text)
aPNSChannelResponse_creationDate :: (Maybe Text -> f (Maybe Text))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_creationDate = (APNSChannelResponse -> Maybe Text)
-> (APNSChannelResponse -> Maybe Text -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Text
creationDate :: Maybe Text
$sel:creationDate:APNSChannelResponse' :: APNSChannelResponse -> Maybe Text
creationDate} -> Maybe Text
creationDate) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Text
a -> APNSChannelResponse
s {$sel:creationDate:APNSChannelResponse' :: Maybe Text
creationDate = Maybe Text
a} :: APNSChannelResponse)

-- | The user who last modified the APNs channel.
aPNSChannelResponse_lastModifiedBy :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Text)
aPNSChannelResponse_lastModifiedBy :: (Maybe Text -> f (Maybe Text))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_lastModifiedBy = (APNSChannelResponse -> Maybe Text)
-> (APNSChannelResponse -> Maybe Text -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Text
lastModifiedBy :: Maybe Text
$sel:lastModifiedBy:APNSChannelResponse' :: APNSChannelResponse -> Maybe Text
lastModifiedBy} -> Maybe Text
lastModifiedBy) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Text
a -> APNSChannelResponse
s {$sel:lastModifiedBy:APNSChannelResponse' :: Maybe Text
lastModifiedBy = Maybe Text
a} :: APNSChannelResponse)

-- | (Not used) This property is retained only for backward compatibility.
aPNSChannelResponse_hasCredential :: Lens.Lens' APNSChannelResponse (Prelude.Maybe Prelude.Bool)
aPNSChannelResponse_hasCredential :: (Maybe Bool -> f (Maybe Bool))
-> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_hasCredential = (APNSChannelResponse -> Maybe Bool)
-> (APNSChannelResponse -> Maybe Bool -> APNSChannelResponse)
-> Lens
     APNSChannelResponse APNSChannelResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Maybe Bool
hasCredential :: Maybe Bool
$sel:hasCredential:APNSChannelResponse' :: APNSChannelResponse -> Maybe Bool
hasCredential} -> Maybe Bool
hasCredential) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Maybe Bool
a -> APNSChannelResponse
s {$sel:hasCredential:APNSChannelResponse' :: Maybe Bool
hasCredential = Maybe Bool
a} :: APNSChannelResponse)

-- | The type of messaging or notification platform for the channel. For the
-- APNs channel, this value is APNS.
aPNSChannelResponse_platform :: Lens.Lens' APNSChannelResponse Prelude.Text
aPNSChannelResponse_platform :: (Text -> f Text) -> APNSChannelResponse -> f APNSChannelResponse
aPNSChannelResponse_platform = (APNSChannelResponse -> Text)
-> (APNSChannelResponse -> Text -> APNSChannelResponse)
-> Lens APNSChannelResponse APNSChannelResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelResponse' {Text
platform :: Text
$sel:platform:APNSChannelResponse' :: APNSChannelResponse -> Text
platform} -> Text
platform) (\s :: APNSChannelResponse
s@APNSChannelResponse' {} Text
a -> APNSChannelResponse
s {$sel:platform:APNSChannelResponse' :: Text
platform = Text
a} :: APNSChannelResponse)

instance Core.FromJSON APNSChannelResponse where
  parseJSON :: Value -> Parser APNSChannelResponse
parseJSON =
    String
-> (Object -> Parser APNSChannelResponse)
-> Value
-> Parser APNSChannelResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"APNSChannelResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> APNSChannelResponse
APNSChannelResponse'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Text
 -> APNSChannelResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> APNSChannelResponse)
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
"LastModifiedDate")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> APNSChannelResponse)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> APNSChannelResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Enabled")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> APNSChannelResponse)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> APNSChannelResponse)
forall (f :: * -> *) a b. Applicative f => 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
"HasTokenKey")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> APNSChannelResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> APNSChannelResponse)
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
"DefaultAuthenticationMethod")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> APNSChannelResponse)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> APNSChannelResponse)
forall (f :: * -> *) a b. Applicative f => 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
"IsArchived")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> APNSChannelResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> APNSChannelResponse)
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
"ApplicationId")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> APNSChannelResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> APNSChannelResponse)
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
"Version")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> APNSChannelResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Bool -> Text -> APNSChannelResponse)
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
"Id")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Bool -> Text -> APNSChannelResponse)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> Text -> APNSChannelResponse)
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
"CreationDate")
            Parser (Maybe Text -> Maybe Bool -> Text -> APNSChannelResponse)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Text -> APNSChannelResponse)
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
"LastModifiedBy")
            Parser (Maybe Bool -> Text -> APNSChannelResponse)
-> Parser (Maybe Bool) -> Parser (Text -> APNSChannelResponse)
forall (f :: * -> *) a b. Applicative f => 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
"HasCredential")
            Parser (Text -> APNSChannelResponse)
-> Parser Text -> Parser APNSChannelResponse
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
"Platform")
      )

instance Prelude.Hashable APNSChannelResponse

instance Prelude.NFData APNSChannelResponse