{-# 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.AppConfig.ListDeployments
(
ListDeployments (..),
newListDeployments,
listDeployments_nextToken,
listDeployments_maxResults,
listDeployments_applicationId,
listDeployments_environmentId,
ListDeploymentsResponse (..),
newListDeploymentsResponse,
listDeploymentsResponse_items,
listDeploymentsResponse_nextToken,
listDeploymentsResponse_httpStatus,
)
where
import Amazonka.AppConfig.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 ListDeployments = ListDeployments'
{
ListDeployments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeployments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListDeployments -> Text
applicationId :: Prelude.Text,
ListDeployments -> Text
environmentId :: Prelude.Text
}
deriving (ListDeployments -> ListDeployments -> Bool
(ListDeployments -> ListDeployments -> Bool)
-> (ListDeployments -> ListDeployments -> Bool)
-> Eq ListDeployments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeployments -> ListDeployments -> Bool
$c/= :: ListDeployments -> ListDeployments -> Bool
== :: ListDeployments -> ListDeployments -> Bool
$c== :: ListDeployments -> ListDeployments -> Bool
Prelude.Eq, ReadPrec [ListDeployments]
ReadPrec ListDeployments
Int -> ReadS ListDeployments
ReadS [ListDeployments]
(Int -> ReadS ListDeployments)
-> ReadS [ListDeployments]
-> ReadPrec ListDeployments
-> ReadPrec [ListDeployments]
-> Read ListDeployments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeployments]
$creadListPrec :: ReadPrec [ListDeployments]
readPrec :: ReadPrec ListDeployments
$creadPrec :: ReadPrec ListDeployments
readList :: ReadS [ListDeployments]
$creadList :: ReadS [ListDeployments]
readsPrec :: Int -> ReadS ListDeployments
$creadsPrec :: Int -> ReadS ListDeployments
Prelude.Read, Int -> ListDeployments -> ShowS
[ListDeployments] -> ShowS
ListDeployments -> String
(Int -> ListDeployments -> ShowS)
-> (ListDeployments -> String)
-> ([ListDeployments] -> ShowS)
-> Show ListDeployments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeployments] -> ShowS
$cshowList :: [ListDeployments] -> ShowS
show :: ListDeployments -> String
$cshow :: ListDeployments -> String
showsPrec :: Int -> ListDeployments -> ShowS
$cshowsPrec :: Int -> ListDeployments -> ShowS
Prelude.Show, (forall x. ListDeployments -> Rep ListDeployments x)
-> (forall x. Rep ListDeployments x -> ListDeployments)
-> Generic ListDeployments
forall x. Rep ListDeployments x -> ListDeployments
forall x. ListDeployments -> Rep ListDeployments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDeployments x -> ListDeployments
$cfrom :: forall x. ListDeployments -> Rep ListDeployments x
Prelude.Generic)
newListDeployments ::
Prelude.Text ->
Prelude.Text ->
ListDeployments
newListDeployments :: Text -> Text -> ListDeployments
newListDeployments Text
pApplicationId_ Text
pEnvironmentId_ =
ListDeployments' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListDeployments
ListDeployments'
{ $sel:nextToken:ListDeployments' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListDeployments' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:applicationId:ListDeployments' :: Text
applicationId = Text
pApplicationId_,
$sel:environmentId:ListDeployments' :: Text
environmentId = Text
pEnvironmentId_
}
listDeployments_nextToken :: Lens.Lens' ListDeployments (Prelude.Maybe Prelude.Text)
listDeployments_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeployments -> f ListDeployments
listDeployments_nextToken = (ListDeployments -> Maybe Text)
-> (ListDeployments -> Maybe Text -> ListDeployments)
-> Lens ListDeployments ListDeployments (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeployments' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeployments' :: ListDeployments -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeployments
s@ListDeployments' {} Maybe Text
a -> ListDeployments
s {$sel:nextToken:ListDeployments' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeployments)
listDeployments_maxResults :: Lens.Lens' ListDeployments (Prelude.Maybe Prelude.Natural)
listDeployments_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDeployments -> f ListDeployments
listDeployments_maxResults = (ListDeployments -> Maybe Natural)
-> (ListDeployments -> Maybe Natural -> ListDeployments)
-> Lens
ListDeployments ListDeployments (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeployments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDeployments' :: ListDeployments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDeployments
s@ListDeployments' {} Maybe Natural
a -> ListDeployments
s {$sel:maxResults:ListDeployments' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDeployments)
listDeployments_applicationId :: Lens.Lens' ListDeployments Prelude.Text
listDeployments_applicationId :: (Text -> f Text) -> ListDeployments -> f ListDeployments
listDeployments_applicationId = (ListDeployments -> Text)
-> (ListDeployments -> Text -> ListDeployments)
-> Lens ListDeployments ListDeployments Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeployments' {Text
applicationId :: Text
$sel:applicationId:ListDeployments' :: ListDeployments -> Text
applicationId} -> Text
applicationId) (\s :: ListDeployments
s@ListDeployments' {} Text
a -> ListDeployments
s {$sel:applicationId:ListDeployments' :: Text
applicationId = Text
a} :: ListDeployments)
listDeployments_environmentId :: Lens.Lens' ListDeployments Prelude.Text
listDeployments_environmentId :: (Text -> f Text) -> ListDeployments -> f ListDeployments
listDeployments_environmentId = (ListDeployments -> Text)
-> (ListDeployments -> Text -> ListDeployments)
-> Lens ListDeployments ListDeployments Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeployments' {Text
environmentId :: Text
$sel:environmentId:ListDeployments' :: ListDeployments -> Text
environmentId} -> Text
environmentId) (\s :: ListDeployments
s@ListDeployments' {} Text
a -> ListDeployments
s {$sel:environmentId:ListDeployments' :: Text
environmentId = Text
a} :: ListDeployments)
instance Core.AWSRequest ListDeployments where
type
AWSResponse ListDeployments =
ListDeploymentsResponse
request :: ListDeployments -> Request ListDeployments
request = Service -> ListDeployments -> Request ListDeployments
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListDeployments
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDeployments)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListDeployments))
-> Logger
-> Service
-> Proxy ListDeployments
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDeployments)))
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 [DeploymentSummary]
-> Maybe Text -> Int -> ListDeploymentsResponse
ListDeploymentsResponse'
(Maybe [DeploymentSummary]
-> Maybe Text -> Int -> ListDeploymentsResponse)
-> Either String (Maybe [DeploymentSummary])
-> Either String (Maybe Text -> Int -> ListDeploymentsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [DeploymentSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Items" Either String (Maybe (Maybe [DeploymentSummary]))
-> Maybe [DeploymentSummary]
-> Either String (Maybe [DeploymentSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DeploymentSummary]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListDeploymentsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDeploymentsResponse)
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 (Int -> ListDeploymentsResponse)
-> Either String Int -> Either String ListDeploymentsResponse
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 ListDeployments
instance Prelude.NFData ListDeployments
instance Core.ToHeaders ListDeployments where
toHeaders :: ListDeployments -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListDeployments -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath ListDeployments where
toPath :: ListDeployments -> ByteString
toPath ListDeployments' {Maybe Natural
Maybe Text
Text
environmentId :: Text
applicationId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:environmentId:ListDeployments' :: ListDeployments -> Text
$sel:applicationId:ListDeployments' :: ListDeployments -> Text
$sel:maxResults:ListDeployments' :: ListDeployments -> Maybe Natural
$sel:nextToken:ListDeployments' :: ListDeployments -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/applications/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
ByteString
"/environments/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
environmentId,
ByteString
"/deployments"
]
instance Core.ToQuery ListDeployments where
toQuery :: ListDeployments -> QueryString
toQuery ListDeployments' {Maybe Natural
Maybe Text
Text
environmentId :: Text
applicationId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:environmentId:ListDeployments' :: ListDeployments -> Text
$sel:applicationId:ListDeployments' :: ListDeployments -> Text
$sel:maxResults:ListDeployments' :: ListDeployments -> Maybe Natural
$sel:nextToken:ListDeployments' :: ListDeployments -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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
]
data ListDeploymentsResponse = ListDeploymentsResponse'
{
ListDeploymentsResponse -> Maybe [DeploymentSummary]
items :: Prelude.Maybe [DeploymentSummary],
ListDeploymentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeploymentsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDeploymentsResponse -> ListDeploymentsResponse -> Bool
(ListDeploymentsResponse -> ListDeploymentsResponse -> Bool)
-> (ListDeploymentsResponse -> ListDeploymentsResponse -> Bool)
-> Eq ListDeploymentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeploymentsResponse -> ListDeploymentsResponse -> Bool
$c/= :: ListDeploymentsResponse -> ListDeploymentsResponse -> Bool
== :: ListDeploymentsResponse -> ListDeploymentsResponse -> Bool
$c== :: ListDeploymentsResponse -> ListDeploymentsResponse -> Bool
Prelude.Eq, ReadPrec [ListDeploymentsResponse]
ReadPrec ListDeploymentsResponse
Int -> ReadS ListDeploymentsResponse
ReadS [ListDeploymentsResponse]
(Int -> ReadS ListDeploymentsResponse)
-> ReadS [ListDeploymentsResponse]
-> ReadPrec ListDeploymentsResponse
-> ReadPrec [ListDeploymentsResponse]
-> Read ListDeploymentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeploymentsResponse]
$creadListPrec :: ReadPrec [ListDeploymentsResponse]
readPrec :: ReadPrec ListDeploymentsResponse
$creadPrec :: ReadPrec ListDeploymentsResponse
readList :: ReadS [ListDeploymentsResponse]
$creadList :: ReadS [ListDeploymentsResponse]
readsPrec :: Int -> ReadS ListDeploymentsResponse
$creadsPrec :: Int -> ReadS ListDeploymentsResponse
Prelude.Read, Int -> ListDeploymentsResponse -> ShowS
[ListDeploymentsResponse] -> ShowS
ListDeploymentsResponse -> String
(Int -> ListDeploymentsResponse -> ShowS)
-> (ListDeploymentsResponse -> String)
-> ([ListDeploymentsResponse] -> ShowS)
-> Show ListDeploymentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeploymentsResponse] -> ShowS
$cshowList :: [ListDeploymentsResponse] -> ShowS
show :: ListDeploymentsResponse -> String
$cshow :: ListDeploymentsResponse -> String
showsPrec :: Int -> ListDeploymentsResponse -> ShowS
$cshowsPrec :: Int -> ListDeploymentsResponse -> ShowS
Prelude.Show, (forall x.
ListDeploymentsResponse -> Rep ListDeploymentsResponse x)
-> (forall x.
Rep ListDeploymentsResponse x -> ListDeploymentsResponse)
-> Generic ListDeploymentsResponse
forall x. Rep ListDeploymentsResponse x -> ListDeploymentsResponse
forall x. ListDeploymentsResponse -> Rep ListDeploymentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDeploymentsResponse x -> ListDeploymentsResponse
$cfrom :: forall x. ListDeploymentsResponse -> Rep ListDeploymentsResponse x
Prelude.Generic)
newListDeploymentsResponse ::
Prelude.Int ->
ListDeploymentsResponse
newListDeploymentsResponse :: Int -> ListDeploymentsResponse
newListDeploymentsResponse Int
pHttpStatus_ =
ListDeploymentsResponse' :: Maybe [DeploymentSummary]
-> Maybe Text -> Int -> ListDeploymentsResponse
ListDeploymentsResponse'
{ $sel:items:ListDeploymentsResponse' :: Maybe [DeploymentSummary]
items = Maybe [DeploymentSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDeploymentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDeploymentsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDeploymentsResponse_items :: Lens.Lens' ListDeploymentsResponse (Prelude.Maybe [DeploymentSummary])
listDeploymentsResponse_items :: (Maybe [DeploymentSummary] -> f (Maybe [DeploymentSummary]))
-> ListDeploymentsResponse -> f ListDeploymentsResponse
listDeploymentsResponse_items = (ListDeploymentsResponse -> Maybe [DeploymentSummary])
-> (ListDeploymentsResponse
-> Maybe [DeploymentSummary] -> ListDeploymentsResponse)
-> Lens
ListDeploymentsResponse
ListDeploymentsResponse
(Maybe [DeploymentSummary])
(Maybe [DeploymentSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentsResponse' {Maybe [DeploymentSummary]
items :: Maybe [DeploymentSummary]
$sel:items:ListDeploymentsResponse' :: ListDeploymentsResponse -> Maybe [DeploymentSummary]
items} -> Maybe [DeploymentSummary]
items) (\s :: ListDeploymentsResponse
s@ListDeploymentsResponse' {} Maybe [DeploymentSummary]
a -> ListDeploymentsResponse
s {$sel:items:ListDeploymentsResponse' :: Maybe [DeploymentSummary]
items = Maybe [DeploymentSummary]
a} :: ListDeploymentsResponse) ((Maybe [DeploymentSummary] -> f (Maybe [DeploymentSummary]))
-> ListDeploymentsResponse -> f ListDeploymentsResponse)
-> ((Maybe [DeploymentSummary] -> f (Maybe [DeploymentSummary]))
-> Maybe [DeploymentSummary] -> f (Maybe [DeploymentSummary]))
-> (Maybe [DeploymentSummary] -> f (Maybe [DeploymentSummary]))
-> ListDeploymentsResponse
-> f ListDeploymentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DeploymentSummary]
[DeploymentSummary]
[DeploymentSummary]
[DeploymentSummary]
-> Iso
(Maybe [DeploymentSummary])
(Maybe [DeploymentSummary])
(Maybe [DeploymentSummary])
(Maybe [DeploymentSummary])
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
[DeploymentSummary]
[DeploymentSummary]
[DeploymentSummary]
[DeploymentSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listDeploymentsResponse_nextToken :: Lens.Lens' ListDeploymentsResponse (Prelude.Maybe Prelude.Text)
listDeploymentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentsResponse -> f ListDeploymentsResponse
listDeploymentsResponse_nextToken = (ListDeploymentsResponse -> Maybe Text)
-> (ListDeploymentsResponse
-> Maybe Text -> ListDeploymentsResponse)
-> Lens
ListDeploymentsResponse
ListDeploymentsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeploymentsResponse' :: ListDeploymentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeploymentsResponse
s@ListDeploymentsResponse' {} Maybe Text
a -> ListDeploymentsResponse
s {$sel:nextToken:ListDeploymentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeploymentsResponse)
listDeploymentsResponse_httpStatus :: Lens.Lens' ListDeploymentsResponse Prelude.Int
listDeploymentsResponse_httpStatus :: (Int -> f Int)
-> ListDeploymentsResponse -> f ListDeploymentsResponse
listDeploymentsResponse_httpStatus = (ListDeploymentsResponse -> Int)
-> (ListDeploymentsResponse -> Int -> ListDeploymentsResponse)
-> Lens ListDeploymentsResponse ListDeploymentsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDeploymentsResponse' :: ListDeploymentsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDeploymentsResponse
s@ListDeploymentsResponse' {} Int
a -> ListDeploymentsResponse
s {$sel:httpStatus:ListDeploymentsResponse' :: Int
httpStatus = Int
a} :: ListDeploymentsResponse)
instance Prelude.NFData ListDeploymentsResponse