{-# 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.EKS.DeleteFargateProfile
(
DeleteFargateProfile (..),
newDeleteFargateProfile,
deleteFargateProfile_clusterName,
deleteFargateProfile_fargateProfileName,
DeleteFargateProfileResponse (..),
newDeleteFargateProfileResponse,
deleteFargateProfileResponse_fargateProfile,
deleteFargateProfileResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EKS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteFargateProfile = DeleteFargateProfile'
{
DeleteFargateProfile -> Text
clusterName :: Prelude.Text,
DeleteFargateProfile -> Text
fargateProfileName :: Prelude.Text
}
deriving (DeleteFargateProfile -> DeleteFargateProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFargateProfile -> DeleteFargateProfile -> Bool
$c/= :: DeleteFargateProfile -> DeleteFargateProfile -> Bool
== :: DeleteFargateProfile -> DeleteFargateProfile -> Bool
$c== :: DeleteFargateProfile -> DeleteFargateProfile -> Bool
Prelude.Eq, ReadPrec [DeleteFargateProfile]
ReadPrec DeleteFargateProfile
Int -> ReadS DeleteFargateProfile
ReadS [DeleteFargateProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFargateProfile]
$creadListPrec :: ReadPrec [DeleteFargateProfile]
readPrec :: ReadPrec DeleteFargateProfile
$creadPrec :: ReadPrec DeleteFargateProfile
readList :: ReadS [DeleteFargateProfile]
$creadList :: ReadS [DeleteFargateProfile]
readsPrec :: Int -> ReadS DeleteFargateProfile
$creadsPrec :: Int -> ReadS DeleteFargateProfile
Prelude.Read, Int -> DeleteFargateProfile -> ShowS
[DeleteFargateProfile] -> ShowS
DeleteFargateProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFargateProfile] -> ShowS
$cshowList :: [DeleteFargateProfile] -> ShowS
show :: DeleteFargateProfile -> String
$cshow :: DeleteFargateProfile -> String
showsPrec :: Int -> DeleteFargateProfile -> ShowS
$cshowsPrec :: Int -> DeleteFargateProfile -> ShowS
Prelude.Show, forall x. Rep DeleteFargateProfile x -> DeleteFargateProfile
forall x. DeleteFargateProfile -> Rep DeleteFargateProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFargateProfile x -> DeleteFargateProfile
$cfrom :: forall x. DeleteFargateProfile -> Rep DeleteFargateProfile x
Prelude.Generic)
newDeleteFargateProfile ::
Prelude.Text ->
Prelude.Text ->
DeleteFargateProfile
newDeleteFargateProfile :: Text -> Text -> DeleteFargateProfile
newDeleteFargateProfile
Text
pClusterName_
Text
pFargateProfileName_ =
DeleteFargateProfile'
{ $sel:clusterName:DeleteFargateProfile' :: Text
clusterName = Text
pClusterName_,
$sel:fargateProfileName:DeleteFargateProfile' :: Text
fargateProfileName = Text
pFargateProfileName_
}
deleteFargateProfile_clusterName :: Lens.Lens' DeleteFargateProfile Prelude.Text
deleteFargateProfile_clusterName :: Lens' DeleteFargateProfile Text
deleteFargateProfile_clusterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFargateProfile' {Text
clusterName :: Text
$sel:clusterName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
clusterName} -> Text
clusterName) (\s :: DeleteFargateProfile
s@DeleteFargateProfile' {} Text
a -> DeleteFargateProfile
s {$sel:clusterName:DeleteFargateProfile' :: Text
clusterName = Text
a} :: DeleteFargateProfile)
deleteFargateProfile_fargateProfileName :: Lens.Lens' DeleteFargateProfile Prelude.Text
deleteFargateProfile_fargateProfileName :: Lens' DeleteFargateProfile Text
deleteFargateProfile_fargateProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFargateProfile' {Text
fargateProfileName :: Text
$sel:fargateProfileName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
fargateProfileName} -> Text
fargateProfileName) (\s :: DeleteFargateProfile
s@DeleteFargateProfile' {} Text
a -> DeleteFargateProfile
s {$sel:fargateProfileName:DeleteFargateProfile' :: Text
fargateProfileName = Text
a} :: DeleteFargateProfile)
instance Core.AWSRequest DeleteFargateProfile where
type
AWSResponse DeleteFargateProfile =
DeleteFargateProfileResponse
request :: (Service -> Service)
-> DeleteFargateProfile -> Request DeleteFargateProfile
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteFargateProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteFargateProfile)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe FargateProfile -> Int -> DeleteFargateProfileResponse
DeleteFargateProfileResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"fargateProfile")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteFargateProfile where
hashWithSalt :: Int -> DeleteFargateProfile -> Int
hashWithSalt Int
_salt DeleteFargateProfile' {Text
fargateProfileName :: Text
clusterName :: Text
$sel:fargateProfileName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
$sel:clusterName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fargateProfileName
instance Prelude.NFData DeleteFargateProfile where
rnf :: DeleteFargateProfile -> ()
rnf DeleteFargateProfile' {Text
fargateProfileName :: Text
clusterName :: Text
$sel:fargateProfileName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
$sel:clusterName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
clusterName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fargateProfileName
instance Data.ToHeaders DeleteFargateProfile where
toHeaders :: DeleteFargateProfile -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteFargateProfile where
toPath :: DeleteFargateProfile -> ByteString
toPath DeleteFargateProfile' {Text
fargateProfileName :: Text
clusterName :: Text
$sel:fargateProfileName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
$sel:clusterName:DeleteFargateProfile' :: DeleteFargateProfile -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/clusters/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
clusterName,
ByteString
"/fargate-profiles/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
fargateProfileName
]
instance Data.ToQuery DeleteFargateProfile where
toQuery :: DeleteFargateProfile -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteFargateProfileResponse = DeleteFargateProfileResponse'
{
DeleteFargateProfileResponse -> Maybe FargateProfile
fargateProfile :: Prelude.Maybe FargateProfile,
DeleteFargateProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteFargateProfileResponse
-> DeleteFargateProfileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFargateProfileResponse
-> DeleteFargateProfileResponse -> Bool
$c/= :: DeleteFargateProfileResponse
-> DeleteFargateProfileResponse -> Bool
== :: DeleteFargateProfileResponse
-> DeleteFargateProfileResponse -> Bool
$c== :: DeleteFargateProfileResponse
-> DeleteFargateProfileResponse -> Bool
Prelude.Eq, ReadPrec [DeleteFargateProfileResponse]
ReadPrec DeleteFargateProfileResponse
Int -> ReadS DeleteFargateProfileResponse
ReadS [DeleteFargateProfileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFargateProfileResponse]
$creadListPrec :: ReadPrec [DeleteFargateProfileResponse]
readPrec :: ReadPrec DeleteFargateProfileResponse
$creadPrec :: ReadPrec DeleteFargateProfileResponse
readList :: ReadS [DeleteFargateProfileResponse]
$creadList :: ReadS [DeleteFargateProfileResponse]
readsPrec :: Int -> ReadS DeleteFargateProfileResponse
$creadsPrec :: Int -> ReadS DeleteFargateProfileResponse
Prelude.Read, Int -> DeleteFargateProfileResponse -> ShowS
[DeleteFargateProfileResponse] -> ShowS
DeleteFargateProfileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFargateProfileResponse] -> ShowS
$cshowList :: [DeleteFargateProfileResponse] -> ShowS
show :: DeleteFargateProfileResponse -> String
$cshow :: DeleteFargateProfileResponse -> String
showsPrec :: Int -> DeleteFargateProfileResponse -> ShowS
$cshowsPrec :: Int -> DeleteFargateProfileResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteFargateProfileResponse x -> DeleteFargateProfileResponse
forall x.
DeleteFargateProfileResponse -> Rep DeleteFargateProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFargateProfileResponse x -> DeleteFargateProfileResponse
$cfrom :: forall x.
DeleteFargateProfileResponse -> Rep DeleteFargateProfileResponse x
Prelude.Generic)
newDeleteFargateProfileResponse ::
Prelude.Int ->
DeleteFargateProfileResponse
newDeleteFargateProfileResponse :: Int -> DeleteFargateProfileResponse
newDeleteFargateProfileResponse Int
pHttpStatus_ =
DeleteFargateProfileResponse'
{ $sel:fargateProfile:DeleteFargateProfileResponse' :: Maybe FargateProfile
fargateProfile =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteFargateProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteFargateProfileResponse_fargateProfile :: Lens.Lens' DeleteFargateProfileResponse (Prelude.Maybe FargateProfile)
deleteFargateProfileResponse_fargateProfile :: Lens' DeleteFargateProfileResponse (Maybe FargateProfile)
deleteFargateProfileResponse_fargateProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFargateProfileResponse' {Maybe FargateProfile
fargateProfile :: Maybe FargateProfile
$sel:fargateProfile:DeleteFargateProfileResponse' :: DeleteFargateProfileResponse -> Maybe FargateProfile
fargateProfile} -> Maybe FargateProfile
fargateProfile) (\s :: DeleteFargateProfileResponse
s@DeleteFargateProfileResponse' {} Maybe FargateProfile
a -> DeleteFargateProfileResponse
s {$sel:fargateProfile:DeleteFargateProfileResponse' :: Maybe FargateProfile
fargateProfile = Maybe FargateProfile
a} :: DeleteFargateProfileResponse)
deleteFargateProfileResponse_httpStatus :: Lens.Lens' DeleteFargateProfileResponse Prelude.Int
deleteFargateProfileResponse_httpStatus :: Lens' DeleteFargateProfileResponse Int
deleteFargateProfileResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFargateProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteFargateProfileResponse' :: DeleteFargateProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteFargateProfileResponse
s@DeleteFargateProfileResponse' {} Int
a -> DeleteFargateProfileResponse
s {$sel:httpStatus:DeleteFargateProfileResponse' :: Int
httpStatus = Int
a} :: DeleteFargateProfileResponse)
instance Prelude.NFData DeleteFargateProfileResponse where
rnf :: DeleteFargateProfileResponse -> ()
rnf DeleteFargateProfileResponse' {Int
Maybe FargateProfile
httpStatus :: Int
fargateProfile :: Maybe FargateProfile
$sel:httpStatus:DeleteFargateProfileResponse' :: DeleteFargateProfileResponse -> Int
$sel:fargateProfile:DeleteFargateProfileResponse' :: DeleteFargateProfileResponse -> Maybe FargateProfile
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FargateProfile
fargateProfile
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus