{-# 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.UpdateClusterConfig
(
UpdateClusterConfig (..),
newUpdateClusterConfig,
updateClusterConfig_clientRequestToken,
updateClusterConfig_logging,
updateClusterConfig_resourcesVpcConfig,
updateClusterConfig_name,
UpdateClusterConfigResponse (..),
newUpdateClusterConfigResponse,
updateClusterConfigResponse_update,
updateClusterConfigResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.EKS.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 UpdateClusterConfig = UpdateClusterConfig'
{
UpdateClusterConfig -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
UpdateClusterConfig -> Maybe Logging
logging :: Prelude.Maybe Logging,
UpdateClusterConfig -> Maybe VpcConfigRequest
resourcesVpcConfig :: Prelude.Maybe VpcConfigRequest,
UpdateClusterConfig -> Text
name :: Prelude.Text
}
deriving (UpdateClusterConfig -> UpdateClusterConfig -> Bool
(UpdateClusterConfig -> UpdateClusterConfig -> Bool)
-> (UpdateClusterConfig -> UpdateClusterConfig -> Bool)
-> Eq UpdateClusterConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClusterConfig -> UpdateClusterConfig -> Bool
$c/= :: UpdateClusterConfig -> UpdateClusterConfig -> Bool
== :: UpdateClusterConfig -> UpdateClusterConfig -> Bool
$c== :: UpdateClusterConfig -> UpdateClusterConfig -> Bool
Prelude.Eq, ReadPrec [UpdateClusterConfig]
ReadPrec UpdateClusterConfig
Int -> ReadS UpdateClusterConfig
ReadS [UpdateClusterConfig]
(Int -> ReadS UpdateClusterConfig)
-> ReadS [UpdateClusterConfig]
-> ReadPrec UpdateClusterConfig
-> ReadPrec [UpdateClusterConfig]
-> Read UpdateClusterConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClusterConfig]
$creadListPrec :: ReadPrec [UpdateClusterConfig]
readPrec :: ReadPrec UpdateClusterConfig
$creadPrec :: ReadPrec UpdateClusterConfig
readList :: ReadS [UpdateClusterConfig]
$creadList :: ReadS [UpdateClusterConfig]
readsPrec :: Int -> ReadS UpdateClusterConfig
$creadsPrec :: Int -> ReadS UpdateClusterConfig
Prelude.Read, Int -> UpdateClusterConfig -> ShowS
[UpdateClusterConfig] -> ShowS
UpdateClusterConfig -> String
(Int -> UpdateClusterConfig -> ShowS)
-> (UpdateClusterConfig -> String)
-> ([UpdateClusterConfig] -> ShowS)
-> Show UpdateClusterConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClusterConfig] -> ShowS
$cshowList :: [UpdateClusterConfig] -> ShowS
show :: UpdateClusterConfig -> String
$cshow :: UpdateClusterConfig -> String
showsPrec :: Int -> UpdateClusterConfig -> ShowS
$cshowsPrec :: Int -> UpdateClusterConfig -> ShowS
Prelude.Show, (forall x. UpdateClusterConfig -> Rep UpdateClusterConfig x)
-> (forall x. Rep UpdateClusterConfig x -> UpdateClusterConfig)
-> Generic UpdateClusterConfig
forall x. Rep UpdateClusterConfig x -> UpdateClusterConfig
forall x. UpdateClusterConfig -> Rep UpdateClusterConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateClusterConfig x -> UpdateClusterConfig
$cfrom :: forall x. UpdateClusterConfig -> Rep UpdateClusterConfig x
Prelude.Generic)
newUpdateClusterConfig ::
Prelude.Text ->
UpdateClusterConfig
newUpdateClusterConfig :: Text -> UpdateClusterConfig
newUpdateClusterConfig Text
pName_ =
UpdateClusterConfig' :: Maybe Text
-> Maybe Logging
-> Maybe VpcConfigRequest
-> Text
-> UpdateClusterConfig
UpdateClusterConfig'
{ $sel:clientRequestToken:UpdateClusterConfig' :: Maybe Text
clientRequestToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logging:UpdateClusterConfig' :: Maybe Logging
logging = Maybe Logging
forall a. Maybe a
Prelude.Nothing,
$sel:resourcesVpcConfig:UpdateClusterConfig' :: Maybe VpcConfigRequest
resourcesVpcConfig = Maybe VpcConfigRequest
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateClusterConfig' :: Text
name = Text
pName_
}
updateClusterConfig_clientRequestToken :: Lens.Lens' UpdateClusterConfig (Prelude.Maybe Prelude.Text)
updateClusterConfig_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> UpdateClusterConfig -> f UpdateClusterConfig
updateClusterConfig_clientRequestToken = (UpdateClusterConfig -> Maybe Text)
-> (UpdateClusterConfig -> Maybe Text -> UpdateClusterConfig)
-> Lens
UpdateClusterConfig UpdateClusterConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterConfig' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: UpdateClusterConfig
s@UpdateClusterConfig' {} Maybe Text
a -> UpdateClusterConfig
s {$sel:clientRequestToken:UpdateClusterConfig' :: Maybe Text
clientRequestToken = Maybe Text
a} :: UpdateClusterConfig)
updateClusterConfig_logging :: Lens.Lens' UpdateClusterConfig (Prelude.Maybe Logging)
updateClusterConfig_logging :: (Maybe Logging -> f (Maybe Logging))
-> UpdateClusterConfig -> f UpdateClusterConfig
updateClusterConfig_logging = (UpdateClusterConfig -> Maybe Logging)
-> (UpdateClusterConfig -> Maybe Logging -> UpdateClusterConfig)
-> Lens
UpdateClusterConfig
UpdateClusterConfig
(Maybe Logging)
(Maybe Logging)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterConfig' {Maybe Logging
logging :: Maybe Logging
$sel:logging:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe Logging
logging} -> Maybe Logging
logging) (\s :: UpdateClusterConfig
s@UpdateClusterConfig' {} Maybe Logging
a -> UpdateClusterConfig
s {$sel:logging:UpdateClusterConfig' :: Maybe Logging
logging = Maybe Logging
a} :: UpdateClusterConfig)
updateClusterConfig_resourcesVpcConfig :: Lens.Lens' UpdateClusterConfig (Prelude.Maybe VpcConfigRequest)
updateClusterConfig_resourcesVpcConfig :: (Maybe VpcConfigRequest -> f (Maybe VpcConfigRequest))
-> UpdateClusterConfig -> f UpdateClusterConfig
updateClusterConfig_resourcesVpcConfig = (UpdateClusterConfig -> Maybe VpcConfigRequest)
-> (UpdateClusterConfig
-> Maybe VpcConfigRequest -> UpdateClusterConfig)
-> Lens
UpdateClusterConfig
UpdateClusterConfig
(Maybe VpcConfigRequest)
(Maybe VpcConfigRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterConfig' {Maybe VpcConfigRequest
resourcesVpcConfig :: Maybe VpcConfigRequest
$sel:resourcesVpcConfig:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe VpcConfigRequest
resourcesVpcConfig} -> Maybe VpcConfigRequest
resourcesVpcConfig) (\s :: UpdateClusterConfig
s@UpdateClusterConfig' {} Maybe VpcConfigRequest
a -> UpdateClusterConfig
s {$sel:resourcesVpcConfig:UpdateClusterConfig' :: Maybe VpcConfigRequest
resourcesVpcConfig = Maybe VpcConfigRequest
a} :: UpdateClusterConfig)
updateClusterConfig_name :: Lens.Lens' UpdateClusterConfig Prelude.Text
updateClusterConfig_name :: (Text -> f Text) -> UpdateClusterConfig -> f UpdateClusterConfig
updateClusterConfig_name = (UpdateClusterConfig -> Text)
-> (UpdateClusterConfig -> Text -> UpdateClusterConfig)
-> Lens UpdateClusterConfig UpdateClusterConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterConfig' {Text
name :: Text
$sel:name:UpdateClusterConfig' :: UpdateClusterConfig -> Text
name} -> Text
name) (\s :: UpdateClusterConfig
s@UpdateClusterConfig' {} Text
a -> UpdateClusterConfig
s {$sel:name:UpdateClusterConfig' :: Text
name = Text
a} :: UpdateClusterConfig)
instance Core.AWSRequest UpdateClusterConfig where
type
AWSResponse UpdateClusterConfig =
UpdateClusterConfigResponse
request :: UpdateClusterConfig -> Request UpdateClusterConfig
request = Service -> UpdateClusterConfig -> Request UpdateClusterConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateClusterConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateClusterConfig)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateClusterConfig))
-> Logger
-> Service
-> Proxy UpdateClusterConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateClusterConfig)))
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 Update -> Int -> UpdateClusterConfigResponse
UpdateClusterConfigResponse'
(Maybe Update -> Int -> UpdateClusterConfigResponse)
-> Either String (Maybe Update)
-> Either String (Int -> UpdateClusterConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Update)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"update")
Either String (Int -> UpdateClusterConfigResponse)
-> Either String Int -> Either String UpdateClusterConfigResponse
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 UpdateClusterConfig
instance Prelude.NFData UpdateClusterConfig
instance Core.ToHeaders UpdateClusterConfig where
toHeaders :: UpdateClusterConfig -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateClusterConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 UpdateClusterConfig where
toJSON :: UpdateClusterConfig -> Value
toJSON UpdateClusterConfig' {Maybe Text
Maybe Logging
Maybe VpcConfigRequest
Text
name :: Text
resourcesVpcConfig :: Maybe VpcConfigRequest
logging :: Maybe Logging
clientRequestToken :: Maybe Text
$sel:name:UpdateClusterConfig' :: UpdateClusterConfig -> Text
$sel:resourcesVpcConfig:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe VpcConfigRequest
$sel:logging:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe Logging
$sel:clientRequestToken:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"clientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
(Text
"logging" Text -> Logging -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Logging -> Pair) -> Maybe Logging -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Logging
logging,
(Text
"resourcesVpcConfig" Text -> VpcConfigRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(VpcConfigRequest -> Pair) -> Maybe VpcConfigRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfigRequest
resourcesVpcConfig
]
)
instance Core.ToPath UpdateClusterConfig where
toPath :: UpdateClusterConfig -> ByteString
toPath UpdateClusterConfig' {Maybe Text
Maybe Logging
Maybe VpcConfigRequest
Text
name :: Text
resourcesVpcConfig :: Maybe VpcConfigRequest
logging :: Maybe Logging
clientRequestToken :: Maybe Text
$sel:name:UpdateClusterConfig' :: UpdateClusterConfig -> Text
$sel:resourcesVpcConfig:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe VpcConfigRequest
$sel:logging:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe Logging
$sel:clientRequestToken:UpdateClusterConfig' :: UpdateClusterConfig -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/clusters/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name, ByteString
"/update-config"]
instance Core.ToQuery UpdateClusterConfig where
toQuery :: UpdateClusterConfig -> QueryString
toQuery = QueryString -> UpdateClusterConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateClusterConfigResponse = UpdateClusterConfigResponse'
{ UpdateClusterConfigResponse -> Maybe Update
update :: Prelude.Maybe Update,
UpdateClusterConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateClusterConfigResponse -> UpdateClusterConfigResponse -> Bool
(UpdateClusterConfigResponse
-> UpdateClusterConfigResponse -> Bool)
-> (UpdateClusterConfigResponse
-> UpdateClusterConfigResponse -> Bool)
-> Eq UpdateClusterConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClusterConfigResponse -> UpdateClusterConfigResponse -> Bool
$c/= :: UpdateClusterConfigResponse -> UpdateClusterConfigResponse -> Bool
== :: UpdateClusterConfigResponse -> UpdateClusterConfigResponse -> Bool
$c== :: UpdateClusterConfigResponse -> UpdateClusterConfigResponse -> Bool
Prelude.Eq, ReadPrec [UpdateClusterConfigResponse]
ReadPrec UpdateClusterConfigResponse
Int -> ReadS UpdateClusterConfigResponse
ReadS [UpdateClusterConfigResponse]
(Int -> ReadS UpdateClusterConfigResponse)
-> ReadS [UpdateClusterConfigResponse]
-> ReadPrec UpdateClusterConfigResponse
-> ReadPrec [UpdateClusterConfigResponse]
-> Read UpdateClusterConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClusterConfigResponse]
$creadListPrec :: ReadPrec [UpdateClusterConfigResponse]
readPrec :: ReadPrec UpdateClusterConfigResponse
$creadPrec :: ReadPrec UpdateClusterConfigResponse
readList :: ReadS [UpdateClusterConfigResponse]
$creadList :: ReadS [UpdateClusterConfigResponse]
readsPrec :: Int -> ReadS UpdateClusterConfigResponse
$creadsPrec :: Int -> ReadS UpdateClusterConfigResponse
Prelude.Read, Int -> UpdateClusterConfigResponse -> ShowS
[UpdateClusterConfigResponse] -> ShowS
UpdateClusterConfigResponse -> String
(Int -> UpdateClusterConfigResponse -> ShowS)
-> (UpdateClusterConfigResponse -> String)
-> ([UpdateClusterConfigResponse] -> ShowS)
-> Show UpdateClusterConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClusterConfigResponse] -> ShowS
$cshowList :: [UpdateClusterConfigResponse] -> ShowS
show :: UpdateClusterConfigResponse -> String
$cshow :: UpdateClusterConfigResponse -> String
showsPrec :: Int -> UpdateClusterConfigResponse -> ShowS
$cshowsPrec :: Int -> UpdateClusterConfigResponse -> ShowS
Prelude.Show, (forall x.
UpdateClusterConfigResponse -> Rep UpdateClusterConfigResponse x)
-> (forall x.
Rep UpdateClusterConfigResponse x -> UpdateClusterConfigResponse)
-> Generic UpdateClusterConfigResponse
forall x.
Rep UpdateClusterConfigResponse x -> UpdateClusterConfigResponse
forall x.
UpdateClusterConfigResponse -> Rep UpdateClusterConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateClusterConfigResponse x -> UpdateClusterConfigResponse
$cfrom :: forall x.
UpdateClusterConfigResponse -> Rep UpdateClusterConfigResponse x
Prelude.Generic)
newUpdateClusterConfigResponse ::
Prelude.Int ->
UpdateClusterConfigResponse
newUpdateClusterConfigResponse :: Int -> UpdateClusterConfigResponse
newUpdateClusterConfigResponse Int
pHttpStatus_ =
UpdateClusterConfigResponse' :: Maybe Update -> Int -> UpdateClusterConfigResponse
UpdateClusterConfigResponse'
{ $sel:update:UpdateClusterConfigResponse' :: Maybe Update
update =
Maybe Update
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateClusterConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateClusterConfigResponse_update :: Lens.Lens' UpdateClusterConfigResponse (Prelude.Maybe Update)
updateClusterConfigResponse_update :: (Maybe Update -> f (Maybe Update))
-> UpdateClusterConfigResponse -> f UpdateClusterConfigResponse
updateClusterConfigResponse_update = (UpdateClusterConfigResponse -> Maybe Update)
-> (UpdateClusterConfigResponse
-> Maybe Update -> UpdateClusterConfigResponse)
-> Lens
UpdateClusterConfigResponse
UpdateClusterConfigResponse
(Maybe Update)
(Maybe Update)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterConfigResponse' {Maybe Update
update :: Maybe Update
$sel:update:UpdateClusterConfigResponse' :: UpdateClusterConfigResponse -> Maybe Update
update} -> Maybe Update
update) (\s :: UpdateClusterConfigResponse
s@UpdateClusterConfigResponse' {} Maybe Update
a -> UpdateClusterConfigResponse
s {$sel:update:UpdateClusterConfigResponse' :: Maybe Update
update = Maybe Update
a} :: UpdateClusterConfigResponse)
updateClusterConfigResponse_httpStatus :: Lens.Lens' UpdateClusterConfigResponse Prelude.Int
updateClusterConfigResponse_httpStatus :: (Int -> f Int)
-> UpdateClusterConfigResponse -> f UpdateClusterConfigResponse
updateClusterConfigResponse_httpStatus = (UpdateClusterConfigResponse -> Int)
-> (UpdateClusterConfigResponse
-> Int -> UpdateClusterConfigResponse)
-> Lens
UpdateClusterConfigResponse UpdateClusterConfigResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateClusterConfigResponse' :: UpdateClusterConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateClusterConfigResponse
s@UpdateClusterConfigResponse' {} Int
a -> UpdateClusterConfigResponse
s {$sel:httpStatus:UpdateClusterConfigResponse' :: Int
httpStatus = Int
a} :: UpdateClusterConfigResponse)
instance Prelude.NFData UpdateClusterConfigResponse