{-# 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.CodeArtifact.DescribePackageVersion
-- 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)
--
-- Returns a
-- <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionDescription.html PackageVersionDescription>
-- object that contains information about the requested package version.
module Amazonka.CodeArtifact.DescribePackageVersion
  ( -- * Creating a Request
    DescribePackageVersion (..),
    newDescribePackageVersion,

    -- * Request Lenses
    describePackageVersion_namespace,
    describePackageVersion_domainOwner,
    describePackageVersion_domain,
    describePackageVersion_repository,
    describePackageVersion_format,
    describePackageVersion_package,
    describePackageVersion_packageVersion,

    -- * Destructuring the Response
    DescribePackageVersionResponse (..),
    newDescribePackageVersionResponse,

    -- * Response Lenses
    describePackageVersionResponse_httpStatus,
    describePackageVersionResponse_packageVersion,
  )
where

import Amazonka.CodeArtifact.Types
import qualified Amazonka.Core as Core
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:/ 'newDescribePackageVersion' smart constructor.
data DescribePackageVersion = DescribePackageVersion'
  { -- | The namespace of the package. The package component that specifies its
    -- namespace depends on its type. For example:
    --
    -- -   The namespace of a Maven package is its @groupId@.
    --
    -- -   The namespace of an npm package is its @scope@.
    --
    -- -   A Python package does not contain a corresponding component, so
    --     Python packages do not have a namespace.
    DescribePackageVersion -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | The 12-digit account number of the AWS account that owns the domain. It
    -- does not include dashes or spaces.
    DescribePackageVersion -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the domain that contains the repository that contains the
    -- package version.
    DescribePackageVersion -> Text
domain :: Prelude.Text,
    -- | The name of the repository that contains the package version.
    DescribePackageVersion -> Text
repository :: Prelude.Text,
    -- | A format that specifies the type of the requested package version. The
    -- valid values are:
    --
    -- -   @npm@
    --
    -- -   @pypi@
    --
    -- -   @maven@
    DescribePackageVersion -> PackageFormat
format :: PackageFormat,
    -- | The name of the requested package version.
    DescribePackageVersion -> Text
package :: Prelude.Text,
    -- | A string that contains the package version (for example, @3.5.2@).
    DescribePackageVersion -> Text
packageVersion :: Prelude.Text
  }
  deriving (DescribePackageVersion -> DescribePackageVersion -> Bool
(DescribePackageVersion -> DescribePackageVersion -> Bool)
-> (DescribePackageVersion -> DescribePackageVersion -> Bool)
-> Eq DescribePackageVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePackageVersion -> DescribePackageVersion -> Bool
$c/= :: DescribePackageVersion -> DescribePackageVersion -> Bool
== :: DescribePackageVersion -> DescribePackageVersion -> Bool
$c== :: DescribePackageVersion -> DescribePackageVersion -> Bool
Prelude.Eq, ReadPrec [DescribePackageVersion]
ReadPrec DescribePackageVersion
Int -> ReadS DescribePackageVersion
ReadS [DescribePackageVersion]
(Int -> ReadS DescribePackageVersion)
-> ReadS [DescribePackageVersion]
-> ReadPrec DescribePackageVersion
-> ReadPrec [DescribePackageVersion]
-> Read DescribePackageVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePackageVersion]
$creadListPrec :: ReadPrec [DescribePackageVersion]
readPrec :: ReadPrec DescribePackageVersion
$creadPrec :: ReadPrec DescribePackageVersion
readList :: ReadS [DescribePackageVersion]
$creadList :: ReadS [DescribePackageVersion]
readsPrec :: Int -> ReadS DescribePackageVersion
$creadsPrec :: Int -> ReadS DescribePackageVersion
Prelude.Read, Int -> DescribePackageVersion -> ShowS
[DescribePackageVersion] -> ShowS
DescribePackageVersion -> String
(Int -> DescribePackageVersion -> ShowS)
-> (DescribePackageVersion -> String)
-> ([DescribePackageVersion] -> ShowS)
-> Show DescribePackageVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePackageVersion] -> ShowS
$cshowList :: [DescribePackageVersion] -> ShowS
show :: DescribePackageVersion -> String
$cshow :: DescribePackageVersion -> String
showsPrec :: Int -> DescribePackageVersion -> ShowS
$cshowsPrec :: Int -> DescribePackageVersion -> ShowS
Prelude.Show, (forall x. DescribePackageVersion -> Rep DescribePackageVersion x)
-> (forall x.
    Rep DescribePackageVersion x -> DescribePackageVersion)
-> Generic DescribePackageVersion
forall x. Rep DescribePackageVersion x -> DescribePackageVersion
forall x. DescribePackageVersion -> Rep DescribePackageVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePackageVersion x -> DescribePackageVersion
$cfrom :: forall x. DescribePackageVersion -> Rep DescribePackageVersion x
Prelude.Generic)

-- |
-- Create a value of 'DescribePackageVersion' 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:
--
-- 'namespace', 'describePackageVersion_namespace' - The namespace of the package. The package component that specifies its
-- namespace depends on its type. For example:
--
-- -   The namespace of a Maven package is its @groupId@.
--
-- -   The namespace of an npm package is its @scope@.
--
-- -   A Python package does not contain a corresponding component, so
--     Python packages do not have a namespace.
--
-- 'domainOwner', 'describePackageVersion_domainOwner' - The 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
--
-- 'domain', 'describePackageVersion_domain' - The name of the domain that contains the repository that contains the
-- package version.
--
-- 'repository', 'describePackageVersion_repository' - The name of the repository that contains the package version.
--
-- 'format', 'describePackageVersion_format' - A format that specifies the type of the requested package version. The
-- valid values are:
--
-- -   @npm@
--
-- -   @pypi@
--
-- -   @maven@
--
-- 'package', 'describePackageVersion_package' - The name of the requested package version.
--
-- 'packageVersion', 'describePackageVersion_packageVersion' - A string that contains the package version (for example, @3.5.2@).
newDescribePackageVersion ::
  -- | 'domain'
  Prelude.Text ->
  -- | 'repository'
  Prelude.Text ->
  -- | 'format'
  PackageFormat ->
  -- | 'package'
  Prelude.Text ->
  -- | 'packageVersion'
  Prelude.Text ->
  DescribePackageVersion
newDescribePackageVersion :: Text
-> Text -> PackageFormat -> Text -> Text -> DescribePackageVersion
newDescribePackageVersion
  Text
pDomain_
  Text
pRepository_
  PackageFormat
pFormat_
  Text
pPackage_
  Text
pPackageVersion_ =
    DescribePackageVersion' :: Maybe Text
-> Maybe Text
-> Text
-> Text
-> PackageFormat
-> Text
-> Text
-> DescribePackageVersion
DescribePackageVersion'
      { $sel:namespace:DescribePackageVersion' :: Maybe Text
namespace =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:domainOwner:DescribePackageVersion' :: Maybe Text
domainOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:domain:DescribePackageVersion' :: Text
domain = Text
pDomain_,
        $sel:repository:DescribePackageVersion' :: Text
repository = Text
pRepository_,
        $sel:format:DescribePackageVersion' :: PackageFormat
format = PackageFormat
pFormat_,
        $sel:package:DescribePackageVersion' :: Text
package = Text
pPackage_,
        $sel:packageVersion:DescribePackageVersion' :: Text
packageVersion = Text
pPackageVersion_
      }

-- | The namespace of the package. The package component that specifies its
-- namespace depends on its type. For example:
--
-- -   The namespace of a Maven package is its @groupId@.
--
-- -   The namespace of an npm package is its @scope@.
--
-- -   A Python package does not contain a corresponding component, so
--     Python packages do not have a namespace.
describePackageVersion_namespace :: Lens.Lens' DescribePackageVersion (Prelude.Maybe Prelude.Text)
describePackageVersion_namespace :: (Maybe Text -> f (Maybe Text))
-> DescribePackageVersion -> f DescribePackageVersion
describePackageVersion_namespace = (DescribePackageVersion -> Maybe Text)
-> (DescribePackageVersion -> Maybe Text -> DescribePackageVersion)
-> Lens
     DescribePackageVersion
     DescribePackageVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersion' {Maybe Text
namespace :: Maybe Text
$sel:namespace:DescribePackageVersion' :: DescribePackageVersion -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: DescribePackageVersion
s@DescribePackageVersion' {} Maybe Text
a -> DescribePackageVersion
s {$sel:namespace:DescribePackageVersion' :: Maybe Text
namespace = Maybe Text
a} :: DescribePackageVersion)

