{-# 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 #-}
module Amazonka.CodeArtifact.CopyPackageVersions
(
CopyPackageVersions (..),
newCopyPackageVersions,
copyPackageVersions_allowOverwrite,
copyPackageVersions_versionRevisions,
copyPackageVersions_namespace,
copyPackageVersions_domainOwner,
copyPackageVersions_versions,
copyPackageVersions_includeFromUpstream,
copyPackageVersions_domain,
copyPackageVersions_sourceRepository,
copyPackageVersions_destinationRepository,
copyPackageVersions_format,
copyPackageVersions_package,
CopyPackageVersionsResponse (..),
newCopyPackageVersionsResponse,
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
data CopyPackageVersions = CopyPackageVersions'
{
CopyPackageVersions -> Maybe Bool
allowOverwrite :: Prelude.Maybe Prelude.Bool,
CopyPackageVersions -> Maybe (HashMap Text Text)
versionRevisions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CopyPackageVersions -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
CopyPackageVersions -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
CopyPackageVersions -> Maybe [Text]
versions :: Prelude.Maybe [Prelude.Text],
CopyPackageVersions -> Maybe Bool
includeFromUpstream :: Prelude.Maybe Prelude.Bool,
CopyPackageVersions -> Text
domain :: Prelude.Text,
CopyPackageVersions -> Text
sourceRepository :: Prelude.Text,
CopyPackageVersions -> Text
destinationRepository :: Prelude.Text,
CopyPackageVersions -> PackageFormat
format :: PackageFormat,
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)
newCopyPackageVersions ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PackageFormat ->
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_
}
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)
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
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)
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)
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
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)
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)
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)
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)
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)
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
]
data CopyPackageVersionsResponse = CopyPackageVersionsResponse'
{
CopyPackageVersionsResponse
-> Maybe (HashMap Text PackageVersionError)
failedVersions :: Prelude.Maybe (Prelude.HashMap Prelude.Text PackageVersionError),
CopyPackageVersionsResponse
-> Maybe (HashMap Text SuccessfulPackageVersionInfo)
successfulVersions :: Prelude.Maybe (Prelude.HashMap Prelude.Text SuccessfulPackageVersionInfo),
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)
newCopyPackageVersionsResponse ::
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_
}
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
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
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