{-# 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-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)
--
-- 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.Lens as Lens
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
(GetApnsVoipSandboxChannel -> GetApnsVoipSandboxChannel -> Bool)
-> (GetApnsVoipSandboxChannel -> GetApnsVoipSandboxChannel -> Bool)
-> Eq GetApnsVoipSandboxChannel
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]
(Int -> ReadS GetApnsVoipSandboxChannel)
-> ReadS [GetApnsVoipSandboxChannel]
-> ReadPrec GetApnsVoipSandboxChannel
-> ReadPrec [GetApnsVoipSandboxChannel]
-> Read 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
(Int -> GetApnsVoipSandboxChannel -> ShowS)
-> (GetApnsVoipSandboxChannel -> String)
-> ([GetApnsVoipSandboxChannel] -> ShowS)
-> Show GetApnsVoipSandboxChannel
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.
 GetApnsVoipSandboxChannel -> Rep GetApnsVoipSandboxChannel x)
-> (forall x.
    Rep GetApnsVoipSandboxChannel x -> GetApnsVoipSandboxChannel)
-> Generic GetApnsVoipSandboxChannel
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' :: Text -> GetApnsVoipSandboxChannel
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 :: (Text -> f Text)
-> GetApnsVoipSandboxChannel -> f GetApnsVoipSandboxChannel
getApnsVoipSandboxChannel_applicationId = (GetApnsVoipSandboxChannel -> Text)
-> (GetApnsVoipSandboxChannel -> Text -> GetApnsVoipSandboxChannel)
-> Lens
     GetApnsVoipSandboxChannel GetApnsVoipSandboxChannel Text Text
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 :: GetApnsVoipSandboxChannel -> Request GetApnsVoipSandboxChannel
request = Service
-> GetApnsVoipSandboxChannel -> Request GetApnsVoipSandboxChannel
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetApnsVoipSandboxChannel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetApnsVoipSandboxChannel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetApnsVoipSandboxChannel))
-> Logger
-> Service
-> Proxy GetApnsVoipSandboxChannel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetApnsVoipSandboxChannel)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> APNSVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse
GetApnsVoipSandboxChannelResponse'
            (Int
 -> APNSVoipSandboxChannelResponse
 -> GetApnsVoipSandboxChannelResponse)
-> Either String Int
-> Either
     String
     (APNSVoipSandboxChannelResponse
      -> GetApnsVoipSandboxChannelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  (APNSVoipSandboxChannelResponse
   -> GetApnsVoipSandboxChannelResponse)
-> Either String APNSVoipSandboxChannelResponse
-> Either String GetApnsVoipSandboxChannelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String APNSVoipSandboxChannelResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
      )

instance Prelude.Hashable GetApnsVoipSandboxChannel

instance Prelude.NFData GetApnsVoipSandboxChannel

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

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

instance Core.ToQuery GetApnsVoipSandboxChannel where
  toQuery :: GetApnsVoipSandboxChannel -> QueryString
toQuery = QueryString -> GetApnsVoipSandboxChannel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(GetApnsVoipSandboxChannelResponse
 -> GetApnsVoipSandboxChannelResponse -> Bool)
-> (GetApnsVoipSandboxChannelResponse
    -> GetApnsVoipSandboxChannelResponse -> Bool)
-> Eq GetApnsVoipSandboxChannelResponse
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]
(Int -> ReadS GetApnsVoipSandboxChannelResponse)
-> ReadS [GetApnsVoipSandboxChannelResponse]
-> ReadPrec GetApnsVoipSandboxChannelResponse
-> ReadPrec [GetApnsVoipSandboxChannelResponse]
-> Read 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
(Int -> GetApnsVoipSandboxChannelResponse -> ShowS)
-> (GetApnsVoipSandboxChannelResponse -> String)
-> ([GetApnsVoipSandboxChannelResponse] -> ShowS)
-> Show GetApnsVoipSandboxChannelResponse
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.
 GetApnsVoipSandboxChannelResponse
 -> Rep GetApnsVoipSandboxChannelResponse x)
-> (forall x.
    Rep GetApnsVoipSandboxChannelResponse x
    -> GetApnsVoipSandboxChannelResponse)
-> Generic GetApnsVoipSandboxChannelResponse
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' :: Int
-> APNSVoipSandboxChannelResponse
-> GetApnsVoipSandboxChannelResponse
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 :: (Int -> f Int)
-> GetApnsVoipSandboxChannelResponse
-> f GetApnsVoipSandboxChannelResponse
getApnsVoipSandboxChannelResponse_httpStatus = (GetApnsVoipSandboxChannelResponse -> Int)
-> (GetApnsVoipSandboxChannelResponse
    -> Int -> GetApnsVoipSandboxChannelResponse)
-> Lens
     GetApnsVoipSandboxChannelResponse
     GetApnsVoipSandboxChannelResponse
     Int
     Int
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 :: (APNSVoipSandboxChannelResponse
 -> f APNSVoipSandboxChannelResponse)
-> GetApnsVoipSandboxChannelResponse
-> f GetApnsVoipSandboxChannelResponse
getApnsVoipSandboxChannelResponse_aPNSVoipSandboxChannelResponse = (GetApnsVoipSandboxChannelResponse
 -> APNSVoipSandboxChannelResponse)
-> (GetApnsVoipSandboxChannelResponse
    -> APNSVoipSandboxChannelResponse
    -> GetApnsVoipSandboxChannelResponse)
-> Lens
     GetApnsVoipSandboxChannelResponse
     GetApnsVoipSandboxChannelResponse
     APNSVoipSandboxChannelResponse
     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