{-# 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.GetCoreDefinitionVersion
-- 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 core definition version.
module Amazonka.Greengrass.GetCoreDefinitionVersion
  ( -- * Creating a Request
    GetCoreDefinitionVersion (..),
    newGetCoreDefinitionVersion,

    -- * Request Lenses
    getCoreDefinitionVersion_coreDefinitionId,
    getCoreDefinitionVersion_coreDefinitionVersionId,

    -- * Destructuring the Response
    GetCoreDefinitionVersionResponse (..),
    newGetCoreDefinitionVersionResponse,

    -- * Response Lenses
    getCoreDefinitionVersionResponse_definition,
    getCoreDefinitionVersionResponse_arn,
    getCoreDefinitionVersionResponse_nextToken,
    getCoreDefinitionVersionResponse_creationTimestamp,
    getCoreDefinitionVersionResponse_version,
    getCoreDefinitionVersionResponse_id,
    getCoreDefinitionVersionResponse_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:/ 'newGetCoreDefinitionVersion' smart constructor.
data GetCoreDefinitionVersion = GetCoreDefinitionVersion'
  { -- | The ID of the core definition.
    GetCoreDefinitionVersion -> Text
coreDefinitionId :: Prelude.Text,
    -- | The ID of the core definition version. This value maps to the
    -- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
    -- object, which is returned by \'\'ListCoreDefinitionVersions\'\'
    -- requests. If the version is the last one that was associated with a core
    -- definition, the value also maps to the \'\'LatestVersion\'\' property of
    -- the corresponding \'\'DefinitionInformation\'\' object.
    GetCoreDefinitionVersion -> Text
coreDefinitionVersionId :: Prelude.Text
  }
  deriving (GetCoreDefinitionVersion -> GetCoreDefinitionVersion -> Bool
(GetCoreDefinitionVersion -> GetCoreDefinitionVersion -> Bool)
-> (GetCoreDefinitionVersion -> GetCoreDefinitionVersion -> Bool)
-> Eq GetCoreDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCoreDefinitionVersion -> GetCoreDefinitionVersion -> Bool
$c/= :: GetCoreDefinitionVersion -> GetCoreDefinitionVersion -> Bool
== :: GetCoreDefinitionVersion -> GetCoreDefinitionVersion -> Bool
$c== :: GetCoreDefinitionVersion -> GetCoreDefinitionVersion -> Bool
Prelude.Eq, ReadPrec [GetCoreDefinitionVersion]
ReadPrec GetCoreDefinitionVersion
Int -> ReadS GetCoreDefinitionVersion
ReadS [GetCoreDefinitionVersion]
(Int -> ReadS GetCoreDefinitionVersion)
-> ReadS [GetCoreDefinitionVersion]
-> ReadPrec GetCoreDefinitionVersion
-> ReadPrec [GetCoreDefinitionVersion]
-> Read GetCoreDefinitionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCoreDefinitionVersion]
$creadListPrec :: ReadPrec [GetCoreDefinitionVersion]
readPrec :: ReadPrec GetCoreDefinitionVersion
$creadPrec :: ReadPrec GetCoreDefinitionVersion
readList :: ReadS [GetCoreDefinitionVersion]
$creadList :: ReadS [GetCoreDefinitionVersion]
readsPrec :: Int -> ReadS GetCoreDefinitionVersion
$creadsPrec :: Int -> ReadS GetCoreDefinitionVersion
Prelude.Read, Int -> GetCoreDefinitionVersion -> ShowS
[GetCoreDefinitionVersion] -> ShowS
GetCoreDefinitionVersion -> String
(Int -> GetCoreDefinitionVersion -> ShowS)
-> (GetCoreDefinitionVersion -> String)
-> ([GetCoreDefinitionVersion] -> ShowS)
-> Show GetCoreDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCoreDefinitionVersion] -> ShowS
$cshowList :: [GetCoreDefinitionVersion] -> ShowS
show :: GetCoreDefinitionVersion -> String
$cshow :: GetCoreDefinitionVersion -> String
showsPrec :: Int -> GetCoreDefinitionVersion -> ShowS
$cshowsPrec :: Int -> GetCoreDefinitionVersion -> ShowS
Prelude.Show, (forall x.
 GetCoreDefinitionVersion -> Rep GetCoreDefinitionVersion x)
-> (forall x.
    Rep GetCoreDefinitionVersion x -> GetCoreDefinitionVersion)
-> Generic GetCoreDefinitionVersion
forall x.
Rep GetCoreDefinitionVersion x -> GetCoreDefinitionVersion
forall x.
GetCoreDefinitionVersion -> Rep GetCoreDefinitionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCoreDefinitionVersion x -> GetCoreDefinitionVersion
$cfrom :: forall x.
GetCoreDefinitionVersion -> Rep GetCoreDefinitionVersion x
Prelude.Generic)

-- |
-- Create a value of 'GetCoreDefinitionVersion' 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:
--
-- 'coreDefinitionId', 'getCoreDefinitionVersion_coreDefinitionId' - The ID of the core definition.
--
-- 'coreDefinitionVersionId', 'getCoreDefinitionVersion_coreDefinitionVersionId' - The ID of the core definition version. This value maps to the
-- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
-- object, which is returned by \'\'ListCoreDefinitionVersions\'\'
-- requests. If the version is the last one that was associated with a core
-- definition, the value also maps to the \'\'LatestVersion\'\' property of
-- the corresponding \'\'DefinitionInformation\'\' object.
newGetCoreDefinitionVersion ::
  -- | 'coreDefinitionId'
  Prelude.Text ->
  -- | 'coreDefinitionVersionId'
  Prelude.Text ->
  GetCoreDefinitionVersion
newGetCoreDefinitionVersion :: Text -> Text -> GetCoreDefinitionVersion
newGetCoreDefinitionVersion
  Text
pCoreDefinitionId_
  Text
pCoreDefinitionVersionId_ =
    GetCoreDefinitionVersion' :: Text -> Text -> GetCoreDefinitionVersion
GetCoreDefinitionVersion'
      { $sel:coreDefinitionId:GetCoreDefinitionVersion' :: Text
coreDefinitionId =
          Text
pCoreDefinitionId_,
        $sel:coreDefinitionVersionId:GetCoreDefinitionVersion' :: Text
coreDefinitionVersionId =
          Text
pCoreDefinitionVersionId_
      }

-- | The ID of the core definition.
getCoreDefinitionVersion_coreDefinitionId :: Lens.Lens' GetCoreDefinitionVersion Prelude.Text
getCoreDefinitionVersion_coreDefinitionId :: (Text -> f Text)
-> GetCoreDefinitionVersion -> f GetCoreDefinitionVersion
getCoreDefinitionVersion_coreDefinitionId = (GetCoreDefinitionVersion -> Text)
-> (GetCoreDefinitionVersion -> Text -> GetCoreDefinitionVersion)
-> Lens GetCoreDefinitionVersion GetCoreDefinitionVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDefinitionVersion' {Text
coreDefinitionId :: Text
$sel:coreDefinitionId:GetCoreDefinitionVersion' :: GetCoreDefinitionVersion -> Text
coreDefinitionId} -> Text
coreDefinitionId) (\s :: GetCoreDefinitionVersion
s@GetCoreDefinitionVersion' {} Text
a -> GetCoreDefinitionVersion
s {$sel:coreDefinitionId:GetCoreDefinitionVersion' :: Text
coreDefinitionId = Text
a} :: GetCoreDefinitionVersion)

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

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

instance Prelude.NFData GetCoreDefinitionVersion

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

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

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

-- |
-- Create a value of 'GetCoreDefinitionVersionResponse' 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', 'getCoreDefinitionVersionResponse_definition' - Information about the core definition version.
--
-- 'arn', 'getCoreDefinitionVersionResponse_arn' - The ARN of the core definition version.
--
-- 'nextToken', 'getCoreDefinitionVersionResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'creationTimestamp', 'getCoreDefinitionVersionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the core definition
-- version was created.
--
-- 'version', 'getCoreDefinitionVersionResponse_version' - The version of the core definition version.
--
-- 'id', 'getCoreDefinitionVersionResponse_id' - The ID of the core definition version.
--
-- 'httpStatus', 'getCoreDefinitionVersionResponse_httpStatus' - The response's http status code.
newGetCoreDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCoreDefinitionVersionResponse
newGetCoreDefinitionVersionResponse :: Int -> GetCoreDefinitionVersionResponse
newGetCoreDefinitionVersionResponse Int
pHttpStatus_ =
  GetCoreDefinitionVersionResponse' :: Maybe CoreDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetCoreDefinitionVersionResponse
GetCoreDefinitionVersionResponse'
    { $sel:definition:GetCoreDefinitionVersionResponse' :: Maybe CoreDefinitionVersion
definition =
        Maybe CoreDefinitionVersion
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetCoreDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetCoreDefinitionVersionResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetCoreDefinitionVersionResponse' :: Maybe Text
creationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:GetCoreDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetCoreDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCoreDefinitionVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the core definition version.
getCoreDefinitionVersionResponse_definition :: Lens.Lens' GetCoreDefinitionVersionResponse (Prelude.Maybe CoreDefinitionVersion)
getCoreDefinitionVersionResponse_definition :: (Maybe CoreDefinitionVersion -> f (Maybe CoreDefinitionVersion))
-> GetCoreDefinitionVersionResponse
-> f GetCoreDefinitionVersionResponse
getCoreDefinitionVersionResponse_definition = (GetCoreDefinitionVersionResponse -> Maybe CoreDefinitionVersion)
-> (GetCoreDefinitionVersionResponse
    -> Maybe CoreDefinitionVersion -> GetCoreDefinitionVersionResponse)
-> Lens
     GetCoreDefinitionVersionResponse
     GetCoreDefinitionVersionResponse
     (Maybe CoreDefinitionVersion)
     (Maybe CoreDefinitionVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDefinitionVersionResponse' {Maybe CoreDefinitionVersion
definition :: Maybe CoreDefinitionVersion
$sel:definition:GetCoreDefinitionVersionResponse' :: GetCoreDefinitionVersionResponse -> Maybe CoreDefinitionVersion
definition} -> Maybe CoreDefinitionVersion
definition) (\s :: GetCoreDefinitionVersionResponse
s@GetCoreDefinitionVersionResponse' {} Maybe CoreDefinitionVersion
a -> GetCoreDefinitionVersionResponse
s {$sel:definition:GetCoreDefinitionVersionResponse' :: Maybe CoreDefinitionVersion
definition = Maybe CoreDefinitionVersion
a} :: GetCoreDefinitionVersionResponse)

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

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

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

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

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

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

instance
  Prelude.NFData
    GetCoreDefinitionVersionResponse