{-# 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.Lightsail.GetContainerServiceDeployments
(
GetContainerServiceDeployments (..),
newGetContainerServiceDeployments,
getContainerServiceDeployments_serviceName,
GetContainerServiceDeploymentsResponse (..),
newGetContainerServiceDeploymentsResponse,
getContainerServiceDeploymentsResponse_deployments,
getContainerServiceDeploymentsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetContainerServiceDeployments = GetContainerServiceDeployments'
{
GetContainerServiceDeployments -> Text
serviceName :: Prelude.Text
}
deriving (GetContainerServiceDeployments
-> GetContainerServiceDeployments -> Bool
(GetContainerServiceDeployments
-> GetContainerServiceDeployments -> Bool)
-> (GetContainerServiceDeployments
-> GetContainerServiceDeployments -> Bool)
-> Eq GetContainerServiceDeployments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContainerServiceDeployments
-> GetContainerServiceDeployments -> Bool
$c/= :: GetContainerServiceDeployments
-> GetContainerServiceDeployments -> Bool
== :: GetContainerServiceDeployments
-> GetContainerServiceDeployments -> Bool
$c== :: GetContainerServiceDeployments
-> GetContainerServiceDeployments -> Bool
Prelude.Eq, ReadPrec [GetContainerServiceDeployments]
ReadPrec GetContainerServiceDeployments
Int -> ReadS GetContainerServiceDeployments
ReadS [GetContainerServiceDeployments]
(Int -> ReadS GetContainerServiceDeployments)
-> ReadS [GetContainerServiceDeployments]
-> ReadPrec GetContainerServiceDeployments
-> ReadPrec [GetContainerServiceDeployments]
-> Read GetContainerServiceDeployments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContainerServiceDeployments]
$creadListPrec :: ReadPrec [GetContainerServiceDeployments]
readPrec :: ReadPrec GetContainerServiceDeployments
$creadPrec :: ReadPrec GetContainerServiceDeployments
readList :: ReadS [GetContainerServiceDeployments]
$creadList :: ReadS [GetContainerServiceDeployments]
readsPrec :: Int -> ReadS GetContainerServiceDeployments
$creadsPrec :: Int -> ReadS GetContainerServiceDeployments
Prelude.Read, Int -> GetContainerServiceDeployments -> ShowS
[GetContainerServiceDeployments] -> ShowS
GetContainerServiceDeployments -> String
(Int -> GetContainerServiceDeployments -> ShowS)
-> (GetContainerServiceDeployments -> String)
-> ([GetContainerServiceDeployments] -> ShowS)
-> Show GetContainerServiceDeployments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContainerServiceDeployments] -> ShowS
$cshowList :: [GetContainerServiceDeployments] -> ShowS
show :: GetContainerServiceDeployments -> String
$cshow :: GetContainerServiceDeployments -> String
showsPrec :: Int -> GetContainerServiceDeployments -> ShowS
$cshowsPrec :: Int -> GetContainerServiceDeployments -> ShowS
Prelude.Show, (forall x.
GetContainerServiceDeployments
-> Rep GetContainerServiceDeployments x)
-> (forall x.
Rep GetContainerServiceDeployments x
-> GetContainerServiceDeployments)
-> Generic GetContainerServiceDeployments
forall x.
Rep GetContainerServiceDeployments x
-> GetContainerServiceDeployments
forall x.
GetContainerServiceDeployments
-> Rep GetContainerServiceDeployments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContainerServiceDeployments x
-> GetContainerServiceDeployments
$cfrom :: forall x.
GetContainerServiceDeployments
-> Rep GetContainerServiceDeployments x
Prelude.Generic)
newGetContainerServiceDeployments ::
Prelude.Text ->
GetContainerServiceDeployments
newGetContainerServiceDeployments :: Text -> GetContainerServiceDeployments
newGetContainerServiceDeployments Text
pServiceName_ =
GetContainerServiceDeployments' :: Text -> GetContainerServiceDeployments
GetContainerServiceDeployments'
{ $sel:serviceName:GetContainerServiceDeployments' :: Text
serviceName =
Text
pServiceName_
}
getContainerServiceDeployments_serviceName :: Lens.Lens' GetContainerServiceDeployments Prelude.Text
getContainerServiceDeployments_serviceName :: (Text -> f Text)
-> GetContainerServiceDeployments
-> f GetContainerServiceDeployments
getContainerServiceDeployments_serviceName = (GetContainerServiceDeployments -> Text)
-> (GetContainerServiceDeployments
-> Text -> GetContainerServiceDeployments)
-> Lens
GetContainerServiceDeployments
GetContainerServiceDeployments
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContainerServiceDeployments' {Text
serviceName :: Text
$sel:serviceName:GetContainerServiceDeployments' :: GetContainerServiceDeployments -> Text
serviceName} -> Text
serviceName) (\s :: GetContainerServiceDeployments
s@GetContainerServiceDeployments' {} Text
a -> GetContainerServiceDeployments
s {$sel:serviceName:GetContainerServiceDeployments' :: Text
serviceName = Text
a} :: GetContainerServiceDeployments)
instance
Core.AWSRequest
GetContainerServiceDeployments
where
type
AWSResponse GetContainerServiceDeployments =
GetContainerServiceDeploymentsResponse
request :: GetContainerServiceDeployments
-> Request GetContainerServiceDeployments
request = Service
-> GetContainerServiceDeployments
-> Request GetContainerServiceDeployments
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetContainerServiceDeployments
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetContainerServiceDeployments)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetContainerServiceDeployments))
-> Logger
-> Service
-> Proxy GetContainerServiceDeployments
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetContainerServiceDeployments)))
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 [ContainerServiceDeployment]
-> Int -> GetContainerServiceDeploymentsResponse
GetContainerServiceDeploymentsResponse'
(Maybe [ContainerServiceDeployment]
-> Int -> GetContainerServiceDeploymentsResponse)
-> Either String (Maybe [ContainerServiceDeployment])
-> Either String (Int -> GetContainerServiceDeploymentsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe (Maybe [ContainerServiceDeployment]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"deployments" Either String (Maybe (Maybe [ContainerServiceDeployment]))
-> Maybe [ContainerServiceDeployment]
-> Either String (Maybe [ContainerServiceDeployment])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ContainerServiceDeployment]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetContainerServiceDeploymentsResponse)
-> Either String Int
-> Either String GetContainerServiceDeploymentsResponse
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
GetContainerServiceDeployments
instance
Prelude.NFData
GetContainerServiceDeployments
instance
Core.ToHeaders
GetContainerServiceDeployments
where
toHeaders :: GetContainerServiceDeployments -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetContainerServiceDeployments -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetContainerServiceDeployments" ::
Prelude.ByteString
),
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 GetContainerServiceDeployments where
toJSON :: GetContainerServiceDeployments -> Value
toJSON GetContainerServiceDeployments' {Text
serviceName :: Text
$sel:serviceName:GetContainerServiceDeployments' :: GetContainerServiceDeployments -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"serviceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceName)]
)
instance Core.ToPath GetContainerServiceDeployments where
toPath :: GetContainerServiceDeployments -> ByteString
toPath = ByteString -> GetContainerServiceDeployments -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetContainerServiceDeployments where
toQuery :: GetContainerServiceDeployments -> QueryString
toQuery = QueryString -> GetContainerServiceDeployments -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetContainerServiceDeploymentsResponse = GetContainerServiceDeploymentsResponse'
{
GetContainerServiceDeploymentsResponse
-> Maybe [ContainerServiceDeployment]
deployments :: Prelude.Maybe [ContainerServiceDeployment],
GetContainerServiceDeploymentsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetContainerServiceDeploymentsResponse
-> GetContainerServiceDeploymentsResponse -> Bool
(GetContainerServiceDeploymentsResponse
-> GetContainerServiceDeploymentsResponse -> Bool)
-> (GetContainerServiceDeploymentsResponse
-> GetContainerServiceDeploymentsResponse -> Bool)
-> Eq GetContainerServiceDeploymentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContainerServiceDeploymentsResponse
-> GetContainerServiceDeploymentsResponse -> Bool
$c/= :: GetContainerServiceDeploymentsResponse
-> GetContainerServiceDeploymentsResponse -> Bool
== :: GetContainerServiceDeploymentsResponse
-> GetContainerServiceDeploymentsResponse -> Bool
$c== :: GetContainerServiceDeploymentsResponse
-> GetContainerServiceDeploymentsResponse -> Bool
Prelude.Eq, ReadPrec [GetContainerServiceDeploymentsResponse]
ReadPrec GetContainerServiceDeploymentsResponse
Int -> ReadS GetContainerServiceDeploymentsResponse
ReadS [GetContainerServiceDeploymentsResponse]
(Int -> ReadS GetContainerServiceDeploymentsResponse)
-> ReadS [GetContainerServiceDeploymentsResponse]
-> ReadPrec GetContainerServiceDeploymentsResponse
-> ReadPrec [GetContainerServiceDeploymentsResponse]
-> Read GetContainerServiceDeploymentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContainerServiceDeploymentsResponse]
$creadListPrec :: ReadPrec [GetContainerServiceDeploymentsResponse]
readPrec :: ReadPrec GetContainerServiceDeploymentsResponse
$creadPrec :: ReadPrec GetContainerServiceDeploymentsResponse
readList :: ReadS [GetContainerServiceDeploymentsResponse]
$creadList :: ReadS [GetContainerServiceDeploymentsResponse]
readsPrec :: Int -> ReadS GetContainerServiceDeploymentsResponse
$creadsPrec :: Int -> ReadS GetContainerServiceDeploymentsResponse
Prelude.Read, Int -> GetContainerServiceDeploymentsResponse -> ShowS
[GetContainerServiceDeploymentsResponse] -> ShowS
GetContainerServiceDeploymentsResponse -> String
(Int -> GetContainerServiceDeploymentsResponse -> ShowS)
-> (GetContainerServiceDeploymentsResponse -> String)
-> ([GetContainerServiceDeploymentsResponse] -> ShowS)
-> Show GetContainerServiceDeploymentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContainerServiceDeploymentsResponse] -> ShowS
$cshowList :: [GetContainerServiceDeploymentsResponse] -> ShowS
show :: GetContainerServiceDeploymentsResponse -> String
$cshow :: GetContainerServiceDeploymentsResponse -> String
showsPrec :: Int -> GetContainerServiceDeploymentsResponse -> ShowS
$cshowsPrec :: Int -> GetContainerServiceDeploymentsResponse -> ShowS
Prelude.Show, (forall x.
GetContainerServiceDeploymentsResponse
-> Rep GetContainerServiceDeploymentsResponse x)
-> (forall x.
Rep GetContainerServiceDeploymentsResponse x
-> GetContainerServiceDeploymentsResponse)
-> Generic GetContainerServiceDeploymentsResponse
forall x.
Rep GetContainerServiceDeploymentsResponse x
-> GetContainerServiceDeploymentsResponse
forall x.
GetContainerServiceDeploymentsResponse
-> Rep GetContainerServiceDeploymentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContainerServiceDeploymentsResponse x
-> GetContainerServiceDeploymentsResponse
$cfrom :: forall x.
GetContainerServiceDeploymentsResponse
-> Rep GetContainerServiceDeploymentsResponse x
Prelude.Generic)
newGetContainerServiceDeploymentsResponse ::
Prelude.Int ->
GetContainerServiceDeploymentsResponse
newGetContainerServiceDeploymentsResponse :: Int -> GetContainerServiceDeploymentsResponse
newGetContainerServiceDeploymentsResponse
Int
pHttpStatus_ =
GetContainerServiceDeploymentsResponse' :: Maybe [ContainerServiceDeployment]
-> Int -> GetContainerServiceDeploymentsResponse
GetContainerServiceDeploymentsResponse'
{ $sel:deployments:GetContainerServiceDeploymentsResponse' :: Maybe [ContainerServiceDeployment]
deployments =
Maybe [ContainerServiceDeployment]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetContainerServiceDeploymentsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getContainerServiceDeploymentsResponse_deployments :: Lens.Lens' GetContainerServiceDeploymentsResponse (Prelude.Maybe [ContainerServiceDeployment])
getContainerServiceDeploymentsResponse_deployments :: (Maybe [ContainerServiceDeployment]
-> f (Maybe [ContainerServiceDeployment]))
-> GetContainerServiceDeploymentsResponse
-> f GetContainerServiceDeploymentsResponse
getContainerServiceDeploymentsResponse_deployments = (GetContainerServiceDeploymentsResponse
-> Maybe [ContainerServiceDeployment])
-> (GetContainerServiceDeploymentsResponse
-> Maybe [ContainerServiceDeployment]
-> GetContainerServiceDeploymentsResponse)
-> Lens
GetContainerServiceDeploymentsResponse
GetContainerServiceDeploymentsResponse
(Maybe [ContainerServiceDeployment])
(Maybe [ContainerServiceDeployment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContainerServiceDeploymentsResponse' {Maybe [ContainerServiceDeployment]
deployments :: Maybe [ContainerServiceDeployment]
$sel:deployments:GetContainerServiceDeploymentsResponse' :: GetContainerServiceDeploymentsResponse
-> Maybe [ContainerServiceDeployment]
deployments} -> Maybe [ContainerServiceDeployment]
deployments) (\s :: GetContainerServiceDeploymentsResponse
s@GetContainerServiceDeploymentsResponse' {} Maybe [ContainerServiceDeployment]
a -> GetContainerServiceDeploymentsResponse
s {$sel:deployments:GetContainerServiceDeploymentsResponse' :: Maybe [ContainerServiceDeployment]
deployments = Maybe [ContainerServiceDeployment]
a} :: GetContainerServiceDeploymentsResponse) ((Maybe [ContainerServiceDeployment]
-> f (Maybe [ContainerServiceDeployment]))
-> GetContainerServiceDeploymentsResponse
-> f GetContainerServiceDeploymentsResponse)
-> ((Maybe [ContainerServiceDeployment]
-> f (Maybe [ContainerServiceDeployment]))
-> Maybe [ContainerServiceDeployment]
-> f (Maybe [ContainerServiceDeployment]))
-> (Maybe [ContainerServiceDeployment]
-> f (Maybe [ContainerServiceDeployment]))
-> GetContainerServiceDeploymentsResponse
-> f GetContainerServiceDeploymentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ContainerServiceDeployment]
[ContainerServiceDeployment]
[ContainerServiceDeployment]
[ContainerServiceDeployment]
-> Iso
(Maybe [ContainerServiceDeployment])
(Maybe [ContainerServiceDeployment])
(Maybe [ContainerServiceDeployment])
(Maybe [ContainerServiceDeployment])
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
[ContainerServiceDeployment]
[ContainerServiceDeployment]
[ContainerServiceDeployment]
[ContainerServiceDeployment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getContainerServiceDeploymentsResponse_httpStatus :: Lens.Lens' GetContainerServiceDeploymentsResponse Prelude.Int
getContainerServiceDeploymentsResponse_httpStatus :: (Int -> f Int)
-> GetContainerServiceDeploymentsResponse
-> f GetContainerServiceDeploymentsResponse
getContainerServiceDeploymentsResponse_httpStatus = (GetContainerServiceDeploymentsResponse -> Int)
-> (GetContainerServiceDeploymentsResponse
-> Int -> GetContainerServiceDeploymentsResponse)
-> Lens
GetContainerServiceDeploymentsResponse
GetContainerServiceDeploymentsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContainerServiceDeploymentsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetContainerServiceDeploymentsResponse' :: GetContainerServiceDeploymentsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetContainerServiceDeploymentsResponse
s@GetContainerServiceDeploymentsResponse' {} Int
a -> GetContainerServiceDeploymentsResponse
s {$sel:httpStatus:GetContainerServiceDeploymentsResponse' :: Int
httpStatus = Int
a} :: GetContainerServiceDeploymentsResponse)
instance
Prelude.NFData
GetContainerServiceDeploymentsResponse