{-# 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.CopyPackageVersions
-- 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)
--
-- Copies package versions from one repository to another repository in the
-- same domain.
--
-- You must specify @versions@ or @versionRevisions@. You cannot specify
-- both.
module Amazonka.CodeArtifact.CopyPackageVersions
  ( -- * Creating a Request
    CopyPackageVersions (..),
    newCopyPackageVersions,

    -- * Request Lenses
    copyPackageVersions_allowOverwrite,
    copyPackageVersions_versionRevisions,
    copyPackageVersions_namespace,
    copyPackageVersions_domainOwner,
    copyPackageVersions_versions,
    copyPackageVersions_includeFromUpstream,
    copyPackageVersions_domain,
    copyPackageVersions_sourceRepository,
    copyPackageVersions_destinationRepository,
    copyPackageVersions_format,
    copyPackageVersions_package,

    -- * Destructuring the Response
    CopyPackageVersionsResponse (..),
    newCopyPackageVersionsResponse,

    -- * Response Lenses
    copyPackageVersionsResponse_failedVersions,
    copyPackageVersionsResponse_successfulVersions,
    copyPackageVersionsResponse_httpStatus,
  )
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:/ 'newCopyPackageVersions' smart constructor.
data CopyPackageVersions = CopyPackageVersions'
  { -- | Set to true to overwrite a package version that already exists in the
    -- destination repository. If set to false and the package version already
    -- exists in the destination repository, the package version is returned in
    -- the @failedVersions@ field of the response with an @ALREADY_EXISTS@
    -- error code.
    CopyPackageVersions -> Maybe Bool
allowOverwrite :: Prelude.Maybe Prelude.Bool,
    -- | A list of key-value pairs. The keys are package versions and the values
    -- are package version revisions. A @CopyPackageVersion@ operation succeeds
    -- if the specified versions in the source repository match the specified
    -- package version revision.
    --
    -- You must specify @versions@ or @versionRevisions@. You cannot specify
    -- both.
    CopyPackageVersions -> Maybe (HashMap Text Text)
versionRevisions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | 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.
    CopyPackageVersions -> 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.
    CopyPackageVersions -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
    -- | The versions of the package to copy.
    --
    -- You must specify @versions@ or @versionRevisions@. You cannot specify
    -- both.
    CopyPackageVersions -> Maybe [Text]
versions :: Prelude.Maybe [Prelude.Text],
    -- | Set to true to copy packages from repositories that are upstream from
    -- the source repository to the destination repository. The default setting
    -- is false. For more information, see
    -- <https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html Working with upstream repositories>.
    CopyPackageVersions -> Maybe Bool
includeFromUpstream :: Prelude.Maybe Prelude.Bool,
    -- | The name of the domain that contains the source and destination
    -- repositories.
    CopyPackageVersions -> Text
domain :: Prelude.Text,
    -- | The name of the repository that contains the package versions to copy.
    CopyPackageVersions -> Text
sourceRepository :: Prelude.Text,
    -- | The name of the repository into which package versions are copied.
    CopyPackageVersions -> Text
destinationRepository :: Prelude.Text,
    -- | The format of the package that is copied. The valid package types are:
    --
    -- -   @npm@: A Node Package Manager (npm) package.
    --
    -- -   @pypi@: A Python Package Index (PyPI) package.
    --
    -- -   @maven@: A Maven package that contains compiled code in a
    --     distributable format, such as a JAR file.
    CopyPackageVersions -> PackageFormat
format :: PackageFormat,
    -- | The name of the package that is copied.
    CopyPackageVersions -> Text
package :: Prelude.Text
  }
  deriving (CopyPackageVersions -> CopyPackageVersions -> Bool
(CopyPackageVersions -> CopyPackageVersions -> Bool)
-> (CopyPackageVersions -> CopyPackageVersions -> Bool)
-> Eq CopyPackageVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyPackageVersions -> CopyPackageVersions -> Bool
$c/= :: CopyPackageVersions -> CopyPackageVersions -> Bool
== :: CopyPackageVersions -> CopyPackageVersions -> Bool
$c== :: CopyPackageVersions -> CopyPackageVersions -> Bool
Prelude.Eq, ReadPrec [CopyPackageVersions]
ReadPrec CopyPackageVersions
Int -> ReadS CopyPackageVersions
ReadS [CopyPackageVersions]
(Int -> ReadS CopyPackageVersions)
-> ReadS [CopyPackageVersions]
-> ReadPrec CopyPackageVersions
-> ReadPrec [CopyPackageVersions]
-> Read CopyPackageVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CopyPackageVersions]
$creadListPrec :: ReadPrec [CopyPackageVersions]
readPrec :: ReadPrec CopyPackageVersions
$creadPrec :: ReadPrec CopyPackageVersions
readList :: ReadS [CopyPackageVersions]
$creadList :: ReadS [CopyPackageVersions]
readsPrec :: Int -> ReadS CopyPackageVersions
$creadsPrec :: Int -> ReadS CopyPackageVersions
Prelude.Read, Int -> CopyPackageVersions -> ShowS
[CopyPackageVersions] -> ShowS
CopyPackageVersions -> String
(Int -> CopyPackageVersions -> ShowS)
-> (CopyPackageVersions -> String)
-> ([CopyPackageVersions] -> ShowS)
-> Show CopyPackageVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyPackageVersions] -> ShowS
$cshowList :: [CopyPackageVersions] -> ShowS
show :: CopyPackageVersions -> String
$cshow :: CopyPackageVersions -> String
showsPrec :: Int -> CopyPackageVersions -> ShowS
$cshowsPrec :: Int -> CopyPackageVersions -> ShowS
Prelude.Show, (forall x. CopyPackageVersions -> Rep CopyPackageVersions x)
-> (forall x. Rep CopyPackageVersions x -> CopyPackageVersions)
-> Generic CopyPackageVersions
forall x. Rep CopyPackageVersions x -> CopyPackageVersions
forall x. CopyPackageVersions -> Rep CopyPackageVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyPackageVersions x -> CopyPackageVersions
$cfrom :: forall x. CopyPackageVersions -> Rep CopyPackageVersions x
Prelude.Generic)

