{-# 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.GetSubscriptionDefinition
-- 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.
module Amazonka.Greengrass.GetSubscriptionDefinition
  ( -- * Creating a Request
    GetSubscriptionDefinition (..),
    newGetSubscriptionDefinition,

    -- * Request Lenses
    getSubscriptionDefinition_subscriptionDefinitionId,

    -- * Destructuring the Response
    GetSubscriptionDefinitionResponse (..),
    newGetSubscriptionDefinitionResponse,

    -- * Response Lenses
    getSubscriptionDefinitionResponse_latestVersionArn,
    getSubscriptionDefinitionResponse_arn,
    getSubscriptionDefinitionResponse_name,
    getSubscriptionDefinitionResponse_creationTimestamp,
    getSubscriptionDefinitionResponse_id,
    getSubscriptionDefinitionResponse_latestVersion,
    getSubscriptionDefinitionResponse_lastUpdatedTimestamp,
    getSubscriptionDefinitionResponse_tags,
    getSubscriptionDefinitionResponse_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:/ 'newGetSubscriptionDefinition' smart constructor.
data GetSubscriptionDefinition = GetSubscriptionDefinition'
  { -- | The ID of the subscription definition.
    GetSubscriptionDefinition -> Text
subscriptionDefinitionId :: Prelude.Text
  }
  deriving (GetSubscriptionDefinition -> GetSubscriptionDefinition -> Bool
(GetSubscriptionDefinition -> GetSubscriptionDefinition -> Bool)
-> (GetSubscriptionDefinition -> GetSubscriptionDefinition -> Bool)
-> Eq GetSubscriptionDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSubscriptionDefinition -> GetSubscriptionDefinition -> Bool
$c/= :: GetSubscriptionDefinition -> GetSubscriptionDefinition -> Bool
== :: GetSubscriptionDefinition -> GetSubscriptionDefinition -> Bool
$c== :: GetSubscriptionDefinition -> GetSubscriptionDefinition -> Bool
Prelude.Eq, ReadPrec [GetSubscriptionDefinition]
ReadPrec GetSubscriptionDefinition
Int -> ReadS GetSubscriptionDefinition
ReadS [GetSubscriptionDefinition]
(Int -> ReadS GetSubscriptionDefinition)
-> ReadS [GetSubscriptionDefinition]
-> ReadPrec GetSubscriptionDefinition
-> ReadPrec [GetSubscriptionDefinition]
-> Read GetSubscriptionDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSubscriptionDefinition]
$creadListPrec :: ReadPrec [GetSubscriptionDefinition]
readPrec :: ReadPrec GetSubscriptionDefinition
$creadPrec :: ReadPrec GetSubscriptionDefinition
readList :: ReadS [GetSubscriptionDefinition]
$creadList :: ReadS [GetSubscriptionDefinition]
readsPrec :: Int -> ReadS GetSubscriptionDefinition
$creadsPrec :: Int -> ReadS GetSubscriptionDefinition
Prelude.Read, Int -> GetSubscriptionDefinition -> ShowS
[GetSubscriptionDefinition] -> ShowS
GetSubscriptionDefinition -> String
(Int -> GetSubscriptionDefinition -> ShowS)
-> (GetSubscriptionDefinition -> String)
-> ([GetSubscriptionDefinition] -> ShowS)
-> Show GetSubscriptionDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSubscriptionDefinition] -> ShowS
$cshowList :: [GetSubscriptionDefinition] -> ShowS
show :: GetSubscriptionDefinition -> String
$cshow :: GetSubscriptionDefinition -> String
showsPrec :: Int -> GetSubscriptionDefinition -> ShowS
$cshowsPrec :: Int -> GetSubscriptionDefinition -> ShowS
Prelude.Show, (forall x.
 GetSubscriptionDefinition -> Rep GetSubscriptionDefinition x)
-> (forall x.
    Rep GetSubscriptionDefinition x -> GetSubscriptionDefinition)
-> Generic GetSubscriptionDefinition
forall x.
Rep GetSubscriptionDefinition x -> GetSubscriptionDefinition
forall x.
GetSubscriptionDefinition -> Rep GetSubscriptionDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSubscriptionDefinition x -> GetSubscriptionDefinition
$cfrom :: forall x.
GetSubscriptionDefinition -> Rep GetSubscriptionDefinition x
Prelude.Generic)

-- |
-- Create a value of 'GetSubscriptionDefinition' 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:
--
-- 'subscriptionDefinitionId', 'getSubscriptionDefinition_subscriptionDefinitionId' - The ID of the subscription definition.
newGetSubscriptionDefinition ::
  -- | 'subscriptionDefinitionId'
  Prelude.Text ->
  GetSubscriptionDefinition
newGetSubscriptionDefinition :: Text -> GetSubscriptionDefinition
newGetSubscriptionDefinition
  Text
pSubscriptionDefinitionId_ =
    GetSubscriptionDefinition' :: Text -> GetSubscriptionDefinition
GetSubscriptionDefinition'
      { $sel:subscriptionDefinitionId:GetSubscriptionDefinition' :: Text
subscriptionDefinitionId =
          Text
pSubscriptionDefinitionId_
      }

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

instance Core.AWSRequest GetSubscriptionDefinition where
  type
    AWSResponse GetSubscriptionDefinition =
      GetSubscriptionDefinitionResponse
  request :: GetSubscriptionDefinition -> Request GetSubscriptionDefinition
request = Service
-> GetSubscriptionDefinition -> Request GetSubscriptionDefinition
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSubscriptionDefinition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSubscriptionDefinition)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetSubscriptionDefinition))
-> Logger
-> Service
-> Proxy GetSubscriptionDefinition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSubscriptionDefinition)))
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
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> GetSubscriptionDefinitionResponse
GetSubscriptionDefinitionResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetSubscriptionDefinitionResponse)
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
"LatestVersionArn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetSubscriptionDefinitionResponse)
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
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetSubscriptionDefinitionResponse)
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
"Name")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetSubscriptionDefinitionResponse)
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
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetSubscriptionDefinitionResponse)
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
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetSubscriptionDefinitionResponse)
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
"LatestVersion")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Int -> GetSubscriptionDefinitionResponse)
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
"LastUpdatedTimestamp")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Int -> GetSubscriptionDefinitionResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> GetSubscriptionDefinitionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetSubscriptionDefinitionResponse)
-> Either String Int
-> Either String GetSubscriptionDefinitionResponse
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 GetSubscriptionDefinition

instance Prelude.NFData GetSubscriptionDefinition

instance Core.ToHeaders GetSubscriptionDefinition where
  toHeaders :: GetSubscriptionDefinition -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSubscriptionDefinition -> 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 GetSubscriptionDefinition where
  toPath :: GetSubscriptionDefinition -> ByteString
toPath GetSubscriptionDefinition' {Text
subscriptionDefinitionId :: Text
$sel:subscriptionDefinitionId:GetSubscriptionDefinition' :: GetSubscriptionDefinition -> 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
      ]

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

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

-- |
-- Create a value of 'GetSubscriptionDefinitionResponse' 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:
--
-- 'latestVersionArn', 'getSubscriptionDefinitionResponse_latestVersionArn' - The ARN of the latest version associated with the definition.
--
-- 'arn', 'getSubscriptionDefinitionResponse_arn' - The ARN of the definition.
--
-- 'name', 'getSubscriptionDefinitionResponse_name' - The name of the definition.
--
-- 'creationTimestamp', 'getSubscriptionDefinitionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the definition was
-- created.
--
-- 'id', 'getSubscriptionDefinitionResponse_id' - The ID of the definition.
--
-- 'latestVersion', 'getSubscriptionDefinitionResponse_latestVersion' - The ID of the latest version associated with the definition.
--
-- 'lastUpdatedTimestamp', 'getSubscriptionDefinitionResponse_lastUpdatedTimestamp' - The time, in milliseconds since the epoch, when the definition was last
-- updated.
--
-- 'tags', 'getSubscriptionDefinitionResponse_tags' - Tag(s) attached to the resource arn.
--
-- 'httpStatus', 'getSubscriptionDefinitionResponse_httpStatus' - The response's http status code.
newGetSubscriptionDefinitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSubscriptionDefinitionResponse
newGetSubscriptionDefinitionResponse :: Int -> GetSubscriptionDefinitionResponse
newGetSubscriptionDefinitionResponse Int
pHttpStatus_ =
  GetSubscriptionDefinitionResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> GetSubscriptionDefinitionResponse
GetSubscriptionDefinitionResponse'
    { $sel:latestVersionArn:GetSubscriptionDefinitionResponse' :: Maybe Text
latestVersionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetSubscriptionDefinitionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetSubscriptionDefinitionResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetSubscriptionDefinitionResponse' :: Maybe Text
creationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetSubscriptionDefinitionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersion:GetSubscriptionDefinitionResponse' :: Maybe Text
latestVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTimestamp:GetSubscriptionDefinitionResponse' :: Maybe Text
lastUpdatedTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GetSubscriptionDefinitionResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSubscriptionDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the latest version associated with the definition.
getSubscriptionDefinitionResponse_latestVersionArn :: Lens.Lens' GetSubscriptionDefinitionResponse (Prelude.Maybe Prelude.Text)
getSubscriptionDefinitionResponse_latestVersionArn :: (Maybe Text -> f (Maybe Text))
-> GetSubscriptionDefinitionResponse
-> f GetSubscriptionDefinitionResponse
getSubscriptionDefinitionResponse_latestVersionArn = (GetSubscriptionDefinitionResponse -> Maybe Text)
-> (GetSubscriptionDefinitionResponse
    -> Maybe Text -> GetSubscriptionDefinitionResponse)
-> Lens
     GetSubscriptionDefinitionResponse
     GetSubscriptionDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionResponse' {Maybe Text
latestVersionArn :: Maybe Text
$sel:latestVersionArn:GetSubscriptionDefinitionResponse' :: GetSubscriptionDefinitionResponse -> Maybe Text
latestVersionArn} -> Maybe Text
latestVersionArn) (\s :: GetSubscriptionDefinitionResponse
s@GetSubscriptionDefinitionResponse' {} Maybe Text
a -> GetSubscriptionDefinitionResponse
s {$sel:latestVersionArn:GetSubscriptionDefinitionResponse' :: Maybe Text
latestVersionArn = Maybe Text
a} :: GetSubscriptionDefinitionResponse)

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

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

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

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

-- | The ID of the latest version associated with the definition.
getSubscriptionDefinitionResponse_latestVersion :: Lens.Lens' GetSubscriptionDefinitionResponse (Prelude.Maybe Prelude.Text)
getSubscriptionDefinitionResponse_latestVersion :: (Maybe Text -> f (Maybe Text))
-> GetSubscriptionDefinitionResponse
-> f GetSubscriptionDefinitionResponse
getSubscriptionDefinitionResponse_latestVersion = (GetSubscriptionDefinitionResponse -> Maybe Text)
-> (GetSubscriptionDefinitionResponse
    -> Maybe Text -> GetSubscriptionDefinitionResponse)
-> Lens
     GetSubscriptionDefinitionResponse
     GetSubscriptionDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionResponse' {Maybe Text
latestVersion :: Maybe Text
$sel:latestVersion:GetSubscriptionDefinitionResponse' :: GetSubscriptionDefinitionResponse -> Maybe Text
latestVersion} -> Maybe Text
latestVersion) (\s :: GetSubscriptionDefinitionResponse
s@GetSubscriptionDefinitionResponse' {} Maybe Text
a -> GetSubscriptionDefinitionResponse
s {$sel:latestVersion:GetSubscriptionDefinitionResponse' :: Maybe Text
latestVersion = Maybe Text
a} :: GetSubscriptionDefinitionResponse)

-- | The time, in milliseconds since the epoch, when the definition was last
-- updated.
getSubscriptionDefinitionResponse_lastUpdatedTimestamp :: Lens.Lens' GetSubscriptionDefinitionResponse (Prelude.Maybe Prelude.Text)
getSubscriptionDefinitionResponse_lastUpdatedTimestamp :: (Maybe Text -> f (Maybe Text))
-> GetSubscriptionDefinitionResponse
-> f GetSubscriptionDefinitionResponse
getSubscriptionDefinitionResponse_lastUpdatedTimestamp = (GetSubscriptionDefinitionResponse -> Maybe Text)
-> (GetSubscriptionDefinitionResponse
    -> Maybe Text -> GetSubscriptionDefinitionResponse)
-> Lens
     GetSubscriptionDefinitionResponse
     GetSubscriptionDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionResponse' {Maybe Text
lastUpdatedTimestamp :: Maybe Text
$sel:lastUpdatedTimestamp:GetSubscriptionDefinitionResponse' :: GetSubscriptionDefinitionResponse -> Maybe Text
lastUpdatedTimestamp} -> Maybe Text
lastUpdatedTimestamp) (\s :: GetSubscriptionDefinitionResponse
s@GetSubscriptionDefinitionResponse' {} Maybe Text
a -> GetSubscriptionDefinitionResponse
s {$sel:lastUpdatedTimestamp:GetSubscriptionDefinitionResponse' :: Maybe Text
lastUpdatedTimestamp = Maybe Text
a} :: GetSubscriptionDefinitionResponse)

-- | Tag(s) attached to the resource arn.
getSubscriptionDefinitionResponse_tags :: Lens.Lens' GetSubscriptionDefinitionResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getSubscriptionDefinitionResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetSubscriptionDefinitionResponse
-> f GetSubscriptionDefinitionResponse
getSubscriptionDefinitionResponse_tags = (GetSubscriptionDefinitionResponse -> Maybe (HashMap Text Text))
-> (GetSubscriptionDefinitionResponse
    -> Maybe (HashMap Text Text) -> GetSubscriptionDefinitionResponse)
-> Lens
     GetSubscriptionDefinitionResponse
     GetSubscriptionDefinitionResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionDefinitionResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetSubscriptionDefinitionResponse' :: GetSubscriptionDefinitionResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetSubscriptionDefinitionResponse
s@GetSubscriptionDefinitionResponse' {} Maybe (HashMap Text Text)
a -> GetSubscriptionDefinitionResponse
s {$sel:tags:GetSubscriptionDefinitionResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetSubscriptionDefinitionResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetSubscriptionDefinitionResponse
 -> f GetSubscriptionDefinitionResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetSubscriptionDefinitionResponse
-> f GetSubscriptionDefinitionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetSubscriptionDefinitionResponse