{-# 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.GetResourceDefinitionVersion
-- 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 resource definition version, including
-- which resources are included in the version.
module Amazonka.Greengrass.GetResourceDefinitionVersion
  ( -- * Creating a Request
    GetResourceDefinitionVersion (..),
    newGetResourceDefinitionVersion,

    -- * Request Lenses
    getResourceDefinitionVersion_resourceDefinitionVersionId,
    getResourceDefinitionVersion_resourceDefinitionId,

    -- * Destructuring the Response
    GetResourceDefinitionVersionResponse (..),
    newGetResourceDefinitionVersionResponse,

    -- * Response Lenses
    getResourceDefinitionVersionResponse_definition,
    getResourceDefinitionVersionResponse_arn,
    getResourceDefinitionVersionResponse_creationTimestamp,
    getResourceDefinitionVersionResponse_version,
    getResourceDefinitionVersionResponse_id,
    getResourceDefinitionVersionResponse_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:/ 'newGetResourceDefinitionVersion' smart constructor.
data GetResourceDefinitionVersion = GetResourceDefinitionVersion'
  { -- | The ID of the resource definition version. This value maps to the
    -- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
    -- object, which is returned by \'\'ListResourceDefinitionVersions\'\'
    -- requests. If the version is the last one that was associated with a
    -- resource definition, the value also maps to the \'\'LatestVersion\'\'
    -- property of the corresponding \'\'DefinitionInformation\'\' object.
    GetResourceDefinitionVersion -> Text
resourceDefinitionVersionId :: Prelude.Text,
    -- | The ID of the resource definition.
    GetResourceDefinitionVersion -> Text
resourceDefinitionId :: Prelude.Text
  }
  deriving (GetResourceDefinitionVersion
-> GetResourceDefinitionVersion -> Bool
(GetResourceDefinitionVersion
 -> GetResourceDefinitionVersion -> Bool)
-> (GetResourceDefinitionVersion
    -> GetResourceDefinitionVersion -> Bool)
-> Eq GetResourceDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourceDefinitionVersion
-> GetResourceDefinitionVersion -> Bool
$c/= :: GetResourceDefinitionVersion
-> GetResourceDefinitionVersion -> Bool
== :: GetResourceDefinitionVersion
-> GetResourceDefinitionVersion -> Bool
$c== :: GetResourceDefinitionVersion
-> GetResourceDefinitionVersion -> Bool
Prelude.Eq, ReadPrec [GetResourceDefinitionVersion]
ReadPrec GetResourceDefinitionVersion
Int -> ReadS GetResourceDefinitionVersion
ReadS [GetResourceDefinitionVersion]
(Int -> ReadS GetResourceDefinitionVersion)
-> ReadS [GetResourceDefinitionVersion]
-> ReadPrec GetResourceDefinitionVersion
-> ReadPrec [GetResourceDefinitionVersion]
-> Read GetResourceDefinitionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourceDefinitionVersion]
$creadListPrec :: ReadPrec [GetResourceDefinitionVersion]
readPrec :: ReadPrec GetResourceDefinitionVersion
$creadPrec :: ReadPrec GetResourceDefinitionVersion
readList :: ReadS [GetResourceDefinitionVersion]
$creadList :: ReadS [GetResourceDefinitionVersion]
readsPrec :: Int -> ReadS GetResourceDefinitionVersion
$creadsPrec :: Int -> ReadS GetResourceDefinitionVersion
Prelude.Read, Int -> GetResourceDefinitionVersion -> ShowS
[GetResourceDefinitionVersion] -> ShowS
GetResourceDefinitionVersion -> String
(Int -> GetResourceDefinitionVersion -> ShowS)
-> (GetResourceDefinitionVersion -> String)
-> ([GetResourceDefinitionVersion] -> ShowS)
-> Show GetResourceDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourceDefinitionVersion] -> ShowS
$cshowList :: [GetResourceDefinitionVersion] -> ShowS
show :: GetResourceDefinitionVersion -> String
$cshow :: GetResourceDefinitionVersion -> String
showsPrec :: Int -> GetResourceDefinitionVersion -> ShowS
$cshowsPrec :: Int -> GetResourceDefinitionVersion -> ShowS
Prelude.Show, (forall x.
 GetResourceDefinitionVersion -> Rep GetResourceDefinitionVersion x)
-> (forall x.
    Rep GetResourceDefinitionVersion x -> GetResourceDefinitionVersion)
-> Generic GetResourceDefinitionVersion
forall x.
Rep GetResourceDefinitionVersion x -> GetResourceDefinitionVersion
forall x.
GetResourceDefinitionVersion -> Rep GetResourceDefinitionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetResourceDefinitionVersion x -> GetResourceDefinitionVersion
$cfrom :: forall x.
GetResourceDefinitionVersion -> Rep GetResourceDefinitionVersion x
Prelude.Generic)

-- |
-- Create a value of 'GetResourceDefinitionVersion' 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:
--
-- 'resourceDefinitionVersionId', 'getResourceDefinitionVersion_resourceDefinitionVersionId' - The ID of the resource definition version. This value maps to the
-- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
-- object, which is returned by \'\'ListResourceDefinitionVersions\'\'
-- requests. If the version is the last one that was associated with a
-- resource definition, the value also maps to the \'\'LatestVersion\'\'
-- property of the corresponding \'\'DefinitionInformation\'\' object.
--
-- 'resourceDefinitionId', 'getResourceDefinitionVersion_resourceDefinitionId' - The ID of the resource definition.
newGetResourceDefinitionVersion ::
  -- | 'resourceDefinitionVersionId'
  Prelude.Text ->
  -- | 'resourceDefinitionId'
  Prelude.Text ->
  GetResourceDefinitionVersion
newGetResourceDefinitionVersion :: Text -> Text -> GetResourceDefinitionVersion
newGetResourceDefinitionVersion
  Text
pResourceDefinitionVersionId_
  Text
pResourceDefinitionId_ =
    GetResourceDefinitionVersion' :: Text -> Text -> GetResourceDefinitionVersion
GetResourceDefinitionVersion'
      { $sel:resourceDefinitionVersionId:GetResourceDefinitionVersion' :: Text
resourceDefinitionVersionId =
          Text
pResourceDefinitionVersionId_,
        $sel:resourceDefinitionId:GetResourceDefinitionVersion' :: Text
resourceDefinitionId = Text
pResourceDefinitionId_
      }

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

-- | The ID of the resource definition.
getResourceDefinitionVersion_resourceDefinitionId :: Lens.Lens' GetResourceDefinitionVersion Prelude.Text
getResourceDefinitionVersion_resourceDefinitionId :: (Text -> f Text)
-> GetResourceDefinitionVersion -> f GetResourceDefinitionVersion
getResourceDefinitionVersion_resourceDefinitionId = (GetResourceDefinitionVersion -> Text)
-> (GetResourceDefinitionVersion
    -> Text -> GetResourceDefinitionVersion)
-> Lens
     GetResourceDefinitionVersion GetResourceDefinitionVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceDefinitionVersion' {Text
resourceDefinitionId :: Text
$sel:resourceDefinitionId:GetResourceDefinitionVersion' :: GetResourceDefinitionVersion -> Text
resourceDefinitionId} -> Text
resourceDefinitionId) (\s :: GetResourceDefinitionVersion
s@GetResourceDefinitionVersion' {} Text
a -> GetResourceDefinitionVersion
s {$sel:resourceDefinitionId:GetResourceDefinitionVersion' :: Text
resourceDefinitionId = Text
a} :: GetResourceDefinitionVersion)

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

instance Prelude.NFData GetResourceDefinitionVersion

instance Core.ToHeaders GetResourceDefinitionVersion where
  toHeaders :: GetResourceDefinitionVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetResourceDefinitionVersion -> 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 GetResourceDefinitionVersion where
  toPath :: GetResourceDefinitionVersion -> ByteString
toPath GetResourceDefinitionVersion' {Text
resourceDefinitionId :: Text
resourceDefinitionVersionId :: Text
$sel:resourceDefinitionId:GetResourceDefinitionVersion' :: GetResourceDefinitionVersion -> Text
$sel:resourceDefinitionVersionId:GetResourceDefinitionVersion' :: GetResourceDefinitionVersion -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/resources/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceDefinitionId,
        ByteString
