{-# 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.SNS.CreatePlatformEndpoint
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an endpoint for a device and mobile app on one of the supported
-- push notification services, such as GCM (Firebase Cloud Messaging) and
-- APNS. @CreatePlatformEndpoint@ requires the @PlatformApplicationArn@
-- that is returned from @CreatePlatformApplication@. You can use the
-- returned @EndpointArn@ to send a message to a mobile app or by the
-- @Subscribe@ action for subscription to a topic. The
-- @CreatePlatformEndpoint@ action is idempotent, so if the requester
-- already owns an endpoint with the same device token and attributes, that
-- endpoint\'s ARN is returned without creating a new endpoint. For more
-- information, see
-- <https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html Using Amazon SNS Mobile Push Notifications>.
--
-- When using @CreatePlatformEndpoint@ with Baidu, two attributes must be
-- provided: ChannelId and UserId. The token field must also contain the
-- ChannelId. For more information, see
-- <https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePushBaiduEndpoint.html Creating an Amazon SNS Endpoint for Baidu>.
module Amazonka.SNS.CreatePlatformEndpoint
  ( -- * Creating a Request
    CreatePlatformEndpoint (..),
    newCreatePlatformEndpoint,

    -- * Request Lenses
    createPlatformEndpoint_attributes,
    createPlatformEndpoint_customUserData,
    createPlatformEndpoint_platformApplicationArn,
    createPlatformEndpoint_token,

    -- * Destructuring the Response
    CreatePlatformEndpointResponse (..),
    newCreatePlatformEndpointResponse,

    -- * Response Lenses
    createPlatformEndpointResponse_endpointArn,
    createPlatformEndpointResponse_httpStatus,
  )
where

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

-- | Input for CreatePlatformEndpoint action.
--
-- /See:/ 'newCreatePlatformEndpoint' smart constructor.
data CreatePlatformEndpoint = CreatePlatformEndpoint'
  { -- | For a list of attributes, see
    -- <https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html SetEndpointAttributes>.
    CreatePlatformEndpoint -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Arbitrary user data to associate with the endpoint. Amazon SNS does not
    -- use this data. The data must be in UTF-8 format and less than 2KB.
    CreatePlatformEndpoint -> Maybe Text
customUserData :: Prelude.Maybe Prelude.Text,
    -- | PlatformApplicationArn returned from CreatePlatformApplication is used
    -- to create a an endpoint.
    CreatePlatformEndpoint -> Text
platformApplicationArn :: Prelude.Text,
    -- | Unique identifier created by the notification service for an app on a
    -- device. The specific name for Token will vary, depending on which
    -- notification service is being used. For example, when using APNS as the
    -- notification service, you need the device token. Alternatively, when
    -- using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent
    -- is called the registration ID.
    CreatePlatformEndpoint -> Text
token :: Prelude.Text
  }
  deriving (CreatePlatformEndpoint -> CreatePlatformEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePlatformEndpoint -> CreatePlatformEndpoint -> Bool
$c/= :: CreatePlatformEndpoint -> CreatePlatformEndpoint -> Bool
== :: CreatePlatformEndpoint -> CreatePlatformEndpoint -> Bool
$c== :: CreatePlatformEndpoint -> CreatePlatformEndpoint -> Bool
Prelude.Eq, ReadPrec [CreatePlatformEndpoint]
ReadPrec CreatePlatformEndpoint
Int -> ReadS CreatePlatformEndpoint
ReadS [CreatePlatformEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePlatformEndpoint]
$creadListPrec :: ReadPrec [CreatePlatformEndpoint]
readPrec :: ReadPrec CreatePlatformEndpoint
$creadPrec :: ReadPrec CreatePlatformEndpoint
readList :: ReadS [CreatePlatformEndpoint]
$creadList :: ReadS [CreatePlatformEndpoint]
readsPrec :: Int -> ReadS CreatePlatformEndpoint
$creadsPrec :: Int -> ReadS CreatePlatformEndpoint
Prelude.Read, Int -> CreatePlatformEndpoint -> ShowS
[CreatePlatformEndpoint] -> ShowS
CreatePlatformEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePlatformEndpoint] -> ShowS
$cshowList :: [CreatePlatformEndpoint] -> ShowS
show :: CreatePlatformEndpoint -> String
$cshow :: CreatePlatformEndpoint -> String
showsPrec :: Int -> CreatePlatformEndpoint -> ShowS
$cshowsPrec :: Int -> CreatePlatformEndpoint -> ShowS
Prelude.Show, forall x. Rep CreatePlatformEndpoint x -> CreatePlatformEndpoint
forall x. CreatePlatformEndpoint -> Rep CreatePlatformEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePlatformEndpoint x -> CreatePlatformEndpoint
$cfrom :: forall x. CreatePlatformEndpoint -> Rep CreatePlatformEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'CreatePlatformEndpoint' 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:
--
-- 'attributes', 'createPlatformEndpoint_attributes' - For a list of attributes, see
-- <https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html SetEndpointAttributes>.
--
-- 'customUserData', 'createPlatformEndpoint_customUserData' - Arbitrary user data to associate with the endpoint. Amazon SNS does not
-- use this data. The data must be in UTF-8 format and less than 2KB.
--
-- 'platformApplicationArn', 'createPlatformEndpoint_platformApplicationArn' - PlatformApplicationArn returned from CreatePlatformApplication is used
-- to create a an endpoint.
--
-- 'token', 'createPlatformEndpoint_token' - Unique identifier created by the notification service for an app on a
-- device. The specific name for Token will vary, depending on which
-- notification service is being used. For example, when using APNS as the
-- notification service, you need the device token. Alternatively, when
-- using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent
-- is called the registration ID.
newCreatePlatformEndpoint ::
  -- | 'platformApplicationArn'
  Prelude.Text ->
  -- | 'token'
  Prelude.Text ->
  CreatePlatformEndpoint
newCreatePlatformEndpoint :: Text -> Text -> CreatePlatformEndpoint
newCreatePlatformEndpoint
  Text
pPlatformApplicationArn_
  Text
pToken_ =
    CreatePlatformEndpoint'
      { $sel:attributes:CreatePlatformEndpoint' :: Maybe (HashMap Text Text)
attributes =
          forall a. Maybe a
Prelude.Nothing,
        $sel:customUserData:CreatePlatformEndpoint' :: Maybe Text
customUserData = forall a. Maybe a
Prelude.Nothing,
        $sel:platformApplicationArn:CreatePlatformEndpoint' :: Text
platformApplicationArn = Text
pPlatformApplicationArn_,
        $sel:token:CreatePlatformEndpoint' :: Text
token = Text
pToken_
      }

-- | For a list of attributes, see
-- <https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html SetEndpointAttributes>.
createPlatformEndpoint_attributes :: Lens.Lens' CreatePlatformEndpoint (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createPlatformEndpoint_attributes :: Lens' CreatePlatformEndpoint (Maybe (HashMap Text Text))
createPlatformEndpoint_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePlatformEndpoint' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: CreatePlatformEndpoint
s@CreatePlatformEndpoint' {} Maybe (HashMap Text Text)
a -> CreatePlatformEndpoint
s {$sel:attributes:CreatePlatformEndpoint' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: CreatePlatformEndpoint) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Arbitrary user data to associate with the endpoint. Amazon SNS does not
-- use this data. The data must be in UTF-8 format and less than 2KB.
createPlatformEndpoint_customUserData :: Lens.Lens' CreatePlatformEndpoint (Prelude.Maybe Prelude.Text)
createPlatformEndpoint_customUserData :: Lens' CreatePlatformEndpoint (Maybe Text)
createPlatformEndpoint_customUserData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePlatformEndpoint' {Maybe Text
customUserData :: Maybe Text
$sel:customUserData:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe Text
customUserData} -> Maybe Text
customUserData) (\s :: CreatePlatformEndpoint
s@CreatePlatformEndpoint' {} Maybe Text
a -> CreatePlatformEndpoint
s {$sel:customUserData:CreatePlatformEndpoint' :: Maybe Text
customUserData = Maybe Text
a} :: CreatePlatformEndpoint)

