{-# 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.Greengrass.CreateSubscriptionDefinitionVersion
-- 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)
--
-- Creates a version of a subscription definition which has already been
-- defined.
module Amazonka.Greengrass.CreateSubscriptionDefinitionVersion
  ( -- * Creating a Request
    CreateSubscriptionDefinitionVersion (..),
    newCreateSubscriptionDefinitionVersion,

    -- * Request Lenses
    createSubscriptionDefinitionVersion_amznClientToken,
    createSubscriptionDefinitionVersion_subscriptions,
    createSubscriptionDefinitionVersion_subscriptionDefinitionId,

    -- * Destructuring the Response
    CreateSubscriptionDefinitionVersionResponse (..),
    newCreateSubscriptionDefinitionVersionResponse,

    -- * Response Lenses
    createSubscriptionDefinitionVersionResponse_arn,
    createSubscriptionDefinitionVersionResponse_creationTimestamp,
    createSubscriptionDefinitionVersionResponse_version,
    createSubscriptionDefinitionVersionResponse_id,
    createSubscriptionDefinitionVersionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateSubscriptionDefinitionVersion' smart constructor.
data CreateSubscriptionDefinitionVersion = CreateSubscriptionDefinitionVersion'
  { -- | A client token used to correlate requests and responses.
    CreateSubscriptionDefinitionVersion -> Maybe Text
amznClientToken :: Prelude.Maybe Prelude.Text,
    -- | A list of subscriptions.
    CreateSubscriptionDefinitionVersion -> Maybe [Subscription]
subscriptions :: Prelude.Maybe [Subscription],
    -- | The ID of the subscription definition.
    CreateSubscriptionDefinitionVersion -> Text
subscriptionDefinitionId :: Prelude.Text
  }
  deriving (CreateSubscriptionDefinitionVersion
-> CreateSubscriptionDefinitionVersion -> Bool
(CreateSubscriptionDefinitionVersion
 -> CreateSubscriptionDefinitionVersion -> Bool)
-> (CreateSubscriptionDefinitionVersion
    -> CreateSubscriptionDefinitionVersion -> Bool)
-> Eq CreateSubscriptionDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSubscriptionDefinitionVersion
-> CreateSubscriptionDefinitionVersion -> Bool
$c/= :: CreateSubscriptionDefinitionVersion
-> CreateSubscriptionDefinitionVersion -> Bool
== :: CreateSubscriptionDefinitionVersion
-> CreateSubscriptionDefinitionVersion -> Bool
$c== :: CreateSubscriptionDefinitionVersion
-> CreateSubscriptionDefinitionVersion -> Bool
Prelude.Eq, ReadPrec [CreateSubscriptionDefinitionVersion]
ReadPrec CreateSubscriptionDefinitionVersion
Int -> ReadS CreateSubscriptionDefinitionVersion
ReadS [CreateSubscriptionDefinitionVersion]
(Int -> ReadS CreateSubscriptionDefinitionVersion)
-> ReadS [CreateSubscriptionDefinitionVersion]
-> ReadPrec CreateSubscriptionDefinitionVersion
-> ReadPrec [CreateSubscriptionDefinitionVersion]
-> Read CreateSubscriptionDefinitionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSubscriptionDefinitionVersion]
$creadListPrec :: ReadPrec [CreateSubscriptionDefinitionVersion]
readPrec :: ReadPrec CreateSubscriptionDefinitionVersion
$creadPrec :: ReadPrec CreateSubscriptionDefinitionVersion
readList :: ReadS [CreateSubscriptionDefinitionVersion]
$creadList :: ReadS [CreateSubscriptionDefinitionVersion]
readsPrec :: Int -> ReadS CreateSubscriptionDefinitionVersion
$creadsPrec :: Int -> ReadS CreateSubscriptionDefinitionVersion
Prelude.Read, Int -> CreateSubscriptionDefinitionVersion -> ShowS
[CreateSubscriptionDefinitionVersion] -> ShowS
CreateSubscriptionDefinitionVersion -> String
(Int -> CreateSubscriptionDefinitionVersion -> ShowS)
-> (CreateSubscriptionDefinitionVersion -> String)
-> ([CreateSubscriptionDefinitionVersion] -> ShowS)
-> Show CreateSubscriptionDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSubscriptionDefinitionVersion] -> ShowS
$cshowList :: [CreateSubscriptionDefinitionVersion] -> ShowS
show :: CreateSubscriptionDefinitionVersion -> String
$cshow :: CreateSubscriptionDefinitionVersion -> String
showsPrec :: Int -> CreateSubscriptionDefinitionVersion -> ShowS
$cshowsPrec :: Int -> CreateSubscriptionDefinitionVersion -> ShowS
Prelude.Show, (forall x.
 CreateSubscriptionDefinitionVersion
 -> Rep CreateSubscriptionDefinitionVersion x)