-- | The 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
describePackageVersion_domainOwner :: Lens.Lens' DescribePackageVersion (Prelude.Maybe Prelude.Text)
describePackageVersion_domainOwner :: (Maybe Text -> f (Maybe Text))
-> DescribePackageVersion -> f DescribePackageVersion
describePackageVersion_domainOwner = (DescribePackageVersion -> Maybe Text)
-> (DescribePackageVersion -> Maybe Text -> DescribePackageVersion)
-> Lens
     DescribePackageVersion
     DescribePackageVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersion' {Maybe Text
domainOwner :: Maybe Text
$sel:domainOwner:DescribePackageVersion' :: DescribePackageVersion -> Maybe Text
domainOwner} -> Maybe Text
domainOwner) (\s :: DescribePackageVersion
s@DescribePackageVersion' {} Maybe Text
a -> DescribePackageVersion
s {$sel:domainOwner:DescribePackageVersion' :: Maybe Text
domainOwner = Maybe Text
a} :: DescribePackageVersion)

-- | The name of the domain that contains the repository that contains the
-- package version.
describePackageVersion_domain :: Lens.Lens' DescribePackageVersion Prelude.Text
describePackageVersion_domain :: (Text -> f Text)
-> DescribePackageVersion -> f DescribePackageVersion
describePackageVersion_domain = (DescribePackageVersion -> Text)
-> (DescribePackageVersion -> Text -> DescribePackageVersion)
-> Lens DescribePackageVersion DescribePackageVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersion' {Text
domain :: Text
$sel:domain:DescribePackageVersion' :: DescribePackageVersion -> Text
domain} -> Text
domain) (\s :: DescribePackageVersion
s@DescribePackageVersion' {} Text
a -> DescribePackageVersion
s {$sel:domain:DescribePackageVersion' :: Text
domain = Text
a} :: DescribePackageVersion)

-- | The name of the repository that contains the package version.
describePackageVersion_repository :: Lens.Lens' DescribePackageVersion Prelude.Text
describePackageVersion_repository :: (Text -> f Text)
-> DescribePackageVersion -> f DescribePackageVersion
describePackageVersion_repository = (DescribePackageVersion -> Text)
-> (DescribePackageVersion -> Text -> DescribePackageVersion)
-> Lens DescribePackageVersion DescribePackageVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersion' {Text
repository :: Text
$sel:repository:DescribePackageVersion' :: DescribePackageVersion -> Text
repository} -> Text
repository) (\s :: DescribePackageVersion
s@DescribePackageVersion' {} Text
a -> DescribePackageVersion
s {$sel:repository:DescribePackageVersion' :: Text
repository = Text
a} :: DescribePackageVersion)

-- | A format that specifies the type of the requested package version. The
-- valid values are:
--
-- -   @npm@
--
-- -   @pypi@
--
-- -   @maven@
describePackageVersion_format :: Lens.Lens' DescribePackageVersion PackageFormat
describePackageVersion_format :: (PackageFormat -> f PackageFormat)
-> DescribePackageVersion -> f DescribePackageVersion
describePackageVersion_format = (DescribePackageVersion -> PackageFormat)
-> (DescribePackageVersion
    -> PackageFormat -> DescribePackageVersion)
-> Lens
     DescribePackageVersion
     DescribePackageVersion
     PackageFormat
     PackageFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersion' {PackageFormat
format :: PackageFormat
$sel:format:DescribePackageVersion' :: DescribePackageVersion -> PackageFormat
format} -> PackageFormat
format) (\s :: DescribePackageVersion
s@DescribePackageVersion' {} PackageFormat
a -> DescribePackageVersion
s {$sel:format:DescribePackageVersion' :: PackageFormat
format = PackageFormat
a} :: DescribePackageVersion)

-- | The name of the requested package version.
describePackageVersion_package :: Lens.Lens' DescribePackageVersion Prelude.Text
describePackageVersion_package :: (Text -> f Text)
-> DescribePackageVersion -> f DescribePackageVersion
describePackageVersion_package = (DescribePackageVersion -> Text)
-> (DescribePackageVersion -> Text -> DescribePackageVersion)
-> Lens DescribePackageVersion DescribePackageVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersion' {Text
package :: Text
$sel:package:DescribePackageVersion' :: DescribePackageVersion -> Text
package} -> Text
package) (\s :: DescribePackageVersion
s@DescribePackageVersion' {} Text
a -> DescribePackageVersion
s {$sel:package:DescribePackageVersion' :: Text
package = Text
a} :: DescribePackageVersion)

-- | A string that contains the package version (for example, @3.5.2@).
describePackageVersion_packageVersion :: Lens.Lens' DescribePackageVersion Prelude.Text
describePackageVersion_packageVersion :: (Text -> f Text)
-> DescribePackageVersion -> f DescribePackageVersion
describePackageVersion_packageVersion = (DescribePackageVersion -> Text)
-> (DescribePackageVersion -> Text -> DescribePackageVersion)
-> Lens DescribePackageVersion DescribePackageVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersion' {Text
packageVersion :: Text
$sel:packageVersion:DescribePackageVersion' :: DescribePackageVersion -> Text
packageVersion} -> Text
packageVersion) (\s :: DescribePackageVersion
s@DescribePackageVersion' {} Text
a -> DescribePackageVersion
s {$sel:packageVersion:DescribePackageVersion' :: Text
packageVersion = Text
a} :: DescribePackageVersion)

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

instance Prelude.Hashable DescribePackageVersion

instance Prelude.NFData DescribePackageVersion

instance Core.ToHeaders DescribePackageVersion where
  toHeaders :: DescribePackageVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribePackageVersion -> 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 DescribePackageVersion where
  toPath :: DescribePackageVersion -> ByteString
toPath = ByteString -> DescribePackageVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/package/version"

instance Core.ToQuery DescribePackageVersion where
  toQuery :: DescribePackageVersion -> QueryString
toQuery DescribePackageVersion' {Maybe Text
Text
PackageFormat
packageVersion :: Text
package :: Text
format :: PackageFormat
repository :: Text
domain :: Text
domainOwner :: Maybe Text
namespace :: Maybe Text
$sel:packageVersion:DescribePackageVersion' :: DescribePackageVersion -> Text
$sel:package:DescribePackageVersion' :: DescribePackageVersion -> Text
$sel:format:DescribePackageVersion' :: DescribePackageVersion -> PackageFormat
$sel:repository:DescribePackageVersion' :: DescribePackageVersion -> Text
$sel:domain:DescribePackageVersion' :: DescribePackageVersion -> Text
$sel:domainOwner:DescribePackageVersion' :: DescribePackageVersion -> Maybe Text
$sel:namespace:DescribePackageVersion' :: DescribePackageVersion -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"namespace" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
namespace,
        ByteString
"domain-owner" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
domainOwner,
        ByteString
"domain" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domain,
        ByteString
"repository" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
repository,
        ByteString
"format" ByteString -> PackageFormat -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: PackageFormat
format,
        ByteString
"package" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
package,
        ByteString
"version" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
packageVersion
      ]

-- | /See:/ 'newDescribePackageVersionResponse' smart constructor.
data DescribePackageVersionResponse = DescribePackageVersionResponse'
  { -- | The response's http status code.
    DescribePackageVersionResponse -> Int
httpStatus :: Prelude.Int,
    -- | A
    -- <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionDescription.html PackageVersionDescription>
    -- object that contains information about the requested package version.
    DescribePackageVersionResponse -> PackageVersionDescription
packageVersion :: PackageVersionDescription
  }
  deriving (DescribePackageVersionResponse
-> DescribePackageVersionResponse -> Bool
(DescribePackageVersionResponse
 -> DescribePackageVersionResponse -> Bool)
-> (DescribePackageVersionResponse
    -> DescribePackageVersionResponse -> Bool)
-> Eq DescribePackageVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePackageVersionResponse
-> DescribePackageVersionResponse -> Bool
$c/= :: DescribePackageVersionResponse
-> DescribePackageVersionResponse -> Bool
== :: DescribePackageVersionResponse
-> DescribePackageVersionResponse -> Bool
$c== :: DescribePackageVersionResponse
-> DescribePackageVersionResponse -> Bool
Prelude.Eq, ReadPrec [DescribePackageVersionResponse]
ReadPrec DescribePackageVersionResponse
Int -> ReadS DescribePackageVersionResponse
ReadS [DescribePackageVersionResponse]
(Int -> ReadS DescribePackageVersionResponse)
-> ReadS [DescribePackageVersionResponse]
-> ReadPrec DescribePackageVersionResponse
-> ReadPrec [DescribePackageVersionResponse]
-> Read DescribePackageVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePackageVersionResponse]
$creadListPrec :: ReadPrec [DescribePackageVersionResponse]
readPrec :: ReadPrec DescribePackageVersionResponse
$creadPrec :: ReadPrec DescribePackageVersionResponse
readList :: ReadS [DescribePackageVersionResponse]
$creadList :: ReadS [DescribePackageVersionResponse]
readsPrec :: Int -> ReadS DescribePackageVersionResponse
$creadsPrec :: Int -> ReadS DescribePackageVersionResponse
Prelude.Read, Int -> DescribePackageVersionResponse -> ShowS
[DescribePackageVersionResponse] -> ShowS
DescribePackageVersionResponse -> String
(Int -> DescribePackageVersionResponse -> ShowS)
-> (DescribePackageVersionResponse -> String)
-> ([DescribePackageVersionResponse] -> ShowS)
-> Show DescribePackageVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePackageVersionResponse] -> ShowS
$cshowList :: [DescribePackageVersionResponse] -> ShowS
show :: DescribePackageVersionResponse -> String
$cshow :: DescribePackageVersionResponse -> String
showsPrec :: Int -> DescribePackageVersionResponse -> ShowS
$cshowsPrec :: Int -> DescribePackageVersionResponse -> ShowS
Prelude.Show, (forall x.
 DescribePackageVersionResponse
 -> Rep DescribePackageVersionResponse x)
