{-# 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.DescribeFargateProfile
(
DescribeFargateProfile (..),
newDescribeFargateProfile,
describeFargateProfile_clusterName,
describeFargateProfile_fargateProfileName,
DescribeFargateProfileResponse (..),
newDescribeFargateProfileResponse,
describeFargateProfileResponse_fargateProfile,
describeFargateProfileResponse_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 DescribeFargateProfile = DescribeFargateProfile'
{
DescribeFargateProfile -> Text
clusterName :: Prelude.Text,
DescribeFargateProfile -> Text
fargateProfileName :: Prelude.Text
}
deriving (DescribeFargateProfile -> DescribeFargateProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
$c/= :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
== :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
$c== :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
Prelude.Eq, ReadPrec [DescribeFargateProfile]
ReadPrec DescribeFargateProfile
Int -> ReadS DescribeFargateProfile
ReadS [DescribeFargateProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFargateProfile]
$creadListPrec :: ReadPrec [DescribeFargateProfile]
readPrec :: ReadPrec DescribeFargateProfile
$creadPrec :: ReadPrec DescribeFargateProfile
readList :: ReadS [DescribeFargateProfile]
$creadList :: ReadS [DescribeFargateProfile]
readsPrec :: Int -> ReadS DescribeFargateProfile
$creadsPrec :: Int -> ReadS DescribeFargateProfile
Prelude.Read, Int -> DescribeFargateProfile -> ShowS
[DescribeFargateProfile] -> ShowS
DescribeFargateProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFargateProfile] -> ShowS
$cshowList :: [DescribeFargateProfile] -> ShowS
show :: DescribeFargateProfile -> String
$cshow :: DescribeFargateProfile -> String
showsPrec :: Int -> DescribeFargateProfile -> ShowS
$cshowsPrec :: Int -> DescribeFargateProfile -> ShowS
Prelude.Show, forall x. Rep DescribeFargateProfile x -> DescribeFargateProfile
forall x. DescribeFargateProfile -> Rep DescribeFargateProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFargateProfile x -> DescribeFargateProfile
$cfrom :: forall x. DescribeFargateProfile -> Rep DescribeFargateProfile x
Prelude.Generic)
newDescribeFargateProfile ::
Prelude.Text ->
Prelude.Text ->
DescribeFargateProfile
newDescribeFargateProfile :: Text -> Text -> DescribeFargateProfile
newDescribeFargateProfile
Text
pClusterName_
Text
pFargateProfileName_ =
DescribeFargateProfile'
{ $sel:clusterName:DescribeFargateProfile' :: Text
clusterName =
Text
pClusterName_,
$sel:fargateProfileName:DescribeFargateProfile' :: Text
fargateProfileName = Text
pFargateProfileName_
}
describeFargateProfile_clusterName :: Lens.Lens' DescribeFargateProfile Prelude.Text
describeFargateProfile_clusterName :: Lens' DescribeFargateProfile Text
describeFargateProfile_clusterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfile' {Text
clusterName :: Text
$sel:clusterName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
clusterName} -> Text
clusterName) (\s :: DescribeFargateProfile
s@DescribeFargateProfile' {} Text
a -> DescribeFargateProfile
s {$sel:clusterName:DescribeFargateProfile' :: Text
clusterName = Text
a} :: DescribeFargateProfile)
describeFargateProfile_fargateProfileName :: Lens.Lens' DescribeFargateProfile Prelude.Text
describeFargateProfile_fargateProfileName :: Lens' DescribeFargateProfile Text
describeFargateProfile_fargateProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfile' {Text
fargateProfileName :: Text
$sel:fargateProfileName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
fargateProfileName} -> Text
fargateProfileName) (\s :: DescribeFargateProfile
s@DescribeFargateProfile' {} Text
a -> DescribeFargateProfile
s {$sel:fargateProfileName:DescribeFargateProfile' :: Text
fargateProfileName = Text
a} :: DescribeFargateProfile)
instance Core.AWSRequest DescribeFargateProfile where
type
AWSResponse DescribeFargateProfile =
DescribeFargateProfileResponse
request :: (Service -> Service)
-> DescribeFargateProfile -> Request DescribeFargateProfile
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeFargateProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFargateProfile)))
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 -> DescribeFargateProfileResponse
DescribeFargateProfileResponse'
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 DescribeFargateProfile where
hashWithSalt :: Int -> DescribeFargateProfile -> Int
hashWithSalt Int
_salt DescribeFargateProfile' {Text
fargateProfileName :: Text
clusterName :: Text
$sel:fargateProfileName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
$sel:clusterName:DescribeFargateProfile' :: DescribeFargateProfile -> 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 DescribeFargateProfile where
rnf :: DescribeFargateProfile -> ()
rnf DescribeFargateProfile' {Text
fargateProfileName :: Text
clusterName :: Text
$sel:fargateProfileName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
$sel:clusterName:DescribeFargateProfile' :: DescribeFargateProfile -> 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 DescribeFargateProfile where
toHeaders :: DescribeFargateProfile -> 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 DescribeFargateProfile where
toPath :: DescribeFargateProfile -> ByteString
toPath DescribeFargateProfile' {Text
fargateProfileName :: Text
clusterName :: Text
$sel:fargateProfileName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
$sel:clusterName:DescribeFargateProfile' :: DescribeFargateProfile -> 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 DescribeFargateProfile where
toQuery :: DescribeFargateProfile -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeFargateProfileResponse = DescribeFargateProfileResponse'
{
DescribeFargateProfileResponse -> Maybe FargateProfile
fargateProfile :: Prelude.Maybe FargateProfile,
DescribeFargateProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
$c/= :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
== :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
$c== :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFargateProfileResponse]
ReadPrec DescribeFargateProfileResponse
Int -> ReadS DescribeFargateProfileResponse
ReadS [DescribeFargateProfileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFargateProfileResponse]
$creadListPrec :: ReadPrec [DescribeFargateProfileResponse]
readPrec :: ReadPrec DescribeFargateProfileResponse
$creadPrec :: ReadPrec DescribeFargateProfileResponse
readList :: ReadS [DescribeFargateProfileResponse]
$creadList :: ReadS [DescribeFargateProfileResponse]
readsPrec :: Int -> ReadS DescribeFargateProfileResponse
$creadsPrec :: Int -> ReadS DescribeFargateProfileResponse
Prelude.Read, Int -> DescribeFargateProfileResponse -> ShowS
[DescribeFargateProfileResponse] -> ShowS
DescribeFargateProfileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFargateProfileResponse] -> ShowS
$cshowList :: [DescribeFargateProfileResponse] -> ShowS
show :: DescribeFargateProfileResponse -> String
$cshow :: DescribeFargateProfileResponse -> String
showsPrec :: Int -> DescribeFargateProfileResponse -> ShowS
$cshowsPrec :: Int -> DescribeFargateProfileResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeFargateProfileResponse x
-> DescribeFargateProfileResponse
forall x.
DescribeFargateProfileResponse
-> Rep DescribeFargateProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFargateProfileResponse x
-> DescribeFargateProfileResponse
$cfrom :: forall x.
DescribeFargateProfileResponse
-> Rep DescribeFargateProfileResponse x
Prelude.Generic)
newDescribeFargateProfileResponse ::
Prelude.Int ->
DescribeFargateProfileResponse
newDescribeFargateProfileResponse :: Int -> DescribeFargateProfileResponse
newDescribeFargateProfileResponse Int
pHttpStatus_ =
DescribeFargateProfileResponse'
{ $sel:fargateProfile:DescribeFargateProfileResponse' :: Maybe FargateProfile
fargateProfile =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeFargateProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeFargateProfileResponse_fargateProfile :: Lens.Lens' DescribeFargateProfileResponse (Prelude.Maybe FargateProfile)
describeFargateProfileResponse_fargateProfile :: Lens' DescribeFargateProfileResponse (Maybe FargateProfile)
describeFargateProfileResponse_fargateProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfileResponse' {Maybe FargateProfile
fargateProfile :: Maybe FargateProfile
$sel:fargateProfile:DescribeFargateProfileResponse' :: DescribeFargateProfileResponse -> Maybe FargateProfile
fargateProfile} -> Maybe FargateProfile
fargateProfile) (\s :: DescribeFargateProfileResponse
s@DescribeFargateProfileResponse' {} Maybe FargateProfile
a -> DescribeFargateProfileResponse
s {$sel:fargateProfile:DescribeFargateProfileResponse' :: Maybe FargateProfile
fargateProfile = Maybe FargateProfile
a} :: DescribeFargateProfileResponse)
describeFargateProfileResponse_httpStatus :: Lens.Lens' DescribeFargateProfileResponse Prelude.Int
describeFargateProfileResponse_httpStatus :: Lens' DescribeFargateProfileResponse Int
describeFargateProfileResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFargateProfileResponse' :: DescribeFargateProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFargateProfileResponse
s@DescribeFargateProfileResponse' {} Int
a -> DescribeFargateProfileResponse
s {$sel:httpStatus:DescribeFargateProfileResponse' :: Int
httpStatus = Int
a} :: DescribeFargateProfileResponse)
instance
Prelude.NFData
DescribeFargateProfileResponse
where
rnf :: DescribeFargateProfileResponse -> ()
rnf DescribeFargateProfileResponse' {Int
Maybe FargateProfile
httpStatus :: Int
fargateProfile :: Maybe FargateProfile
$sel:httpStatus:DescribeFargateProfileResponse' :: DescribeFargateProfileResponse -> Int
$sel:fargateProfile:DescribeFargateProfileResponse' :: DescribeFargateProfileResponse -> 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