{-# 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.UpdateClusterVersion
(
UpdateClusterVersion (..),
newUpdateClusterVersion,
updateClusterVersion_clientRequestToken,
updateClusterVersion_name,
updateClusterVersion_version,
UpdateClusterVersionResponse (..),
newUpdateClusterVersionResponse,
updateClusterVersionResponse_update,
updateClusterVersionResponse_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 UpdateClusterVersion = UpdateClusterVersion'
{
UpdateClusterVersion -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
UpdateClusterVersion -> Text
name :: Prelude.Text,
UpdateClusterVersion -> Text
version :: Prelude.Text
}
deriving (UpdateClusterVersion -> UpdateClusterVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClusterVersion -> UpdateClusterVersion -> Bool
$c/= :: UpdateClusterVersion -> UpdateClusterVersion -> Bool
== :: UpdateClusterVersion -> UpdateClusterVersion -> Bool
$c== :: UpdateClusterVersion -> UpdateClusterVersion -> Bool
Prelude.Eq, ReadPrec [UpdateClusterVersion]
ReadPrec UpdateClusterVersion
Int -> ReadS UpdateClusterVersion
ReadS [UpdateClusterVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClusterVersion]
$creadListPrec :: ReadPrec [UpdateClusterVersion]
readPrec :: ReadPrec UpdateClusterVersion
$creadPrec :: ReadPrec UpdateClusterVersion
readList :: ReadS [UpdateClusterVersion]
$creadList :: ReadS [UpdateClusterVersion]
readsPrec :: Int -> ReadS UpdateClusterVersion
$creadsPrec :: Int -> ReadS UpdateClusterVersion
Prelude.Read, Int -> UpdateClusterVersion -> ShowS
[UpdateClusterVersion] -> ShowS
UpdateClusterVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClusterVersion] -> ShowS
$cshowList :: [UpdateClusterVersion] -> ShowS
show :: UpdateClusterVersion -> String
$cshow :: UpdateClusterVersion -> String
showsPrec :: Int -> UpdateClusterVersion -> ShowS
$cshowsPrec :: Int -> UpdateClusterVersion -> ShowS
Prelude.Show, forall x. Rep UpdateClusterVersion x -> UpdateClusterVersion
forall x. UpdateClusterVersion -> Rep UpdateClusterVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateClusterVersion x -> UpdateClusterVersion
$cfrom :: forall x. UpdateClusterVersion -> Rep UpdateClusterVersion x
Prelude.Generic)
newUpdateClusterVersion ::
Prelude.Text ->
Prelude.Text ->
UpdateClusterVersion
newUpdateClusterVersion :: Text -> Text -> UpdateClusterVersion
newUpdateClusterVersion Text
pName_ Text
pVersion_ =
UpdateClusterVersion'
{ $sel:clientRequestToken:UpdateClusterVersion' :: Maybe Text
clientRequestToken =
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateClusterVersion' :: Text
name = Text
pName_,
$sel:version:UpdateClusterVersion' :: Text
version = Text
pVersion_
}
updateClusterVersion_clientRequestToken :: Lens.Lens' UpdateClusterVersion (Prelude.Maybe Prelude.Text)
updateClusterVersion_clientRequestToken :: Lens' UpdateClusterVersion (Maybe Text)
updateClusterVersion_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterVersion' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:UpdateClusterVersion' :: UpdateClusterVersion -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: UpdateClusterVersion
s@UpdateClusterVersion' {} Maybe Text
a -> UpdateClusterVersion
s {$sel:clientRequestToken:UpdateClusterVersion' :: Maybe Text
clientRequestToken = Maybe Text
a} :: UpdateClusterVersion)
updateClusterVersion_name :: Lens.Lens' UpdateClusterVersion Prelude.Text
updateClusterVersion_name :: Lens' UpdateClusterVersion Text
updateClusterVersion_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterVersion' {Text
name :: Text
$sel:name:UpdateClusterVersion' :: UpdateClusterVersion -> Text
name} -> Text
name) (\s :: UpdateClusterVersion
s@UpdateClusterVersion' {} Text
a -> UpdateClusterVersion
s {$sel:name:UpdateClusterVersion' :: Text
name = Text
a} :: UpdateClusterVersion)
updateClusterVersion_version :: Lens.Lens' UpdateClusterVersion Prelude.Text
updateClusterVersion_version :: Lens' UpdateClusterVersion Text
updateClusterVersion_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterVersion' {Text
version :: Text
$sel:version:UpdateClusterVersion' :: UpdateClusterVersion -> Text
version} -> Text
version) (\s :: UpdateClusterVersion
s@UpdateClusterVersion' {} Text
a -> UpdateClusterVersion
s {$sel:version:UpdateClusterVersion' :: Text
version = Text
a} :: UpdateClusterVersion)
instance Core.AWSRequest UpdateClusterVersion where
type
AWSResponse UpdateClusterVersion =
UpdateClusterVersionResponse
request :: (Service -> Service)
-> UpdateClusterVersion -> Request UpdateClusterVersion
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateClusterVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateClusterVersion)))
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 Update -> Int -> UpdateClusterVersionResponse
UpdateClusterVersionResponse'
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
"update")
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 UpdateClusterVersion where
hashWithSalt :: Int -> UpdateClusterVersion -> Int
hashWithSalt Int
_salt UpdateClusterVersion' {Maybe Text
Text
version :: Text
name :: Text
clientRequestToken :: Maybe Text
$sel:version:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:name:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:clientRequestToken:UpdateClusterVersion' :: UpdateClusterVersion -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
version
instance Prelude.NFData UpdateClusterVersion where
rnf :: UpdateClusterVersion -> ()
rnf UpdateClusterVersion' {Maybe Text
Text
version :: Text
name :: Text
clientRequestToken :: Maybe Text
$sel:version:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:name:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:clientRequestToken:UpdateClusterVersion' :: UpdateClusterVersion -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
version
instance Data.ToHeaders UpdateClusterVersion where
toHeaders :: UpdateClusterVersion -> 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.ToJSON UpdateClusterVersion where
toJSON :: UpdateClusterVersion -> Value
toJSON UpdateClusterVersion' {Maybe Text
Text
version :: Text
name :: Text
clientRequestToken :: Maybe Text
$sel:version:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:name:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:clientRequestToken:UpdateClusterVersion' :: UpdateClusterVersion -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"clientRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
forall a. a -> Maybe a
Prelude.Just (Key
"version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
version)
]
)
instance Data.ToPath UpdateClusterVersion where
toPath :: UpdateClusterVersion -> ByteString
toPath UpdateClusterVersion' {Maybe Text
Text
version :: Text
name :: Text
clientRequestToken :: Maybe Text
$sel:version:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:name:UpdateClusterVersion' :: UpdateClusterVersion -> Text
$sel:clientRequestToken:UpdateClusterVersion' :: UpdateClusterVersion -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/clusters/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name, ByteString
"/updates"]
instance Data.ToQuery UpdateClusterVersion where
toQuery :: UpdateClusterVersion -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateClusterVersionResponse = UpdateClusterVersionResponse'
{
UpdateClusterVersionResponse -> Maybe Update
update :: Prelude.Maybe Update,
UpdateClusterVersionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateClusterVersionResponse
-> UpdateClusterVersionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClusterVersionResponse
-> UpdateClusterVersionResponse -> Bool
$c/= :: UpdateClusterVersionResponse
-> UpdateClusterVersionResponse -> Bool
== :: UpdateClusterVersionResponse
-> UpdateClusterVersionResponse -> Bool
$c== :: UpdateClusterVersionResponse
-> UpdateClusterVersionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateClusterVersionResponse]
ReadPrec UpdateClusterVersionResponse
Int -> ReadS UpdateClusterVersionResponse
ReadS [UpdateClusterVersionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClusterVersionResponse]
$creadListPrec :: ReadPrec [UpdateClusterVersionResponse]
readPrec :: ReadPrec UpdateClusterVersionResponse
$creadPrec :: ReadPrec UpdateClusterVersionResponse
readList :: ReadS [UpdateClusterVersionResponse]
$creadList :: ReadS [UpdateClusterVersionResponse]
readsPrec :: Int -> ReadS UpdateClusterVersionResponse
$creadsPrec :: Int -> ReadS UpdateClusterVersionResponse
Prelude.Read, Int -> UpdateClusterVersionResponse -> ShowS
[UpdateClusterVersionResponse] -> ShowS
UpdateClusterVersionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClusterVersionResponse] -> ShowS
$cshowList :: [UpdateClusterVersionResponse] -> ShowS
show :: UpdateClusterVersionResponse -> String
$cshow :: UpdateClusterVersionResponse -> String
showsPrec :: Int -> UpdateClusterVersionResponse -> ShowS
$cshowsPrec :: Int -> UpdateClusterVersionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateClusterVersionResponse x -> UpdateClusterVersionResponse
forall x.
UpdateClusterVersionResponse -> Rep UpdateClusterVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateClusterVersionResponse x -> UpdateClusterVersionResponse
$cfrom :: forall x.
UpdateClusterVersionResponse -> Rep UpdateClusterVersionResponse x
Prelude.Generic)
newUpdateClusterVersionResponse ::
Prelude.Int ->
UpdateClusterVersionResponse
newUpdateClusterVersionResponse :: Int -> UpdateClusterVersionResponse
newUpdateClusterVersionResponse Int
pHttpStatus_ =
UpdateClusterVersionResponse'
{ $sel:update:UpdateClusterVersionResponse' :: Maybe Update
update =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateClusterVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateClusterVersionResponse_update :: Lens.Lens' UpdateClusterVersionResponse (Prelude.Maybe Update)
updateClusterVersionResponse_update :: Lens' UpdateClusterVersionResponse (Maybe Update)
updateClusterVersionResponse_update = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterVersionResponse' {Maybe Update
update :: Maybe Update
$sel:update:UpdateClusterVersionResponse' :: UpdateClusterVersionResponse -> Maybe Update
update} -> Maybe Update
update) (\s :: UpdateClusterVersionResponse
s@UpdateClusterVersionResponse' {} Maybe Update
a -> UpdateClusterVersionResponse
s {$sel:update:UpdateClusterVersionResponse' :: Maybe Update
update = Maybe Update
a} :: UpdateClusterVersionResponse)
updateClusterVersionResponse_httpStatus :: Lens.Lens' UpdateClusterVersionResponse Prelude.Int
updateClusterVersionResponse_httpStatus :: Lens' UpdateClusterVersionResponse Int
updateClusterVersionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateClusterVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateClusterVersionResponse' :: UpdateClusterVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateClusterVersionResponse
s@UpdateClusterVersionResponse' {} Int
a -> UpdateClusterVersionResponse
s {$sel:httpStatus:UpdateClusterVersionResponse' :: Int
httpStatus = Int
a} :: UpdateClusterVersionResponse)
instance Prelude.NFData UpdateClusterVersionResponse where
rnf :: UpdateClusterVersionResponse -> ()
rnf UpdateClusterVersionResponse' {Int
Maybe Update
httpStatus :: Int
update :: Maybe Update
$sel:httpStatus:UpdateClusterVersionResponse' :: UpdateClusterVersionResponse -> Int
$sel:update:UpdateClusterVersionResponse' :: UpdateClusterVersionResponse -> Maybe Update
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Update
update
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus