{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetApnsVoipSandboxChannel
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves information about the status and settings of the APNs VoIP
-- sandbox channel for an application.
module Amazonka.Pinpoint.GetApnsVoipSandboxChannel
  ( -- * Creating a Request
    GetApnsVoipSandboxChannel (..),
    newGetApnsVoipSandboxChannel,

    -- * Request Lenses
    getApnsVoipSandboxChannel_applicationId,

    -- * Destructuring the Response
    GetApnsVoipSandboxChannelResponse (..),
    newGetApnsVoipSandboxChannelResponse,

    -- * Response Lenses
    getApnsVoipSandboxChannelResponse_httpStatus,
    getApnsVoipSandboxChannelResponse_aPNSVoipSandboxChannelResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetApnsVoipSandboxChannel' smart constructor.
data GetApnsVoipSandboxChannel = GetApnsVoipSandboxChannel'
  { -- | The unique identifier for the application. This identifier is displayed
    -- as the __Project ID__ on the Amazon Pinpoint console.
    GetApnsVoipSandboxChannel -> Text
applicationId :: Prelude.Text
  }
  deriving (GetApnsVoipSandboxChannel -> GetApnsVoipSandboxChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApnsVoipSandboxChannel -> GetApnsVoipSandboxChannel -> Bool
$c/= :: GetApnsVoipSandboxChannel -> GetApnsVoipSandboxChannel -> Bool
== :: GetApnsVoipSandboxChannel -> GetApnsVoipSandboxChannel -> Bool
$c== :: GetApnsVoipSandboxChannel -> GetApnsVoipSandboxChannel -> Bool
Prelude.Eq, ReadPrec [GetApnsVoipSandboxChannel]
ReadPrec GetApnsVoipSandboxChannel
Int -> ReadS GetApnsVoipSandboxChannel
ReadS [GetApnsVoipSandboxChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApnsVoipSandboxChannel]
$creadListPrec :: ReadPrec [GetApnsVoipSandboxChannel]
readPrec :: ReadPrec GetApnsVoipSandboxChannel
$creadPrec :: ReadPrec GetApnsVoipSandboxChannel
readList :: ReadS [GetApnsVoipSandboxChannel]
$creadList :: ReadS [GetApnsVoipSandboxChannel]
readsPrec :: Int -> ReadS GetApnsVoipSandboxChannel
$creadsPrec :: Int -> ReadS GetApnsVoipSandboxChannel
Prelude.Read, Int -> GetApnsVoipSandboxChannel -> ShowS
[GetApnsVoipSandboxChannel] -> ShowS
GetApnsVoipSandboxChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApnsVoipSandboxChannel] -> ShowS
$cshowList :: [GetApnsVoipSandboxChannel] -> ShowS
show :: GetApnsVoipSandboxChannel -> String
$cshow :: GetApnsVoipSandboxChannel -> String
showsPrec :: Int -> GetApnsVoipSandboxChannel -> ShowS
$cshowsPrec :: Int -> GetApnsVoipSandboxChannel -> ShowS
Prelude.Show, forall x.
Rep GetApnsVoipSandboxChannel x -> GetApnsVoipSandboxChannel
forall x.
GetApnsVoipSandboxChannel -> Rep GetApnsVoipSandboxChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetApnsVoipSandboxChannel x -> GetApnsVoipSandboxChannel
$cfrom :: forall x.
GetApnsVoipSandboxChannel -> Rep GetApnsVoipSandboxChannel x
Prelude.Generic)

-- |
-- Create a value of 'GetApnsVoipSandboxChannel' 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:
--
-- 'applicationId', 'getApnsVoipSandboxChannel_applicationId' - The unique identifier for the application. This identifier is displayed
-- as the __Project ID__ on the Amazon Pinpoint console.
newGetApnsVoipSandboxChannel ::
  -- | 'applicationId'
  Prelude.Text ->
  GetApnsVoipSandboxChannel
newGetApnsVoipSandboxChannel :: Text -> GetApnsVoipSandboxChannel
newGetApnsVoipSandboxChannel Text
pApplicationId_ =
  GetApnsVoipSandboxChannel'
    { $sel:applicationId:GetApnsVoipSandboxChannel' :: Text
applicationId =
        Text
pApplicationId_
    }

-- | The unique identifier for the application. This identifier is displayed
-- as the __Project ID__ on the Amazon Pinpoint console.
getApnsVoipSandboxChannel_applicationId :: Lens.Lens' GetApnsVoipSandboxChannel Prelude.Text
getApnsVoipSandboxChannel_applicationId :: Lens' GetApnsVoipSandboxChannel Text
getApnsVoipSandboxChannel_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApnsVoipSandboxChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsVoipSandboxChannel' :: GetApnsVoipSandboxChannel -> Text
applicationId} -> Text
applicationId) (\s :: GetApnsVoipSandboxChannel
s@GetApnsVoipSandboxChannel' {} Text
a -> GetApnsVoipSandboxChannel
s {$sel:applicationId:GetApnsVoipSandboxChannel' :: Text
applicationId = Text
a} :: GetApnsVoipSandboxChannel)

