{-# 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.GetSubscriptionDefinitionVersion
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves information about a subscription definition version.
module Amazonka.Greengrass.GetSubscriptionDefinitionVersion
  ( -- * Creating a Request
    GetSubscriptionDefinitionVersion (..),
    newGetSubscriptionDefinitionVersion,

    -- * Request Lenses
    getSubscriptionDefinitionVersion_nextToken,
    getSubscriptionDefinitionVersion_subscriptionDefinitionId,
    getSubscriptionDefinitionVersion_subscriptionDefinitionVersionId,

    -- * Destructuring the Response
    GetSubscriptionDefinitionVersionResponse (..),
    newGetSubscriptionDefinitionVersionResponse,

    -- * Response Lenses
    getSubscriptionDefinitionVersionResponse_definition,
    getSubscriptionDefinitionVersionResponse_arn,
    getSubscriptionDefinitionVersionResponse_nextToken,
    getSubscriptionDefinitionVersionResponse_creationTimestamp,
    getSubscriptionDefinitionVersionResponse_version,
    getSubscriptionDefinitionVersionResponse_id,
    getSubscriptionDefinitionVersionResponse_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:/ 'newGetSubscriptionDefinitionVersion' smart constructor.
data GetSubscriptionDefinitionVersion = GetSubscriptionDefinitionVersion'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    GetSubscriptionDefinitionVersion -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the subscription definition.
    GetSubscriptionDefinitionVersion -> Text
subscriptionDefinitionId :: Prelude.Text,
    -- | The ID of the subscription definition version. This value maps to the
    -- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
    -- object, which is returned by \'\'ListSubscriptionDefinitionVersions\'\'
    -- requests. If the version is the last one that was associated with a
    -- subscription definition, the value also maps to the
    -- \'\'LatestVersion\'\' property of the corresponding
    -- \'\'DefinitionInformation\'\' object.
    GetSubscriptionDefinitionVersion -> Text
subscriptionDefinitionVersionId :: Prelude.Text
  }
  deriving (GetSubscriptionDefinitionVersion
-> GetSubscriptionDefinitionVersion -> Bool
(GetSubscriptionDefinitionVersion
 -> GetSubscriptionDefinitionVersion -> Bool)
-> (GetSubscriptionDefinitionVersion
    -> GetSubscriptionDefinitionVersion -> Bool)
-> Eq GetSubscriptionDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSubscriptionDefinitionVersion
-> GetSubscriptionDefinitionVersion -> Bool
$c/= :: GetSubscriptionDefinitionVersion
-> GetSubscriptionDefinitionVersion -> Bool
== :: GetSubscriptionDefinitionVersion
-> GetSubscriptionDefinitionVersion -> Bool
$c== :: GetSubscriptionDefinitionVersion
-> GetSubscriptionDefinitionVersion -> Bool
Prelude.Eq, ReadPrec [GetSubscriptionDefinitionVersion]
ReadPrec GetSubscriptionDefinitionVersion
Int -> ReadS GetSubscriptionDefinitionVersion
ReadS [GetSubscriptionDefinitionVersion]
(Int -> ReadS GetSubscriptionDefinitionVersion)
-> ReadS [GetSubscriptionDefinitionVersion]
-> ReadPrec GetSubscriptionDefinitionVersion
-> ReadPrec [GetSubscriptionDefinitionVersion]
-> Read GetSubscriptionDefinitionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSubscriptionDefinitionVersion]
$creadListPrec :: ReadPrec [GetSubscriptionDefinitionVersion]
readPrec :: ReadPrec GetSubscriptionDefinitionVersion
$creadPrec :: ReadPrec GetSubscriptionDefinitionVersion
readList :: ReadS [GetSubscriptionDefinitionVersion]
$creadList :: ReadS [GetSubscriptionDefinitionVersion]
readsPrec :: Int -> ReadS GetSubscriptionDefinitionVersion
$creadsPrec :: Int -> ReadS GetSubscriptionDefinitionVersion
Prelude.Read, Int -> GetSubscriptionDefinitionVersion -> ShowS
[GetSubscriptionDefinitionVersion] -> ShowS
GetSubscriptionDefinitionVersion -> String
(Int -> GetSubscriptionDefinitionVersion -> ShowS)
-> (GetSubscriptionDefinitionVersion -> String)
-> ([GetSubscriptionDefinitionVersion] -> ShowS)
-> Show GetSubscriptionDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSubscriptionDefinitionVersion] -> ShowS
$cshowList :: [GetSubscriptionDefinitionVersion] -> ShowS
show :: GetSubscriptionDefinitionVersion -> String
$cshow :: GetSubscriptionDefinitionVersion -> String
showsPrec :: Int -> GetSubscriptionDefinitionVersion -> ShowS
$cshowsPrec :: Int -> GetSubscriptionDefinitionVersion -> ShowS
Prelude.Show, (forall x.
 GetSubscriptionDefinitionVersion
 -> Rep GetSubscriptionDefinitionVersion x)
