{-# 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.ListPackageVersions
(
ListPackageVersions (..),
newListPackageVersions,
listPackageVersions_status,
listPackageVersions_namespace,
listPackageVersions_domainOwner,
listPackageVersions_nextToken,
listPackageVersions_maxResults,
listPackageVersions_sortBy,
listPackageVersions_domain,
listPackageVersions_repository,
listPackageVersions_format,
listPackageVersions_package,
ListPackageVersionsResponse (..),
newListPackageVersionsResponse,
listPackageVersionsResponse_format,
listPackageVersionsResponse_namespace,
listPackageVersionsResponse_versions,
listPackageVersionsResponse_nextToken,
listPackageVersionsResponse_package,
listPackageVersionsResponse_defaultDisplayVersion,
listPackageVersionsResponse_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 ListPackageVersions = ListPackageVersions'
{
ListPackageVersions -> Maybe PackageVersionStatus
status :: Prelude.Maybe PackageVersionStatus,
ListPackageVersions -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
ListPackageVersions -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
ListPackageVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPackageVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListPackageVersions -> Maybe PackageVersionSortType
sortBy :: Prelude.Maybe PackageVersionSortType,
ListPackageVersions -> Text
domain :: Prelude.Text,
ListPackageVersions -> Text
repository :: Prelude.Text,
ListPackageVersions -> PackageFormat
format :: PackageFormat,
ListPackageVersions -> Text
package :: Prelude.Text
}
deriving (ListPackageVersions -> ListPackageVersions -> Bool
(ListPackageVersions -> ListPackageVersions -> Bool)
-> (ListPackageVersions -> ListPackageVersions -> Bool)
-> Eq ListPackageVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackageVersions -> ListPackageVersions -> Bool
$c/= :: ListPackageVersions -> ListPackageVersions -> Bool
== :: ListPackageVersions -> ListPackageVersions -> Bool
$c== :: ListPackageVersions -> ListPackageVersions -> Bool
Prelude.Eq, ReadPrec [ListPackageVersions]
ReadPrec ListPackageVersions
Int -> ReadS ListPackageVersions
ReadS [ListPackageVersions]
(Int -> ReadS ListPackageVersions)
-> ReadS [ListPackageVersions]
-> ReadPrec ListPackageVersions
-> ReadPrec [ListPackageVersions]
-> Read ListPackageVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackageVersions]
$creadListPrec :: ReadPrec [ListPackageVersions]
readPrec :: ReadPrec ListPackageVersions
$creadPrec :: ReadPrec ListPackageVersions
readList :: ReadS [ListPackageVersions]
$creadList :: ReadS [ListPackageVersions]
readsPrec :: Int -> ReadS ListPackageVersions
$creadsPrec :: Int -> ReadS ListPackageVersions
Prelude.Read, Int -> ListPackageVersions -> ShowS
[ListPackageVersions] -> ShowS
ListPackageVersions -> String
(Int -> ListPackageVersions -> ShowS)
-> (ListPackageVersions -> String)
-> ([ListPackageVersions] -> ShowS)
-> Show ListPackageVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackageVersions] -> ShowS
$cshowList :: [ListPackageVersions] -> ShowS
show :: ListPackageVersions -> String
$cshow :: ListPackageVersions -> String
showsPrec :: Int -> ListPackageVersions -> ShowS
$cshowsPrec :: Int -> ListPackageVersions -> ShowS
Prelude.Show, (forall x. ListPackageVersions -> Rep ListPackageVersions x)
-> (forall x. Rep ListPackageVersions x -> ListPackageVersions)
-> Generic ListPackageVersions
forall x. Rep ListPackageVersions x -> ListPackageVersions
forall x. ListPackageVersions -> Rep ListPackageVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPackageVersions x -> ListPackageVersions
$cfrom :: forall x. ListPackageVersions -> Rep ListPackageVersions x
Prelude.Generic)
newListPackageVersions ::
Prelude.Text ->
Prelude.Text ->
PackageFormat ->
Prelude.Text ->
ListPackageVersions
newListPackageVersions :: Text -> Text -> PackageFormat -> Text -> ListPackageVersions
newListPackageVersions
Text
pDomain_
Text
pRepository_
PackageFormat
pFormat_
Text
pPackage_ =
ListPackageVersions' :: Maybe PackageVersionStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe PackageVersionSortType
-> Text
-> Text
-> PackageFormat
-> Text
-> ListPackageVersions
ListPackageVersions'
{ $sel:status:ListPackageVersions' :: Maybe PackageVersionStatus
status = Maybe PackageVersionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:namespace:ListPackageVersions' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainOwner:ListPackageVersions' :: Maybe Text
domainOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPackageVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListPackageVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:ListPackageVersions' :: Maybe PackageVersionSortType
sortBy = Maybe PackageVersionSortType
forall a. Maybe a
Prelude.Nothing,
$sel:domain:ListPackageVersions' :: Text
domain = Text
pDomain_,
$sel:repository:ListPackageVersions' :: Text
repository = Text
pRepository_,
$sel:format:ListPackageVersions' :: PackageFormat
format = PackageFormat
pFormat_,
$sel:package:ListPackageVersions' :: Text
package = Text
pPackage_
}
listPackageVersions_status :: Lens.Lens' ListPackageVersions (Prelude.Maybe PackageVersionStatus)
listPackageVersions_status :: (Maybe PackageVersionStatus -> f (Maybe PackageVersionStatus))
-> ListPackageVersions -> f ListPackageVersions
listPackageVersions_status = (ListPackageVersions -> Maybe PackageVersionStatus)
-> (ListPackageVersions
-> Maybe PackageVersionStatus -> ListPackageVersions)
-> Lens
ListPackageVersions
ListPackageVersions
(Maybe PackageVersionStatus)
(Maybe PackageVersionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Maybe PackageVersionStatus
status :: Maybe PackageVersionStatus
$sel:status:ListPackageVersions' :: ListPackageVersions -> Maybe PackageVersionStatus
status} -> Maybe PackageVersionStatus
status) (\s :: ListPackageVersions
s@ListPackageVersions' {} Maybe PackageVersionStatus
a -> ListPackageVersions
s {$sel:status:ListPackageVersions' :: Maybe PackageVersionStatus
status = Maybe PackageVersionStatus
a} :: ListPackageVersions)
listPackageVersions_namespace :: Lens.Lens' ListPackageVersions (Prelude.Maybe Prelude.Text)
listPackageVersions_namespace :: (Maybe Text -> f (Maybe Text))
-> ListPackageVersions -> f ListPackageVersions
listPackageVersions_namespace = (ListPackageVersions -> Maybe Text)
-> (ListPackageVersions -> Maybe Text -> ListPackageVersions)
-> Lens
ListPackageVersions ListPackageVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Maybe Text
namespace :: Maybe Text
$sel:namespace:ListPackageVersions' :: ListPackageVersions -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: ListPackageVersions
s@ListPackageVersions' {} Maybe Text
a -> ListPackageVersions
s {$sel:namespace:ListPackageVersions' :: Maybe Text
namespace = Maybe Text
a} :: ListPackageVersions)
listPackageVersions_domainOwner :: Lens.Lens' ListPackageVersions (Prelude.Maybe Prelude.Text)
listPackageVersions_domainOwner :: (Maybe Text -> f (Maybe Text))
-> ListPackageVersions -> f ListPackageVersions
listPackageVersions_domainOwner = (ListPackageVersions -> Maybe Text)
-> (ListPackageVersions -> Maybe Text -> ListPackageVersions)
-> Lens
ListPackageVersions ListPackageVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Maybe Text
domainOwner :: Maybe Text
$sel:domainOwner:ListPackageVersions' :: ListPackageVersions -> Maybe Text
domainOwner} -> Maybe Text
domainOwner) (\s :: ListPackageVersions
s@ListPackageVersions' {} Maybe Text
a -> ListPackageVersions
s {$sel:domainOwner:ListPackageVersions' :: Maybe Text
domainOwner = Maybe Text
a} :: ListPackageVersions)
listPackageVersions_nextToken :: Lens.Lens' ListPackageVersions (Prelude.Maybe Prelude.Text)
listPackageVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPackageVersions -> f ListPackageVersions
listPackageVersions_nextToken = (ListPackageVersions -> Maybe Text)
-> (ListPackageVersions -> Maybe Text -> ListPackageVersions)
-> Lens
ListPackageVersions ListPackageVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackageVersions' :: ListPackageVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackageVersions
s@ListPackageVersions' {} Maybe Text
a -> ListPackageVersions
s {$sel:nextToken:ListPackageVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackageVersions)
listPackageVersions_maxResults :: Lens.Lens' ListPackageVersions (Prelude.Maybe Prelude.Natural)
listPackageVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPackageVersions -> f ListPackageVersions
listPackageVersions_maxResults = (ListPackageVersions -> Maybe Natural)
-> (ListPackageVersions -> Maybe Natural -> ListPackageVersions)
-> Lens
ListPackageVersions
ListPackageVersions
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPackageVersions' :: ListPackageVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPackageVersions
s@ListPackageVersions' {} Maybe Natural
a -> ListPackageVersions
s {$sel:maxResults:ListPackageVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPackageVersions)
listPackageVersions_sortBy :: Lens.Lens' ListPackageVersions (Prelude.Maybe PackageVersionSortType)
listPackageVersions_sortBy :: (Maybe PackageVersionSortType -> f (Maybe PackageVersionSortType))
-> ListPackageVersions -> f ListPackageVersions
listPackageVersions_sortBy = (ListPackageVersions -> Maybe PackageVersionSortType)
-> (ListPackageVersions
-> Maybe PackageVersionSortType -> ListPackageVersions)
-> Lens
ListPackageVersions
ListPackageVersions
(Maybe PackageVersionSortType)
(Maybe PackageVersionSortType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Maybe PackageVersionSortType
sortBy :: Maybe PackageVersionSortType
$sel:sortBy:ListPackageVersions' :: ListPackageVersions -> Maybe PackageVersionSortType
sortBy} -> Maybe PackageVersionSortType
sortBy) (\s :: ListPackageVersions
s@ListPackageVersions' {} Maybe PackageVersionSortType
a -> ListPackageVersions
s {$sel:sortBy:ListPackageVersions' :: Maybe PackageVersionSortType
sortBy = Maybe PackageVersionSortType
a} :: ListPackageVersions)
listPackageVersions_domain :: Lens.Lens' ListPackageVersions Prelude.Text
listPackageVersions_domain :: (Text -> f Text) -> ListPackageVersions -> f ListPackageVersions
listPackageVersions_domain = (ListPackageVersions -> Text)
-> (ListPackageVersions -> Text -> ListPackageVersions)
-> Lens ListPackageVersions ListPackageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Text
domain :: Text
$sel:domain:ListPackageVersions' :: ListPackageVersions -> Text
domain} -> Text
domain) (\s :: ListPackageVersions
s@ListPackageVersions' {} Text
a -> ListPackageVersions
s {$sel:domain:ListPackageVersions' :: Text
domain = Text
a} :: ListPackageVersions)
listPackageVersions_repository :: Lens.Lens' ListPackageVersions Prelude.Text
listPackageVersions_repository :: (Text -> f Text) -> ListPackageVersions -> f ListPackageVersions
listPackageVersions_repository = (ListPackageVersions -> Text)
-> (ListPackageVersions -> Text -> ListPackageVersions)
-> Lens ListPackageVersions ListPackageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Text
repository :: Text
$sel:repository:ListPackageVersions' :: ListPackageVersions -> Text
repository} -> Text
repository) (\s :: ListPackageVersions
s@ListPackageVersions' {} Text
a -> ListPackageVersions
s {$sel:repository:ListPackageVersions' :: Text
repository = Text
a} :: ListPackageVersions)
listPackageVersions_format :: Lens.Lens' ListPackageVersions PackageFormat
listPackageVersions_format :: (PackageFormat -> f PackageFormat)
-> ListPackageVersions -> f ListPackageVersions
listPackageVersions_format = (ListPackageVersions -> PackageFormat)
-> (ListPackageVersions -> PackageFormat -> ListPackageVersions)
-> Lens
ListPackageVersions ListPackageVersions PackageFormat PackageFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {PackageFormat
format :: PackageFormat
$sel:format:ListPackageVersions' :: ListPackageVersions -> PackageFormat
format} -> PackageFormat
format) (\s :: ListPackageVersions
s@ListPackageVersions' {} PackageFormat
a -> ListPackageVersions
s {$sel:format:ListPackageVersions' :: PackageFormat
format = PackageFormat
a} :: ListPackageVersions)
listPackageVersions_package :: Lens.Lens' ListPackageVersions Prelude.Text
listPackageVersions_package :: (Text -> f Text) -> ListPackageVersions -> f ListPackageVersions
listPackageVersions_package = (ListPackageVersions -> Text)
-> (ListPackageVersions -> Text -> ListPackageVersions)
-> Lens ListPackageVersions ListPackageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersions' {Text
package :: Text
$sel:package:ListPackageVersions' :: ListPackageVersions -> Text
package} -> Text
package) (\s :: ListPackageVersions
s@ListPackageVersions' {} Text
a -> ListPackageVersions
s {$sel:package:ListPackageVersions' :: Text
package = Text
a} :: ListPackageVersions)
instance Core.AWSPager ListPackageVersions where
page :: ListPackageVersions
-> AWSResponse ListPackageVersions -> Maybe ListPackageVersions
page ListPackageVersions
rq AWSResponse ListPackageVersions
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPackageVersions
ListPackageVersionsResponse
rs
ListPackageVersionsResponse
-> Getting (First Text) ListPackageVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPackageVersionsResponse
-> Const (First Text) ListPackageVersionsResponse
Lens' ListPackageVersionsResponse (Maybe Text)
listPackageVersionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListPackageVersionsResponse
-> Const (First Text) ListPackageVersionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPackageVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListPackageVersions
forall a. Maybe a
Prelude.Nothing
| Maybe [PackageVersionSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPackageVersions
ListPackageVersionsResponse
rs
ListPackageVersionsResponse
-> Getting
(First [PackageVersionSummary])
ListPackageVersionsResponse
[PackageVersionSummary]
-> Maybe [PackageVersionSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PackageVersionSummary]
-> Const
(First [PackageVersionSummary]) (Maybe [PackageVersionSummary]))
-> ListPackageVersionsResponse
-> Const
(First [PackageVersionSummary]) ListPackageVersionsResponse
Lens' ListPackageVersionsResponse (Maybe [PackageVersionSummary])
listPackageVersionsResponse_versions
((Maybe [PackageVersionSummary]
-> Const
(First [PackageVersionSummary]) (Maybe [PackageVersionSummary]))
-> ListPackageVersionsResponse
-> Const
(First [PackageVersionSummary]) ListPackageVersionsResponse)
-> (([PackageVersionSummary]
-> Const (First [PackageVersionSummary]) [PackageVersionSummary])
-> Maybe [PackageVersionSummary]
-> Const
(First [PackageVersionSummary]) (Maybe [PackageVersionSummary]))
-> Getting
(First [PackageVersionSummary])
ListPackageVersionsResponse
[PackageVersionSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PackageVersionSummary]
-> Const (First [PackageVersionSummary]) [PackageVersionSummary])
-> Maybe [PackageVersionSummary]
-> Const
(First [PackageVersionSummary]) (Maybe [PackageVersionSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListPackageVersions
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListPackageVersions -> Maybe ListPackageVersions
forall a. a -> Maybe a
Prelude.Just (ListPackageVersions -> Maybe ListPackageVersions)
-> ListPackageVersions -> Maybe ListPackageVersions
forall a b. (a -> b) -> a -> b
Prelude.$
ListPackageVersions
rq
ListPackageVersions
-> (ListPackageVersions -> ListPackageVersions)
-> ListPackageVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPackageVersions -> Identity ListPackageVersions
Lens
ListPackageVersions ListPackageVersions (Maybe Text) (Maybe Text)
listPackageVersions_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListPackageVersions -> Identity ListPackageVersions)
-> Maybe Text -> ListPackageVersions -> ListPackageVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPackageVersions
ListPackageVersionsResponse
rs
ListPackageVersionsResponse
-> Getting (First Text) ListPackageVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPackageVersionsResponse
-> Const (First Text) ListPackageVersionsResponse
Lens' ListPackageVersionsResponse (Maybe Text)
listPackageVersionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListPackageVersionsResponse
-> Const (First Text) ListPackageVersionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPackageVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListPackageVersions where
type
AWSResponse ListPackageVersions =
ListPackageVersionsResponse
request :: ListPackageVersions -> Request ListPackageVersions
request = Service -> ListPackageVersions -> Request ListPackageVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListPackageVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPackageVersions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListPackageVersions))
-> Logger
-> Service
-> Proxy ListPackageVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPackageVersions)))
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 PackageFormat
-> Maybe Text
-> Maybe [PackageVersionSummary]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListPackageVersionsResponse
ListPackageVersionsResponse'
(Maybe PackageFormat
-> Maybe Text
-> Maybe [PackageVersionSummary]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListPackageVersionsResponse)
-> Either String (Maybe PackageFormat)
-> Either
String
(Maybe Text
-> Maybe [PackageVersionSummary]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListPackageVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe PackageFormat)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"format")
Either
String
(Maybe Text
-> Maybe [PackageVersionSummary]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListPackageVersionsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [PackageVersionSummary]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListPackageVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"namespace")
Either
String
(Maybe [PackageVersionSummary]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListPackageVersionsResponse)
-> Either String (Maybe [PackageVersionSummary])
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> ListPackageVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [PackageVersionSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"versions" Either String (Maybe (Maybe [PackageVersionSummary]))
-> Maybe [PackageVersionSummary]
-> Either String (Maybe [PackageVersionSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PackageVersionSummary]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> ListPackageVersionsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> ListPackageVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
Either
String
(Maybe Text -> Maybe Text -> Int -> ListPackageVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> ListPackageVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"package")
Either String (Maybe Text -> Int -> ListPackageVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListPackageVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"defaultDisplayVersion")
Either String (Int -> ListPackageVersionsResponse)
-> Either String Int -> Either String ListPackageVersionsResponse
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 ListPackageVersions
instance Prelude.NFData ListPackageVersions
instance Core.ToHeaders ListPackageVersions where
toHeaders :: ListPackageVersions -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListPackageVersions -> 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 ListPackageVersions where
toJSON :: ListPackageVersions -> Value
toJSON = Value -> ListPackageVersions -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath ListPackageVersions where
toPath :: ListPackageVersions -> ByteString
toPath = ByteString -> ListPackageVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/package/versions"
instance Core.ToQuery ListPackageVersions where
toQuery :: ListPackageVersions -> QueryString
toQuery ListPackageVersions' {Maybe Natural
Maybe Text
Maybe PackageVersionSortType
Maybe PackageVersionStatus
Text
PackageFormat
package :: Text
format :: PackageFormat
repository :: Text
domain :: Text
sortBy :: Maybe PackageVersionSortType
maxResults :: Maybe Natural
nextToken :: Maybe Text
domainOwner :: Maybe Text
namespace :: Maybe Text
status :: Maybe PackageVersionStatus
$sel:package:ListPackageVersions' :: ListPackageVersions -> Text
$sel:format:ListPackageVersions' :: ListPackageVersions -> PackageFormat
$sel:repository:ListPackageVersions' :: ListPackageVersions -> Text
$sel:domain:ListPackageVersions' :: ListPackageVersions -> Text
$sel:sortBy:ListPackageVersions' :: ListPackageVersions -> Maybe PackageVersionSortType
$sel:maxResults:ListPackageVersions' :: ListPackageVersions -> Maybe Natural
$sel:nextToken:ListPackageVersions' :: ListPackageVersions -> Maybe Text
$sel:domainOwner:ListPackageVersions' :: ListPackageVersions -> Maybe Text
$sel:namespace:ListPackageVersions' :: ListPackageVersions -> Maybe Text
$sel:status:ListPackageVersions' :: ListPackageVersions -> Maybe PackageVersionStatus
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"status" ByteString -> Maybe PackageVersionStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PackageVersionStatus
status,
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
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
ByteString
"sortBy" ByteString -> Maybe PackageVersionSortType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PackageVersionSortType
sortBy,
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
]
data ListPackageVersionsResponse = ListPackageVersionsResponse'
{
ListPackageVersionsResponse -> Maybe PackageFormat
format :: Prelude.Maybe PackageFormat,
ListPackageVersionsResponse -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
ListPackageVersionsResponse -> Maybe [PackageVersionSummary]
versions :: Prelude.Maybe [PackageVersionSummary],
ListPackageVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPackageVersionsResponse -> Maybe Text
package :: Prelude.Maybe Prelude.Text,
ListPackageVersionsResponse -> Maybe Text
defaultDisplayVersion :: Prelude.Maybe Prelude.Text,
ListPackageVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPackageVersionsResponse -> ListPackageVersionsResponse -> Bool
(ListPackageVersionsResponse
-> ListPackageVersionsResponse -> Bool)
-> (ListPackageVersionsResponse
-> ListPackageVersionsResponse -> Bool)
-> Eq ListPackageVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackageVersionsResponse -> ListPackageVersionsResponse -> Bool
$c/= :: ListPackageVersionsResponse -> ListPackageVersionsResponse -> Bool
== :: ListPackageVersionsResponse -> ListPackageVersionsResponse -> Bool
$c== :: ListPackageVersionsResponse -> ListPackageVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListPackageVersionsResponse]
ReadPrec ListPackageVersionsResponse
Int -> ReadS ListPackageVersionsResponse
ReadS [ListPackageVersionsResponse]
(Int -> ReadS ListPackageVersionsResponse)
-> ReadS [ListPackageVersionsResponse]
-> ReadPrec ListPackageVersionsResponse
-> ReadPrec [ListPackageVersionsResponse]
-> Read ListPackageVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackageVersionsResponse]
$creadListPrec :: ReadPrec [ListPackageVersionsResponse]
readPrec :: ReadPrec ListPackageVersionsResponse
$creadPrec :: ReadPrec ListPackageVersionsResponse
readList :: ReadS [ListPackageVersionsResponse]
$creadList :: ReadS [ListPackageVersionsResponse]
readsPrec :: Int -> ReadS ListPackageVersionsResponse
$creadsPrec :: Int -> ReadS ListPackageVersionsResponse
Prelude.Read, Int -> ListPackageVersionsResponse -> ShowS
[ListPackageVersionsResponse] -> ShowS
ListPackageVersionsResponse -> String
(Int -> ListPackageVersionsResponse -> ShowS)
-> (ListPackageVersionsResponse -> String)
-> ([ListPackageVersionsResponse] -> ShowS)
-> Show ListPackageVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackageVersionsResponse] -> ShowS
$cshowList :: [ListPackageVersionsResponse] -> ShowS
show :: ListPackageVersionsResponse -> String
$cshow :: ListPackageVersionsResponse -> String
showsPrec :: Int -> ListPackageVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListPackageVersionsResponse -> ShowS
Prelude.Show, (forall x.
ListPackageVersionsResponse -> Rep ListPackageVersionsResponse x)
-> (forall x.
Rep ListPackageVersionsResponse x -> ListPackageVersionsResponse)
-> Generic ListPackageVersionsResponse
forall x.
Rep ListPackageVersionsResponse x -> ListPackageVersionsResponse
forall x.
ListPackageVersionsResponse -> Rep ListPackageVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPackageVersionsResponse x -> ListPackageVersionsResponse
$cfrom :: forall x.
ListPackageVersionsResponse -> Rep ListPackageVersionsResponse x
Prelude.Generic)
newListPackageVersionsResponse ::
Prelude.Int ->
ListPackageVersionsResponse
newListPackageVersionsResponse :: Int -> ListPackageVersionsResponse
newListPackageVersionsResponse Int
pHttpStatus_ =
ListPackageVersionsResponse' :: Maybe PackageFormat
-> Maybe Text
-> Maybe [PackageVersionSummary]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListPackageVersionsResponse
ListPackageVersionsResponse'
{ $sel:format:ListPackageVersionsResponse' :: Maybe PackageFormat
format =
Maybe PackageFormat
forall a. Maybe a
Prelude.Nothing,
$sel:namespace:ListPackageVersionsResponse' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:versions:ListPackageVersionsResponse' :: Maybe [PackageVersionSummary]
versions = Maybe [PackageVersionSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPackageVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:package:ListPackageVersionsResponse' :: Maybe Text
package = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultDisplayVersion:ListPackageVersionsResponse' :: Maybe Text
defaultDisplayVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPackageVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPackageVersionsResponse_format :: Lens.Lens' ListPackageVersionsResponse (Prelude.Maybe PackageFormat)
listPackageVersionsResponse_format :: (Maybe PackageFormat -> f (Maybe PackageFormat))
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse
listPackageVersionsResponse_format = (ListPackageVersionsResponse -> Maybe PackageFormat)
-> (ListPackageVersionsResponse
-> Maybe PackageFormat -> ListPackageVersionsResponse)
-> Lens
ListPackageVersionsResponse
ListPackageVersionsResponse
(Maybe PackageFormat)
(Maybe PackageFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersionsResponse' {Maybe PackageFormat
format :: Maybe PackageFormat
$sel:format:ListPackageVersionsResponse' :: ListPackageVersionsResponse -> Maybe PackageFormat
format} -> Maybe PackageFormat
format) (\s :: ListPackageVersionsResponse
s@ListPackageVersionsResponse' {} Maybe PackageFormat
a -> ListPackageVersionsResponse
s {$sel:format:ListPackageVersionsResponse' :: Maybe PackageFormat
format = Maybe PackageFormat
a} :: ListPackageVersionsResponse)
listPackageVersionsResponse_namespace :: Lens.Lens' ListPackageVersionsResponse (Prelude.Maybe Prelude.Text)
listPackageVersionsResponse_namespace :: (Maybe Text -> f (Maybe Text))
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse
listPackageVersionsResponse_namespace = (ListPackageVersionsResponse -> Maybe Text)
-> (ListPackageVersionsResponse
-> Maybe Text -> ListPackageVersionsResponse)
-> Lens' ListPackageVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersionsResponse' {Maybe Text
namespace :: Maybe Text
$sel:namespace:ListPackageVersionsResponse' :: ListPackageVersionsResponse -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: ListPackageVersionsResponse
s@ListPackageVersionsResponse' {} Maybe Text
a -> ListPackageVersionsResponse
s {$sel:namespace:ListPackageVersionsResponse' :: Maybe Text
namespace = Maybe Text
a} :: ListPackageVersionsResponse)
listPackageVersionsResponse_versions :: Lens.Lens' ListPackageVersionsResponse (Prelude.Maybe [PackageVersionSummary])
listPackageVersionsResponse_versions :: (Maybe [PackageVersionSummary]
-> f (Maybe [PackageVersionSummary]))
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse
listPackageVersionsResponse_versions = (ListPackageVersionsResponse -> Maybe [PackageVersionSummary])
-> (ListPackageVersionsResponse
-> Maybe [PackageVersionSummary] -> ListPackageVersionsResponse)
-> Lens'
ListPackageVersionsResponse (Maybe [PackageVersionSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersionsResponse' {Maybe [PackageVersionSummary]
versions :: Maybe [PackageVersionSummary]
$sel:versions:ListPackageVersionsResponse' :: ListPackageVersionsResponse -> Maybe [PackageVersionSummary]
versions} -> Maybe [PackageVersionSummary]
versions) (\s :: ListPackageVersionsResponse
s@ListPackageVersionsResponse' {} Maybe [PackageVersionSummary]
a -> ListPackageVersionsResponse
s {$sel:versions:ListPackageVersionsResponse' :: Maybe [PackageVersionSummary]
versions = Maybe [PackageVersionSummary]
a} :: ListPackageVersionsResponse) ((Maybe [PackageVersionSummary]
-> f (Maybe [PackageVersionSummary]))
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse)
-> ((Maybe [PackageVersionSummary]
-> f (Maybe [PackageVersionSummary]))
-> Maybe [PackageVersionSummary]
-> f (Maybe [PackageVersionSummary]))
-> (Maybe [PackageVersionSummary]
-> f (Maybe [PackageVersionSummary]))
-> ListPackageVersionsResponse
-> f ListPackageVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PackageVersionSummary]
[PackageVersionSummary]
[PackageVersionSummary]
[PackageVersionSummary]
-> Iso
(Maybe [PackageVersionSummary])
(Maybe [PackageVersionSummary])
(Maybe [PackageVersionSummary])
(Maybe [PackageVersionSummary])
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
[PackageVersionSummary]
[PackageVersionSummary]
[PackageVersionSummary]
[PackageVersionSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listPackageVersionsResponse_nextToken :: Lens.Lens' ListPackageVersionsResponse (Prelude.Maybe Prelude.Text)
listPackageVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse
listPackageVersionsResponse_nextToken = (ListPackageVersionsResponse -> Maybe Text)
-> (ListPackageVersionsResponse
-> Maybe Text -> ListPackageVersionsResponse)
-> Lens' ListPackageVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackageVersionsResponse' :: ListPackageVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackageVersionsResponse
s@ListPackageVersionsResponse' {} Maybe Text
a -> ListPackageVersionsResponse
s {$sel:nextToken:ListPackageVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackageVersionsResponse)
listPackageVersionsResponse_package :: Lens.Lens' ListPackageVersionsResponse (Prelude.Maybe Prelude.Text)
listPackageVersionsResponse_package :: (Maybe Text -> f (Maybe Text))
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse
listPackageVersionsResponse_package = (ListPackageVersionsResponse -> Maybe Text)
-> (ListPackageVersionsResponse
-> Maybe Text -> ListPackageVersionsResponse)
-> Lens' ListPackageVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersionsResponse' {Maybe Text
package :: Maybe Text
$sel:package:ListPackageVersionsResponse' :: ListPackageVersionsResponse -> Maybe Text
package} -> Maybe Text
package) (\s :: ListPackageVersionsResponse
s@ListPackageVersionsResponse' {} Maybe Text
a -> ListPackageVersionsResponse
s {$sel:package:ListPackageVersionsResponse' :: Maybe Text
package = Maybe Text
a} :: ListPackageVersionsResponse)
listPackageVersionsResponse_defaultDisplayVersion :: Lens.Lens' ListPackageVersionsResponse (Prelude.Maybe Prelude.Text)
listPackageVersionsResponse_defaultDisplayVersion :: (Maybe Text -> f (Maybe Text))
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse
listPackageVersionsResponse_defaultDisplayVersion = (ListPackageVersionsResponse -> Maybe Text)
-> (ListPackageVersionsResponse
-> Maybe Text -> ListPackageVersionsResponse)
-> Lens' ListPackageVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersionsResponse' {Maybe Text
defaultDisplayVersion :: Maybe Text
$sel:defaultDisplayVersion:ListPackageVersionsResponse' :: ListPackageVersionsResponse -> Maybe Text
defaultDisplayVersion} -> Maybe Text
defaultDisplayVersion) (\s :: ListPackageVersionsResponse
s@ListPackageVersionsResponse' {} Maybe Text
a -> ListPackageVersionsResponse
s {$sel:defaultDisplayVersion:ListPackageVersionsResponse' :: Maybe Text
defaultDisplayVersion = Maybe Text
a} :: ListPackageVersionsResponse)
listPackageVersionsResponse_httpStatus :: Lens.Lens' ListPackageVersionsResponse Prelude.Int
listPackageVersionsResponse_httpStatus :: (Int -> f Int)
-> ListPackageVersionsResponse -> f ListPackageVersionsResponse
listPackageVersionsResponse_httpStatus = (ListPackageVersionsResponse -> Int)
-> (ListPackageVersionsResponse
-> Int -> ListPackageVersionsResponse)
-> Lens
ListPackageVersionsResponse ListPackageVersionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackageVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListPackageVersionsResponse' :: ListPackageVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListPackageVersionsResponse
s@ListPackageVersionsResponse' {} Int
a -> ListPackageVersionsResponse
s {$sel:httpStatus:ListPackageVersionsResponse' :: Int
httpStatus = Int
a} :: ListPackageVersionsResponse)
instance Prelude.NFData ListPackageVersionsResponse