-> (forall x.
    Rep DescribePackageVersionResponse x
    -> DescribePackageVersionResponse)
-> Generic DescribePackageVersionResponse
forall x.
Rep DescribePackageVersionResponse x
-> DescribePackageVersionResponse
forall x.
DescribePackageVersionResponse
-> Rep DescribePackageVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePackageVersionResponse x
-> DescribePackageVersionResponse
$cfrom :: forall x.
DescribePackageVersionResponse
-> Rep DescribePackageVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribePackageVersionResponse' 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:
--
-- 'httpStatus', 'describePackageVersionResponse_httpStatus' - The response's http status code.
--
-- 'packageVersion', 'describePackageVersionResponse_packageVersion' - A
-- <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionDescription.html PackageVersionDescription>
-- object that contains information about the requested package version.
newDescribePackageVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'packageVersion'
  PackageVersionDescription ->
  DescribePackageVersionResponse
newDescribePackageVersionResponse :: Int -> PackageVersionDescription -> DescribePackageVersionResponse
newDescribePackageVersionResponse
  Int
pHttpStatus_
  PackageVersionDescription
pPackageVersion_ =
    DescribePackageVersionResponse' :: Int -> PackageVersionDescription -> DescribePackageVersionResponse
DescribePackageVersionResponse'
      { $sel:httpStatus:DescribePackageVersionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:packageVersion:DescribePackageVersionResponse' :: PackageVersionDescription
packageVersion = PackageVersionDescription
pPackageVersion_
      }

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

-- | A
-- <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionDescription.html PackageVersionDescription>
-- object that contains information about the requested package version.
describePackageVersionResponse_packageVersion :: Lens.Lens' DescribePackageVersionResponse PackageVersionDescription
describePackageVersionResponse_packageVersion :: (PackageVersionDescription -> f PackageVersionDescription)
-> DescribePackageVersionResponse
-> f DescribePackageVersionResponse
describePackageVersionResponse_packageVersion = (DescribePackageVersionResponse -> PackageVersionDescription)
-> (DescribePackageVersionResponse
    -> PackageVersionDescription -> DescribePackageVersionResponse)
-> Lens
     DescribePackageVersionResponse
     DescribePackageVersionResponse
     PackageVersionDescription
     PackageVersionDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePackageVersionResponse' {PackageVersionDescription
packageVersion :: PackageVersionDescription
$sel:packageVersion:DescribePackageVersionResponse' :: DescribePackageVersionResponse -> PackageVersionDescription
packageVersion} -> PackageVersionDescription
packageVersion) (\s :: DescribePackageVersionResponse
s@DescribePackageVersionResponse' {} PackageVersionDescription
a -> DescribePackageVersionResponse
s {$sel:packageVersion:DescribePackageVersionResponse' :: PackageVersionDescription
packageVersion = PackageVersionDescription
a} :: DescribePackageVersionResponse)

instance
  Prelude.NFData
    DescribePackageVersionResponse