{-# 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.ListDeploymentStrategies
(
ListDeploymentStrategies (..),
newListDeploymentStrategies,
listDeploymentStrategies_nextToken,
listDeploymentStrategies_maxResults,
ListDeploymentStrategiesResponse (..),
newListDeploymentStrategiesResponse,
listDeploymentStrategiesResponse_items,
listDeploymentStrategiesResponse_nextToken,
listDeploymentStrategiesResponse_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 ListDeploymentStrategies = ListDeploymentStrategies'
{
ListDeploymentStrategies -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeploymentStrategies -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListDeploymentStrategies -> ListDeploymentStrategies -> Bool
(ListDeploymentStrategies -> ListDeploymentStrategies -> Bool)
-> (ListDeploymentStrategies -> ListDeploymentStrategies -> Bool)
-> Eq ListDeploymentStrategies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeploymentStrategies -> ListDeploymentStrategies -> Bool
$c/= :: ListDeploymentStrategies -> ListDeploymentStrategies -> Bool
== :: ListDeploymentStrategies -> ListDeploymentStrategies -> Bool
$c== :: ListDeploymentStrategies -> ListDeploymentStrategies -> Bool
Prelude.Eq, ReadPrec [ListDeploymentStrategies]
ReadPrec ListDeploymentStrategies
Int -> ReadS ListDeploymentStrategies
ReadS [ListDeploymentStrategies]
(Int -> ReadS ListDeploymentStrategies)
-> ReadS [ListDeploymentStrategies]
-> ReadPrec ListDeploymentStrategies
-> ReadPrec [ListDeploymentStrategies]
-> Read ListDeploymentStrategies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeploymentStrategies]
$creadListPrec :: ReadPrec [ListDeploymentStrategies]
readPrec :: ReadPrec ListDeploymentStrategies
$creadPrec :: ReadPrec ListDeploymentStrategies
readList :: ReadS [ListDeploymentStrategies]
$creadList :: ReadS [ListDeploymentStrategies]
readsPrec :: Int -> ReadS ListDeploymentStrategies
$creadsPrec :: Int -> ReadS ListDeploymentStrategies
Prelude.Read, Int -> ListDeploymentStrategies -> ShowS
[ListDeploymentStrategies] -> ShowS
ListDeploymentStrategies -> String
(Int -> ListDeploymentStrategies -> ShowS)
-> (ListDeploymentStrategies -> String)
-> ([ListDeploymentStrategies] -> ShowS)
-> Show ListDeploymentStrategies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeploymentStrategies] -> ShowS
$cshowList :: [ListDeploymentStrategies] -> ShowS
show :: ListDeploymentStrategies -> String
$cshow :: ListDeploymentStrategies -> String
showsPrec :: Int -> ListDeploymentStrategies -> ShowS
$cshowsPrec :: Int -> ListDeploymentStrategies -> ShowS
Prelude.Show, (forall x.
ListDeploymentStrategies -> Rep ListDeploymentStrategies x)
-> (forall x.
Rep ListDeploymentStrategies x -> ListDeploymentStrategies)
-> Generic ListDeploymentStrategies
forall x.
Rep ListDeploymentStrategies x -> ListDeploymentStrategies
forall x.
ListDeploymentStrategies -> Rep ListDeploymentStrategies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeploymentStrategies x -> ListDeploymentStrategies
$cfrom :: forall x.
ListDeploymentStrategies -> Rep ListDeploymentStrategies x
Prelude.Generic)
newListDeploymentStrategies ::
ListDeploymentStrategies
newListDeploymentStrategies :: ListDeploymentStrategies
newListDeploymentStrategies =
ListDeploymentStrategies' :: Maybe Text -> Maybe Natural -> ListDeploymentStrategies
ListDeploymentStrategies'
{ $sel:nextToken:ListDeploymentStrategies' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListDeploymentStrategies' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listDeploymentStrategies_nextToken :: Lens.Lens' ListDeploymentStrategies (Prelude.Maybe Prelude.Text)
listDeploymentStrategies_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentStrategies -> f ListDeploymentStrategies
listDeploymentStrategies_nextToken = (ListDeploymentStrategies -> Maybe Text)
-> (ListDeploymentStrategies
-> Maybe Text -> ListDeploymentStrategies)
-> Lens
ListDeploymentStrategies
ListDeploymentStrategies
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentStrategies' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeploymentStrategies' :: ListDeploymentStrategies -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeploymentStrategies
s@ListDeploymentStrategies' {} Maybe Text
a -> ListDeploymentStrategies
s {$sel:nextToken:ListDeploymentStrategies' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeploymentStrategies)
listDeploymentStrategies_maxResults :: Lens.Lens' ListDeploymentStrategies (Prelude.Maybe Prelude.Natural)
listDeploymentStrategies_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDeploymentStrategies -> f ListDeploymentStrategies
listDeploymentStrategies_maxResults = (ListDeploymentStrategies -> Maybe Natural)
-> (ListDeploymentStrategies
-> Maybe Natural -> ListDeploymentStrategies)
-> Lens
ListDeploymentStrategies
ListDeploymentStrategies
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentStrategies' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDeploymentStrategies' :: ListDeploymentStrategies -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDeploymentStrategies
s@ListDeploymentStrategies' {} Maybe Natural
a -> ListDeploymentStrategies
s {$sel:maxResults:ListDeploymentStrategies' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDeploymentStrategies)
instance Core.AWSRequest ListDeploymentStrategies where
type
AWSResponse ListDeploymentStrategies =
ListDeploymentStrategiesResponse
request :: ListDeploymentStrategies -> Request ListDeploymentStrategies
request = Service
-> ListDeploymentStrategies -> Request ListDeploymentStrategies
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListDeploymentStrategies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDeploymentStrategies)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListDeploymentStrategies))
-> Logger
-> Service
-> Proxy ListDeploymentStrategies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDeploymentStrategies)))
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 [DeploymentStrategy]
-> Maybe Text -> Int -> ListDeploymentStrategiesResponse
ListDeploymentStrategiesResponse'
(Maybe [DeploymentStrategy]
-> Maybe Text -> Int -> ListDeploymentStrategiesResponse)
-> Either String (Maybe [DeploymentStrategy])
-> Either
String (Maybe Text -> Int -> ListDeploymentStrategiesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [DeploymentStrategy]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Items" Either String (Maybe (Maybe [DeploymentStrategy]))
-> Maybe [DeploymentStrategy]
-> Either String (Maybe [DeploymentStrategy])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DeploymentStrategy]
forall a. Monoid a => a
Prelude.mempty)
Either
String (Maybe Text -> Int -> ListDeploymentStrategiesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDeploymentStrategiesResponse)
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 -> ListDeploymentStrategiesResponse)
-> Either String Int
-> Either String ListDeploymentStrategiesResponse
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 ListDeploymentStrategies
instance Prelude.NFData ListDeploymentStrategies
instance Core.ToHeaders ListDeploymentStrategies where
toHeaders :: ListDeploymentStrategies -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListDeploymentStrategies -> 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 ListDeploymentStrategies where
toPath :: ListDeploymentStrategies -> ByteString
toPath = ByteString -> ListDeploymentStrategies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/deploymentstrategies"
instance Core.ToQuery ListDeploymentStrategies where
toQuery :: ListDeploymentStrategies -> QueryString
toQuery ListDeploymentStrategies' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListDeploymentStrategies' :: ListDeploymentStrategies -> Maybe Natural
$sel:nextToken:ListDeploymentStrategies' :: ListDeploymentStrategies -> 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 ListDeploymentStrategiesResponse = ListDeploymentStrategiesResponse'
{
ListDeploymentStrategiesResponse -> Maybe [DeploymentStrategy]
items :: Prelude.Maybe [DeploymentStrategy],
ListDeploymentStrategiesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeploymentStrategiesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDeploymentStrategiesResponse
-> ListDeploymentStrategiesResponse -> Bool
(ListDeploymentStrategiesResponse
-> ListDeploymentStrategiesResponse -> Bool)
-> (ListDeploymentStrategiesResponse
-> ListDeploymentStrategiesResponse -> Bool)
-> Eq ListDeploymentStrategiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeploymentStrategiesResponse
-> ListDeploymentStrategiesResponse -> Bool
$c/= :: ListDeploymentStrategiesResponse
-> ListDeploymentStrategiesResponse -> Bool
== :: ListDeploymentStrategiesResponse
-> ListDeploymentStrategiesResponse -> Bool
$c== :: ListDeploymentStrategiesResponse
-> ListDeploymentStrategiesResponse -> Bool
Prelude.Eq, ReadPrec [ListDeploymentStrategiesResponse]
ReadPrec ListDeploymentStrategiesResponse
Int -> ReadS ListDeploymentStrategiesResponse
ReadS [ListDeploymentStrategiesResponse]
(Int -> ReadS ListDeploymentStrategiesResponse)
-> ReadS [ListDeploymentStrategiesResponse]
-> ReadPrec ListDeploymentStrategiesResponse
-> ReadPrec [ListDeploymentStrategiesResponse]
-> Read ListDeploymentStrategiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeploymentStrategiesResponse]
$creadListPrec :: ReadPrec [ListDeploymentStrategiesResponse]
readPrec :: ReadPrec ListDeploymentStrategiesResponse
$creadPrec :: ReadPrec ListDeploymentStrategiesResponse
readList :: ReadS [ListDeploymentStrategiesResponse]
$creadList :: ReadS [ListDeploymentStrategiesResponse]
readsPrec :: Int -> ReadS ListDeploymentStrategiesResponse
$creadsPrec :: Int -> ReadS ListDeploymentStrategiesResponse
Prelude.Read, Int -> ListDeploymentStrategiesResponse -> ShowS
[ListDeploymentStrategiesResponse] -> ShowS
ListDeploymentStrategiesResponse -> String
(Int -> ListDeploymentStrategiesResponse -> ShowS)
-> (ListDeploymentStrategiesResponse -> String)
-> ([ListDeploymentStrategiesResponse] -> ShowS)
-> Show ListDeploymentStrategiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeploymentStrategiesResponse] -> ShowS
$cshowList :: [ListDeploymentStrategiesResponse] -> ShowS
show :: ListDeploymentStrategiesResponse -> String
$cshow :: ListDeploymentStrategiesResponse -> String
showsPrec :: Int -> ListDeploymentStrategiesResponse -> ShowS
$cshowsPrec :: Int -> ListDeploymentStrategiesResponse -> ShowS
Prelude.Show, (forall x.
ListDeploymentStrategiesResponse
-> Rep ListDeploymentStrategiesResponse x)
-> (forall x.
Rep ListDeploymentStrategiesResponse x
-> ListDeploymentStrategiesResponse)
-> Generic ListDeploymentStrategiesResponse
forall x.
Rep ListDeploymentStrategiesResponse x
-> ListDeploymentStrategiesResponse
forall x.
ListDeploymentStrategiesResponse
-> Rep ListDeploymentStrategiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeploymentStrategiesResponse x
-> ListDeploymentStrategiesResponse
$cfrom :: forall x.
ListDeploymentStrategiesResponse
-> Rep ListDeploymentStrategiesResponse x
Prelude.Generic)
newListDeploymentStrategiesResponse ::
Prelude.Int ->
ListDeploymentStrategiesResponse
newListDeploymentStrategiesResponse :: Int -> ListDeploymentStrategiesResponse
newListDeploymentStrategiesResponse Int
pHttpStatus_ =
ListDeploymentStrategiesResponse' :: Maybe [DeploymentStrategy]
-> Maybe Text -> Int -> ListDeploymentStrategiesResponse
ListDeploymentStrategiesResponse'
{ $sel:items:ListDeploymentStrategiesResponse' :: Maybe [DeploymentStrategy]
items =
Maybe [DeploymentStrategy]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDeploymentStrategiesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDeploymentStrategiesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDeploymentStrategiesResponse_items :: Lens.Lens' ListDeploymentStrategiesResponse (Prelude.Maybe [DeploymentStrategy])
listDeploymentStrategiesResponse_items :: (Maybe [DeploymentStrategy] -> f (Maybe [DeploymentStrategy]))
-> ListDeploymentStrategiesResponse
-> f ListDeploymentStrategiesResponse
listDeploymentStrategiesResponse_items = (ListDeploymentStrategiesResponse -> Maybe [DeploymentStrategy])
-> (ListDeploymentStrategiesResponse
-> Maybe [DeploymentStrategy] -> ListDeploymentStrategiesResponse)
-> Lens
ListDeploymentStrategiesResponse
ListDeploymentStrategiesResponse
(Maybe [DeploymentStrategy])
(Maybe [DeploymentStrategy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentStrategiesResponse' {Maybe [DeploymentStrategy]
items :: Maybe [DeploymentStrategy]
$sel:items:ListDeploymentStrategiesResponse' :: ListDeploymentStrategiesResponse -> Maybe [DeploymentStrategy]
items} -> Maybe [DeploymentStrategy]
items) (\s :: ListDeploymentStrategiesResponse
s@ListDeploymentStrategiesResponse' {} Maybe [DeploymentStrategy]
a -> ListDeploymentStrategiesResponse
s {$sel:items:ListDeploymentStrategiesResponse' :: Maybe [DeploymentStrategy]
items = Maybe [DeploymentStrategy]
a} :: ListDeploymentStrategiesResponse) ((Maybe [DeploymentStrategy] -> f (Maybe [DeploymentStrategy]))
-> ListDeploymentStrategiesResponse
-> f ListDeploymentStrategiesResponse)
-> ((Maybe [DeploymentStrategy] -> f (Maybe [DeploymentStrategy]))
-> Maybe [DeploymentStrategy] -> f (Maybe [DeploymentStrategy]))
-> (Maybe [DeploymentStrategy] -> f (Maybe [DeploymentStrategy]))
-> ListDeploymentStrategiesResponse
-> f ListDeploymentStrategiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DeploymentStrategy]
[DeploymentStrategy]
[DeploymentStrategy]
[DeploymentStrategy]
-> Iso
(Maybe [DeploymentStrategy])
(Maybe [DeploymentStrategy])
(Maybe [DeploymentStrategy])
(Maybe [DeploymentStrategy])
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
[DeploymentStrategy]
[DeploymentStrategy]
[DeploymentStrategy]
[DeploymentStrategy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listDeploymentStrategiesResponse_nextToken :: Lens.Lens' ListDeploymentStrategiesResponse (Prelude.Maybe Prelude.Text)
listDeploymentStrategiesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentStrategiesResponse
-> f ListDeploymentStrategiesResponse
listDeploymentStrategiesResponse_nextToken = (ListDeploymentStrategiesResponse -> Maybe Text)
-> (ListDeploymentStrategiesResponse
-> Maybe Text -> ListDeploymentStrategiesResponse)
-> Lens
ListDeploymentStrategiesResponse
ListDeploymentStrategiesResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentStrategiesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeploymentStrategiesResponse' :: ListDeploymentStrategiesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeploymentStrategiesResponse
s@ListDeploymentStrategiesResponse' {} Maybe Text
a -> ListDeploymentStrategiesResponse
s {$sel:nextToken:ListDeploymentStrategiesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeploymentStrategiesResponse)
listDeploymentStrategiesResponse_httpStatus :: Lens.Lens' ListDeploymentStrategiesResponse Prelude.Int
listDeploymentStrategiesResponse_httpStatus :: (Int -> f Int)
-> ListDeploymentStrategiesResponse
-> f ListDeploymentStrategiesResponse
listDeploymentStrategiesResponse_httpStatus = (ListDeploymentStrategiesResponse -> Int)
-> (ListDeploymentStrategiesResponse
-> Int -> ListDeploymentStrategiesResponse)
-> Lens
ListDeploymentStrategiesResponse
ListDeploymentStrategiesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentStrategiesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDeploymentStrategiesResponse' :: ListDeploymentStrategiesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDeploymentStrategiesResponse
s@ListDeploymentStrategiesResponse' {} Int
a -> ListDeploymentStrategiesResponse
s {$sel:httpStatus:ListDeploymentStrategiesResponse' :: Int
httpStatus = Int
a} :: ListDeploymentStrategiesResponse)
instance
Prelude.NFData
ListDeploymentStrategiesResponse