{-# 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.Proton.UpdateServicePipeline
(
UpdateServicePipeline (..),
newUpdateServicePipeline,
updateServicePipeline_templateMinorVersion,
updateServicePipeline_templateMajorVersion,
updateServicePipeline_deploymentType,
updateServicePipeline_serviceName,
updateServicePipeline_spec,
UpdateServicePipelineResponse (..),
newUpdateServicePipelineResponse,
updateServicePipelineResponse_httpStatus,
updateServicePipelineResponse_pipeline,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateServicePipeline = UpdateServicePipeline'
{
UpdateServicePipeline -> Maybe Text
templateMinorVersion :: Prelude.Maybe Prelude.Text,
UpdateServicePipeline -> Maybe Text
templateMajorVersion :: Prelude.Maybe Prelude.Text,
UpdateServicePipeline -> DeploymentUpdateType
deploymentType :: DeploymentUpdateType,
UpdateServicePipeline -> Text
serviceName :: Prelude.Text,
UpdateServicePipeline -> Sensitive Text
spec :: Core.Sensitive Prelude.Text
}
deriving (UpdateServicePipeline -> UpdateServicePipeline -> Bool
(UpdateServicePipeline -> UpdateServicePipeline -> Bool)
-> (UpdateServicePipeline -> UpdateServicePipeline -> Bool)
-> Eq UpdateServicePipeline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServicePipeline -> UpdateServicePipeline -> Bool
$c/= :: UpdateServicePipeline -> UpdateServicePipeline -> Bool
== :: UpdateServicePipeline -> UpdateServicePipeline -> Bool
$c== :: UpdateServicePipeline -> UpdateServicePipeline -> Bool
Prelude.Eq, Int -> UpdateServicePipeline -> ShowS
[UpdateServicePipeline] -> ShowS
UpdateServicePipeline -> String
(Int -> UpdateServicePipeline -> ShowS)
-> (UpdateServicePipeline -> String)
-> ([UpdateServicePipeline] -> ShowS)
-> Show UpdateServicePipeline
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServicePipeline] -> ShowS
$cshowList :: [UpdateServicePipeline] -> ShowS
show :: UpdateServicePipeline -> String
$cshow :: UpdateServicePipeline -> String
showsPrec :: Int -> UpdateServicePipeline -> ShowS
$cshowsPrec :: Int -> UpdateServicePipeline -> ShowS
Prelude.Show, (forall x. UpdateServicePipeline -> Rep UpdateServicePipeline x)
-> (forall x. Rep UpdateServicePipeline x -> UpdateServicePipeline)
-> Generic UpdateServicePipeline
forall x. Rep UpdateServicePipeline x -> UpdateServicePipeline
forall x. UpdateServicePipeline -> Rep UpdateServicePipeline x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServicePipeline x -> UpdateServicePipeline
$cfrom :: forall x. UpdateServicePipeline -> Rep UpdateServicePipeline x
Prelude.Generic)
newUpdateServicePipeline ::
DeploymentUpdateType ->
Prelude.Text ->
Prelude.Text ->
UpdateServicePipeline
newUpdateServicePipeline :: DeploymentUpdateType -> Text -> Text -> UpdateServicePipeline
newUpdateServicePipeline
DeploymentUpdateType
pDeploymentType_
Text
pServiceName_
Text
pSpec_ =
UpdateServicePipeline' :: Maybe Text
-> Maybe Text
-> DeploymentUpdateType
-> Text
-> Sensitive Text
-> UpdateServicePipeline
UpdateServicePipeline'
{ $sel:templateMinorVersion:UpdateServicePipeline' :: Maybe Text
templateMinorVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateMajorVersion:UpdateServicePipeline' :: Maybe Text
templateMajorVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentType:UpdateServicePipeline' :: DeploymentUpdateType
deploymentType = DeploymentUpdateType
pDeploymentType_,
$sel:serviceName:UpdateServicePipeline' :: Text
serviceName = Text
pServiceName_,
$sel:spec:UpdateServicePipeline' :: Sensitive Text
spec = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pSpec_
}
updateServicePipeline_templateMinorVersion :: Lens.Lens' UpdateServicePipeline (Prelude.Maybe Prelude.Text)
updateServicePipeline_templateMinorVersion :: (Maybe Text -> f (Maybe Text))
-> UpdateServicePipeline -> f UpdateServicePipeline
updateServicePipeline_templateMinorVersion = (UpdateServicePipeline -> Maybe Text)
-> (UpdateServicePipeline -> Maybe Text -> UpdateServicePipeline)
-> Lens
UpdateServicePipeline
UpdateServicePipeline
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServicePipeline' {Maybe Text
templateMinorVersion :: Maybe Text
$sel:templateMinorVersion:UpdateServicePipeline' :: UpdateServicePipeline -> Maybe Text
templateMinorVersion} -> Maybe Text
templateMinorVersion) (\s :: UpdateServicePipeline
s@UpdateServicePipeline' {} Maybe Text
a -> UpdateServicePipeline
s {$sel:templateMinorVersion:UpdateServicePipeline' :: Maybe Text
templateMinorVersion = Maybe Text
a} :: UpdateServicePipeline)
updateServicePipeline_templateMajorVersion :: Lens.Lens' UpdateServicePipeline (Prelude.Maybe Prelude.Text)
updateServicePipeline_templateMajorVersion :: (Maybe Text -> f (Maybe Text))
-> UpdateServicePipeline -> f UpdateServicePipeline
updateServicePipeline_templateMajorVersion = (UpdateServicePipeline -> Maybe Text)
-> (UpdateServicePipeline -> Maybe Text -> UpdateServicePipeline)
-> Lens
UpdateServicePipeline
UpdateServicePipeline
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServicePipeline' {Maybe Text
templateMajorVersion :: Maybe Text
$sel:templateMajorVersion:UpdateServicePipeline' :: UpdateServicePipeline -> Maybe Text
templateMajorVersion} -> Maybe Text
templateMajorVersion) (\s :: UpdateServicePipeline
s@UpdateServicePipeline' {} Maybe Text
a -> UpdateServicePipeline
s {$sel:templateMajorVersion:UpdateServicePipeline' :: Maybe Text
templateMajorVersion = Maybe Text
a} :: UpdateServicePipeline)
updateServicePipeline_deploymentType :: Lens.Lens' UpdateServicePipeline DeploymentUpdateType
updateServicePipeline_deploymentType :: (DeploymentUpdateType -> f DeploymentUpdateType)
-> UpdateServicePipeline -> f UpdateServicePipeline
updateServicePipeline_deploymentType = (UpdateServicePipeline -> DeploymentUpdateType)
-> (UpdateServicePipeline
-> DeploymentUpdateType -> UpdateServicePipeline)
-> Lens
UpdateServicePipeline
UpdateServicePipeline
DeploymentUpdateType
DeploymentUpdateType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServicePipeline' {DeploymentUpdateType
deploymentType :: DeploymentUpdateType
$sel:deploymentType:UpdateServicePipeline' :: UpdateServicePipeline -> DeploymentUpdateType
deploymentType} -> DeploymentUpdateType
deploymentType) (\s :: UpdateServicePipeline
s@UpdateServicePipeline' {} DeploymentUpdateType
a -> UpdateServicePipeline
s {$sel:deploymentType:UpdateServicePipeline' :: DeploymentUpdateType
deploymentType = DeploymentUpdateType
a} :: UpdateServicePipeline)
updateServicePipeline_serviceName :: Lens.Lens' UpdateServicePipeline Prelude.Text
updateServicePipeline_serviceName :: (Text -> f Text)
-> UpdateServicePipeline -> f UpdateServicePipeline
updateServicePipeline_serviceName = (UpdateServicePipeline -> Text)
-> (UpdateServicePipeline -> Text -> UpdateServicePipeline)
-> Lens UpdateServicePipeline UpdateServicePipeline Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServicePipeline' {Text
serviceName :: Text
$sel:serviceName:UpdateServicePipeline' :: UpdateServicePipeline -> Text
serviceName} -> Text
serviceName) (\s :: UpdateServicePipeline
s@UpdateServicePipeline' {} Text
a -> UpdateServicePipeline
s {$sel:serviceName:UpdateServicePipeline' :: Text
serviceName = Text
a} :: UpdateServicePipeline)
updateServicePipeline_spec :: Lens.Lens' UpdateServicePipeline Prelude.Text
updateServicePipeline_spec :: (Text -> f Text)
-> UpdateServicePipeline -> f UpdateServicePipeline
updateServicePipeline_spec = (UpdateServicePipeline -> Sensitive Text)
-> (UpdateServicePipeline
-> Sensitive Text -> UpdateServicePipeline)
-> Lens
UpdateServicePipeline
UpdateServicePipeline
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServicePipeline' {Sensitive Text
spec :: Sensitive Text
$sel:spec:UpdateServicePipeline' :: UpdateServicePipeline -> Sensitive Text
spec} -> Sensitive Text
spec) (\s :: UpdateServicePipeline
s@UpdateServicePipeline' {} Sensitive Text
a -> UpdateServicePipeline
s {$sel:spec:UpdateServicePipeline' :: Sensitive Text
spec = Sensitive Text
a} :: UpdateServicePipeline) ((Sensitive Text -> f (Sensitive Text))
-> UpdateServicePipeline -> f UpdateServicePipeline)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UpdateServicePipeline
-> f UpdateServicePipeline
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.AWSRequest UpdateServicePipeline where
type
AWSResponse UpdateServicePipeline =
UpdateServicePipelineResponse
request :: UpdateServicePipeline -> Request UpdateServicePipeline
request = Service -> UpdateServicePipeline -> Request UpdateServicePipeline
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateServicePipeline
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServicePipeline)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateServicePipeline))
-> Logger
-> Service
-> Proxy UpdateServicePipeline
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServicePipeline)))
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 ->
Int -> ServicePipeline -> UpdateServicePipelineResponse
UpdateServicePipelineResponse'
(Int -> ServicePipeline -> UpdateServicePipelineResponse)
-> Either String Int
-> Either String (ServicePipeline -> UpdateServicePipelineResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (ServicePipeline -> UpdateServicePipelineResponse)
-> Either String ServicePipeline
-> Either String UpdateServicePipelineResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ServicePipeline
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"pipeline")
)
instance Prelude.Hashable UpdateServicePipeline
instance Prelude.NFData UpdateServicePipeline
instance Core.ToHeaders UpdateServicePipeline where
toHeaders :: UpdateServicePipeline -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateServicePipeline -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AwsProton20200720.UpdateServicePipeline" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateServicePipeline where
toJSON :: UpdateServicePipeline -> Value
toJSON UpdateServicePipeline' {Maybe Text
Text
Sensitive Text
DeploymentUpdateType
spec :: Sensitive Text
serviceName :: Text
deploymentType :: DeploymentUpdateType
templateMajorVersion :: Maybe Text
templateMinorVersion :: Maybe Text
$sel:spec:UpdateServicePipeline' :: UpdateServicePipeline -> Sensitive Text
$sel:serviceName:UpdateServicePipeline' :: UpdateServicePipeline -> Text
$sel:deploymentType:UpdateServicePipeline' :: UpdateServicePipeline -> DeploymentUpdateType
$sel:templateMajorVersion:UpdateServicePipeline' :: UpdateServicePipeline -> Maybe Text
$sel:templateMinorVersion:UpdateServicePipeline' :: UpdateServicePipeline -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"templateMinorVersion" 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
templateMinorVersion,
(Text
"templateMajorVersion" 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
templateMajorVersion,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"deploymentType" Text -> DeploymentUpdateType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DeploymentUpdateType
deploymentType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"serviceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"spec" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
spec)
]
)
instance Core.ToPath UpdateServicePipeline where
toPath :: UpdateServicePipeline -> ByteString
toPath = ByteString -> UpdateServicePipeline -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateServicePipeline where
toQuery :: UpdateServicePipeline -> QueryString
toQuery = QueryString -> UpdateServicePipeline -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateServicePipelineResponse = UpdateServicePipelineResponse'
{
UpdateServicePipelineResponse -> Int
httpStatus :: Prelude.Int,
UpdateServicePipelineResponse -> ServicePipeline
pipeline :: ServicePipeline
}
deriving (UpdateServicePipelineResponse
-> UpdateServicePipelineResponse -> Bool
(UpdateServicePipelineResponse
-> UpdateServicePipelineResponse -> Bool)
-> (UpdateServicePipelineResponse
-> UpdateServicePipelineResponse -> Bool)
-> Eq UpdateServicePipelineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServicePipelineResponse
-> UpdateServicePipelineResponse -> Bool
$c/= :: UpdateServicePipelineResponse
-> UpdateServicePipelineResponse -> Bool
== :: UpdateServicePipelineResponse
-> UpdateServicePipelineResponse -> Bool
$c== :: UpdateServicePipelineResponse
-> UpdateServicePipelineResponse -> Bool
Prelude.Eq, Int -> UpdateServicePipelineResponse -> ShowS
[UpdateServicePipelineResponse] -> ShowS
UpdateServicePipelineResponse -> String
(Int -> UpdateServicePipelineResponse -> ShowS)
-> (UpdateServicePipelineResponse -> String)
-> ([UpdateServicePipelineResponse] -> ShowS)
-> Show UpdateServicePipelineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServicePipelineResponse] -> ShowS
$cshowList :: [UpdateServicePipelineResponse] -> ShowS
show :: UpdateServicePipelineResponse -> String
$cshow :: UpdateServicePipelineResponse -> String
showsPrec :: Int -> UpdateServicePipelineResponse -> ShowS
$cshowsPrec :: Int -> UpdateServicePipelineResponse -> ShowS
Prelude.Show, (forall x.
UpdateServicePipelineResponse
-> Rep UpdateServicePipelineResponse x)
-> (forall x.
Rep UpdateServicePipelineResponse x
-> UpdateServicePipelineResponse)
-> Generic UpdateServicePipelineResponse
forall x.
Rep UpdateServicePipelineResponse x
-> UpdateServicePipelineResponse
forall x.
UpdateServicePipelineResponse
-> Rep UpdateServicePipelineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServicePipelineResponse x
-> UpdateServicePipelineResponse
$cfrom :: forall x.
UpdateServicePipelineResponse
-> Rep UpdateServicePipelineResponse x
Prelude.Generic)
newUpdateServicePipelineResponse ::
Prelude.Int ->
ServicePipeline ->
UpdateServicePipelineResponse
newUpdateServicePipelineResponse :: Int -> ServicePipeline -> UpdateServicePipelineResponse
newUpdateServicePipelineResponse
Int
pHttpStatus_
ServicePipeline
pPipeline_ =
UpdateServicePipelineResponse' :: Int -> ServicePipeline -> UpdateServicePipelineResponse
UpdateServicePipelineResponse'
{ $sel:httpStatus:UpdateServicePipelineResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:pipeline:UpdateServicePipelineResponse' :: ServicePipeline
pipeline = ServicePipeline
pPipeline_
}
updateServicePipelineResponse_httpStatus :: Lens.Lens' UpdateServicePipelineResponse Prelude.Int
updateServicePipelineResponse_httpStatus :: (Int -> f Int)
-> UpdateServicePipelineResponse -> f UpdateServicePipelineResponse
updateServicePipelineResponse_httpStatus = (UpdateServicePipelineResponse -> Int)
-> (UpdateServicePipelineResponse
-> Int -> UpdateServicePipelineResponse)
-> Lens
UpdateServicePipelineResponse UpdateServicePipelineResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServicePipelineResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServicePipelineResponse' :: UpdateServicePipelineResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServicePipelineResponse
s@UpdateServicePipelineResponse' {} Int
a -> UpdateServicePipelineResponse
s {$sel:httpStatus:UpdateServicePipelineResponse' :: Int
httpStatus = Int
a} :: UpdateServicePipelineResponse)
updateServicePipelineResponse_pipeline :: Lens.Lens' UpdateServicePipelineResponse ServicePipeline
updateServicePipelineResponse_pipeline :: (ServicePipeline -> f ServicePipeline)
-> UpdateServicePipelineResponse -> f UpdateServicePipelineResponse
updateServicePipelineResponse_pipeline = (UpdateServicePipelineResponse -> ServicePipeline)
-> (UpdateServicePipelineResponse
-> ServicePipeline -> UpdateServicePipelineResponse)
-> Lens
UpdateServicePipelineResponse
UpdateServicePipelineResponse
ServicePipeline
ServicePipeline
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServicePipelineResponse' {ServicePipeline
pipeline :: ServicePipeline
$sel:pipeline:UpdateServicePipelineResponse' :: UpdateServicePipelineResponse -> ServicePipeline
pipeline} -> ServicePipeline
pipeline) (\s :: UpdateServicePipelineResponse
s@UpdateServicePipelineResponse' {} ServicePipeline
a -> UpdateServicePipelineResponse
s {$sel:pipeline:UpdateServicePipelineResponse' :: ServicePipeline
pipeline = ServicePipeline
a} :: UpdateServicePipelineResponse)
instance Prelude.NFData UpdateServicePipelineResponse