instance Core.AWSRequest GetApnsVoipSandboxChannel where
  type
    AWSResponse GetApnsVoipSandboxChannel =
      GetApnsVoipSandboxChannelResponse
  request :: (Service -> Service)
-> GetApnsVoipSandboxChannel -> Request GetApnsVoipSandboxChannel
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetApnsVoipSandboxChannel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetApnsVoipSandboxChannel)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> APNSVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse
GetApnsVoipSandboxChannelResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
      )

instance Prelude.Hashable GetApnsVoipSandboxChannel where
  hashWithSalt :: Int -> GetApnsVoipSandboxChannel -> Int
hashWithSalt Int
_salt GetApnsVoipSandboxChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsVoipSandboxChannel' :: GetApnsVoipSandboxChannel -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId

instance Prelude.NFData GetApnsVoipSandboxChannel where
  rnf :: GetApnsVoipSandboxChannel -> ()
rnf GetApnsVoipSandboxChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsVoipSandboxChannel' :: GetApnsVoipSandboxChannel -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId

instance Data.ToHeaders GetApnsVoipSandboxChannel where
  toHeaders :: GetApnsVoipSandboxChannel -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath GetApnsVoipSandboxChannel where
  toPath :: GetApnsVoipSandboxChannel -> ByteString
toPath GetApnsVoipSandboxChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsVoipSandboxChannel' :: GetApnsVoipSandboxChannel -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/apps/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationId,
        ByteString
"/channels/apns_voip_sandbox"
      ]

instance Data.ToQuery GetApnsVoipSandboxChannel where
  toQuery :: GetApnsVoipSandboxChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetApnsVoipSandboxChannelResponse' smart constructor.
data GetApnsVoipSandboxChannelResponse = GetApnsVoipSandboxChannelResponse'
  { -- | The response's http status code.
    GetApnsVoipSandboxChannelResponse -> Int
httpStatus :: Prelude.Int,
    GetApnsVoipSandboxChannelResponse -> APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse :: APNSVoipSandboxChannelResponse
  }
  deriving (GetApnsVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApnsVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse -> Bool
$c/= :: GetApnsVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse -> Bool
== :: GetApnsVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse -> Bool
$c== :: GetApnsVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse -> Bool
Prelude.Eq, ReadPrec [GetApnsVoipSandboxChannelResponse]
ReadPrec GetApnsVoipSandboxChannelResponse
Int -> ReadS GetApnsVoipSandboxChannelResponse
ReadS [GetApnsVoipSandboxChannelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApnsVoipSandboxChannelResponse]
$creadListPrec :: ReadPrec [GetApnsVoipSandboxChannelResponse]
readPrec :: ReadPrec GetApnsVoipSandboxChannelResponse
$creadPrec :: ReadPrec GetApnsVoipSandboxChannelResponse
readList :: ReadS [GetApnsVoipSandboxChannelResponse]
$creadList :: ReadS [GetApnsVoipSandboxChannelResponse]
readsPrec :: Int -> ReadS GetApnsVoipSandboxChannelResponse
$creadsPrec :: Int -> ReadS GetApnsVoipSandboxChannelResponse
Prelude.Read, Int -> GetApnsVoipSandboxChannelResponse -> ShowS
[GetApnsVoipSandboxChannelResponse] -> ShowS
GetApnsVoipSandboxChannelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApnsVoipSandboxChannelResponse] -> ShowS
$cshowList :: [GetApnsVoipSandboxChannelResponse] -> ShowS
show :: GetApnsVoipSandboxChannelResponse -> String
$cshow :: GetApnsVoipSandboxChannelResponse -> String
showsPrec :: Int -> GetApnsVoipSandboxChannelResponse -> ShowS
$cshowsPrec :: Int -> GetApnsVoipSandboxChannelResponse -> ShowS
Prelude.Show, forall x.
Rep GetApnsVoipSandboxChannelResponse x
-> GetApnsVoipSandboxChannelResponse
forall x.
GetApnsVoipSandboxChannelResponse
-> Rep GetApnsVoipSandboxChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetApnsVoipSandboxChannelResponse x
-> GetApnsVoipSandboxChannelResponse
$cfrom :: forall x.
GetApnsVoipSandboxChannelResponse
-> Rep GetApnsVoipSandboxChannelResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetApnsVoipSandboxChannelResponse' 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:
--
-- 'httpStatus', 'getApnsVoipSandboxChannelResponse_httpStatus' - The response's http status code.
--
-- 'aPNSVoipSandboxChannelResponse', 'getApnsVoipSandboxChannelResponse_aPNSVoipSandboxChannelResponse' - Undocumented member.
newGetApnsVoipSandboxChannelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'aPNSVoipSandboxChannelResponse'
  APNSVoipSandboxChannelResponse ->
  GetApnsVoipSandboxChannelResponse
