{-# 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.AppStream.StopImageBuilder
(
StopImageBuilder (..),
newStopImageBuilder,
stopImageBuilder_name,
StopImageBuilderResponse (..),
newStopImageBuilderResponse,
stopImageBuilderResponse_imageBuilder,
stopImageBuilderResponse_httpStatus,
)
where
import Amazonka.AppStream.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 StopImageBuilder = StopImageBuilder'
{
StopImageBuilder -> Text
name :: Prelude.Text
}
deriving (StopImageBuilder -> StopImageBuilder -> Bool
(StopImageBuilder -> StopImageBuilder -> Bool)
-> (StopImageBuilder -> StopImageBuilder -> Bool)
-> Eq StopImageBuilder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopImageBuilder -> StopImageBuilder -> Bool
$c/= :: StopImageBuilder -> StopImageBuilder -> Bool
== :: StopImageBuilder -> StopImageBuilder -> Bool
$c== :: StopImageBuilder -> StopImageBuilder -> Bool
Prelude.Eq, ReadPrec [StopImageBuilder]
ReadPrec StopImageBuilder
Int -> ReadS StopImageBuilder
ReadS [StopImageBuilder]
(Int -> ReadS StopImageBuilder)
-> ReadS [StopImageBuilder]
-> ReadPrec StopImageBuilder
-> ReadPrec [StopImageBuilder]
-> Read StopImageBuilder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopImageBuilder]
$creadListPrec :: ReadPrec [StopImageBuilder]
readPrec :: ReadPrec StopImageBuilder
$creadPrec :: ReadPrec StopImageBuilder
readList :: ReadS [StopImageBuilder]
$creadList :: ReadS [StopImageBuilder]
readsPrec :: Int -> ReadS StopImageBuilder
$creadsPrec :: Int -> ReadS StopImageBuilder
Prelude.Read, Int -> StopImageBuilder -> ShowS
[StopImageBuilder] -> ShowS
StopImageBuilder -> String
(Int -> StopImageBuilder -> ShowS)
-> (StopImageBuilder -> String)
-> ([StopImageBuilder] -> ShowS)
-> Show StopImageBuilder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopImageBuilder] -> ShowS
$cshowList :: [StopImageBuilder] -> ShowS
show :: StopImageBuilder -> String
$cshow :: StopImageBuilder -> String
showsPrec :: Int -> StopImageBuilder -> ShowS
$cshowsPrec :: Int -> StopImageBuilder -> ShowS
Prelude.Show, (forall x. StopImageBuilder -> Rep StopImageBuilder x)
-> (forall x. Rep StopImageBuilder x -> StopImageBuilder)
-> Generic StopImageBuilder
forall x. Rep StopImageBuilder x -> StopImageBuilder
forall x. StopImageBuilder -> Rep StopImageBuilder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopImageBuilder x -> StopImageBuilder
$cfrom :: forall x. StopImageBuilder -> Rep StopImageBuilder x
Prelude.Generic)
newStopImageBuilder ::
Prelude.Text ->
StopImageBuilder
newStopImageBuilder :: Text -> StopImageBuilder
newStopImageBuilder Text
pName_ =
StopImageBuilder' :: Text -> StopImageBuilder
StopImageBuilder' {$sel:name:StopImageBuilder' :: Text
name = Text
pName_}
stopImageBuilder_name :: Lens.Lens' StopImageBuilder Prelude.Text
stopImageBuilder_name :: (Text -> f Text) -> StopImageBuilder -> f StopImageBuilder
stopImageBuilder_name = (StopImageBuilder -> Text)
-> (StopImageBuilder -> Text -> StopImageBuilder)
-> Lens StopImageBuilder StopImageBuilder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopImageBuilder' {Text
name :: Text
$sel:name:StopImageBuilder' :: StopImageBuilder -> Text
name} -> Text
name) (\s :: StopImageBuilder
s@StopImageBuilder' {} Text
a -> StopImageBuilder
s {$sel:name:StopImageBuilder' :: Text
name = Text
a} :: StopImageBuilder)
instance Core.AWSRequest StopImageBuilder where
type
AWSResponse StopImageBuilder =
StopImageBuilderResponse
request :: StopImageBuilder -> Request StopImageBuilder
request = Service -> StopImageBuilder -> Request StopImageBuilder
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopImageBuilder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopImageBuilder)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopImageBuilder))
-> Logger
-> Service
-> Proxy StopImageBuilder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopImageBuilder)))
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 ImageBuilder -> Int -> StopImageBuilderResponse
StopImageBuilderResponse'
(Maybe ImageBuilder -> Int -> StopImageBuilderResponse)
-> Either String (Maybe ImageBuilder)
-> Either String (Int -> StopImageBuilderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ImageBuilder)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ImageBuilder")
Either String (Int -> StopImageBuilderResponse)
-> Either String Int -> Either String StopImageBuilderResponse
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 StopImageBuilder
instance Prelude.NFData StopImageBuilder
instance Core.ToHeaders StopImageBuilder where
toHeaders :: StopImageBuilder -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopImageBuilder -> 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
"PhotonAdminProxyService.StopImageBuilder" ::
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 StopImageBuilder where
toJSON :: StopImageBuilder -> Value
toJSON StopImageBuilder' {Text
name :: Text
$sel:name:StopImageBuilder' :: StopImageBuilder -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath StopImageBuilder where
toPath :: StopImageBuilder -> ByteString
toPath = ByteString -> StopImageBuilder -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopImageBuilder where
toQuery :: StopImageBuilder -> QueryString
toQuery = QueryString -> StopImageBuilder -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopImageBuilderResponse = StopImageBuilderResponse'
{
StopImageBuilderResponse -> Maybe ImageBuilder
imageBuilder :: Prelude.Maybe ImageBuilder,
StopImageBuilderResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopImageBuilderResponse -> StopImageBuilderResponse -> Bool
(StopImageBuilderResponse -> StopImageBuilderResponse -> Bool)
-> (StopImageBuilderResponse -> StopImageBuilderResponse -> Bool)
-> Eq StopImageBuilderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopImageBuilderResponse -> StopImageBuilderResponse -> Bool
$c/= :: StopImageBuilderResponse -> StopImageBuilderResponse -> Bool
== :: StopImageBuilderResponse -> StopImageBuilderResponse -> Bool
$c== :: StopImageBuilderResponse -> StopImageBuilderResponse -> Bool
Prelude.Eq, ReadPrec [StopImageBuilderResponse]
ReadPrec StopImageBuilderResponse
Int -> ReadS StopImageBuilderResponse
ReadS [StopImageBuilderResponse]
(Int -> ReadS StopImageBuilderResponse)
-> ReadS [StopImageBuilderResponse]
-> ReadPrec StopImageBuilderResponse
-> ReadPrec [StopImageBuilderResponse]
-> Read StopImageBuilderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopImageBuilderResponse]
$creadListPrec :: ReadPrec [StopImageBuilderResponse]
readPrec :: ReadPrec StopImageBuilderResponse
$creadPrec :: ReadPrec StopImageBuilderResponse
readList :: ReadS [StopImageBuilderResponse]
$creadList :: ReadS [StopImageBuilderResponse]
readsPrec :: Int -> ReadS StopImageBuilderResponse
$creadsPrec :: Int -> ReadS StopImageBuilderResponse
Prelude.Read, Int -> StopImageBuilderResponse -> ShowS
[StopImageBuilderResponse] -> ShowS
StopImageBuilderResponse -> String
(Int -> StopImageBuilderResponse -> ShowS)
-> (StopImageBuilderResponse -> String)
-> ([StopImageBuilderResponse] -> ShowS)
-> Show StopImageBuilderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopImageBuilderResponse] -> ShowS
$cshowList :: [StopImageBuilderResponse] -> ShowS
show :: StopImageBuilderResponse -> String
$cshow :: StopImageBuilderResponse -> String
showsPrec :: Int -> StopImageBuilderResponse -> ShowS
$cshowsPrec :: Int -> StopImageBuilderResponse -> ShowS
Prelude.Show, (forall x.
StopImageBuilderResponse -> Rep StopImageBuilderResponse x)
-> (forall x.
Rep StopImageBuilderResponse x -> StopImageBuilderResponse)
-> Generic StopImageBuilderResponse
forall x.
Rep StopImageBuilderResponse x -> StopImageBuilderResponse
forall x.
StopImageBuilderResponse -> Rep StopImageBuilderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopImageBuilderResponse x -> StopImageBuilderResponse
$cfrom :: forall x.
StopImageBuilderResponse -> Rep StopImageBuilderResponse x
Prelude.Generic)
newStopImageBuilderResponse ::
Prelude.Int ->
StopImageBuilderResponse
newStopImageBuilderResponse :: Int -> StopImageBuilderResponse
newStopImageBuilderResponse Int
pHttpStatus_ =
StopImageBuilderResponse' :: Maybe ImageBuilder -> Int -> StopImageBuilderResponse
StopImageBuilderResponse'
{ $sel:imageBuilder:StopImageBuilderResponse' :: Maybe ImageBuilder
imageBuilder =
Maybe ImageBuilder
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopImageBuilderResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopImageBuilderResponse_imageBuilder :: Lens.Lens' StopImageBuilderResponse (Prelude.Maybe ImageBuilder)
stopImageBuilderResponse_imageBuilder :: (Maybe ImageBuilder -> f (Maybe ImageBuilder))
-> StopImageBuilderResponse -> f StopImageBuilderResponse
stopImageBuilderResponse_imageBuilder = (StopImageBuilderResponse -> Maybe ImageBuilder)
-> (StopImageBuilderResponse
-> Maybe ImageBuilder -> StopImageBuilderResponse)
-> Lens
StopImageBuilderResponse
StopImageBuilderResponse
(Maybe ImageBuilder)
(Maybe ImageBuilder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopImageBuilderResponse' {Maybe ImageBuilder
imageBuilder :: Maybe ImageBuilder
$sel:imageBuilder:StopImageBuilderResponse' :: StopImageBuilderResponse -> Maybe ImageBuilder
imageBuilder} -> Maybe ImageBuilder
imageBuilder) (\s :: StopImageBuilderResponse
s@StopImageBuilderResponse' {} Maybe ImageBuilder
a -> StopImageBuilderResponse
s {$sel:imageBuilder:StopImageBuilderResponse' :: Maybe ImageBuilder
imageBuilder = Maybe ImageBuilder
a} :: StopImageBuilderResponse)
stopImageBuilderResponse_httpStatus :: Lens.Lens' StopImageBuilderResponse Prelude.Int
stopImageBuilderResponse_httpStatus :: (Int -> f Int)
-> StopImageBuilderResponse -> f StopImageBuilderResponse
stopImageBuilderResponse_httpStatus = (StopImageBuilderResponse -> Int)
-> (StopImageBuilderResponse -> Int -> StopImageBuilderResponse)
-> Lens StopImageBuilderResponse StopImageBuilderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopImageBuilderResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopImageBuilderResponse' :: StopImageBuilderResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopImageBuilderResponse
s@StopImageBuilderResponse' {} Int
a -> StopImageBuilderResponse
s {$sel:httpStatus:StopImageBuilderResponse' :: Int
httpStatus = Int
a} :: StopImageBuilderResponse)
instance Prelude.NFData StopImageBuilderResponse