-- | PlatformApplicationArn returned from CreatePlatformApplication is used
-- to create a an endpoint.
createPlatformEndpoint_platformApplicationArn :: Lens.Lens' CreatePlatformEndpoint Prelude.Text
createPlatformEndpoint_platformApplicationArn :: Lens' CreatePlatformEndpoint Text
createPlatformEndpoint_platformApplicationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePlatformEndpoint' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
platformApplicationArn} -> Text
platformApplicationArn) (\s :: CreatePlatformEndpoint
s@CreatePlatformEndpoint' {} Text
a -> CreatePlatformEndpoint
s {$sel:platformApplicationArn:CreatePlatformEndpoint' :: Text
platformApplicationArn = Text
a} :: CreatePlatformEndpoint)

-- | Unique identifier created by the notification service for an app on a
-- device. The specific name for Token will vary, depending on which
-- notification service is being used. For example, when using APNS as the
-- notification service, you need the device token. Alternatively, when
-- using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent
-- is called the registration ID.
createPlatformEndpoint_token :: Lens.Lens' CreatePlatformEndpoint Prelude.Text
createPlatformEndpoint_token :: Lens' CreatePlatformEndpoint Text
createPlatformEndpoint_token = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePlatformEndpoint' {Text
token :: Text
$sel:token:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
token} -> Text
token) (\s :: CreatePlatformEndpoint
s@CreatePlatformEndpoint' {} Text
a -> CreatePlatformEndpoint
s {$sel:token:CreatePlatformEndpoint' :: Text
token = Text
a} :: CreatePlatformEndpoint)

