{-# 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.WorkDocs.CreateNotificationSubscription
-- 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)
--
-- Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint
-- receives a confirmation message, and must confirm the subscription.
--
-- For more information, see
-- <https://docs.aws.amazon.com/workdocs/latest/developerguide/subscribe-notifications.html Subscribe to Notifications>
-- in the /Amazon WorkDocs Developer Guide/.
module Amazonka.WorkDocs.CreateNotificationSubscription
  ( -- * Creating a Request
    CreateNotificationSubscription (..),
    newCreateNotificationSubscription,

    -- * Request Lenses
    createNotificationSubscription_organizationId,
    createNotificationSubscription_endpoint,
    createNotificationSubscription_protocol,
    createNotificationSubscription_subscriptionType,

    -- * Destructuring the Response
    CreateNotificationSubscriptionResponse (..),
    newCreateNotificationSubscriptionResponse,

    -- * Response Lenses
    createNotificationSubscriptionResponse_subscription,
    createNotificationSubscriptionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkDocs.Types

-- | /See:/ 'newCreateNotificationSubscription' smart constructor.
data CreateNotificationSubscription = CreateNotificationSubscription'
  { -- | The ID of the organization.
    CreateNotificationSubscription -> Text
organizationId :: Prelude.Text,
    -- | The endpoint to receive the notifications. If the protocol is HTTPS, the
    -- endpoint is a URL that begins with @https@.
    CreateNotificationSubscription -> Text
endpoint :: Prelude.Text,
    -- | The protocol to use. The supported value is https, which delivers
    -- JSON-encoded messages using HTTPS POST.
    CreateNotificationSubscription -> SubscriptionProtocolType
protocol :: SubscriptionProtocolType,
    -- | The notification type.
    CreateNotificationSubscription -> SubscriptionType
subscriptionType :: SubscriptionType
  }
  deriving (CreateNotificationSubscription
-> CreateNotificationSubscription -> Bool
(CreateNotificationSubscription
 -> CreateNotificationSubscription -> Bool)
-> (CreateNotificationSubscription
    -> CreateNotificationSubscription -> Bool)
-> Eq CreateNotificationSubscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNotificationSubscription
-> CreateNotificationSubscription -> Bool
$c/= :: CreateNotificationSubscription
-> CreateNotificationSubscription -> Bool
== :: CreateNotificationSubscription
-> CreateNotificationSubscription -> Bool
$c== :: CreateNotificationSubscription
-> CreateNotificationSubscription -> Bool
Prelude.Eq, ReadPrec [CreateNotificationSubscription]
ReadPrec CreateNotificationSubscription
Int -> ReadS CreateNotificationSubscription
ReadS [CreateNotificationSubscription]
(Int -> ReadS CreateNotificationSubscription)
-> ReadS [CreateNotificationSubscription]
-> ReadPrec CreateNotificationSubscription
-> ReadPrec [CreateNotificationSubscription]
-> Read CreateNotificationSubscription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNotificationSubscription]
$creadListPrec :: ReadPrec [CreateNotificationSubscription]
readPrec :: ReadPrec CreateNotificationSubscription
$creadPrec :: ReadPrec CreateNotificationSubscription
readList :: ReadS [CreateNotificationSubscription]
$creadList :: ReadS [CreateNotificationSubscription]
readsPrec :: Int -> ReadS CreateNotificationSubscription
$creadsPrec :: Int -> ReadS CreateNotificationSubscription
Prelude.Read, Int -> CreateNotificationSubscription -> ShowS
[CreateNotificationSubscription] -> ShowS
CreateNotificationSubscription -> String
(Int -> CreateNotificationSubscription -> ShowS)
-> (CreateNotificationSubscription -> String)
-> ([CreateNotificationSubscription] -> ShowS)
-> Show CreateNotificationSubscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNotificationSubscription] -> ShowS
$cshowList :: [CreateNotificationSubscription] -> ShowS
show :: CreateNotificationSubscription -> String
$cshow :: CreateNotificationSubscription -> String
showsPrec :: Int -> CreateNotificationSubscription -> ShowS
$cshowsPrec :: Int -> CreateNotificationSubscription -> ShowS
Prelude.Show, (forall x.
 CreateNotificationSubscription
 -> Rep CreateNotificationSubscription x)