-> (forall x.
    Rep CreateSubscriptionDefinitionVersion x
    -> CreateSubscriptionDefinitionVersion)
-> Generic CreateSubscriptionDefinitionVersion
forall x.
Rep CreateSubscriptionDefinitionVersion x
-> CreateSubscriptionDefinitionVersion
forall x.
CreateSubscriptionDefinitionVersion
-> Rep CreateSubscriptionDefinitionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSubscriptionDefinitionVersion x
-> CreateSubscriptionDefinitionVersion
$cfrom :: forall x.
CreateSubscriptionDefinitionVersion
-> Rep CreateSubscriptionDefinitionVersion x
Prelude.Generic)

-- |
-- Create a value of 'CreateSubscriptionDefinitionVersion' 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:
--
-- 'amznClientToken', 'createSubscriptionDefinitionVersion_amznClientToken' - A client token used to correlate requests and responses.
--
-- 'subscriptions', 'createSubscriptionDefinitionVersion_subscriptions' - A list of subscriptions.
--
-- 'subscriptionDefinitionId', 'createSubscriptionDefinitionVersion_subscriptionDefinitionId' - The ID of the subscription definition.
newCreateSubscriptionDefinitionVersion ::
  -- | 'subscriptionDefinitionId'
  Prelude.Text ->
  CreateSubscriptionDefinitionVersion
newCreateSubscriptionDefinitionVersion :: Text -> CreateSubscriptionDefinitionVersion
newCreateSubscriptionDefinitionVersion
  Text
pSubscriptionDefinitionId_ =
    CreateSubscriptionDefinitionVersion' :: Maybe Text
-> Maybe [Subscription]
-> Text
-> CreateSubscriptionDefinitionVersion
CreateSubscriptionDefinitionVersion'
      { $sel:amznClientToken:CreateSubscriptionDefinitionVersion' :: Maybe Text
amznClientToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:subscriptions:CreateSubscriptionDefinitionVersion' :: Maybe [Subscription]
subscriptions = Maybe [Subscription]
forall a. Maybe a
Prelude.Nothing,
        $sel:subscriptionDefinitionId:CreateSubscriptionDefinitionVersion' :: Text
subscriptionDefinitionId =
          Text
pSubscriptionDefinitionId_
      }

-- | A client token used to correlate requests and responses.
createSubscriptionDefinitionVersion_amznClientToken :: Lens.Lens' CreateSubscriptionDefinitionVersion (Prelude.Maybe Prelude.Text)
createSubscriptionDefinitionVersion_amznClientToken :: (Maybe Text -> f (Maybe Text))
-> CreateSubscriptionDefinitionVersion
-> f CreateSubscriptionDefinitionVersion
createSubscriptionDefinitionVersion_amznClientToken = (CreateSubscriptionDefinitionVersion -> Maybe Text)
-> (CreateSubscriptionDefinitionVersion
    -> Maybe Text -> CreateSubscriptionDefinitionVersion)
-> Lens
     CreateSubscriptionDefinitionVersion
     CreateSubscriptionDefinitionVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionDefinitionVersion' {Maybe Text
amznClientToken :: Maybe Text
$sel:amznClientToken:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe Text
amznClientToken} -> Maybe Text
amznClientToken) (\s :: CreateSubscriptionDefinitionVersion
s@CreateSubscriptionDefinitionVersion' {} Maybe Text
a -> CreateSubscriptionDefinitionVersion
s {$sel:amznClientToken:CreateSubscriptionDefinitionVersion' :: Maybe Text
amznClientToken = Maybe Text
a} :: CreateSubscriptionDefinitionVersion)

-- | A list of subscriptions.
createSubscriptionDefinitionVersion_subscriptions :: Lens.Lens' CreateSubscriptionDefinitionVersion (Prelude.Maybe [Subscription])
createSubscriptionDefinitionVersion_subscriptions :: (Maybe [Subscription] -> f (Maybe [Subscription]))
-> CreateSubscriptionDefinitionVersion
-> f CreateSubscriptionDefinitionVersion
createSubscriptionDefinitionVersion_subscriptions = (CreateSubscriptionDefinitionVersion -> Maybe [Subscription])
-> (CreateSubscriptionDefinitionVersion
    -> Maybe [Subscription] -> CreateSubscriptionDefinitionVersion)
-> Lens
     CreateSubscriptionDefinitionVersion
     CreateSubscriptionDefinitionVersion
     (Maybe [Subscription])
     (Maybe [Subscription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionDefinitionVersion' {Maybe [Subscription]
subscriptions :: Maybe [Subscription]
$sel:subscriptions:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe [Subscription]
subscriptions} -> Maybe [Subscription]
subscriptions) (\s :: CreateSubscriptionDefinitionVersion
s@CreateSubscriptionDefinitionVersion' {} Maybe [Subscription]
a -> CreateSubscriptionDefinitionVersion
s {$sel:subscriptions:CreateSubscriptionDefinitionVersion' :: Maybe [Subscription]
subscriptions = Maybe [Subscription]
a} :: CreateSubscriptionDefinitionVersion) ((Maybe [Subscription] -> f (Maybe [Subscription]))
 -> CreateSubscriptionDefinitionVersion
 -> f CreateSubscriptionDefinitionVersion)
-> ((Maybe [Subscription] -> f (Maybe [Subscription]))
    -> Maybe [Subscription] -> f (Maybe [Subscription]))
-> (Maybe [Subscription] -> f (Maybe [Subscription]))
-> CreateSubscriptionDefinitionVersion
-> f CreateSubscriptionDefinitionVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Subscription] [Subscription] [Subscription] [Subscription]
-> Iso
     (Maybe [Subscription])
     (Maybe [Subscription])
     (Maybe [Subscription])
     (Maybe [Subscription])
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 AnIso [Subscription] [Subscription] [Subscription] [Subscription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the subscription definition.
createSubscriptionDefinitionVersion_subscriptionDefinitionId :: Lens.Lens' CreateSubscriptionDefinitionVersion Prelude.Text
createSubscriptionDefinitionVersion_subscriptionDefinitionId :: (Text -> f Text)
-> CreateSubscriptionDefinitionVersion
-> f CreateSubscriptionDefinitionVersion
createSubscriptionDefinitionVersion_subscriptionDefinitionId = (CreateSubscriptionDefinitionVersion -> Text)
-> (CreateSubscriptionDefinitionVersion
    -> Text -> CreateSubscriptionDefinitionVersion)
-> Lens
     CreateSubscriptionDefinitionVersion
     CreateSubscriptionDefinitionVersion
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionDefinitionVersion' {Text
subscriptionDefinitionId :: Text
$sel:subscriptionDefinitionId:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Text
subscriptionDefinitionId} -> Text
subscriptionDefinitionId) (\s :: CreateSubscriptionDefinitionVersion
s@CreateSubscriptionDefinitionVersion' {} Text
a -> CreateSubscriptionDefinitionVersion
s {$sel:subscriptionDefinitionId:CreateSubscriptionDefinitionVersion' :: Text
subscriptionDefinitionId = Text
a} :: CreateSubscriptionDefinitionVersion)

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

instance
  Prelude.NFData
    CreateSubscriptionDefinitionVersion

instance
  Core.ToHeaders
    CreateSubscriptionDefinitionVersion
  where
  toHeaders :: CreateSubscriptionDefinitionVersion -> ResponseHeaders
toHeaders CreateSubscriptionDefinitionVersion' {Maybe [Subscription]
Maybe Text
Text
subscriptionDefinitionId :: Text
subscriptions :: Maybe [Subscription]
amznClientToken :: Maybe Text
$sel:subscriptionDefinitionId:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Text
$sel:subscriptions:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe [Subscription]
$sel:amznClientToken:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amzn-Client-Token" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
amznClientToken,
        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
    CreateSubscriptionDefinitionVersion
  where
  toJSON :: CreateSubscriptionDefinitionVersion -> Value
toJSON CreateSubscriptionDefinitionVersion' {Maybe [Subscription]
Maybe Text
Text
subscriptionDefinitionId :: Text
subscriptions :: Maybe [Subscription]
amznClientToken :: Maybe Text
$sel:subscriptionDefinitionId:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Text
$sel:subscriptions:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe [Subscription]
$sel:amznClientToken:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Subscriptions" Text -> [Subscription] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Subscription] -> Pair) -> Maybe [Subscription] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Subscription]
subscriptions
          ]
      )

instance
  Core.ToPath
    CreateSubscriptionDefinitionVersion
  where
  toPath :: CreateSubscriptionDefinitionVersion -> ByteString
toPath CreateSubscriptionDefinitionVersion' {Maybe [Subscription]
Maybe Text
Text
subscriptionDefinitionId :: Text
subscriptions :: Maybe [Subscription]
amznClientToken :: Maybe Text
$sel:subscriptionDefinitionId:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Text
$sel:subscriptions:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe [Subscription]
$sel:amznClientToken:CreateSubscriptionDefinitionVersion' :: CreateSubscriptionDefinitionVersion -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/subscriptions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
subscriptionDefinitionId,
        ByteString
"/versions"
      ]

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

-- | /See:/ 'newCreateSubscriptionDefinitionVersionResponse' smart constructor.
data CreateSubscriptionDefinitionVersionResponse = CreateSubscriptionDefinitionVersionResponse'
  { -- | The ARN of the version.
    CreateSubscriptionDefinitionVersionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the version was created.
    CreateSubscriptionDefinitionVersionResponse -> Maybe Text
creationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The ID of the version.
    CreateSubscriptionDefinitionVersionResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The ID of the parent definition that the version is associated with.
    CreateSubscriptionDefinitionVersionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateSubscriptionDefinitionVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateSubscriptionDefinitionVersionResponse
-> CreateSubscriptionDefinitionVersionResponse -> Bool
(CreateSubscriptionDefinitionVersionResponse
 -> CreateSubscriptionDefinitionVersionResponse -> Bool)
-> (CreateSubscriptionDefinitionVersionResponse
    -> CreateSubscriptionDefinitionVersionResponse -> Bool)
-> Eq CreateSubscriptionDefinitionVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSubscriptionDefinitionVersionResponse
-> CreateSubscriptionDefinitionVersionResponse -> Bool
$c/= :: CreateSubscriptionDefinitionVersionResponse
-> CreateSubscriptionDefinitionVersionResponse -> Bool
== :: CreateSubscriptionDefinitionVersionResponse
-> CreateSubscriptionDefinitionVersionResponse -> Bool
$c== :: CreateSubscriptionDefinitionVersionResponse
-> CreateSubscriptionDefinitionVersionResponse -> Bool
Prelude.Eq, ReadPrec [CreateSubscriptionDefinitionVersionResponse]
ReadPrec CreateSubscriptionDefinitionVersionResponse
Int -> ReadS CreateSubscriptionDefinitionVersionResponse
ReadS [CreateSubscriptionDefinitionVersionResponse]
(Int -> ReadS CreateSubscriptionDefinitionVersionResponse)
-> ReadS [CreateSubscriptionDefinitionVersionResponse]
-> ReadPrec CreateSubscriptionDefinitionVersionResponse
-> ReadPrec [CreateSubscriptionDefinitionVersionResponse]
-> Read CreateSubscriptionDefinitionVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSubscriptionDefinitionVersionResponse]
$creadListPrec :: ReadPrec [CreateSubscriptionDefinitionVersionResponse]
readPrec :: ReadPrec CreateSubscriptionDefinitionVersionResponse
$creadPrec :: ReadPrec CreateSubscriptionDefinitionVersionResponse
readList :: ReadS [CreateSubscriptionDefinitionVersionResponse]
$creadList :: ReadS [CreateSubscriptionDefinitionVersionResponse]
readsPrec :: Int -> ReadS CreateSubscriptionDefinitionVersionResponse
$creadsPrec :: Int -> ReadS CreateSubscriptionDefinitionVersionResponse
Prelude.Read, Int -> CreateSubscriptionDefinitionVersionResponse -> ShowS
[CreateSubscriptionDefinitionVersionResponse] -> ShowS
CreateSubscriptionDefinitionVersionResponse -> String
(Int -> CreateSubscriptionDefinitionVersionResponse -> ShowS)
-> (CreateSubscriptionDefinitionVersionResponse -> String)
-> ([CreateSubscriptionDefinitionVersionResponse] -> ShowS)
-> Show CreateSubscriptionDefinitionVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSubscriptionDefinitionVersionResponse] -> ShowS
$cshowList :: [CreateSubscriptionDefinitionVersionResponse] -> ShowS
show :: CreateSubscriptionDefinitionVersionResponse -> String
$cshow :: CreateSubscriptionDefinitionVersionResponse -> String
showsPrec :: Int -> CreateSubscriptionDefinitionVersionResponse -> ShowS
$cshowsPrec :: Int -> CreateSubscriptionDefinitionVersionResponse -> ShowS
Prelude.Show, (forall x.
 CreateSubscriptionDefinitionVersionResponse
 -> Rep CreateSubscriptionDefinitionVersionResponse x)