-- |
-- Create a value of 'CopyPackageVersions' 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:
--
-- 'allowOverwrite', 'copyPackageVersions_allowOverwrite' - Set to true to overwrite a package version that already exists in the
-- destination repository. If set to false and the package version already
-- exists in the destination repository, the package version is returned in
-- the @failedVersions@ field of the response with an @ALREADY_EXISTS@
-- error code.
--
-- 'versionRevisions', 'copyPackageVersions_versionRevisions' - A list of key-value pairs. The keys are package versions and the values
-- are package version revisions. A @CopyPackageVersion@ operation succeeds
-- if the specified versions in the source repository match the specified
-- package version revision.
--
-- You must specify @versions@ or @versionRevisions@. You cannot specify
-- both.
--
-- 'namespace', 'copyPackageVersions_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', 'copyPackageVersions_domainOwner' - The 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
--
-- 'versions', 'copyPackageVersions_versions' - The versions of the package to copy.
--
-- You must specify @versions@ or @versionRevisions@. You cannot specify
-- both.
--
-- 'includeFromUpstream', 'copyPackageVersions_includeFromUpstream' - Set to true to copy packages from repositories that are upstream from
-- the source repository to the destination repository. The default setting
-- is false. For more information, see
-- <https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html Working with upstream repositories>.
--
-- 'domain', 'copyPackageVersions_domain' - The name of the domain that contains the source and destination
-- repositories.
--
-- 'sourceRepository', 'copyPackageVersions_sourceRepository' - The name of the repository that contains the package versions to copy.
--
-- 'destinationRepository', 'copyPackageVersions_destinationRepository' - The name of the repository into which package versions are copied.
--
-- 'format', 'copyPackageVersions_format' - The format of the package that is copied. The valid package types are:
--
-- -   @npm@: A Node Package Manager (npm) package.
--
-- -   @pypi@: A Python Package Index (PyPI) package.
--
-- -   @maven@: A Maven package that contains compiled code in a
--     distributable format, such as a JAR file.
--
-- 'package', 'copyPackageVersions_package' - The name of the package that is copied.
newCopyPackageVersions ::
  -- | 'domain'
  Prelude.Text ->
  -- | 'sourceRepository'
  Prelude.Text ->
  -- | 'destinationRepository'
  Prelude.Text ->
  -- | 'format'
  PackageFormat ->
  -- | 'package'
  Prelude.Text ->
  CopyPackageVersions
newCopyPackageVersions :: Text
-> Text -> Text -> PackageFormat -> Text -> CopyPackageVersions
newCopyPackageVersions
  Text
pDomain_
  Text
pSourceRepository_
  Text
pDestinationRepository_
  PackageFormat
pFormat_
  Text
pPackage_ =
    CopyPackageVersions' :: Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Text
-> Text
-> Text
-> PackageFormat
-> Text
-> CopyPackageVersions
CopyPackageVersions'
      { $sel:allowOverwrite:CopyPackageVersions' :: Maybe Bool
allowOverwrite =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:versionRevisions:CopyPackageVersions' :: Maybe (HashMap Text Text)
versionRevisions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:namespace:CopyPackageVersions' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:domainOwner:CopyPackageVersions' :: Maybe Text
domainOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:versions:CopyPackageVersions' :: Maybe [Text]
versions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:includeFromUpstream:CopyPackageVersions' :: Maybe Bool
includeFromUpstream = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:domain:CopyPackageVersions' :: Text
domain = Text
pDomain_,
        $sel:sourceRepository:CopyPackageVersions' :: Text
sourceRepository = Text
pSourceRepository_,
        $sel:destinationRepository:CopyPackageVersions' :: Text
destinationRepository = Text
pDestinationRepository_,
        $sel:format:CopyPackageVersions' :: PackageFormat
format = PackageFormat
pFormat_,
        $sel:package:CopyPackageVersions' :: Text
package = Text
pPackage_
      }

-- | Set to true to overwrite a package version that already exists in the
-- destination repository. If set to false and the package version already
-- exists in the destination repository, the package version is returned in
-- the @failedVersions@ field of the response with an @ALREADY_EXISTS@
-- error code.
copyPackageVersions_allowOverwrite :: Lens.Lens' CopyPackageVersions (Prelude.Maybe Prelude.Bool)
copyPackageVersions_allowOverwrite :: (Maybe Bool -> f (Maybe Bool))
-> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_allowOverwrite = (CopyPackageVersions -> Maybe Bool)
-> (CopyPackageVersions -> Maybe Bool -> CopyPackageVersions)
-> Lens
     CopyPackageVersions CopyPackageVersions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Maybe Bool
allowOverwrite :: Maybe Bool
$sel:allowOverwrite:CopyPackageVersions' :: CopyPackageVersions -> Maybe Bool
allowOverwrite} -> Maybe Bool
allowOverwrite) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Maybe Bool
a -> CopyPackageVersions
s {$sel:allowOverwrite:CopyPackageVersions' :: Maybe Bool
allowOverwrite = Maybe Bool
a} :: CopyPackageVersions)

-- | A list of key-value pairs. The keys are package versions and the values
-- are package version revisions. A @CopyPackageVersion@ operation succeeds
-- if the specified versions in the source repository match the specified
-- package version revision.
--
-- You must specify @versions@ or @versionRevisions@. You cannot specify
-- both.
copyPackageVersions_versionRevisions :: Lens.Lens' CopyPackageVersions (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
copyPackageVersions_versionRevisions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_versionRevisions = (CopyPackageVersions -> Maybe (HashMap Text Text))
-> (CopyPackageVersions
    -> Maybe (HashMap Text Text) -> CopyPackageVersions)
-> Lens
     CopyPackageVersions
     CopyPackageVersions
     (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 (\CopyPackageVersions' {Maybe (HashMap Text Text)
versionRevisions :: Maybe (HashMap Text Text)
$sel:versionRevisions:CopyPackageVersions' :: CopyPackageVersions -> Maybe (HashMap Text Text)
versionRevisions} -> Maybe (HashMap Text Text)
versionRevisions) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Maybe (HashMap Text Text)
a -> CopyPackageVersions
s {$sel:versionRevisions:CopyPackageVersions' :: Maybe (HashMap Text Text)
versionRevisions = Maybe (HashMap Text Text)
a} :: CopyPackageVersions) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CopyPackageVersions -> f CopyPackageVersions)
-> ((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)))
-> CopyPackageVersions
-> f CopyPackageVersions
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 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.
copyPackageVersions_namespace :: Lens.Lens' CopyPackageVersions (Prelude.Maybe Prelude.Text)
copyPackageVersions_namespace :: (Maybe Text -> f (Maybe Text))
-> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_namespace = (CopyPackageVersions -> Maybe Text)
-> (CopyPackageVersions -> Maybe Text -> CopyPackageVersions)
-> Lens
     CopyPackageVersions CopyPackageVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Maybe Text
namespace :: Maybe Text
$sel:namespace:CopyPackageVersions' :: CopyPackageVersions -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Maybe Text
a -> CopyPackageVersions
s {$sel:namespace:CopyPackageVersions' :: Maybe Text
namespace = Maybe Text
a} :: CopyPackageVersions)

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

-- | The versions of the package to copy.
--
-- You must specify @versions@ or @versionRevisions@. You cannot specify
-- both.
copyPackageVersions_versions :: Lens.Lens' CopyPackageVersions (Prelude.Maybe [Prelude.Text])
copyPackageVersions_versions :: (Maybe [Text] -> f (Maybe [Text]))
-> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_versions = (CopyPackageVersions -> Maybe [Text])
-> (CopyPackageVersions -> Maybe [Text] -> CopyPackageVersions)
-> Lens
     CopyPackageVersions
     CopyPackageVersions
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Maybe [Text]
versions :: Maybe [Text]
$sel:versions:CopyPackageVersions' :: CopyPackageVersions -> Maybe [Text]
versions} -> Maybe [Text]
versions) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Maybe [Text]
a -> CopyPackageVersions
s {$sel:versions:CopyPackageVersions' :: Maybe [Text]
versions = Maybe [Text]
a} :: CopyPackageVersions) ((Maybe [Text] -> f (Maybe [Text]))
 -> CopyPackageVersions -> f CopyPackageVersions)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CopyPackageVersions