instance Core.AWSRequest CreatePlatformEndpoint where
  type
    AWSResponse CreatePlatformEndpoint =
      CreatePlatformEndpointResponse
  request :: (Service -> Service)
-> CreatePlatformEndpoint -> Request CreatePlatformEndpoint
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreatePlatformEndpoint
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreatePlatformEndpoint)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreatePlatformEndpointResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Int -> CreatePlatformEndpointResponse
CreatePlatformEndpointResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"EndpointArn")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable CreatePlatformEndpoint where
  hashWithSalt :: Int -> CreatePlatformEndpoint -> Int
hashWithSalt Int
_salt CreatePlatformEndpoint' {Maybe Text
Maybe (HashMap Text Text)
Text
token :: Text
platformApplicationArn :: Text
customUserData :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:token:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
$sel:platformApplicationArn:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
$sel:customUserData:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe Text
$sel:attributes:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
attributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customUserData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
platformApplicationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
token

instance Prelude.NFData CreatePlatformEndpoint where
  rnf :: CreatePlatformEndpoint -> ()
rnf CreatePlatformEndpoint' {Maybe Text
Maybe (HashMap Text Text)
Text
token :: Text
platformApplicationArn :: Text
customUserData :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:token:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
$sel:platformApplicationArn:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
$sel:customUserData:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe Text
$sel:attributes:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customUserData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
platformApplicationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
token

instance Data.ToHeaders CreatePlatformEndpoint where
  toHeaders :: CreatePlatformEndpoint -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath CreatePlatformEndpoint where
  toPath :: CreatePlatformEndpoint -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreatePlatformEndpoint where
  toQuery :: CreatePlatformEndpoint -> QueryString
toQuery CreatePlatformEndpoint' {Maybe Text
Maybe (HashMap Text Text)
Text
token :: Text
platformApplicationArn :: Text
customUserData :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:token:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
$sel:platformApplicationArn:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Text
$sel:customUserData:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe Text
$sel:attributes:CreatePlatformEndpoint' :: CreatePlatformEndpoint -> Maybe (HashMap Text Text)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreatePlatformEndpoint" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
        ByteString
"Attributes"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall k v.
(ToQuery k, ToQuery v) =>
ByteString
-> ByteString -> ByteString -> HashMap k v -> QueryString
Data.toQueryMap ByteString
"entry" ByteString
"key" ByteString
"value"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
attributes
            ),
        ByteString
"CustomUserData" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
customUserData,
        ByteString
"PlatformApplicationArn"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
platformApplicationArn,
        ByteString
"Token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
token
      ]

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

-- |
-- Create a value of 'CreatePlatformEndpointResponse' 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:
--
-- 'endpointArn', 'createPlatformEndpointResponse_endpointArn' - EndpointArn returned from CreateEndpoint action.
--
-- 'httpStatus', 'createPlatformEndpointResponse_httpStatus' - The response's http status code.
newCreatePlatformEndpointResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreatePlatformEndpointResponse
newCreatePlatformEndpointResponse :: Int -> CreatePlatformEndpointResponse
newCreatePlatformEndpointResponse Int
pHttpStatus_ =
  CreatePlatformEndpointResponse'
    { $sel:endpointArn:CreatePlatformEndpointResponse' :: Maybe Text
endpointArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreatePlatformEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | EndpointArn returned from CreateEndpoint action.
createPlatformEndpointResponse_endpointArn :: Lens.Lens' CreatePlatformEndpointResponse (Prelude.Maybe Prelude.Text)
createPlatformEndpointResponse_endpointArn :: Lens' CreatePlatformEndpointResponse (Maybe Text)
createPlatformEndpointResponse_endpointArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePlatformEndpointResponse' {Maybe Text
endpointArn :: Maybe Text
$sel:endpointArn:CreatePlatformEndpointResponse' :: CreatePlatformEndpointResponse -> Maybe Text
endpointArn} -> Maybe Text
endpointArn) (\s :: CreatePlatformEndpointResponse
s@CreatePlatformEndpointResponse' {} Maybe Text
a -> CreatePlatformEndpointResponse
s {$sel:endpointArn:CreatePlatformEndpointResponse' :: Maybe Text
endpointArn = Maybe Text
a} :: CreatePlatformEndpointResponse)

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

instance
  Prelude.NFData
    CreatePlatformEndpointResponse
  where
  rnf :: CreatePlatformEndpointResponse -> ()
rnf CreatePlatformEndpointResponse' {Int
Maybe Text
httpStatus :: Int
endpointArn :: Maybe Text
$sel:httpStatus:CreatePlatformEndpointResponse' :: CreatePlatformEndpointResponse -> Int
$sel:endpointArn:CreatePlatformEndpointResponse' :: CreatePlatformEndpointResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus