{-# 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.GetBackendEnvironment
(
GetBackendEnvironment (..),
newGetBackendEnvironment,
getBackendEnvironment_appId,
getBackendEnvironment_environmentName,
GetBackendEnvironmentResponse (..),
newGetBackendEnvironmentResponse,
getBackendEnvironmentResponse_httpStatus,
getBackendEnvironmentResponse_backendEnvironment,
)
where
import Amazonka.Amplify.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 GetBackendEnvironment = GetBackendEnvironment'
{
GetBackendEnvironment -> Text
appId :: Prelude.Text,
GetBackendEnvironment -> Text
environmentName :: Prelude.Text
}
deriving (GetBackendEnvironment -> GetBackendEnvironment -> Bool
(GetBackendEnvironment -> GetBackendEnvironment -> Bool)
-> (GetBackendEnvironment -> GetBackendEnvironment -> Bool)
-> Eq GetBackendEnvironment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBackendEnvironment -> GetBackendEnvironment -> Bool
$c/= :: GetBackendEnvironment -> GetBackendEnvironment -> Bool
== :: GetBackendEnvironment -> GetBackendEnvironment -> Bool
$c== :: GetBackendEnvironment -> GetBackendEnvironment -> Bool
Prelude.Eq, ReadPrec [GetBackendEnvironment]
ReadPrec GetBackendEnvironment
Int -> ReadS GetBackendEnvironment
ReadS [GetBackendEnvironment]
(Int -> ReadS GetBackendEnvironment)
-> ReadS [GetBackendEnvironment]
-> ReadPrec GetBackendEnvironment
-> ReadPrec [GetBackendEnvironment]
-> Read GetBackendEnvironment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBackendEnvironment]
$creadListPrec :: ReadPrec [GetBackendEnvironment]
readPrec :: ReadPrec GetBackendEnvironment
$creadPrec :: ReadPrec GetBackendEnvironment
readList :: ReadS [GetBackendEnvironment]
$creadList :: ReadS [GetBackendEnvironment]
readsPrec :: Int -> ReadS GetBackendEnvironment
$creadsPrec :: Int -> ReadS GetBackendEnvironment
Prelude.Read, Int -> GetBackendEnvironment -> ShowS
[GetBackendEnvironment] -> ShowS
GetBackendEnvironment -> String
(Int -> GetBackendEnvironment -> ShowS)
-> (GetBackendEnvironment -> String)
-> ([GetBackendEnvironment] -> ShowS)
-> Show GetBackendEnvironment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBackendEnvironment] -> ShowS
$cshowList :: [GetBackendEnvironment] -> ShowS
show :: GetBackendEnvironment -> String
$cshow :: GetBackendEnvironment -> String
showsPrec :: Int -> GetBackendEnvironment -> ShowS
$cshowsPrec :: Int -> GetBackendEnvironment -> ShowS
Prelude.Show, (forall x. GetBackendEnvironment -> Rep GetBackendEnvironment x)
-> (forall x. Rep GetBackendEnvironment x -> GetBackendEnvironment)
-> Generic GetBackendEnvironment
forall x. Rep GetBackendEnvironment x -> GetBackendEnvironment
forall x. GetBackendEnvironment -> Rep GetBackendEnvironment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBackendEnvironment x -> GetBackendEnvironment
$cfrom :: forall x. GetBackendEnvironment -> Rep GetBackendEnvironment x
Prelude.Generic)
newGetBackendEnvironment ::
Prelude.Text ->
Prelude.Text ->
GetBackendEnvironment
newGetBackendEnvironment :: Text -> Text -> GetBackendEnvironment
newGetBackendEnvironment Text
pAppId_ Text
pEnvironmentName_ =
GetBackendEnvironment' :: Text -> Text -> GetBackendEnvironment
GetBackendEnvironment'
{ $sel:appId:GetBackendEnvironment' :: Text
appId = Text
pAppId_,
$sel:environmentName:GetBackendEnvironment' :: Text
environmentName = Text
pEnvironmentName_
}
getBackendEnvironment_appId :: Lens.Lens' GetBackendEnvironment Prelude.Text
getBackendEnvironment_appId :: (Text -> f Text)
-> GetBackendEnvironment -> f GetBackendEnvironment
getBackendEnvironment_appId = (GetBackendEnvironment -> Text)
-> (GetBackendEnvironment -> Text -> GetBackendEnvironment)
-> Lens GetBackendEnvironment GetBackendEnvironment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendEnvironment' {Text
appId :: Text
$sel:appId:GetBackendEnvironment' :: GetBackendEnvironment -> Text
appId} -> Text
appId) (\s :: GetBackendEnvironment
s@GetBackendEnvironment' {} Text
a -> GetBackendEnvironment
s {$sel:appId:GetBackendEnvironment' :: Text
appId = Text
a} :: GetBackendEnvironment)
getBackendEnvironment_environmentName :: Lens.Lens' GetBackendEnvironment Prelude.Text
getBackendEnvironment_environmentName :: (Text -> f Text)
-> GetBackendEnvironment -> f GetBackendEnvironment
getBackendEnvironment_environmentName = (GetBackendEnvironment -> Text)
-> (GetBackendEnvironment -> Text -> GetBackendEnvironment)
-> Lens GetBackendEnvironment GetBackendEnvironment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendEnvironment' {Text
environmentName :: Text
$sel:environmentName:GetBackendEnvironment' :: GetBackendEnvironment -> Text
environmentName} -> Text
environmentName) (\s :: GetBackendEnvironment
s@GetBackendEnvironment' {} Text
a -> GetBackendEnvironment
s {$sel:environmentName:GetBackendEnvironment' :: Text
environmentName = Text
a} :: GetBackendEnvironment)
instance Core.AWSRequest GetBackendEnvironment where
type
AWSResponse GetBackendEnvironment =
GetBackendEnvironmentResponse
request :: GetBackendEnvironment -> Request GetBackendEnvironment
request = Service -> GetBackendEnvironment -> Request GetBackendEnvironment
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetBackendEnvironment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetBackendEnvironment)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetBackendEnvironment))
-> Logger
-> Service
-> Proxy GetBackendEnvironment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetBackendEnvironment)))
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 -> BackendEnvironment -> GetBackendEnvironmentResponse
GetBackendEnvironmentResponse'
(Int -> BackendEnvironment -> GetBackendEnvironmentResponse)
-> Either String Int
-> Either
String (BackendEnvironment -> GetBackendEnvironmentResponse)
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 (BackendEnvironment -> GetBackendEnvironmentResponse)
-> Either String BackendEnvironment
-> Either String GetBackendEnvironmentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String BackendEnvironment
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"backendEnvironment")
)
instance Prelude.Hashable GetBackendEnvironment
instance Prelude.NFData GetBackendEnvironment
instance Core.ToHeaders GetBackendEnvironment where
toHeaders :: GetBackendEnvironment -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetBackendEnvironment -> 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 GetBackendEnvironment where
toPath :: GetBackendEnvironment -> ByteString
toPath GetBackendEnvironment' {Text
environmentName :: Text
appId :: Text
$sel:environmentName:GetBackendEnvironment' :: GetBackendEnvironment -> Text
$sel:appId:GetBackendEnvironment' :: GetBackendEnvironment -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/apps/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId,
ByteString
"/backendenvironments/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
environmentName
]
instance Core.ToQuery GetBackendEnvironment where
toQuery :: GetBackendEnvironment -> QueryString
toQuery = QueryString -> GetBackendEnvironment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetBackendEnvironmentResponse = GetBackendEnvironmentResponse'
{
GetBackendEnvironmentResponse -> Int
httpStatus :: Prelude.Int,
GetBackendEnvironmentResponse -> BackendEnvironment
backendEnvironment :: BackendEnvironment
}
deriving (GetBackendEnvironmentResponse
-> GetBackendEnvironmentResponse -> Bool
(GetBackendEnvironmentResponse
-> GetBackendEnvironmentResponse -> Bool)
-> (GetBackendEnvironmentResponse
-> GetBackendEnvironmentResponse -> Bool)
-> Eq GetBackendEnvironmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBackendEnvironmentResponse
-> GetBackendEnvironmentResponse -> Bool
$c/= :: GetBackendEnvironmentResponse
-> GetBackendEnvironmentResponse -> Bool
== :: GetBackendEnvironmentResponse
-> GetBackendEnvironmentResponse -> Bool
$c== :: GetBackendEnvironmentResponse
-> GetBackendEnvironmentResponse -> Bool
Prelude.Eq, ReadPrec [GetBackendEnvironmentResponse]
ReadPrec GetBackendEnvironmentResponse
Int -> ReadS GetBackendEnvironmentResponse
ReadS [GetBackendEnvironmentResponse]
(Int -> ReadS GetBackendEnvironmentResponse)
-> ReadS [GetBackendEnvironmentResponse]
-> ReadPrec GetBackendEnvironmentResponse
-> ReadPrec [GetBackendEnvironmentResponse]
-> Read GetBackendEnvironmentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBackendEnvironmentResponse]
$creadListPrec :: ReadPrec [GetBackendEnvironmentResponse]
readPrec :: ReadPrec GetBackendEnvironmentResponse
$creadPrec :: ReadPrec GetBackendEnvironmentResponse
readList :: ReadS [GetBackendEnvironmentResponse]
$creadList :: ReadS [GetBackendEnvironmentResponse]
readsPrec :: Int -> ReadS GetBackendEnvironmentResponse
$creadsPrec :: Int -> ReadS GetBackendEnvironmentResponse
Prelude.Read, Int -> GetBackendEnvironmentResponse -> ShowS
[GetBackendEnvironmentResponse] -> ShowS
GetBackendEnvironmentResponse -> String
(Int -> GetBackendEnvironmentResponse -> ShowS)
-> (GetBackendEnvironmentResponse -> String)
-> ([GetBackendEnvironmentResponse] -> ShowS)
-> Show GetBackendEnvironmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBackendEnvironmentResponse] -> ShowS
$cshowList :: [GetBackendEnvironmentResponse] -> ShowS
show :: GetBackendEnvironmentResponse -> String
$cshow :: GetBackendEnvironmentResponse -> String
showsPrec :: Int -> GetBackendEnvironmentResponse -> ShowS
$cshowsPrec :: Int -> GetBackendEnvironmentResponse -> ShowS
Prelude.Show, (forall x.
GetBackendEnvironmentResponse
-> Rep GetBackendEnvironmentResponse x)
-> (forall x.
Rep GetBackendEnvironmentResponse x
-> GetBackendEnvironmentResponse)
-> Generic GetBackendEnvironmentResponse
forall x.
Rep GetBackendEnvironmentResponse x
-> GetBackendEnvironmentResponse
forall x.
GetBackendEnvironmentResponse
-> Rep GetBackendEnvironmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBackendEnvironmentResponse x
-> GetBackendEnvironmentResponse
$cfrom :: forall x.
GetBackendEnvironmentResponse
-> Rep GetBackendEnvironmentResponse x
Prelude.Generic)
newGetBackendEnvironmentResponse ::
Prelude.Int ->
BackendEnvironment ->
GetBackendEnvironmentResponse
newGetBackendEnvironmentResponse :: Int -> BackendEnvironment -> GetBackendEnvironmentResponse
newGetBackendEnvironmentResponse
Int
pHttpStatus_
BackendEnvironment
pBackendEnvironment_ =
GetBackendEnvironmentResponse' :: Int -> BackendEnvironment -> GetBackendEnvironmentResponse
GetBackendEnvironmentResponse'
{ $sel:httpStatus:GetBackendEnvironmentResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:backendEnvironment:GetBackendEnvironmentResponse' :: BackendEnvironment
backendEnvironment = BackendEnvironment
pBackendEnvironment_
}
getBackendEnvironmentResponse_httpStatus :: Lens.Lens' GetBackendEnvironmentResponse Prelude.Int
getBackendEnvironmentResponse_httpStatus :: (Int -> f Int)
-> GetBackendEnvironmentResponse -> f GetBackendEnvironmentResponse
getBackendEnvironmentResponse_httpStatus = (GetBackendEnvironmentResponse -> Int)
-> (GetBackendEnvironmentResponse
-> Int -> GetBackendEnvironmentResponse)
-> Lens
GetBackendEnvironmentResponse GetBackendEnvironmentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendEnvironmentResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBackendEnvironmentResponse' :: GetBackendEnvironmentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBackendEnvironmentResponse
s@GetBackendEnvironmentResponse' {} Int
a -> GetBackendEnvironmentResponse
s {$sel:httpStatus:GetBackendEnvironmentResponse' :: Int
httpStatus = Int
a} :: GetBackendEnvironmentResponse)
getBackendEnvironmentResponse_backendEnvironment :: Lens.Lens' GetBackendEnvironmentResponse BackendEnvironment
getBackendEnvironmentResponse_backendEnvironment :: (BackendEnvironment -> f BackendEnvironment)
-> GetBackendEnvironmentResponse -> f GetBackendEnvironmentResponse
getBackendEnvironmentResponse_backendEnvironment = (GetBackendEnvironmentResponse -> BackendEnvironment)
-> (GetBackendEnvironmentResponse
-> BackendEnvironment -> GetBackendEnvironmentResponse)
-> Lens
GetBackendEnvironmentResponse
GetBackendEnvironmentResponse
BackendEnvironment
BackendEnvironment
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackendEnvironmentResponse' {BackendEnvironment
backendEnvironment :: BackendEnvironment
$sel:backendEnvironment:GetBackendEnvironmentResponse' :: GetBackendEnvironmentResponse -> BackendEnvironment
backendEnvironment} -> BackendEnvironment
backendEnvironment) (\s :: GetBackendEnvironmentResponse
s@GetBackendEnvironmentResponse' {} BackendEnvironment
a -> GetBackendEnvironmentResponse
s {$sel:backendEnvironment:GetBackendEnvironmentResponse' :: BackendEnvironment
backendEnvironment = BackendEnvironment
a} :: GetBackendEnvironmentResponse)
instance Prelude.NFData GetBackendEnvironmentResponse