{-# 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.Cloud9.DescribeEnvironmentStatus
(
DescribeEnvironmentStatus (..),
newDescribeEnvironmentStatus,
describeEnvironmentStatus_environmentId,
DescribeEnvironmentStatusResponse (..),
newDescribeEnvironmentStatusResponse,
describeEnvironmentStatusResponse_httpStatus,
describeEnvironmentStatusResponse_status,
describeEnvironmentStatusResponse_message,
)
where
import Amazonka.Cloud9.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 DescribeEnvironmentStatus = DescribeEnvironmentStatus'
{
DescribeEnvironmentStatus -> Text
environmentId :: Prelude.Text
}
deriving (DescribeEnvironmentStatus -> DescribeEnvironmentStatus -> Bool
(DescribeEnvironmentStatus -> DescribeEnvironmentStatus -> Bool)
-> (DescribeEnvironmentStatus -> DescribeEnvironmentStatus -> Bool)
-> Eq DescribeEnvironmentStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEnvironmentStatus -> DescribeEnvironmentStatus -> Bool
$c/= :: DescribeEnvironmentStatus -> DescribeEnvironmentStatus -> Bool
== :: DescribeEnvironmentStatus -> DescribeEnvironmentStatus -> Bool
$c== :: DescribeEnvironmentStatus -> DescribeEnvironmentStatus -> Bool
Prelude.Eq, ReadPrec [DescribeEnvironmentStatus]
ReadPrec DescribeEnvironmentStatus
Int -> ReadS DescribeEnvironmentStatus
ReadS [DescribeEnvironmentStatus]
(Int -> ReadS DescribeEnvironmentStatus)
-> ReadS [DescribeEnvironmentStatus]
-> ReadPrec DescribeEnvironmentStatus
-> ReadPrec [DescribeEnvironmentStatus]
-> Read DescribeEnvironmentStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEnvironmentStatus]
$creadListPrec :: ReadPrec [DescribeEnvironmentStatus]
readPrec :: ReadPrec DescribeEnvironmentStatus
$creadPrec :: ReadPrec DescribeEnvironmentStatus
readList :: ReadS [DescribeEnvironmentStatus]
$creadList :: ReadS [DescribeEnvironmentStatus]
readsPrec :: Int -> ReadS DescribeEnvironmentStatus
$creadsPrec :: Int -> ReadS DescribeEnvironmentStatus
Prelude.Read, Int -> DescribeEnvironmentStatus -> ShowS
[DescribeEnvironmentStatus] -> ShowS
DescribeEnvironmentStatus -> String
(Int -> DescribeEnvironmentStatus -> ShowS)
-> (DescribeEnvironmentStatus -> String)
-> ([DescribeEnvironmentStatus] -> ShowS)
-> Show DescribeEnvironmentStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEnvironmentStatus] -> ShowS
$cshowList :: [DescribeEnvironmentStatus] -> ShowS
show :: DescribeEnvironmentStatus -> String
$cshow :: DescribeEnvironmentStatus -> String
showsPrec :: Int -> DescribeEnvironmentStatus -> ShowS
$cshowsPrec :: Int -> DescribeEnvironmentStatus -> ShowS
Prelude.Show, (forall x.
DescribeEnvironmentStatus -> Rep DescribeEnvironmentStatus x)
-> (forall x.
Rep DescribeEnvironmentStatus x -> DescribeEnvironmentStatus)
-> Generic DescribeEnvironmentStatus
forall x.
Rep DescribeEnvironmentStatus x -> DescribeEnvironmentStatus
forall x.
DescribeEnvironmentStatus -> Rep DescribeEnvironmentStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEnvironmentStatus x -> DescribeEnvironmentStatus
$cfrom :: forall x.
DescribeEnvironmentStatus -> Rep DescribeEnvironmentStatus x
Prelude.Generic)
newDescribeEnvironmentStatus ::
Prelude.Text ->
DescribeEnvironmentStatus
newDescribeEnvironmentStatus :: Text -> DescribeEnvironmentStatus
newDescribeEnvironmentStatus Text
pEnvironmentId_ =
DescribeEnvironmentStatus' :: Text -> DescribeEnvironmentStatus
DescribeEnvironmentStatus'
{ $sel:environmentId:DescribeEnvironmentStatus' :: Text
environmentId =
Text
pEnvironmentId_
}
describeEnvironmentStatus_environmentId :: Lens.Lens' DescribeEnvironmentStatus Prelude.Text
describeEnvironmentStatus_environmentId :: (Text -> f Text)
-> DescribeEnvironmentStatus -> f DescribeEnvironmentStatus
describeEnvironmentStatus_environmentId = (DescribeEnvironmentStatus -> Text)
-> (DescribeEnvironmentStatus -> Text -> DescribeEnvironmentStatus)
-> Lens
DescribeEnvironmentStatus DescribeEnvironmentStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEnvironmentStatus' {Text
environmentId :: Text
$sel:environmentId:DescribeEnvironmentStatus' :: DescribeEnvironmentStatus -> Text
environmentId} -> Text
environmentId) (\s :: DescribeEnvironmentStatus
s@DescribeEnvironmentStatus' {} Text
a -> DescribeEnvironmentStatus
s {$sel:environmentId:DescribeEnvironmentStatus' :: Text
environmentId = Text
a} :: DescribeEnvironmentStatus)
instance Core.AWSRequest DescribeEnvironmentStatus where
type
AWSResponse DescribeEnvironmentStatus =
DescribeEnvironmentStatusResponse
request :: DescribeEnvironmentStatus -> Request DescribeEnvironmentStatus
request = Service
-> DescribeEnvironmentStatus -> Request DescribeEnvironmentStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeEnvironmentStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeEnvironmentStatus)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeEnvironmentStatus))
-> Logger
-> Service
-> Proxy DescribeEnvironmentStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeEnvironmentStatus)))
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 ->
Int
-> EnvironmentStatus -> Text -> DescribeEnvironmentStatusResponse
DescribeEnvironmentStatusResponse'
(Int
-> EnvironmentStatus -> Text -> DescribeEnvironmentStatusResponse)
-> Either String Int
-> Either
String
(EnvironmentStatus -> Text -> DescribeEnvironmentStatusResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String
(EnvironmentStatus -> Text -> DescribeEnvironmentStatusResponse)
-> Either String EnvironmentStatus
-> Either String (Text -> DescribeEnvironmentStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String EnvironmentStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"status")
Either String (Text -> DescribeEnvironmentStatusResponse)
-> Either String Text
-> Either String DescribeEnvironmentStatusResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"message")
)
instance Prelude.Hashable DescribeEnvironmentStatus
instance Prelude.NFData DescribeEnvironmentStatus
instance Core.ToHeaders DescribeEnvironmentStatus where
toHeaders :: DescribeEnvironmentStatus -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeEnvironmentStatus -> 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
"AWSCloud9WorkspaceManagementService.DescribeEnvironmentStatus" ::
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 DescribeEnvironmentStatus where
toJSON :: DescribeEnvironmentStatus -> Value
toJSON DescribeEnvironmentStatus' {Text
environmentId :: Text
$sel:environmentId:DescribeEnvironmentStatus' :: DescribeEnvironmentStatus -> 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
"environmentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
environmentId)
]
)
instance Core.ToPath DescribeEnvironmentStatus where
toPath :: DescribeEnvironmentStatus -> ByteString
toPath = ByteString -> DescribeEnvironmentStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeEnvironmentStatus where
toQuery :: DescribeEnvironmentStatus -> QueryString
toQuery = QueryString -> DescribeEnvironmentStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeEnvironmentStatusResponse = DescribeEnvironmentStatusResponse'
{
DescribeEnvironmentStatusResponse -> Int
httpStatus :: Prelude.Int,
DescribeEnvironmentStatusResponse -> EnvironmentStatus
status :: EnvironmentStatus,
DescribeEnvironmentStatusResponse -> Text
message :: Prelude.Text
}
deriving (DescribeEnvironmentStatusResponse
-> DescribeEnvironmentStatusResponse -> Bool
(DescribeEnvironmentStatusResponse
-> DescribeEnvironmentStatusResponse -> Bool)
-> (DescribeEnvironmentStatusResponse
-> DescribeEnvironmentStatusResponse -> Bool)
-> Eq DescribeEnvironmentStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEnvironmentStatusResponse
-> DescribeEnvironmentStatusResponse -> Bool
$c/= :: DescribeEnvironmentStatusResponse
-> DescribeEnvironmentStatusResponse -> Bool
== :: DescribeEnvironmentStatusResponse
-> DescribeEnvironmentStatusResponse -> Bool
$c== :: DescribeEnvironmentStatusResponse
-> DescribeEnvironmentStatusResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEnvironmentStatusResponse]
ReadPrec DescribeEnvironmentStatusResponse
Int -> ReadS DescribeEnvironmentStatusResponse
ReadS [DescribeEnvironmentStatusResponse]
(Int -> ReadS DescribeEnvironmentStatusResponse)
-> ReadS [DescribeEnvironmentStatusResponse]
-> ReadPrec DescribeEnvironmentStatusResponse
-> ReadPrec [DescribeEnvironmentStatusResponse]
-> Read DescribeEnvironmentStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEnvironmentStatusResponse]
$creadListPrec :: ReadPrec [DescribeEnvironmentStatusResponse]
readPrec :: ReadPrec DescribeEnvironmentStatusResponse
$creadPrec :: ReadPrec DescribeEnvironmentStatusResponse
readList :: ReadS [DescribeEnvironmentStatusResponse]
$creadList :: ReadS [DescribeEnvironmentStatusResponse]
readsPrec :: Int -> ReadS DescribeEnvironmentStatusResponse
$creadsPrec :: Int -> ReadS DescribeEnvironmentStatusResponse
Prelude.Read, Int -> DescribeEnvironmentStatusResponse -> ShowS
[DescribeEnvironmentStatusResponse] -> ShowS
DescribeEnvironmentStatusResponse -> String
(Int -> DescribeEnvironmentStatusResponse -> ShowS)
-> (DescribeEnvironmentStatusResponse -> String)
-> ([DescribeEnvironmentStatusResponse] -> ShowS)
-> Show DescribeEnvironmentStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEnvironmentStatusResponse] -> ShowS
$cshowList :: [DescribeEnvironmentStatusResponse] -> ShowS
show :: DescribeEnvironmentStatusResponse -> String
$cshow :: DescribeEnvironmentStatusResponse -> String
showsPrec :: Int -> DescribeEnvironmentStatusResponse -> ShowS
$cshowsPrec :: Int -> DescribeEnvironmentStatusResponse -> ShowS
Prelude.Show, (forall x.
DescribeEnvironmentStatusResponse
-> Rep DescribeEnvironmentStatusResponse x)
-> (forall x.
Rep DescribeEnvironmentStatusResponse x
-> DescribeEnvironmentStatusResponse)
-> Generic DescribeEnvironmentStatusResponse
forall x.
Rep DescribeEnvironmentStatusResponse x
-> DescribeEnvironmentStatusResponse
forall x.
DescribeEnvironmentStatusResponse
-> Rep DescribeEnvironmentStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEnvironmentStatusResponse x
-> DescribeEnvironmentStatusResponse
$cfrom :: forall x.
DescribeEnvironmentStatusResponse
-> Rep DescribeEnvironmentStatusResponse x
Prelude.Generic)
newDescribeEnvironmentStatusResponse ::
Prelude.Int ->
EnvironmentStatus ->
Prelude.Text ->
DescribeEnvironmentStatusResponse
newDescribeEnvironmentStatusResponse :: Int
-> EnvironmentStatus -> Text -> DescribeEnvironmentStatusResponse
newDescribeEnvironmentStatusResponse
Int
pHttpStatus_
EnvironmentStatus
pStatus_
Text
pMessage_ =
DescribeEnvironmentStatusResponse' :: Int
-> EnvironmentStatus -> Text -> DescribeEnvironmentStatusResponse
DescribeEnvironmentStatusResponse'
{ $sel:httpStatus:DescribeEnvironmentStatusResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:status:DescribeEnvironmentStatusResponse' :: EnvironmentStatus
status = EnvironmentStatus
pStatus_,
$sel:message:DescribeEnvironmentStatusResponse' :: Text
message = Text
pMessage_
}
describeEnvironmentStatusResponse_httpStatus :: Lens.Lens' DescribeEnvironmentStatusResponse Prelude.Int
describeEnvironmentStatusResponse_httpStatus :: (Int -> f Int)
-> DescribeEnvironmentStatusResponse
-> f DescribeEnvironmentStatusResponse
describeEnvironmentStatusResponse_httpStatus = (DescribeEnvironmentStatusResponse -> Int)
-> (DescribeEnvironmentStatusResponse
-> Int -> DescribeEnvironmentStatusResponse)
-> Lens
DescribeEnvironmentStatusResponse
DescribeEnvironmentStatusResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEnvironmentStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeEnvironmentStatusResponse' :: DescribeEnvironmentStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeEnvironmentStatusResponse
s@DescribeEnvironmentStatusResponse' {} Int
a -> DescribeEnvironmentStatusResponse
s {$sel:httpStatus:DescribeEnvironmentStatusResponse' :: Int
httpStatus = Int
a} :: DescribeEnvironmentStatusResponse)
describeEnvironmentStatusResponse_status :: Lens.Lens' DescribeEnvironmentStatusResponse EnvironmentStatus
describeEnvironmentStatusResponse_status :: (EnvironmentStatus -> f EnvironmentStatus)
-> DescribeEnvironmentStatusResponse
-> f DescribeEnvironmentStatusResponse
describeEnvironmentStatusResponse_status = (DescribeEnvironmentStatusResponse -> EnvironmentStatus)
-> (DescribeEnvironmentStatusResponse
-> EnvironmentStatus -> DescribeEnvironmentStatusResponse)
-> Lens
DescribeEnvironmentStatusResponse
DescribeEnvironmentStatusResponse
EnvironmentStatus
EnvironmentStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEnvironmentStatusResponse' {EnvironmentStatus
status :: EnvironmentStatus
$sel:status:DescribeEnvironmentStatusResponse' :: DescribeEnvironmentStatusResponse -> EnvironmentStatus
status} -> EnvironmentStatus
status) (\s :: DescribeEnvironmentStatusResponse
s@DescribeEnvironmentStatusResponse' {} EnvironmentStatus
a -> DescribeEnvironmentStatusResponse
s {$sel:status:DescribeEnvironmentStatusResponse' :: EnvironmentStatus
status = EnvironmentStatus
a} :: DescribeEnvironmentStatusResponse)
describeEnvironmentStatusResponse_message :: Lens.Lens' DescribeEnvironmentStatusResponse Prelude.Text
describeEnvironmentStatusResponse_message :: (Text -> f Text)
-> DescribeEnvironmentStatusResponse
-> f DescribeEnvironmentStatusResponse
describeEnvironmentStatusResponse_message = (DescribeEnvironmentStatusResponse -> Text)
-> (DescribeEnvironmentStatusResponse
-> Text -> DescribeEnvironmentStatusResponse)
-> Lens
DescribeEnvironmentStatusResponse
DescribeEnvironmentStatusResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEnvironmentStatusResponse' {Text
message :: Text
$sel:message:DescribeEnvironmentStatusResponse' :: DescribeEnvironmentStatusResponse -> Text
message} -> Text
message) (\s :: DescribeEnvironmentStatusResponse
s@DescribeEnvironmentStatusResponse' {} Text
a -> DescribeEnvironmentStatusResponse
s {$sel:message:DescribeEnvironmentStatusResponse' :: Text
message = Text
a} :: DescribeEnvironmentStatusResponse)
instance
Prelude.NFData
DescribeEnvironmentStatusResponse