-> f CopyPackageVersions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Set to true to copy packages from repositories that are upstream from
-- the source repository to the destination repository. The default setting
-- is false. For more information, see
-- <https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html Working with upstream repositories>.
copyPackageVersions_includeFromUpstream :: Lens.Lens' CopyPackageVersions (Prelude.Maybe Prelude.Bool)
copyPackageVersions_includeFromUpstream :: (Maybe Bool -> f (Maybe Bool))
-> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_includeFromUpstream = (CopyPackageVersions -> Maybe Bool)
-> (CopyPackageVersions -> Maybe Bool -> CopyPackageVersions)
-> Lens
     CopyPackageVersions CopyPackageVersions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Maybe Bool
includeFromUpstream :: Maybe Bool
$sel:includeFromUpstream:CopyPackageVersions' :: CopyPackageVersions -> Maybe Bool
includeFromUpstream} -> Maybe Bool
includeFromUpstream) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Maybe Bool
a -> CopyPackageVersions
s {$sel:includeFromUpstream:CopyPackageVersions' :: Maybe Bool
includeFromUpstream = Maybe Bool
a} :: CopyPackageVersions)

-- | The name of the domain that contains the source and destination
-- repositories.
copyPackageVersions_domain :: Lens.Lens' CopyPackageVersions Prelude.Text
copyPackageVersions_domain :: (Text -> f Text) -> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_domain = (CopyPackageVersions -> Text)
-> (CopyPackageVersions -> Text -> CopyPackageVersions)
-> Lens CopyPackageVersions CopyPackageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Text
domain :: Text
$sel:domain:CopyPackageVersions' :: CopyPackageVersions -> Text
domain} -> Text
domain) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Text
a -> CopyPackageVersions
s {$sel:domain:CopyPackageVersions' :: Text
domain = Text
a} :: CopyPackageVersions)

-- | The name of the repository that contains the package versions to copy.
copyPackageVersions_sourceRepository :: Lens.Lens' CopyPackageVersions Prelude.Text
copyPackageVersions_sourceRepository :: (Text -> f Text) -> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_sourceRepository = (CopyPackageVersions -> Text)
-> (CopyPackageVersions -> Text -> CopyPackageVersions)
-> Lens CopyPackageVersions CopyPackageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Text
sourceRepository :: Text
$sel:sourceRepository:CopyPackageVersions' :: CopyPackageVersions -> Text
sourceRepository} -> Text
sourceRepository) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Text
a -> CopyPackageVersions
s {$sel:sourceRepository:CopyPackageVersions' :: Text
sourceRepository = Text
a} :: CopyPackageVersions)

-- | The name of the repository into which package versions are copied.
copyPackageVersions_destinationRepository :: Lens.Lens' CopyPackageVersions Prelude.Text
copyPackageVersions_destinationRepository :: (Text -> f Text) -> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_destinationRepository = (CopyPackageVersions -> Text)
-> (CopyPackageVersions -> Text -> CopyPackageVersions)
-> Lens CopyPackageVersions CopyPackageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Text
destinationRepository :: Text
$sel:destinationRepository:CopyPackageVersions' :: CopyPackageVersions -> Text
destinationRepository} -> Text
destinationRepository) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Text
a -> CopyPackageVersions
s {$sel:destinationRepository:CopyPackageVersions' :: Text
destinationRepository = Text
a} :: CopyPackageVersions)

-- | The format of the package that is copied. The valid package types are:
--
-- -   @npm@: A Node Package Manager (npm) package.
--
-- -   @pypi@: A Python Package Index (PyPI) package.
--
-- -   @maven@: A Maven package that contains compiled code in a
--     distributable format, such as a JAR file.
copyPackageVersions_format :: Lens.Lens' CopyPackageVersions PackageFormat
copyPackageVersions_format :: (PackageFormat -> f PackageFormat)
-> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_format = (CopyPackageVersions -> PackageFormat)
-> (CopyPackageVersions -> PackageFormat -> CopyPackageVersions)
-> Lens
     CopyPackageVersions CopyPackageVersions PackageFormat PackageFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {PackageFormat
format :: PackageFormat
$sel:format:CopyPackageVersions' :: CopyPackageVersions -> PackageFormat
format} -> PackageFormat
format) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} PackageFormat
a -> CopyPackageVersions
s {$sel:format:CopyPackageVersions' :: PackageFormat
format = PackageFormat
a} :: CopyPackageVersions)

-- | The name of the package that is copied.
copyPackageVersions_package :: Lens.Lens' CopyPackageVersions Prelude.Text
copyPackageVersions_package :: (Text -> f Text) -> CopyPackageVersions -> f CopyPackageVersions
copyPackageVersions_package = (CopyPackageVersions -> Text)
-> (CopyPackageVersions -> Text -> CopyPackageVersions)
-> Lens CopyPackageVersions CopyPackageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersions' {Text
package :: Text
$sel:package:CopyPackageVersions' :: CopyPackageVersions -> Text
package} -> Text
package) (\s :: CopyPackageVersions
s@CopyPackageVersions' {} Text
a -> CopyPackageVersions
s {$sel:package:CopyPackageVersions' :: Text
package = Text
a} :: CopyPackageVersions)

instance Core.AWSRequest CopyPackageVersions where
  type
    AWSResponse CopyPackageVersions =
      CopyPackageVersionsResponse
  request :: CopyPackageVersions -> Request CopyPackageVersions
request = Service -> CopyPackageVersions -> Request CopyPackageVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CopyPackageVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CopyPackageVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CopyPackageVersions))
-> Logger
-> Service
-> Proxy CopyPackageVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CopyPackageVersions)))
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 (HashMap Text PackageVersionError)
-> Maybe (HashMap Text SuccessfulPackageVersionInfo)
-> Int
-> CopyPackageVersionsResponse
CopyPackageVersionsResponse'
            (Maybe (HashMap Text PackageVersionError)
 -> Maybe (HashMap Text SuccessfulPackageVersionInfo)
 -> Int
 -> CopyPackageVersionsResponse)
-> Either String (Maybe (HashMap Text PackageVersionError))
-> Either
     String
     (Maybe (HashMap Text SuccessfulPackageVersionInfo)
      -> Int -> CopyPackageVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text PackageVersionError)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failedVersions" Either String (Maybe (Maybe (HashMap Text PackageVersionError)))
-> Maybe (HashMap Text PackageVersionError)
-> Either String (Maybe (HashMap Text PackageVersionError))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text PackageVersionError)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe (HashMap Text SuccessfulPackageVersionInfo)
   -> Int -> CopyPackageVersionsResponse)
-> Either
     String (Maybe (HashMap Text SuccessfulPackageVersionInfo))
-> Either String (Int -> CopyPackageVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either
     String (Maybe (Maybe (HashMap Text SuccessfulPackageVersionInfo)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"successfulVersions"
                            Either
  String (Maybe (Maybe (HashMap Text SuccessfulPackageVersionInfo)))
-> Maybe (HashMap Text SuccessfulPackageVersionInfo)
-> Either
     String (Maybe (HashMap Text SuccessfulPackageVersionInfo))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text SuccessfulPackageVersionInfo)
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> CopyPackageVersionsResponse)
-> Either String Int -> Either String CopyPackageVersionsResponse
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 CopyPackageVersions

instance Prelude.NFData CopyPackageVersions

instance Core.ToHeaders CopyPackageVersions where
  toHeaders :: CopyPackageVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CopyPackageVersions -> 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.ToJSON CopyPackageVersions where
  toJSON :: CopyPackageVersions -> Value
toJSON CopyPackageVersions' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Text
PackageFormat
package :: Text
format :: PackageFormat
destinationRepository :: Text
sourceRepository :: Text
domain :: Text
includeFromUpstream :: Maybe Bool
versions :: Maybe [Text]
domainOwner :: Maybe Text
namespace :: Maybe Text
versionRevisions :: Maybe (HashMap Text Text)
allowOverwrite :: Maybe Bool
$sel:package:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:format:CopyPackageVersions' :: CopyPackageVersions -> PackageFormat
$sel:destinationRepository:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:sourceRepository:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:domain:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:includeFromUpstream:CopyPackageVersions' :: CopyPackageVersions -> Maybe Bool
$sel:versions:CopyPackageVersions' :: CopyPackageVersions -> Maybe [Text]
$sel:domainOwner:CopyPackageVersions' :: CopyPackageVersions -> Maybe Text
$sel:namespace:CopyPackageVersions' :: CopyPackageVersions -> Maybe Text
$sel:versionRevisions:CopyPackageVersions' :: CopyPackageVersions -> Maybe (HashMap Text Text)
$sel:allowOverwrite:CopyPackageVersions' :: CopyPackageVersions -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"allowOverwrite" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowOverwrite,
            (Text
"versionRevisions" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
versionRevisions,
            (Text
"versions" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
versions,
            (Text
"includeFromUpstream" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeFromUpstream
          ]
      )

instance Core.ToPath CopyPackageVersions where
  toPath :: CopyPackageVersions -> ByteString
toPath = ByteString -> CopyPackageVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/package/versions/copy"

instance Core.ToQuery CopyPackageVersions where
  toQuery :: CopyPackageVersions -> QueryString
toQuery CopyPackageVersions' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Text
PackageFormat
package :: Text
format :: PackageFormat
destinationRepository :: Text
sourceRepository :: Text
domain :: Text
includeFromUpstream :: Maybe Bool
versions :: Maybe [Text]
domainOwner :: Maybe Text
namespace :: Maybe Text
versionRevisions :: Maybe (HashMap Text Text)
allowOverwrite :: Maybe Bool
$sel:package:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:format:CopyPackageVersions' :: CopyPackageVersions -> PackageFormat
$sel:destinationRepository:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:sourceRepository:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:domain:CopyPackageVersions' :: CopyPackageVersions -> Text
$sel:includeFromUpstream:CopyPackageVersions' :: CopyPackageVersions -> Maybe Bool
$sel:versions:CopyPackageVersions' :: CopyPackageVersions -> Maybe [Text]
$sel:domainOwner:CopyPackageVersions' :: CopyPackageVersions -> Maybe Text
$sel:namespace:CopyPackageVersions' :: CopyPackageVersions -> Maybe Text
$sel:versionRevisions:CopyPackageVersions' :: CopyPackageVersions -> Maybe (HashMap Text Text)
$sel:allowOverwrite:CopyPackageVersions' :: CopyPackageVersions -> Maybe Bool
..} =
    [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
"source-repository" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sourceRepository,
        ByteString
"destination-repository"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
destinationRepository,
        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
      ]

-- | /See:/ 'newCopyPackageVersionsResponse' smart constructor.
data CopyPackageVersionsResponse = CopyPackageVersionsResponse'
  { -- | A map of package versions that failed to copy and their error codes. The
    -- possible error codes are in the @PackageVersionError@ data type. They
    -- are:
    --
    -- -   @ALREADY_EXISTS@
    --
    -- -   @MISMATCHED_REVISION@
    --
    -- -   @MISMATCHED_STATUS@
    --
    -- -   @NOT_ALLOWED@
    --
    -- -   @NOT_FOUND@
    --
    -- -   @SKIPPED@
    CopyPackageVersionsResponse
-> Maybe (HashMap Text PackageVersionError)
failedVersions :: Prelude.Maybe (Prelude.HashMap Prelude.Text PackageVersionError),
    -- | A list of the package versions that were successfully copied to your
    -- repository.
    CopyPackageVersionsResponse
-> Maybe (HashMap Text SuccessfulPackageVersionInfo)
successfulVersions :: Prelude.Maybe (Prelude.HashMap Prelude.Text SuccessfulPackageVersionInfo),
    -- | The response's http status code.
    CopyPackageVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CopyPackageVersionsResponse -> CopyPackageVersionsResponse -> Bool
(CopyPackageVersionsResponse
 -> CopyPackageVersionsResponse -> Bool)
-> (CopyPackageVersionsResponse
    -> CopyPackageVersionsResponse -> Bool)
-> Eq CopyPackageVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyPackageVersionsResponse -> CopyPackageVersionsResponse -> Bool
$c/= :: CopyPackageVersionsResponse -> CopyPackageVersionsResponse -> Bool
== :: CopyPackageVersionsResponse -> CopyPackageVersionsResponse -> Bool
$c== :: CopyPackageVersionsResponse -> CopyPackageVersionsResponse -> Bool
Prelude.Eq, ReadPrec [CopyPackageVersionsResponse]
ReadPrec CopyPackageVersionsResponse
Int -> ReadS CopyPackageVersionsResponse
ReadS [CopyPackageVersionsResponse]
(Int -> ReadS CopyPackageVersionsResponse)
-> ReadS [CopyPackageVersionsResponse]
-> ReadPrec CopyPackageVersionsResponse
-> ReadPrec [CopyPackageVersionsResponse]
-> Read CopyPackageVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CopyPackageVersionsResponse]
$creadListPrec :: ReadPrec [CopyPackageVersionsResponse]
readPrec :: ReadPrec CopyPackageVersionsResponse
$creadPrec :: ReadPrec CopyPackageVersionsResponse
readList :: ReadS [CopyPackageVersionsResponse]
$creadList :: ReadS [CopyPackageVersionsResponse]
readsPrec :: Int -> ReadS CopyPackageVersionsResponse
$creadsPrec :: Int -> ReadS CopyPackageVersionsResponse
Prelude.Read, Int -> CopyPackageVersionsResponse -> ShowS
[CopyPackageVersionsResponse] -> ShowS
CopyPackageVersionsResponse -> String
(Int -> CopyPackageVersionsResponse -> ShowS)
-> (CopyPackageVersionsResponse -> String)
-> ([CopyPackageVersionsResponse] -> ShowS)
-> Show CopyPackageVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyPackageVersionsResponse] -> ShowS
$cshowList :: [CopyPackageVersionsResponse] -> ShowS
show :: CopyPackageVersionsResponse -> String
$cshow :: CopyPackageVersionsResponse -> String
showsPrec :: Int -> CopyPackageVersionsResponse -> ShowS
$cshowsPrec :: Int -> CopyPackageVersionsResponse -> ShowS
Prelude.Show, (forall x.
 CopyPackageVersionsResponse -> Rep CopyPackageVersionsResponse x)
-> (forall x.
    Rep CopyPackageVersionsResponse x -> CopyPackageVersionsResponse)
-> Generic CopyPackageVersionsResponse
forall x.
Rep CopyPackageVersionsResponse x -> CopyPackageVersionsResponse
forall x.
CopyPackageVersionsResponse -> Rep CopyPackageVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CopyPackageVersionsResponse x -> CopyPackageVersionsResponse
$cfrom :: forall x.
CopyPackageVersionsResponse -> Rep CopyPackageVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'CopyPackageVersionsResponse' 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:
--
-- 'failedVersions', 'copyPackageVersionsResponse_failedVersions' - A map of package versions that failed to copy and their error codes. The
-- possible error codes are in the @PackageVersionError@ data type. They
-- are:
--
-- -   @ALREADY_EXISTS@
--
-- -   @MISMATCHED_REVISION@
--
-- -   @MISMATCHED_STATUS@
--
-- -   @NOT_ALLOWED@
--
-- -   @NOT_FOUND@
--
-- -   @SKIPPED@
--
-- 'successfulVersions', 'copyPackageVersionsResponse_successfulVersions' - A list of the package versions that were successfully copied to your
-- repository.
--
-- 'httpStatus', 'copyPackageVersionsResponse_httpStatus' - The response's http status code.
newCopyPackageVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CopyPackageVersionsResponse
newCopyPackageVersionsResponse :: Int -> CopyPackageVersionsResponse
newCopyPackageVersionsResponse Int
pHttpStatus_ =
  CopyPackageVersionsResponse' :: Maybe (HashMap Text PackageVersionError)
-> Maybe (HashMap Text SuccessfulPackageVersionInfo)
-> Int
-> CopyPackageVersionsResponse
CopyPackageVersionsResponse'
    { $sel:failedVersions:CopyPackageVersionsResponse' :: Maybe (HashMap Text PackageVersionError)
failedVersions =
        Maybe (HashMap Text PackageVersionError)
forall a. Maybe a
Prelude.Nothing,
      $sel:successfulVersions:CopyPackageVersionsResponse' :: Maybe (HashMap Text SuccessfulPackageVersionInfo)
successfulVersions = Maybe (HashMap Text SuccessfulPackageVersionInfo)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CopyPackageVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A map of package versions that failed to copy and their error codes. The
-- possible error codes are in the @PackageVersionError@ data type. They
-- are:
--
-- -   @ALREADY_EXISTS@
--
-- -   @MISMATCHED_REVISION@
--
-- -   @MISMATCHED_STATUS@
--
-- -   @NOT_ALLOWED@
--
-- -   @NOT_FOUND@
--
-- -   @SKIPPED@
copyPackageVersionsResponse_failedVersions :: Lens.Lens' CopyPackageVersionsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text PackageVersionError))
copyPackageVersionsResponse_failedVersions :: (Maybe (HashMap Text PackageVersionError)
 -> f (Maybe (HashMap Text PackageVersionError)))
-> CopyPackageVersionsResponse -> f CopyPackageVersionsResponse
copyPackageVersionsResponse_failedVersions = (CopyPackageVersionsResponse
 -> Maybe (HashMap Text PackageVersionError))
-> (CopyPackageVersionsResponse
    -> Maybe (HashMap Text PackageVersionError)
    -> CopyPackageVersionsResponse)
-> Lens
     CopyPackageVersionsResponse
     CopyPackageVersionsResponse
     (Maybe (HashMap Text PackageVersionError))
     (Maybe (HashMap Text PackageVersionError))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersionsResponse' {Maybe (HashMap Text PackageVersionError)
failedVersions :: Maybe (HashMap Text PackageVersionError)
$sel:failedVersions:CopyPackageVersionsResponse' :: CopyPackageVersionsResponse
-> Maybe (HashMap Text PackageVersionError)
failedVersions} -> Maybe (HashMap Text PackageVersionError)
failedVersions) (\s :: CopyPackageVersionsResponse
s@CopyPackageVersionsResponse' {} Maybe (HashMap Text PackageVersionError)
a -> CopyPackageVersionsResponse
s {$sel:failedVersions:CopyPackageVersionsResponse' :: Maybe (HashMap Text PackageVersionError)
failedVersions = Maybe (HashMap Text PackageVersionError)
a} :: CopyPackageVersionsResponse) ((Maybe (HashMap Text PackageVersionError)
  -> f (Maybe (HashMap Text PackageVersionError)))
 -> CopyPackageVersionsResponse -> f CopyPackageVersionsResponse)
-> ((Maybe (HashMap Text PackageVersionError)
     -> f (Maybe (HashMap Text PackageVersionError)))
    -> Maybe (HashMap Text PackageVersionError)
    -> f (Maybe (HashMap Text PackageVersionError)))
-> (Maybe (HashMap Text PackageVersionError)
    -> f (Maybe (HashMap Text PackageVersionError)))
-> CopyPackageVersionsResponse
-> f CopyPackageVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text PackageVersionError)
  (HashMap Text PackageVersionError)
  (HashMap Text PackageVersionError)
  (HashMap Text PackageVersionError)
-> Iso
     (Maybe (HashMap Text PackageVersionError))
     (Maybe (HashMap Text PackageVersionError))
     (Maybe (HashMap Text PackageVersionError))
     (Maybe (HashMap Text PackageVersionError))
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 PackageVersionError)
  (HashMap Text PackageVersionError)
  (HashMap Text PackageVersionError)
  (HashMap Text PackageVersionError)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of the package versions that were successfully copied to your
-- repository.
copyPackageVersionsResponse_successfulVersions :: Lens.Lens' CopyPackageVersionsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text SuccessfulPackageVersionInfo))
copyPackageVersionsResponse_successfulVersions :: (Maybe (HashMap Text SuccessfulPackageVersionInfo)
 -> f (Maybe (HashMap Text SuccessfulPackageVersionInfo)))
-> CopyPackageVersionsResponse -> f CopyPackageVersionsResponse
copyPackageVersionsResponse_successfulVersions = (CopyPackageVersionsResponse
 -> Maybe (HashMap Text SuccessfulPackageVersionInfo))
-> (CopyPackageVersionsResponse
    -> Maybe (HashMap Text SuccessfulPackageVersionInfo)
    -> CopyPackageVersionsResponse)
-> Lens
     CopyPackageVersionsResponse
     CopyPackageVersionsResponse
     (Maybe (HashMap Text SuccessfulPackageVersionInfo))
     (Maybe (HashMap Text SuccessfulPackageVersionInfo))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyPackageVersionsResponse' {Maybe (HashMap Text SuccessfulPackageVersionInfo)
successfulVersions :: Maybe (HashMap Text SuccessfulPackageVersionInfo)
$sel:successfulVersions:CopyPackageVersionsResponse' :: CopyPackageVersionsResponse
-> Maybe (HashMap Text SuccessfulPackageVersionInfo)
successfulVersions} -> Maybe (HashMap Text SuccessfulPackageVersionInfo)
successfulVersions) (\s :: CopyPackageVersionsResponse
s@CopyPackageVersionsResponse' {} Maybe (HashMap Text SuccessfulPackageVersionInfo)
a -> CopyPackageVersionsResponse
s {$sel:successfulVersions:CopyPackageVersionsResponse' :: Maybe (HashMap Text SuccessfulPackageVersionInfo)
successfulVersions = Maybe (HashMap Text SuccessfulPackageVersionInfo)
a} :: CopyPackageVersionsResponse) ((Maybe (HashMap Text SuccessfulPackageVersionInfo)
  -> f (Maybe (HashMap Text SuccessfulPackageVersionInfo)))
 -> CopyPackageVersionsResponse -> f CopyPackageVersionsResponse)
-> ((Maybe (HashMap Text SuccessfulPackageVersionInfo)
     -> f (Maybe (HashMap Text SuccessfulPackageVersionInfo)))
    -> Maybe (HashMap Text SuccessfulPackageVersionInfo)
    -> f (Maybe (HashMap Text SuccessfulPackageVersionInfo)))
-> (Maybe (HashMap Text SuccessfulPackageVersionInfo)
    -> f (Maybe (HashMap Text SuccessfulPackageVersionInfo)))
-> CopyPackageVersionsResponse
-> f CopyPackageVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text SuccessfulPackageVersionInfo)
  (HashMap Text SuccessfulPackageVersionInfo)
  (HashMap Text SuccessfulPackageVersionInfo)
  (HashMap Text SuccessfulPackageVersionInfo)
-> Iso
     (Maybe (HashMap Text SuccessfulPackageVersionInfo))
     (Maybe (HashMap Text SuccessfulPackageVersionInfo))
     (Maybe (HashMap Text SuccessfulPackageVersionInfo))
     (Maybe (HashMap Text SuccessfulPackageVersionInfo))
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 SuccessfulPackageVersionInfo)
  (HashMap Text SuccessfulPackageVersionInfo)
  (HashMap Text SuccessfulPackageVersionInfo)
  (HashMap Text SuccessfulPackageVersionInfo)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CopyPackageVersionsResponse