-> (forall x.
    Rep CreateNotificationSubscription x
    -> CreateNotificationSubscription)
-> Generic CreateNotificationSubscription
forall x.
Rep CreateNotificationSubscription x
-> CreateNotificationSubscription
forall x.
CreateNotificationSubscription
-> Rep CreateNotificationSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNotificationSubscription x
-> CreateNotificationSubscription
$cfrom :: forall x.
CreateNotificationSubscription
-> Rep CreateNotificationSubscription x
Prelude.Generic)

-- |
-- Create a value of 'CreateNotificationSubscription' 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:
--
-- 'organizationId', 'createNotificationSubscription_organizationId' - The ID of the organization.
--
-- 'endpoint', 'createNotificationSubscription_endpoint' - The endpoint to receive the notifications. If the protocol is HTTPS, the
-- endpoint is a URL that begins with @https@.
--
-- 'protocol', 'createNotificationSubscription_protocol' - The protocol to use. The supported value is https, which delivers
-- JSON-encoded messages using HTTPS POST.
--
-- 'subscriptionType', 'createNotificationSubscription_subscriptionType' - The notification type.
newCreateNotificationSubscription ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'endpoint'
  Prelude.Text ->
  -- | 'protocol'
  SubscriptionProtocolType ->
  -- | 'subscriptionType'
  SubscriptionType ->
  CreateNotificationSubscription
newCreateNotificationSubscription :: Text
-> Text
-> SubscriptionProtocolType
-> SubscriptionType
-> CreateNotificationSubscription
newCreateNotificationSubscription
  Text
pOrganizationId_
  Text
pEndpoint_
  SubscriptionProtocolType
pProtocol_
  SubscriptionType
pSubscriptionType_ =
    CreateNotificationSubscription' :: Text
-> Text
-> SubscriptionProtocolType
-> SubscriptionType
-> CreateNotificationSubscription
CreateNotificationSubscription'
      { $sel:organizationId:CreateNotificationSubscription' :: Text
organizationId =
          Text
pOrganizationId_,
        $sel:endpoint:CreateNotificationSubscription' :: Text
endpoint = Text
pEndpoint_,
        $sel:protocol:CreateNotificationSubscription' :: SubscriptionProtocolType
protocol = SubscriptionProtocolType
pProtocol_,
        $sel:subscriptionType:CreateNotificationSubscription' :: SubscriptionType
subscriptionType = SubscriptionType
pSubscriptionType_
      }

-- | The ID of the organization.
createNotificationSubscription_organizationId :: Lens.Lens' CreateNotificationSubscription Prelude.Text
createNotificationSubscription_organizationId :: (Text -> f Text)
-> CreateNotificationSubscription
-> f CreateNotificationSubscription
createNotificationSubscription_organizationId = (CreateNotificationSubscription -> Text)
-> (CreateNotificationSubscription
    -> Text -> CreateNotificationSubscription)
-> Lens
     CreateNotificationSubscription
     CreateNotificationSubscription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationSubscription' {Text
organizationId :: Text
$sel:organizationId:CreateNotificationSubscription' :: CreateNotificationSubscription -> Text
organizationId} -> Text
organizationId) (\s :: CreateNotificationSubscription
s@CreateNotificationSubscription' {} Text
a -> CreateNotificationSubscription
s {$sel:organizationId:CreateNotificationSubscription' :: Text
organizationId = Text
a} :: CreateNotificationSubscription)

-- | The endpoint to receive the notifications. If the protocol is HTTPS, the
-- endpoint is a URL that begins with @https@.
createNotificationSubscription_endpoint :: Lens.Lens' CreateNotificationSubscription Prelude.Text
createNotificationSubscription_endpoint :: (Text -> f Text)
-> CreateNotificationSubscription
-> f CreateNotificationSubscription
createNotificationSubscription_endpoint = (CreateNotificationSubscription -> Text)
-> (CreateNotificationSubscription
    -> Text -> CreateNotificationSubscription)
-> Lens
     CreateNotificationSubscription
     CreateNotificationSubscription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationSubscription' {Text
endpoint :: Text
$sel:endpoint:CreateNotificationSubscription' :: CreateNotificationSubscription -> Text
endpoint} -> Text
endpoint) (\s :: CreateNotificationSubscription
s@CreateNotificationSubscription' {} Text
a -> CreateNotificationSubscription
s {$sel:endpoint:CreateNotificationSubscription' :: Text
endpoint = Text
a} :: CreateNotificationSubscription)

-- | The protocol to use. The supported value is https, which delivers
-- JSON-encoded messages using HTTPS POST.
createNotificationSubscription_protocol :: Lens.Lens' CreateNotificationSubscription SubscriptionProtocolType
createNotificationSubscription_protocol :: (SubscriptionProtocolType -> f SubscriptionProtocolType)
-> CreateNotificationSubscription
-> f CreateNotificationSubscription
createNotificationSubscription_protocol = (CreateNotificationSubscription -> SubscriptionProtocolType)
-> (CreateNotificationSubscription
    -> SubscriptionProtocolType -> CreateNotificationSubscription)
-> Lens
     CreateNotificationSubscription
     CreateNotificationSubscription
     SubscriptionProtocolType
     SubscriptionProtocolType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationSubscription' {SubscriptionProtocolType
protocol :: SubscriptionProtocolType
$sel:protocol:CreateNotificationSubscription' :: CreateNotificationSubscription -> SubscriptionProtocolType
protocol} -> SubscriptionProtocolType
protocol) (\s :: CreateNotificationSubscription
s@CreateNotificationSubscription' {} SubscriptionProtocolType
a -> CreateNotificationSubscription
s {$sel:protocol:CreateNotificationSubscription' :: SubscriptionProtocolType
protocol = SubscriptionProtocolType
a} :: CreateNotificationSubscription)

-- | The notification type.
createNotificationSubscription_subscriptionType :: Lens.Lens' CreateNotificationSubscription SubscriptionType
createNotificationSubscription_subscriptionType :: (SubscriptionType -> f SubscriptionType)
-> CreateNotificationSubscription
-> f CreateNotificationSubscription
createNotificationSubscription_subscriptionType = (CreateNotificationSubscription -> SubscriptionType)
-> (CreateNotificationSubscription
    -> SubscriptionType -> CreateNotificationSubscription)
-> Lens
     CreateNotificationSubscription
     CreateNotificationSubscription
     SubscriptionType
     SubscriptionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationSubscription' {SubscriptionType
subscriptionType :: SubscriptionType
$sel:subscriptionType:CreateNotificationSubscription' :: CreateNotificationSubscription -> SubscriptionType
subscriptionType} -> SubscriptionType
subscriptionType) (\s :: CreateNotificationSubscription
s@CreateNotificationSubscription' {} SubscriptionType
a -> CreateNotificationSubscription
s {$sel:subscriptionType:CreateNotificationSubscription' :: SubscriptionType
subscriptionType = SubscriptionType
a} :: CreateNotificationSubscription)

instance
  Core.AWSRequest
    CreateNotificationSubscription
  where
  type
    AWSResponse CreateNotificationSubscription =
      CreateNotificationSubscriptionResponse
  request :: CreateNotificationSubscription
-> Request CreateNotificationSubscription
request = Service
-> CreateNotificationSubscription
-> Request CreateNotificationSubscription
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateNotificationSubscription
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateNotificationSubscription)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateNotificationSubscription))
-> Logger
-> Service
-> Proxy CreateNotificationSubscription
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateNotificationSubscription)))
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 ->
          Maybe Subscription -> Int -> CreateNotificationSubscriptionResponse
CreateNotificationSubscriptionResponse'
            (Maybe Subscription
 -> Int -> CreateNotificationSubscriptionResponse)
-> Either String (Maybe Subscription)
-> Either String (Int -> CreateNotificationSubscriptionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Subscription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Subscription")
            Either String (Int -> CreateNotificationSubscriptionResponse)
-> Either String Int
-> Either String CreateNotificationSubscriptionResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance
  Prelude.Hashable
    CreateNotificationSubscription

instance
  Prelude.NFData
    CreateNotificationSubscription

instance
  Core.ToHeaders
    CreateNotificationSubscription
  where
  toHeaders :: CreateNotificationSubscription -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateNotificationSubscription -> 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.ToJSON CreateNotificationSubscription where
  toJSON :: CreateNotificationSubscription -> Value
toJSON CreateNotificationSubscription' {Text
SubscriptionProtocolType
SubscriptionType
subscriptionType :: SubscriptionType
protocol :: SubscriptionProtocolType
endpoint :: Text
organizationId :: Text
$sel:subscriptionType:CreateNotificationSubscription' :: CreateNotificationSubscription -> SubscriptionType
$sel:protocol:CreateNotificationSubscription' :: CreateNotificationSubscription -> SubscriptionProtocolType
$sel:endpoint:CreateNotificationSubscription' :: CreateNotificationSubscription -> Text
$sel:organizationId:CreateNotificationSubscription' :: CreateNotificationSubscription -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Endpoint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpoint),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Protocol" Text -> SubscriptionProtocolType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SubscriptionProtocolType
protocol),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SubscriptionType" Text -> SubscriptionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SubscriptionType
subscriptionType)
          ]
      )

instance Core.ToPath CreateNotificationSubscription where
  toPath :: CreateNotificationSubscription -> ByteString
toPath CreateNotificationSubscription' {Text
SubscriptionProtocolType
SubscriptionType
subscriptionType :: SubscriptionType
protocol :: SubscriptionProtocolType
endpoint :: Text
organizationId :: Text
$sel:subscriptionType:CreateNotificationSubscription' :: CreateNotificationSubscription -> SubscriptionType
$sel:protocol:CreateNotificationSubscription' :: CreateNotificationSubscription -> SubscriptionProtocolType
$sel:endpoint:CreateNotificationSubscription' :: CreateNotificationSubscription -> Text
$sel:organizationId:CreateNotificationSubscription' :: CreateNotificationSubscription -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/api/v1/organizations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
organizationId,
        ByteString
"/subscriptions"
      ]

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

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

-- |
-- Create a value of 'CreateNotificationSubscriptionResponse' 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:
--
-- 'subscription', 'createNotificationSubscriptionResponse_subscription' - The subscription.
--
-- 'httpStatus', 'createNotificationSubscriptionResponse_httpStatus' - The response's http status code.
newCreateNotificationSubscriptionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateNotificationSubscriptionResponse
newCreateNotificationSubscriptionResponse :: Int -> CreateNotificationSubscriptionResponse
newCreateNotificationSubscriptionResponse
  Int
pHttpStatus_ =
    CreateNotificationSubscriptionResponse' :: Maybe Subscription -> Int -> CreateNotificationSubscriptionResponse
CreateNotificationSubscriptionResponse'
      { $sel:subscription:CreateNotificationSubscriptionResponse' :: Maybe Subscription
subscription =
          Maybe Subscription
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateNotificationSubscriptionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The subscription.
createNotificationSubscriptionResponse_subscription :: Lens.Lens' CreateNotificationSubscriptionResponse (Prelude.Maybe Subscription)
createNotificationSubscriptionResponse_subscription :: (Maybe Subscription -> f (Maybe Subscription))
-> CreateNotificationSubscriptionResponse
-> f CreateNotificationSubscriptionResponse
createNotificationSubscriptionResponse_subscription = (CreateNotificationSubscriptionResponse -> Maybe Subscription)
-> (CreateNotificationSubscriptionResponse
    -> Maybe Subscription -> CreateNotificationSubscriptionResponse)
-> Lens
     CreateNotificationSubscriptionResponse
     CreateNotificationSubscriptionResponse
     (Maybe Subscription)
     (Maybe Subscription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationSubscriptionResponse' {Maybe Subscription
subscription :: Maybe Subscription
$sel:subscription:CreateNotificationSubscriptionResponse' :: CreateNotificationSubscriptionResponse -> Maybe Subscription
subscription} -> Maybe Subscription
subscription) (\s :: CreateNotificationSubscriptionResponse
s@CreateNotificationSubscriptionResponse' {} Maybe Subscription
a -> CreateNotificationSubscriptionResponse
s {$sel:subscription:CreateNotificationSubscriptionResponse' :: Maybe Subscription
subscription = Maybe Subscription
a} :: CreateNotificationSubscriptionResponse)

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

instance
  Prelude.NFData
    CreateNotificationSubscriptionResponse