-> (forall x.
    Rep GetSubscriptionDefinitionVersion x
    -> GetSubscriptionDefinitionVersion)
-> Generic GetSubscriptionDefinitionVersion
forall x.
Rep GetSubscriptionDefinitionVersion x
-> GetSubscriptionDefinitionVersion
forall x.
GetSubscriptionDefinitionVersion
-> Rep GetSubscriptionDefinitionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSubscriptionDefinitionVersion x
-> GetSubscriptionDefinitionVersion
$cfrom :: forall x.
GetSubscriptionDefinitionVersion
-> Rep GetSubscriptionDefinitionVersion x
Prelude.Generic)

-- |
-- Create a value of 'GetSubscriptionDefinitionVersion' 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:
--
-- 'nextToken', 'getSubscriptionDefinitionVersion_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'subscriptionDefinitionId', 'getSubscriptionDefinitionVersion_subscriptionDefinitionId' - The ID of the subscription definition.
--
-- 'subscriptionDefinitionVersionId', 'getSubscriptionDefinitionVersion_subscriptionDefinitionVersionId' - The ID of the subscription definition version. This value maps to the
-- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
-- object, which is returned by \'\'ListSubscriptionDefinitionVersions\'\'
-- requests. If the version is the last one that was associated with a
-- subscription definition, the value also maps to the
-- \'\'LatestVersion\'\' property of the corresponding
-- \'\'DefinitionInformation\'\' object.
newGetSubscriptionDefinitionVersion ::
  -- | 'subscriptionDefinitionId'
  Prelude.Text ->
  -- | 'subscriptionDefinitionVersionId'
  Prelude.Text ->
  GetSubscriptionDefinitionVersion
newGetSubscriptionDefinitionVersion :: Text -> Text -> GetSubscriptionDefinitionVersion
newGetSubscriptionDefinitionVersion
  Text
pSubscriptionDefinitionId_
  Text
pSubscriptionDefinitionVersionId_ =
    GetSubscriptionDefinitionVersion' :: Maybe Text -> Text -> Text -> GetSubscriptionDefinitionVersion
GetSubscriptionDefinitionVersion'
      { $sel:nextToken:GetSubscriptionDefinitionVersion' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:subscriptionDefinitionId:GetSubscriptionDefinitionVersion' :: Text
subscriptionDefinitionId =
          Text
pSubscriptionDefinitionId_,
        $sel:subscriptionDefinitionVersionId:GetSubscriptionDefinitionVersion' :: Text
subscriptionDefinitionVersionId =
          Text
pSubscriptionDefinitionVersionId_
      }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
getSubscriptionDefinitionVersion_nextToken :: Lens.Lens' GetSubscriptionDefinitionVersion (Prelude.Maybe Prelude.Text)
getSubscriptionDefinitionVersion_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSubscriptionDefinitionVersion
-> f GetSubscriptionDefinitionVersion
getSubscriptionDefinitionVersion_nextToken = (GetSubscriptionDefinitionVersion -> Maybe Text)
-> (GetSubscriptionDefinitionVersion
    -> Maybe Text -> GetSubscriptionDefinitionVersion)
-> Lens
     GetSubscriptionDefinitionVersion
     GetSubscriptionDefinitionVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionVersion' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSubscriptionDefinitionVersion
s@GetSubscriptionDefinitionVersion' {} Maybe Text
a -> GetSubscriptionDefinitionVersion
s {$sel:nextToken:GetSubscriptionDefinitionVersion' :: Maybe Text
nextToken = Maybe Text
a} :: GetSubscriptionDefinitionVersion)

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

-- | The ID of the subscription definition version. This value maps to the
-- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
-- object, which is returned by \'\'ListSubscriptionDefinitionVersions\'\'
-- requests. If the version is the last one that was associated with a
-- subscription definition, the value also maps to the
-- \'\'LatestVersion\'\' property of the corresponding
-- \'\'DefinitionInformation\'\' object.
getSubscriptionDefinitionVersion_subscriptionDefinitionVersionId :: Lens.Lens' GetSubscriptionDefinitionVersion Prelude.Text
getSubscriptionDefinitionVersion_subscriptionDefinitionVersionId :: (Text -> f Text)
-> GetSubscriptionDefinitionVersion
-> f GetSubscriptionDefinitionVersion
getSubscriptionDefinitionVersion_subscriptionDefinitionVersionId = (GetSubscriptionDefinitionVersion -> Text)
-> (GetSubscriptionDefinitionVersion
    -> Text -> GetSubscriptionDefinitionVersion)
-> Lens
     GetSubscriptionDefinitionVersion
     GetSubscriptionDefinitionVersion
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionVersion' {Text
subscriptionDefinitionVersionId :: Text
$sel:subscriptionDefinitionVersionId:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> Text
subscriptionDefinitionVersionId} -> Text
subscriptionDefinitionVersionId) (\s :: GetSubscriptionDefinitionVersion
s@GetSubscriptionDefinitionVersion' {} Text
a -> GetSubscriptionDefinitionVersion
s {$sel:subscriptionDefinitionVersionId:GetSubscriptionDefinitionVersion' :: Text
subscriptionDefinitionVersionId = Text
a} :: GetSubscriptionDefinitionVersion)

instance
  Core.AWSRequest
    GetSubscriptionDefinitionVersion
  where
  type
    AWSResponse GetSubscriptionDefinitionVersion =
      GetSubscriptionDefinitionVersionResponse
  request :: GetSubscriptionDefinitionVersion
-> Request GetSubscriptionDefinitionVersion
request = Service
-> GetSubscriptionDefinitionVersion
-> Request GetSubscriptionDefinitionVersion
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSubscriptionDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetSubscriptionDefinitionVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetSubscriptionDefinitionVersion))
-> Logger
-> Service
-> Proxy GetSubscriptionDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetSubscriptionDefinitionVersion)))
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 SubscriptionDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetSubscriptionDefinitionVersionResponse
GetSubscriptionDefinitionVersionResponse'
            (Maybe SubscriptionDefinitionVersion
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetSubscriptionDefinitionVersionResponse)
-> Either String (Maybe SubscriptionDefinitionVersion)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetSubscriptionDefinitionVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe SubscriptionDefinitionVersion)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Definition")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetSubscriptionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetSubscriptionDefinitionVersionResponse)
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
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetSubscriptionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetSubscriptionDefinitionVersionResponse)
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
"NextToken")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetSubscriptionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> GetSubscriptionDefinitionVersionResponse)
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 -> GetSubscriptionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Int -> GetSubscriptionDefinitionVersionResponse)
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 -> GetSubscriptionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetSubscriptionDefinitionVersionResponse)
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 -> GetSubscriptionDefinitionVersionResponse)
-> Either String Int
-> Either String GetSubscriptionDefinitionVersionResponse
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
    GetSubscriptionDefinitionVersion

instance
  Prelude.NFData
    GetSubscriptionDefinitionVersion

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

instance Core.ToPath GetSubscriptionDefinitionVersion where
  toPath :: GetSubscriptionDefinitionVersion -> ByteString
toPath GetSubscriptionDefinitionVersion' {Maybe Text
Text
subscriptionDefinitionVersionId :: Text
subscriptionDefinitionId :: Text
nextToken :: Maybe Text
$sel:subscriptionDefinitionVersionId:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> Text
$sel:subscriptionDefinitionId:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> Text
$sel:nextToken:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> 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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
subscriptionDefinitionVersionId
      ]

instance
  Core.ToQuery
    GetSubscriptionDefinitionVersion
  where
  toQuery :: GetSubscriptionDefinitionVersion -> QueryString
toQuery GetSubscriptionDefinitionVersion' {Maybe Text
Text
subscriptionDefinitionVersionId :: Text
subscriptionDefinitionId :: Text
nextToken :: Maybe Text
$sel:subscriptionDefinitionVersionId:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> Text
$sel:subscriptionDefinitionId:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> Text
$sel:nextToken:GetSubscriptionDefinitionVersion' :: GetSubscriptionDefinitionVersion -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken]

-- | /See:/ 'newGetSubscriptionDefinitionVersionResponse' smart constructor.
data GetSubscriptionDefinitionVersionResponse = GetSubscriptionDefinitionVersionResponse'
  { -- | Information about the subscription definition version.
    GetSubscriptionDefinitionVersionResponse
-> Maybe SubscriptionDefinitionVersion
definition :: Prelude.Maybe SubscriptionDefinitionVersion,
    -- | The ARN of the subscription definition version.
    GetSubscriptionDefinitionVersionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    GetSubscriptionDefinitionVersionResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the subscription
    -- definition version was created.
    GetSubscriptionDefinitionVersionResponse -> Maybe Text
creationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The version of the subscription definition version.
    GetSubscriptionDefinitionVersionResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The ID of the subscription definition version.
    GetSubscriptionDefinitionVersionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetSubscriptionDefinitionVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSubscriptionDefinitionVersionResponse
-> GetSubscriptionDefinitionVersionResponse -> Bool
(GetSubscriptionDefinitionVersionResponse
 -> GetSubscriptionDefinitionVersionResponse -> Bool)
-> (GetSubscriptionDefinitionVersionResponse
    -> GetSubscriptionDefinitionVersionResponse -> Bool)
-> Eq GetSubscriptionDefinitionVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSubscriptionDefinitionVersionResponse
-> GetSubscriptionDefinitionVersionResponse -> Bool
$c/= :: GetSubscriptionDefinitionVersionResponse
-> GetSubscriptionDefinitionVersionResponse -> Bool
== :: GetSubscriptionDefinitionVersionResponse
-> GetSubscriptionDefinitionVersionResponse -> Bool
$c== :: GetSubscriptionDefinitionVersionResponse
-> GetSubscriptionDefinitionVersionResponse -> Bool
Prelude.Eq, ReadPrec [GetSubscriptionDefinitionVersionResponse]
ReadPrec GetSubscriptionDefinitionVersionResponse
Int -> ReadS GetSubscriptionDefinitionVersionResponse
ReadS [GetSubscriptionDefinitionVersionResponse]
(Int -> ReadS GetSubscriptionDefinitionVersionResponse)
-> ReadS [GetSubscriptionDefinitionVersionResponse]
-> ReadPrec GetSubscriptionDefinitionVersionResponse
-> ReadPrec [GetSubscriptionDefinitionVersionResponse]
-> Read GetSubscriptionDefinitionVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSubscriptionDefinitionVersionResponse]
$creadListPrec :: ReadPrec [GetSubscriptionDefinitionVersionResponse]
readPrec :: ReadPrec GetSubscriptionDefinitionVersionResponse
$creadPrec :: ReadPrec GetSubscriptionDefinitionVersionResponse
readList :: ReadS [GetSubscriptionDefinitionVersionResponse]
$creadList :: ReadS [GetSubscriptionDefinitionVersionResponse]
readsPrec :: Int -> ReadS GetSubscriptionDefinitionVersionResponse
$creadsPrec :: Int -> ReadS GetSubscriptionDefinitionVersionResponse
Prelude.Read, Int -> GetSubscriptionDefinitionVersionResponse -> ShowS
[GetSubscriptionDefinitionVersionResponse] -> ShowS
GetSubscriptionDefinitionVersionResponse -> String
(Int -> GetSubscriptionDefinitionVersionResponse -> ShowS)
-> (GetSubscriptionDefinitionVersionResponse -> String)
-> ([GetSubscriptionDefinitionVersionResponse] -> ShowS)
-> Show GetSubscriptionDefinitionVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSubscriptionDefinitionVersionResponse] -> ShowS
$cshowList :: [GetSubscriptionDefinitionVersionResponse] -> ShowS
show :: GetSubscriptionDefinitionVersionResponse -> String
$cshow :: GetSubscriptionDefinitionVersionResponse -> String
showsPrec :: Int -> GetSubscriptionDefinitionVersionResponse -> ShowS
$cshowsPrec :: Int -> GetSubscriptionDefinitionVersionResponse -> ShowS
Prelude.Show, (forall x.
 GetSubscriptionDefinitionVersionResponse
 -> Rep GetSubscriptionDefinitionVersionResponse x)
-> (forall x.
    Rep GetSubscriptionDefinitionVersionResponse x
    -> GetSubscriptionDefinitionVersionResponse)
-> Generic GetSubscriptionDefinitionVersionResponse
forall x.
Rep GetSubscriptionDefinitionVersionResponse x
-> GetSubscriptionDefinitionVersionResponse
forall x.
GetSubscriptionDefinitionVersionResponse
-> Rep GetSubscriptionDefinitionVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSubscriptionDefinitionVersionResponse x
-> GetSubscriptionDefinitionVersionResponse
$cfrom :: forall x.
GetSubscriptionDefinitionVersionResponse
-> Rep GetSubscriptionDefinitionVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSubscriptionDefinitionVersionResponse' 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:
--
-- 'definition', 'getSubscriptionDefinitionVersionResponse_definition' - Information about the subscription definition version.
--
-- 'arn', 'getSubscriptionDefinitionVersionResponse_arn' - The ARN of the subscription definition version.
--
-- 'nextToken', 'getSubscriptionDefinitionVersionResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'creationTimestamp', 'getSubscriptionDefinitionVersionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the subscription
-- definition version was created.
--
-- 'version', 'getSubscriptionDefinitionVersionResponse_version' - The version of the subscription definition version.
--
-- 'id', 'getSubscriptionDefinitionVersionResponse_id' - The ID of the subscription definition version.
--
-- 'httpStatus', 'getSubscriptionDefinitionVersionResponse_httpStatus' - The response's http status code.
newGetSubscriptionDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSubscriptionDefinitionVersionResponse
newGetSubscriptionDefinitionVersionResponse :: Int -> GetSubscriptionDefinitionVersionResponse
newGetSubscriptionDefinitionVersionResponse
  Int
