{-# 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.GameLift.DeleteScalingPolicy
(
DeleteScalingPolicy (..),
newDeleteScalingPolicy,
deleteScalingPolicy_name,
deleteScalingPolicy_fleetId,
DeleteScalingPolicyResponse (..),
newDeleteScalingPolicyResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
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 DeleteScalingPolicy = DeleteScalingPolicy'
{
DeleteScalingPolicy -> Text
name :: Prelude.Text,
DeleteScalingPolicy -> Text
fleetId :: Prelude.Text
}
deriving (DeleteScalingPolicy -> DeleteScalingPolicy -> Bool
(DeleteScalingPolicy -> DeleteScalingPolicy -> Bool)
-> (DeleteScalingPolicy -> DeleteScalingPolicy -> Bool)
-> Eq DeleteScalingPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteScalingPolicy -> DeleteScalingPolicy -> Bool
$c/= :: DeleteScalingPolicy -> DeleteScalingPolicy -> Bool
== :: DeleteScalingPolicy -> DeleteScalingPolicy -> Bool
$c== :: DeleteScalingPolicy -> DeleteScalingPolicy -> Bool
Prelude.Eq, ReadPrec [DeleteScalingPolicy]
ReadPrec DeleteScalingPolicy
Int -> ReadS DeleteScalingPolicy
ReadS [DeleteScalingPolicy]
(Int -> ReadS DeleteScalingPolicy)
-> ReadS [DeleteScalingPolicy]
-> ReadPrec DeleteScalingPolicy
-> ReadPrec [DeleteScalingPolicy]
-> Read DeleteScalingPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteScalingPolicy]
$creadListPrec :: ReadPrec [DeleteScalingPolicy]
readPrec :: ReadPrec DeleteScalingPolicy
$creadPrec :: ReadPrec DeleteScalingPolicy
readList :: ReadS [DeleteScalingPolicy]
$creadList :: ReadS [DeleteScalingPolicy]
readsPrec :: Int -> ReadS DeleteScalingPolicy
$creadsPrec :: Int -> ReadS DeleteScalingPolicy
Prelude.Read, Int -> DeleteScalingPolicy -> ShowS
[DeleteScalingPolicy] -> ShowS
DeleteScalingPolicy -> String
(Int -> DeleteScalingPolicy -> ShowS)
-> (DeleteScalingPolicy -> String)
-> ([DeleteScalingPolicy] -> ShowS)
-> Show DeleteScalingPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteScalingPolicy] -> ShowS
$cshowList :: [DeleteScalingPolicy] -> ShowS
show :: DeleteScalingPolicy -> String
$cshow :: DeleteScalingPolicy -> String
showsPrec :: Int -> DeleteScalingPolicy -> ShowS
$cshowsPrec :: Int -> DeleteScalingPolicy -> ShowS
Prelude.Show, (forall x. DeleteScalingPolicy -> Rep DeleteScalingPolicy x)
-> (forall x. Rep DeleteScalingPolicy x -> DeleteScalingPolicy)
-> Generic DeleteScalingPolicy
forall x. Rep DeleteScalingPolicy x -> DeleteScalingPolicy
forall x. DeleteScalingPolicy -> Rep DeleteScalingPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteScalingPolicy x -> DeleteScalingPolicy
$cfrom :: forall x. DeleteScalingPolicy -> Rep DeleteScalingPolicy x
Prelude.Generic)
newDeleteScalingPolicy ::
Prelude.Text ->
Prelude.Text ->
DeleteScalingPolicy
newDeleteScalingPolicy :: Text -> Text -> DeleteScalingPolicy
newDeleteScalingPolicy Text
pName_ Text
pFleetId_ =
DeleteScalingPolicy' :: Text -> Text -> DeleteScalingPolicy
DeleteScalingPolicy'
{ $sel:name:DeleteScalingPolicy' :: Text
name = Text
pName_,
$sel:fleetId:DeleteScalingPolicy' :: Text
fleetId = Text
pFleetId_
}
deleteScalingPolicy_name :: Lens.Lens' DeleteScalingPolicy Prelude.Text
deleteScalingPolicy_name :: (Text -> f Text) -> DeleteScalingPolicy -> f DeleteScalingPolicy
deleteScalingPolicy_name = (DeleteScalingPolicy -> Text)
-> (DeleteScalingPolicy -> Text -> DeleteScalingPolicy)
-> Lens DeleteScalingPolicy DeleteScalingPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteScalingPolicy' {Text
name :: Text
$sel:name:DeleteScalingPolicy' :: DeleteScalingPolicy -> Text
name} -> Text
name) (\s :: DeleteScalingPolicy
s@DeleteScalingPolicy' {} Text
a -> DeleteScalingPolicy
s {$sel:name:DeleteScalingPolicy' :: Text
name = Text
a} :: DeleteScalingPolicy)
deleteScalingPolicy_fleetId :: Lens.Lens' DeleteScalingPolicy Prelude.Text
deleteScalingPolicy_fleetId :: (Text -> f Text) -> DeleteScalingPolicy -> f DeleteScalingPolicy
deleteScalingPolicy_fleetId = (DeleteScalingPolicy -> Text)
-> (DeleteScalingPolicy -> Text -> DeleteScalingPolicy)
-> Lens DeleteScalingPolicy DeleteScalingPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteScalingPolicy' {Text
fleetId :: Text
$sel:fleetId:DeleteScalingPolicy' :: DeleteScalingPolicy -> Text
fleetId} -> Text
fleetId) (\s :: DeleteScalingPolicy
s@DeleteScalingPolicy' {} Text
a -> DeleteScalingPolicy
s {$sel:fleetId:DeleteScalingPolicy' :: Text
fleetId = Text
a} :: DeleteScalingPolicy)
instance Core.AWSRequest DeleteScalingPolicy where
type
AWSResponse DeleteScalingPolicy =
DeleteScalingPolicyResponse
request :: DeleteScalingPolicy -> Request DeleteScalingPolicy
request = Service -> DeleteScalingPolicy -> Request DeleteScalingPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteScalingPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteScalingPolicy)))
response =
AWSResponse DeleteScalingPolicy
-> Logger
-> Service
-> Proxy DeleteScalingPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteScalingPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteScalingPolicy
DeleteScalingPolicyResponse
DeleteScalingPolicyResponse'
instance Prelude.Hashable DeleteScalingPolicy
instance Prelude.NFData DeleteScalingPolicy
instance Core.ToHeaders DeleteScalingPolicy where
toHeaders :: DeleteScalingPolicy -> [Header]
toHeaders =
[Header] -> DeleteScalingPolicy -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"GameLift.DeleteScalingPolicy" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteScalingPolicy where
toJSON :: DeleteScalingPolicy -> Value
toJSON DeleteScalingPolicy' {Text
fleetId :: Text
name :: Text
$sel:fleetId:DeleteScalingPolicy' :: DeleteScalingPolicy -> Text
$sel:name:DeleteScalingPolicy' :: DeleteScalingPolicy -> 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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetId)
]
)
instance Core.ToPath DeleteScalingPolicy where
toPath :: DeleteScalingPolicy -> ByteString
toPath = ByteString -> DeleteScalingPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteScalingPolicy where
toQuery :: DeleteScalingPolicy -> QueryString
toQuery = QueryString -> DeleteScalingPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteScalingPolicyResponse = DeleteScalingPolicyResponse'
{
}
deriving (DeleteScalingPolicyResponse -> DeleteScalingPolicyResponse -> Bool
(DeleteScalingPolicyResponse
-> DeleteScalingPolicyResponse -> Bool)
-> (DeleteScalingPolicyResponse
-> DeleteScalingPolicyResponse -> Bool)
-> Eq DeleteScalingPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteScalingPolicyResponse -> DeleteScalingPolicyResponse -> Bool
$c/= :: DeleteScalingPolicyResponse -> DeleteScalingPolicyResponse -> Bool
== :: DeleteScalingPolicyResponse -> DeleteScalingPolicyResponse -> Bool
$c== :: DeleteScalingPolicyResponse -> DeleteScalingPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteScalingPolicyResponse]
ReadPrec DeleteScalingPolicyResponse
Int -> ReadS DeleteScalingPolicyResponse
ReadS [DeleteScalingPolicyResponse]
(Int -> ReadS DeleteScalingPolicyResponse)
-> ReadS [DeleteScalingPolicyResponse]
-> ReadPrec DeleteScalingPolicyResponse
-> ReadPrec [DeleteScalingPolicyResponse]
-> Read DeleteScalingPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteScalingPolicyResponse]
$creadListPrec :: ReadPrec [DeleteScalingPolicyResponse]
readPrec :: ReadPrec DeleteScalingPolicyResponse
$creadPrec :: ReadPrec DeleteScalingPolicyResponse
readList :: ReadS [DeleteScalingPolicyResponse]
$creadList :: ReadS [DeleteScalingPolicyResponse]
readsPrec :: Int -> ReadS DeleteScalingPolicyResponse
$creadsPrec :: Int -> ReadS DeleteScalingPolicyResponse
Prelude.Read, Int -> DeleteScalingPolicyResponse -> ShowS
[DeleteScalingPolicyResponse] -> ShowS
DeleteScalingPolicyResponse -> String
(Int -> DeleteScalingPolicyResponse -> ShowS)
-> (DeleteScalingPolicyResponse -> String)
-> ([DeleteScalingPolicyResponse] -> ShowS)
-> Show DeleteScalingPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteScalingPolicyResponse] -> ShowS
$cshowList :: [DeleteScalingPolicyResponse] -> ShowS
show :: DeleteScalingPolicyResponse -> String
$cshow :: DeleteScalingPolicyResponse -> String
showsPrec :: Int -> DeleteScalingPolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteScalingPolicyResponse -> ShowS
Prelude.Show, (forall x.
DeleteScalingPolicyResponse -> Rep DeleteScalingPolicyResponse x)
-> (forall x.
Rep DeleteScalingPolicyResponse x -> DeleteScalingPolicyResponse)
-> Generic DeleteScalingPolicyResponse
forall x.
Rep DeleteScalingPolicyResponse x -> DeleteScalingPolicyResponse
forall x.
DeleteScalingPolicyResponse -> Rep DeleteScalingPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteScalingPolicyResponse x -> DeleteScalingPolicyResponse
$cfrom :: forall x.
DeleteScalingPolicyResponse -> Rep DeleteScalingPolicyResponse x
Prelude.Generic)
newDeleteScalingPolicyResponse ::
DeleteScalingPolicyResponse
newDeleteScalingPolicyResponse :: DeleteScalingPolicyResponse
newDeleteScalingPolicyResponse =
DeleteScalingPolicyResponse
DeleteScalingPolicyResponse'
instance Prelude.NFData DeleteScalingPolicyResponse