"/versions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceDefinitionVersionId
      ]

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

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

-- |
-- Create a value of 'GetResourceDefinitionVersionResponse' 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', 'getResourceDefinitionVersionResponse_definition' - Information about the definition.
--
-- 'arn', 'getResourceDefinitionVersionResponse_arn' - Arn of the resource definition version.
--
-- 'creationTimestamp', 'getResourceDefinitionVersionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the resource definition
-- version was created.
--
-- 'version', 'getResourceDefinitionVersionResponse_version' - The version of the resource definition version.
--
-- 'id', 'getResourceDefinitionVersionResponse_id' - The ID of the resource definition version.
--
-- 'httpStatus', 'getResourceDefinitionVersionResponse_httpStatus' - The response's http status code.
newGetResourceDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetResourceDefinitionVersionResponse
newGetResourceDefinitionVersionResponse :: Int -> GetResourceDefinitionVersionResponse
newGetResourceDefinitionVersionResponse Int
pHttpStatus_ =
  GetResourceDefinitionVersionResponse' :: Maybe ResourceDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetResourceDefinitionVersionResponse
GetResourceDefinitionVersionResponse'
    { $sel:definition:GetResourceDefinitionVersionResponse' :: Maybe ResourceDefinitionVersion
definition =
        Maybe ResourceDefinitionVersion
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetResourceDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetResourceDefinitionVersionResponse' :: Maybe Text
creationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:GetResourceDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetResourceDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetResourceDefinitionVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the definition.
getResourceDefinitionVersionResponse_definition :: Lens.Lens' GetResourceDefinitionVersionResponse (Prelude.Maybe ResourceDefinitionVersion)
getResourceDefinitionVersionResponse_definition :: (Maybe ResourceDefinitionVersion
 -> f (Maybe ResourceDefinitionVersion))
-> GetResourceDefinitionVersionResponse
-> f GetResourceDefinitionVersionResponse
getResourceDefinitionVersionResponse_definition = (GetResourceDefinitionVersionResponse
 -> Maybe ResourceDefinitionVersion)
-> (GetResourceDefinitionVersionResponse
    -> Maybe ResourceDefinitionVersion
    -> GetResourceDefinitionVersionResponse)
-> Lens
     GetResourceDefinitionVersionResponse
     GetResourceDefinitionVersionResponse
     (Maybe ResourceDefinitionVersion)
     (Maybe ResourceDefinitionVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceDefinitionVersionResponse' {Maybe ResourceDefinitionVersion
definition :: Maybe ResourceDefinitionVersion
$sel:definition:GetResourceDefinitionVersionResponse' :: GetResourceDefinitionVersionResponse
-> Maybe ResourceDefinitionVersion
definition} -> Maybe ResourceDefinitionVersion
definition) (\s :: GetResourceDefinitionVersionResponse
s@GetResourceDefinitionVersionResponse' {} Maybe ResourceDefinitionVersion
a -> GetResourceDefinitionVersionResponse
s {$sel:definition:GetResourceDefinitionVersionResponse' :: Maybe ResourceDefinitionVersion
definition = Maybe ResourceDefinitionVersion
a} :: GetResourceDefinitionVersionResponse)

-- | Arn of the resource definition version.
getResourceDefinitionVersionResponse_arn :: Lens.Lens' GetResourceDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
getResourceDefinitionVersionResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetResourceDefinitionVersionResponse
-> f GetResourceDefinitionVersionResponse
getResourceDefinitionVersionResponse_arn = (GetResourceDefinitionVersionResponse -> Maybe Text)
-> (GetResourceDefinitionVersionResponse
    -> Maybe Text -> GetResourceDefinitionVersionResponse)
-> Lens
     GetResourceDefinitionVersionResponse
     GetResourceDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceDefinitionVersionResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetResourceDefinitionVersionResponse' :: GetResourceDefinitionVersionResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetResourceDefinitionVersionResponse
s@GetResourceDefinitionVersionResponse' {} Maybe Text
a -> GetResourceDefinitionVersionResponse
s {$sel:arn:GetResourceDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
a} :: GetResourceDefinitionVersionResponse)

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

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

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

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

instance
  Prelude.NFData
    GetResourceDefinitionVersionResponse