-> (forall x.
    Rep CreateSubscriptionDefinitionVersionResponse x
    -> CreateSubscriptionDefinitionVersionResponse)
-> Generic CreateSubscriptionDefinitionVersionResponse
forall x.
Rep CreateSubscriptionDefinitionVersionResponse x
-> CreateSubscriptionDefinitionVersionResponse
forall x.
CreateSubscriptionDefinitionVersionResponse
-> Rep CreateSubscriptionDefinitionVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSubscriptionDefinitionVersionResponse x
-> CreateSubscriptionDefinitionVersionResponse
$cfrom :: forall x.
CreateSubscriptionDefinitionVersionResponse
-> Rep CreateSubscriptionDefinitionVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateSubscriptionDefinitionVersionResponse' 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:
--
-- 'arn', 'createSubscriptionDefinitionVersionResponse_arn' - The ARN of the version.
--
-- 'creationTimestamp', 'createSubscriptionDefinitionVersionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the version was created.
--
-- 'version', 'createSubscriptionDefinitionVersionResponse_version' - The ID of the version.
--
-- 'id', 'createSubscriptionDefinitionVersionResponse_id' - The ID of the parent definition that the version is associated with.
--
-- 'httpStatus', 'createSubscriptionDefinitionVersionResponse_httpStatus' - The response's http status code.
newCreateSubscriptionDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateSubscriptionDefinitionVersionResponse
newCreateSubscriptionDefinitionVersionResponse :: Int -> CreateSubscriptionDefinitionVersionResponse
newCreateSubscriptionDefinitionVersionResponse
  Int
pHttpStatus_ =
    CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateSubscriptionDefinitionVersionResponse
CreateSubscriptionDefinitionVersionResponse'
      { $sel:arn:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
arn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:creationTimestamp:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
creationTimestamp =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:version:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:id:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateSubscriptionDefinitionVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The ARN of the version.
createSubscriptionDefinitionVersionResponse_arn :: Lens.Lens' CreateSubscriptionDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
createSubscriptionDefinitionVersionResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateSubscriptionDefinitionVersionResponse
-> f CreateSubscriptionDefinitionVersionResponse
createSubscriptionDefinitionVersionResponse_arn = (CreateSubscriptionDefinitionVersionResponse -> Maybe Text)
-> (CreateSubscriptionDefinitionVersionResponse
    -> Maybe Text -> CreateSubscriptionDefinitionVersionResponse)
-> Lens
     CreateSubscriptionDefinitionVersionResponse
     CreateSubscriptionDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionDefinitionVersionResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateSubscriptionDefinitionVersionResponse
s@CreateSubscriptionDefinitionVersionResponse' {} Maybe Text
a -> CreateSubscriptionDefinitionVersionResponse
s {$sel:arn:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateSubscriptionDefinitionVersionResponse)

-- | The time, in milliseconds since the epoch, when the version was created.
createSubscriptionDefinitionVersionResponse_creationTimestamp :: Lens.Lens' CreateSubscriptionDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
createSubscriptionDefinitionVersionResponse_creationTimestamp :: (Maybe Text -> f (Maybe Text))
-> CreateSubscriptionDefinitionVersionResponse
-> f CreateSubscriptionDefinitionVersionResponse
createSubscriptionDefinitionVersionResponse_creationTimestamp = (CreateSubscriptionDefinitionVersionResponse -> Maybe Text)
-> (CreateSubscriptionDefinitionVersionResponse
    -> Maybe Text -> CreateSubscriptionDefinitionVersionResponse)
-> Lens
     CreateSubscriptionDefinitionVersionResponse
     CreateSubscriptionDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionDefinitionVersionResponse' {Maybe Text
creationTimestamp :: Maybe Text
$sel:creationTimestamp:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
creationTimestamp} -> Maybe Text
creationTimestamp) (\s :: CreateSubscriptionDefinitionVersionResponse
s@CreateSubscriptionDefinitionVersionResponse' {} Maybe Text
a -> CreateSubscriptionDefinitionVersionResponse
s {$sel:creationTimestamp:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
creationTimestamp = Maybe Text
a} :: CreateSubscriptionDefinitionVersionResponse)

-- | The ID of the version.
createSubscriptionDefinitionVersionResponse_version :: Lens.Lens' CreateSubscriptionDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
createSubscriptionDefinitionVersionResponse_version :: (Maybe Text -> f (Maybe Text))
-> CreateSubscriptionDefinitionVersionResponse
-> f CreateSubscriptionDefinitionVersionResponse
createSubscriptionDefinitionVersionResponse_version = (CreateSubscriptionDefinitionVersionResponse -> Maybe Text)
-> (CreateSubscriptionDefinitionVersionResponse
    -> Maybe Text -> CreateSubscriptionDefinitionVersionResponse)
-> Lens
     CreateSubscriptionDefinitionVersionResponse
     CreateSubscriptionDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionDefinitionVersionResponse' {Maybe Text
version :: Maybe Text
$sel:version:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: CreateSubscriptionDefinitionVersionResponse
s@CreateSubscriptionDefinitionVersionResponse' {} Maybe Text
a -> CreateSubscriptionDefinitionVersionResponse
s {$sel:version:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
a} :: CreateSubscriptionDefinitionVersionResponse)

-- | The ID of the parent definition that the version is associated with.
createSubscriptionDefinitionVersionResponse_id :: Lens.Lens' CreateSubscriptionDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
createSubscriptionDefinitionVersionResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateSubscriptionDefinitionVersionResponse
-> f CreateSubscriptionDefinitionVersionResponse
createSubscriptionDefinitionVersionResponse_id = (CreateSubscriptionDefinitionVersionResponse -> Maybe Text)
-> (CreateSubscriptionDefinitionVersionResponse
    -> Maybe Text -> CreateSubscriptionDefinitionVersionResponse)
-> Lens
     CreateSubscriptionDefinitionVersionResponse
     CreateSubscriptionDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionDefinitionVersionResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateSubscriptionDefinitionVersionResponse
s@CreateSubscriptionDefinitionVersionResponse' {} Maybe Text
a -> CreateSubscriptionDefinitionVersionResponse
s {$sel:id:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
a} :: CreateSubscriptionDefinitionVersionResponse)

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

instance
  Prelude.NFData
    CreateSubscriptionDefinitionVersionResponse