newGetApnsVoipSandboxChannelResponse :: Int
-> APNSVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse
newGetApnsVoipSandboxChannelResponse
  Int
pHttpStatus_
  APNSVoipSandboxChannelResponse
pAPNSVoipSandboxChannelResponse_ =
    GetApnsVoipSandboxChannelResponse'
      { $sel:httpStatus:GetApnsVoipSandboxChannelResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:aPNSVoipSandboxChannelResponse:GetApnsVoipSandboxChannelResponse' :: APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse =
          APNSVoipSandboxChannelResponse
pAPNSVoipSandboxChannelResponse_
      }

-- | The response's http status code.
getApnsVoipSandboxChannelResponse_httpStatus :: Lens.Lens' GetApnsVoipSandboxChannelResponse Prelude.Int
getApnsVoipSandboxChannelResponse_httpStatus :: Lens' GetApnsVoipSandboxChannelResponse Int
getApnsVoipSandboxChannelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApnsVoipSandboxChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetApnsVoipSandboxChannelResponse' :: GetApnsVoipSandboxChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetApnsVoipSandboxChannelResponse
s@GetApnsVoipSandboxChannelResponse' {} Int
a -> GetApnsVoipSandboxChannelResponse
s {$sel:httpStatus:GetApnsVoipSandboxChannelResponse' :: Int
httpStatus = Int
a} :: GetApnsVoipSandboxChannelResponse)

-- | Undocumented member.
getApnsVoipSandboxChannelResponse_aPNSVoipSandboxChannelResponse :: Lens.Lens' GetApnsVoipSandboxChannelResponse APNSVoipSandboxChannelResponse
getApnsVoipSandboxChannelResponse_aPNSVoipSandboxChannelResponse :: Lens'
  GetApnsVoipSandboxChannelResponse APNSVoipSandboxChannelResponse
getApnsVoipSandboxChannelResponse_aPNSVoipSandboxChannelResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApnsVoipSandboxChannelResponse' {APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse :: APNSVoipSandboxChannelResponse
$sel:aPNSVoipSandboxChannelResponse:GetApnsVoipSandboxChannelResponse' :: GetApnsVoipSandboxChannelResponse -> APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse} -> APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse) (\s :: GetApnsVoipSandboxChannelResponse
s@GetApnsVoipSandboxChannelResponse' {} APNSVoipSandboxChannelResponse
a -> GetApnsVoipSandboxChannelResponse
s {$sel:aPNSVoipSandboxChannelResponse:GetApnsVoipSandboxChannelResponse' :: APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse = APNSVoipSandboxChannelResponse
a} :: GetApnsVoipSandboxChannelResponse)

instance
  Prelude.NFData
    GetApnsVoipSandboxChannelResponse
  where
  rnf :: GetApnsVoipSandboxChannelResponse -> ()
rnf GetApnsVoipSandboxChannelResponse' {Int
APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse :: APNSVoipSandboxChannelResponse
httpStatus :: Int
$sel:aPNSVoipSandboxChannelResponse:GetApnsVoipSandboxChannelResponse' :: GetApnsVoipSandboxChannelResponse -> APNSVoipSandboxChannelResponse
$sel:httpStatus:GetApnsVoipSandboxChannelResponse' :: GetApnsVoipSandboxChannelResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf APNSVoipSandboxChannelResponse
aPNSVoipSandboxChannelResponse