{-# 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.Snowball.CancelCluster
(
CancelCluster (..),
newCancelCluster,
cancelCluster_clusterId,
CancelClusterResponse (..),
newCancelClusterResponse,
cancelClusterResponse_httpStatus,
)
where
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
import Amazonka.Snowball.Types
data CancelCluster = CancelCluster'
{
CancelCluster -> Text
clusterId :: Prelude.Text
}
deriving (CancelCluster -> CancelCluster -> Bool
(CancelCluster -> CancelCluster -> Bool)
-> (CancelCluster -> CancelCluster -> Bool) -> Eq CancelCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelCluster -> CancelCluster -> Bool
$c/= :: CancelCluster -> CancelCluster -> Bool
== :: CancelCluster -> CancelCluster -> Bool
$c== :: CancelCluster -> CancelCluster -> Bool
Prelude.Eq, ReadPrec [CancelCluster]
ReadPrec CancelCluster
Int -> ReadS CancelCluster
ReadS [CancelCluster]
(Int -> ReadS CancelCluster)
-> ReadS [CancelCluster]
-> ReadPrec CancelCluster
-> ReadPrec [CancelCluster]
-> Read CancelCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelCluster]
$creadListPrec :: ReadPrec [CancelCluster]
readPrec :: ReadPrec CancelCluster
$creadPrec :: ReadPrec CancelCluster
readList :: ReadS [CancelCluster]
$creadList :: ReadS [CancelCluster]
readsPrec :: Int -> ReadS CancelCluster
$creadsPrec :: Int -> ReadS CancelCluster
Prelude.Read, Int -> CancelCluster -> ShowS
[CancelCluster] -> ShowS
CancelCluster -> String
(Int -> CancelCluster -> ShowS)
-> (CancelCluster -> String)
-> ([CancelCluster] -> ShowS)
-> Show CancelCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelCluster] -> ShowS
$cshowList :: [CancelCluster] -> ShowS
show :: CancelCluster -> String
$cshow :: CancelCluster -> String
showsPrec :: Int -> CancelCluster -> ShowS
$cshowsPrec :: Int -> CancelCluster -> ShowS
Prelude.Show, (forall x. CancelCluster -> Rep CancelCluster x)
-> (forall x. Rep CancelCluster x -> CancelCluster)
-> Generic CancelCluster
forall x. Rep CancelCluster x -> CancelCluster
forall x. CancelCluster -> Rep CancelCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelCluster x -> CancelCluster
$cfrom :: forall x. CancelCluster -> Rep CancelCluster x
Prelude.Generic)
newCancelCluster ::
Prelude.Text ->
CancelCluster
newCancelCluster :: Text -> CancelCluster
newCancelCluster Text
pClusterId_ =
CancelCluster' :: Text -> CancelCluster
CancelCluster' {$sel:clusterId:CancelCluster' :: Text
clusterId = Text
pClusterId_}
cancelCluster_clusterId :: Lens.Lens' CancelCluster Prelude.Text
cancelCluster_clusterId :: (Text -> f Text) -> CancelCluster -> f CancelCluster
cancelCluster_clusterId = (CancelCluster -> Text)
-> (CancelCluster -> Text -> CancelCluster)
-> Lens CancelCluster CancelCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelCluster' {Text
clusterId :: Text
$sel:clusterId:CancelCluster' :: CancelCluster -> Text
clusterId} -> Text
clusterId) (\s :: CancelCluster
s@CancelCluster' {} Text
a -> CancelCluster
s {$sel:clusterId:CancelCluster' :: Text
clusterId = Text
a} :: CancelCluster)
instance Core.AWSRequest CancelCluster where
type
AWSResponse CancelCluster =
CancelClusterResponse
request :: CancelCluster -> Request CancelCluster
request = Service -> CancelCluster -> Request CancelCluster
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CancelCluster)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CancelCluster))
-> Logger
-> Service
-> Proxy CancelCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CancelCluster)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> CancelClusterResponse
CancelClusterResponse'
(Int -> CancelClusterResponse)
-> Either String Int -> Either String CancelClusterResponse
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))
)
instance Prelude.Hashable CancelCluster
instance Prelude.NFData CancelCluster
instance Core.ToHeaders CancelCluster where
toHeaders :: CancelCluster -> ResponseHeaders
toHeaders =
ResponseHeaders -> CancelCluster -> 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
"AWSIESnowballJobManagementService.CancelCluster" ::
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 CancelCluster where
toJSON :: CancelCluster -> Value
toJSON CancelCluster' {Text
clusterId :: Text
$sel:clusterId:CancelCluster' :: CancelCluster -> 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
"ClusterId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterId)]
)
instance Core.ToPath CancelCluster where
toPath :: CancelCluster -> ByteString
toPath = ByteString -> CancelCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelCluster where
toQuery :: CancelCluster -> QueryString
toQuery = QueryString -> CancelCluster -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelClusterResponse = CancelClusterResponse'
{
CancelClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelClusterResponse -> CancelClusterResponse -> Bool
(CancelClusterResponse -> CancelClusterResponse -> Bool)
-> (CancelClusterResponse -> CancelClusterResponse -> Bool)
-> Eq CancelClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelClusterResponse -> CancelClusterResponse -> Bool
$c/= :: CancelClusterResponse -> CancelClusterResponse -> Bool
== :: CancelClusterResponse -> CancelClusterResponse -> Bool
$c== :: CancelClusterResponse -> CancelClusterResponse -> Bool
Prelude.Eq, ReadPrec [CancelClusterResponse]
ReadPrec CancelClusterResponse
Int -> ReadS CancelClusterResponse
ReadS [CancelClusterResponse]
(Int -> ReadS CancelClusterResponse)
-> ReadS [CancelClusterResponse]
-> ReadPrec CancelClusterResponse
-> ReadPrec [CancelClusterResponse]
-> Read CancelClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelClusterResponse]
$creadListPrec :: ReadPrec [CancelClusterResponse]
readPrec :: ReadPrec CancelClusterResponse
$creadPrec :: ReadPrec CancelClusterResponse
readList :: ReadS [CancelClusterResponse]
$creadList :: ReadS [CancelClusterResponse]
readsPrec :: Int -> ReadS CancelClusterResponse
$creadsPrec :: Int -> ReadS CancelClusterResponse
Prelude.Read, Int -> CancelClusterResponse -> ShowS
[CancelClusterResponse] -> ShowS
CancelClusterResponse -> String
(Int -> CancelClusterResponse -> ShowS)
-> (CancelClusterResponse -> String)
-> ([CancelClusterResponse] -> ShowS)
-> Show CancelClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelClusterResponse] -> ShowS
$cshowList :: [CancelClusterResponse] -> ShowS
show :: CancelClusterResponse -> String
$cshow :: CancelClusterResponse -> String
showsPrec :: Int -> CancelClusterResponse -> ShowS
$cshowsPrec :: Int -> CancelClusterResponse -> ShowS
Prelude.Show, (forall x. CancelClusterResponse -> Rep CancelClusterResponse x)
-> (forall x. Rep CancelClusterResponse x -> CancelClusterResponse)
-> Generic CancelClusterResponse
forall x. Rep CancelClusterResponse x -> CancelClusterResponse
forall x. CancelClusterResponse -> Rep CancelClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelClusterResponse x -> CancelClusterResponse
$cfrom :: forall x. CancelClusterResponse -> Rep CancelClusterResponse x
Prelude.Generic)
newCancelClusterResponse ::
Prelude.Int ->
CancelClusterResponse
newCancelClusterResponse :: Int -> CancelClusterResponse
newCancelClusterResponse Int
pHttpStatus_ =
CancelClusterResponse' :: Int -> CancelClusterResponse
CancelClusterResponse' {$sel:httpStatus:CancelClusterResponse' :: Int
httpStatus = Int
pHttpStatus_}
cancelClusterResponse_httpStatus :: Lens.Lens' CancelClusterResponse Prelude.Int
cancelClusterResponse_httpStatus :: (Int -> f Int) -> CancelClusterResponse -> f CancelClusterResponse
cancelClusterResponse_httpStatus = (CancelClusterResponse -> Int)
-> (CancelClusterResponse -> Int -> CancelClusterResponse)
-> Lens CancelClusterResponse CancelClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelClusterResponse' :: CancelClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelClusterResponse
s@CancelClusterResponse' {} Int
a -> CancelClusterResponse
s {$sel:httpStatus:CancelClusterResponse' :: Int
httpStatus = Int
a} :: CancelClusterResponse)
instance Prelude.NFData CancelClusterResponse