{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_id,
    createSubscriptionDefinitionVersionResponse_version,
    createSubscriptionDefinitionVersionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Greengrass.Types
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
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]
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
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.
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'
      { $sel:amznClientToken:CreateSubscriptionDefinitionVersion' :: Maybe Text
amznClientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:subscriptions:CreateSubscriptionDefinitionVersion' :: Maybe [Subscription]
subscriptions = 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 :: Lens' CreateSubscriptionDefinitionVersion (Maybe Text)
createSubscriptionDefinitionVersion_amznClientToken = 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 :: Lens' CreateSubscriptionDefinitionVersion (Maybe [Subscription])
createSubscriptionDefinitionVersion_subscriptions = 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) 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

-- | The ID of the subscription definition.
createSubscriptionDefinitionVersion_subscriptionDefinitionId :: Lens.Lens' CreateSubscriptionDefinitionVersion Prelude.Text
createSubscriptionDefinitionVersion_subscriptionDefinitionId :: Lens' CreateSubscriptionDefinitionVersion Text
createSubscriptionDefinitionVersion_subscriptionDefinitionId = 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 :: (Service -> Service)
-> CreateSubscriptionDefinitionVersion
-> Request CreateSubscriptionDefinitionVersion
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateSubscriptionDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateSubscriptionDefinitionVersion)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateSubscriptionDefinitionVersionResponse
CreateSubscriptionDefinitionVersionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Version")
            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
    CreateSubscriptionDefinitionVersion
  where
  hashWithSalt :: Int -> CreateSubscriptionDefinitionVersion -> Int
hashWithSalt
    Int
_salt
    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
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
amznClientToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Subscription]
subscriptions
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
subscriptionDefinitionId

instance
  Prelude.NFData
    CreateSubscriptionDefinitionVersion
  where
  rnf :: CreateSubscriptionDefinitionVersion -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
amznClientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Subscription]
subscriptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
subscriptionDefinitionId

instance
  Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amzn-Client-Token" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
amznClientToken,
        HeaderName
"Content-Type"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"application/x-amz-json-1.1" :: Prelude.ByteString)
      ]

instance
  Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Subscriptions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Subscription]
subscriptions
          ]
      )

instance
  Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/subscriptions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
subscriptionDefinitionId,
        ByteString
"/versions"
      ]

instance
  Data.ToQuery
    CreateSubscriptionDefinitionVersion
  where
  toQuery :: CreateSubscriptionDefinitionVersion -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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 parent definition that the version is associated with.
    CreateSubscriptionDefinitionVersionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The ID of the version.
    CreateSubscriptionDefinitionVersionResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateSubscriptionDefinitionVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateSubscriptionDefinitionVersionResponse
-> CreateSubscriptionDefinitionVersionResponse -> Bool
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]
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
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.
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.
--
-- 'id', 'createSubscriptionDefinitionVersionResponse_id' - The ID of the parent definition that the version is associated with.
--
-- 'version', 'createSubscriptionDefinitionVersionResponse_version' - The ID of the version.
--
-- 'httpStatus', 'createSubscriptionDefinitionVersionResponse_httpStatus' - The response's http status code.
newCreateSubscriptionDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateSubscriptionDefinitionVersionResponse
newCreateSubscriptionDefinitionVersionResponse :: Int -> CreateSubscriptionDefinitionVersionResponse
newCreateSubscriptionDefinitionVersionResponse
  Int
pHttpStatus_ =
    CreateSubscriptionDefinitionVersionResponse'
      { $sel:arn:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
arn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:creationTimestamp:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
creationTimestamp =
          forall a. Maybe a
Prelude.Nothing,
        $sel:id:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
        $sel:version:CreateSubscriptionDefinitionVersionResponse' :: Maybe Text
version = 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 :: Lens' CreateSubscriptionDefinitionVersionResponse (Maybe Text)
createSubscriptionDefinitionVersionResponse_arn = 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 :: Lens' CreateSubscriptionDefinitionVersionResponse (Maybe Text)
createSubscriptionDefinitionVersionResponse_creationTimestamp = 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 parent definition that the version is associated with.
createSubscriptionDefinitionVersionResponse_id :: Lens.Lens' CreateSubscriptionDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
createSubscriptionDefinitionVersionResponse_id :: Lens' CreateSubscriptionDefinitionVersionResponse (Maybe Text)
createSubscriptionDefinitionVersionResponse_id = 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 ID of the version.
createSubscriptionDefinitionVersionResponse_version :: Lens.Lens' CreateSubscriptionDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
createSubscriptionDefinitionVersionResponse_version :: Lens' CreateSubscriptionDefinitionVersionResponse (Maybe Text)
createSubscriptionDefinitionVersionResponse_version = 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 response's http status code.
createSubscriptionDefinitionVersionResponse_httpStatus :: Lens.Lens' CreateSubscriptionDefinitionVersionResponse Prelude.Int
createSubscriptionDefinitionVersionResponse_httpStatus :: Lens' CreateSubscriptionDefinitionVersionResponse Int
createSubscriptionDefinitionVersionResponse_httpStatus = 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
  where
  rnf :: CreateSubscriptionDefinitionVersionResponse -> ()
rnf CreateSubscriptionDefinitionVersionResponse' {Int
Maybe Text
httpStatus :: Int
version :: Maybe Text
id :: Maybe Text
creationTimestamp :: Maybe Text
arn :: Maybe Text
$sel:httpStatus:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Int
$sel:version:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
$sel:id:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
$sel:creationTimestamp:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
$sel:arn:CreateSubscriptionDefinitionVersionResponse' :: CreateSubscriptionDefinitionVersionResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creationTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus