{-# 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.Amplify.ListArtifacts
(
ListArtifacts (..),
newListArtifacts,
listArtifacts_maxResults,
listArtifacts_nextToken,
listArtifacts_appId,
listArtifacts_branchName,
listArtifacts_jobId,
ListArtifactsResponse (..),
newListArtifactsResponse,
listArtifactsResponse_nextToken,
listArtifactsResponse_httpStatus,
listArtifactsResponse_artifacts,
)
where
import Amazonka.Amplify.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListArtifacts = ListArtifacts'
{
ListArtifacts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListArtifacts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListArtifacts -> Text
appId :: Prelude.Text,
ListArtifacts -> Text
branchName :: Prelude.Text,
ListArtifacts -> Text
jobId :: Prelude.Text
}
deriving (ListArtifacts -> ListArtifacts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListArtifacts -> ListArtifacts -> Bool
$c/= :: ListArtifacts -> ListArtifacts -> Bool
== :: ListArtifacts -> ListArtifacts -> Bool
$c== :: ListArtifacts -> ListArtifacts -> Bool
Prelude.Eq, ReadPrec [ListArtifacts]
ReadPrec ListArtifacts
Int -> ReadS ListArtifacts
ReadS [ListArtifacts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListArtifacts]
$creadListPrec :: ReadPrec [ListArtifacts]
readPrec :: ReadPrec ListArtifacts
$creadPrec :: ReadPrec ListArtifacts
readList :: ReadS [ListArtifacts]
$creadList :: ReadS [ListArtifacts]
readsPrec :: Int -> ReadS ListArtifacts
$creadsPrec :: Int -> ReadS ListArtifacts
Prelude.Read, Int -> ListArtifacts -> ShowS
[ListArtifacts] -> ShowS
ListArtifacts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListArtifacts] -> ShowS
$cshowList :: [ListArtifacts] -> ShowS
show :: ListArtifacts -> String
$cshow :: ListArtifacts -> String
showsPrec :: Int -> ListArtifacts -> ShowS
$cshowsPrec :: Int -> ListArtifacts -> ShowS
Prelude.Show, forall x. Rep ListArtifacts x -> ListArtifacts
forall x. ListArtifacts -> Rep ListArtifacts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListArtifacts x -> ListArtifacts
$cfrom :: forall x. ListArtifacts -> Rep ListArtifacts x
Prelude.Generic)
newListArtifacts ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ListArtifacts
newListArtifacts :: Text -> Text -> Text -> ListArtifacts
newListArtifacts Text
pAppId_ Text
pBranchName_ Text
pJobId_ =
ListArtifacts'
{ $sel:maxResults:ListArtifacts' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListArtifacts' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:appId:ListArtifacts' :: Text
appId = Text
pAppId_,
$sel:branchName:ListArtifacts' :: Text
branchName = Text
pBranchName_,
$sel:jobId:ListArtifacts' :: Text
jobId = Text
pJobId_
}
listArtifacts_maxResults :: Lens.Lens' ListArtifacts (Prelude.Maybe Prelude.Natural)
listArtifacts_maxResults :: Lens' ListArtifacts (Maybe Natural)
listArtifacts_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifacts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListArtifacts' :: ListArtifacts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListArtifacts
s@ListArtifacts' {} Maybe Natural
a -> ListArtifacts
s {$sel:maxResults:ListArtifacts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListArtifacts)
listArtifacts_nextToken :: Lens.Lens' ListArtifacts (Prelude.Maybe Prelude.Text)
listArtifacts_nextToken :: Lens' ListArtifacts (Maybe Text)
listArtifacts_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifacts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListArtifacts' :: ListArtifacts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListArtifacts
s@ListArtifacts' {} Maybe Text
a -> ListArtifacts
s {$sel:nextToken:ListArtifacts' :: Maybe Text
nextToken = Maybe Text
a} :: ListArtifacts)
listArtifacts_appId :: Lens.Lens' ListArtifacts Prelude.Text
listArtifacts_appId :: Lens' ListArtifacts Text
listArtifacts_appId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifacts' {Text
appId :: Text
$sel:appId:ListArtifacts' :: ListArtifacts -> Text
appId} -> Text
appId) (\s :: ListArtifacts
s@ListArtifacts' {} Text
a -> ListArtifacts
s {$sel:appId:ListArtifacts' :: Text
appId = Text
a} :: ListArtifacts)
listArtifacts_branchName :: Lens.Lens' ListArtifacts Prelude.Text
listArtifacts_branchName :: Lens' ListArtifacts Text
listArtifacts_branchName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifacts' {Text
branchName :: Text
$sel:branchName:ListArtifacts' :: ListArtifacts -> Text
branchName} -> Text
branchName) (\s :: ListArtifacts
s@ListArtifacts' {} Text
a -> ListArtifacts
s {$sel:branchName:ListArtifacts' :: Text
branchName = Text
a} :: ListArtifacts)
listArtifacts_jobId :: Lens.Lens' ListArtifacts Prelude.Text
listArtifacts_jobId :: Lens' ListArtifacts Text
listArtifacts_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifacts' {Text
jobId :: Text
$sel:jobId:ListArtifacts' :: ListArtifacts -> Text
jobId} -> Text
jobId) (\s :: ListArtifacts
s@ListArtifacts' {} Text
a -> ListArtifacts
s {$sel:jobId:ListArtifacts' :: Text
jobId = Text
a} :: ListArtifacts)
instance Core.AWSRequest ListArtifacts where
type
AWSResponse ListArtifacts =
ListArtifactsResponse
request :: (Service -> Service) -> ListArtifacts -> Request ListArtifacts
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListArtifacts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListArtifacts)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> [Artifact] -> ListArtifactsResponse
ListArtifactsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"artifacts" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListArtifacts where
hashWithSalt :: Int -> ListArtifacts -> Int
hashWithSalt Int
_salt ListArtifacts' {Maybe Natural
Maybe Text
Text
jobId :: Text
branchName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:ListArtifacts' :: ListArtifacts -> Text
$sel:branchName:ListArtifacts' :: ListArtifacts -> Text
$sel:appId:ListArtifacts' :: ListArtifacts -> Text
$sel:nextToken:ListArtifacts' :: ListArtifacts -> Maybe Text
$sel:maxResults:ListArtifacts' :: ListArtifacts -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
branchName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
instance Prelude.NFData ListArtifacts where
rnf :: ListArtifacts -> ()
rnf ListArtifacts' {Maybe Natural
Maybe Text
Text
jobId :: Text
branchName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:ListArtifacts' :: ListArtifacts -> Text
$sel:branchName:ListArtifacts' :: ListArtifacts -> Text
$sel:appId:ListArtifacts' :: ListArtifacts -> Text
$sel:nextToken:ListArtifacts' :: ListArtifacts -> Maybe Text
$sel:maxResults:ListArtifacts' :: ListArtifacts -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
branchName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
instance Data.ToHeaders ListArtifacts where
toHeaders :: ListArtifacts -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListArtifacts where
toPath :: ListArtifacts -> ByteString
toPath ListArtifacts' {Maybe Natural
Maybe Text
Text
jobId :: Text
branchName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:ListArtifacts' :: ListArtifacts -> Text
$sel:branchName:ListArtifacts' :: ListArtifacts -> Text
$sel:appId:ListArtifacts' :: ListArtifacts -> Text
$sel:nextToken:ListArtifacts' :: ListArtifacts -> Maybe Text
$sel:maxResults:ListArtifacts' :: ListArtifacts -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/apps/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
appId,
ByteString
"/branches/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
branchName,
ByteString
"/jobs/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
jobId,
ByteString
"/artifacts"
]
instance Data.ToQuery ListArtifacts where
toQuery :: ListArtifacts -> QueryString
toQuery ListArtifacts' {Maybe Natural
Maybe Text
Text
jobId :: Text
branchName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:ListArtifacts' :: ListArtifacts -> Text
$sel:branchName:ListArtifacts' :: ListArtifacts -> Text
$sel:appId:ListArtifacts' :: ListArtifacts -> Text
$sel:nextToken:ListArtifacts' :: ListArtifacts -> Maybe Text
$sel:maxResults:ListArtifacts' :: ListArtifacts -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListArtifactsResponse = ListArtifactsResponse'
{
ListArtifactsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListArtifactsResponse -> Int
httpStatus :: Prelude.Int,
ListArtifactsResponse -> [Artifact]
artifacts :: [Artifact]
}
deriving (ListArtifactsResponse -> ListArtifactsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListArtifactsResponse -> ListArtifactsResponse -> Bool
$c/= :: ListArtifactsResponse -> ListArtifactsResponse -> Bool
== :: ListArtifactsResponse -> ListArtifactsResponse -> Bool
$c== :: ListArtifactsResponse -> ListArtifactsResponse -> Bool
Prelude.Eq, ReadPrec [ListArtifactsResponse]
ReadPrec ListArtifactsResponse
Int -> ReadS ListArtifactsResponse
ReadS [ListArtifactsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListArtifactsResponse]
$creadListPrec :: ReadPrec [ListArtifactsResponse]
readPrec :: ReadPrec ListArtifactsResponse
$creadPrec :: ReadPrec ListArtifactsResponse
readList :: ReadS [ListArtifactsResponse]
$creadList :: ReadS [ListArtifactsResponse]
readsPrec :: Int -> ReadS ListArtifactsResponse
$creadsPrec :: Int -> ReadS ListArtifactsResponse
Prelude.Read, Int -> ListArtifactsResponse -> ShowS
[ListArtifactsResponse] -> ShowS
ListArtifactsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListArtifactsResponse] -> ShowS
$cshowList :: [ListArtifactsResponse] -> ShowS
show :: ListArtifactsResponse -> String
$cshow :: ListArtifactsResponse -> String
showsPrec :: Int -> ListArtifactsResponse -> ShowS
$cshowsPrec :: Int -> ListArtifactsResponse -> ShowS
Prelude.Show, forall x. Rep ListArtifactsResponse x -> ListArtifactsResponse
forall x. ListArtifactsResponse -> Rep ListArtifactsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListArtifactsResponse x -> ListArtifactsResponse
$cfrom :: forall x. ListArtifactsResponse -> Rep ListArtifactsResponse x
Prelude.Generic)
newListArtifactsResponse ::
Prelude.Int ->
ListArtifactsResponse
newListArtifactsResponse :: Int -> ListArtifactsResponse
newListArtifactsResponse Int
pHttpStatus_ =
ListArtifactsResponse'
{ $sel:nextToken:ListArtifactsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListArtifactsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:artifacts:ListArtifactsResponse' :: [Artifact]
artifacts = forall a. Monoid a => a
Prelude.mempty
}
listArtifactsResponse_nextToken :: Lens.Lens' ListArtifactsResponse (Prelude.Maybe Prelude.Text)
listArtifactsResponse_nextToken :: Lens' ListArtifactsResponse (Maybe Text)
listArtifactsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifactsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListArtifactsResponse' :: ListArtifactsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListArtifactsResponse
s@ListArtifactsResponse' {} Maybe Text
a -> ListArtifactsResponse
s {$sel:nextToken:ListArtifactsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListArtifactsResponse)
listArtifactsResponse_httpStatus :: Lens.Lens' ListArtifactsResponse Prelude.Int
listArtifactsResponse_httpStatus :: Lens' ListArtifactsResponse Int
listArtifactsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifactsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListArtifactsResponse' :: ListArtifactsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListArtifactsResponse
s@ListArtifactsResponse' {} Int
a -> ListArtifactsResponse
s {$sel:httpStatus:ListArtifactsResponse' :: Int
httpStatus = Int
a} :: ListArtifactsResponse)
listArtifactsResponse_artifacts :: Lens.Lens' ListArtifactsResponse [Artifact]
listArtifactsResponse_artifacts :: Lens' ListArtifactsResponse [Artifact]
listArtifactsResponse_artifacts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArtifactsResponse' {[Artifact]
artifacts :: [Artifact]
$sel:artifacts:ListArtifactsResponse' :: ListArtifactsResponse -> [Artifact]
artifacts} -> [Artifact]
artifacts) (\s :: ListArtifactsResponse
s@ListArtifactsResponse' {} [Artifact]
a -> ListArtifactsResponse
s {$sel:artifacts:ListArtifactsResponse' :: [Artifact]
artifacts = [Artifact]
a} :: ListArtifactsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListArtifactsResponse where
rnf :: ListArtifactsResponse -> ()
rnf ListArtifactsResponse' {Int
[Artifact]
Maybe Text
artifacts :: [Artifact]
httpStatus :: Int
nextToken :: Maybe Text
$sel:artifacts:ListArtifactsResponse' :: ListArtifactsResponse -> [Artifact]
$sel:httpStatus:ListArtifactsResponse' :: ListArtifactsResponse -> Int
$sel:nextToken:ListArtifactsResponse' :: ListArtifactsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Artifact]
artifacts