pHttpStatus_ =
    GetSubscriptionDefinitionVersionResponse' :: Maybe SubscriptionDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetSubscriptionDefinitionVersionResponse
GetSubscriptionDefinitionVersionResponse'
      { $sel:definition:GetSubscriptionDefinitionVersionResponse' :: Maybe SubscriptionDefinitionVersion
definition =
          Maybe SubscriptionDefinitionVersion
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:GetSubscriptionDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetSubscriptionDefinitionVersionResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:creationTimestamp:GetSubscriptionDefinitionVersionResponse' :: Maybe Text
creationTimestamp =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:version:GetSubscriptionDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:id:GetSubscriptionDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetSubscriptionDefinitionVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the subscription definition version.
getSubscriptionDefinitionVersionResponse_definition :: Lens.Lens' GetSubscriptionDefinitionVersionResponse (Prelude.Maybe SubscriptionDefinitionVersion)
getSubscriptionDefinitionVersionResponse_definition :: (Maybe SubscriptionDefinitionVersion
 -> f (Maybe SubscriptionDefinitionVersion))
-> GetSubscriptionDefinitionVersionResponse
-> f GetSubscriptionDefinitionVersionResponse
getSubscriptionDefinitionVersionResponse_definition = (GetSubscriptionDefinitionVersionResponse
 -> Maybe SubscriptionDefinitionVersion)
-> (GetSubscriptionDefinitionVersionResponse
    -> Maybe SubscriptionDefinitionVersion
    -> GetSubscriptionDefinitionVersionResponse)
-> Lens
     GetSubscriptionDefinitionVersionResponse
     GetSubscriptionDefinitionVersionResponse
     (Maybe SubscriptionDefinitionVersion)
     (Maybe SubscriptionDefinitionVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionVersionResponse' {Maybe SubscriptionDefinitionVersion
definition :: Maybe SubscriptionDefinitionVersion
$sel:definition:GetSubscriptionDefinitionVersionResponse' :: GetSubscriptionDefinitionVersionResponse
-> Maybe SubscriptionDefinitionVersion
definition} -> Maybe SubscriptionDefinitionVersion
definition) (\s :: GetSubscriptionDefinitionVersionResponse
s@GetSubscriptionDefinitionVersionResponse' {} Maybe SubscriptionDefinitionVersion
a -> GetSubscriptionDefinitionVersionResponse
s {$sel:definition:GetSubscriptionDefinitionVersionResponse' :: Maybe SubscriptionDefinitionVersion
definition = Maybe SubscriptionDefinitionVersion
a} :: GetSubscriptionDefinitionVersionResponse)

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

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
getSubscriptionDefinitionVersionResponse_nextToken :: Lens.Lens' GetSubscriptionDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
getSubscriptionDefinitionVersionResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSubscriptionDefinitionVersionResponse
-> f GetSubscriptionDefinitionVersionResponse
getSubscriptionDefinitionVersionResponse_nextToken = (GetSubscriptionDefinitionVersionResponse -> Maybe Text)
-> (GetSubscriptionDefinitionVersionResponse
    -> Maybe Text -> GetSubscriptionDefinitionVersionResponse)
-> Lens
     GetSubscriptionDefinitionVersionResponse
     GetSubscriptionDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionVersionResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSubscriptionDefinitionVersionResponse' :: GetSubscriptionDefinitionVersionResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSubscriptionDefinitionVersionResponse
s@GetSubscriptionDefinitionVersionResponse' {} Maybe Text
a -> GetSubscriptionDefinitionVersionResponse
s {$sel:nextToken:GetSubscriptionDefinitionVersionResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetSubscriptionDefinitionVersionResponse)

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

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

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

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

instance
  Prelude.NFData
    GetSubscriptionDefinitionVersionResponse