{-# 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.UpdateEnvironmentAccountConnection
(
UpdateEnvironmentAccountConnection (..),
newUpdateEnvironmentAccountConnection,
updateEnvironmentAccountConnection_id,
updateEnvironmentAccountConnection_roleArn,
UpdateEnvironmentAccountConnectionResponse (..),
newUpdateEnvironmentAccountConnectionResponse,
updateEnvironmentAccountConnectionResponse_httpStatus,
updateEnvironmentAccountConnectionResponse_environmentAccountConnection,
)
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 UpdateEnvironmentAccountConnection = UpdateEnvironmentAccountConnection'
{
UpdateEnvironmentAccountConnection -> Text
id :: Prelude.Text,
UpdateEnvironmentAccountConnection -> Text
roleArn :: Prelude.Text
}
deriving (UpdateEnvironmentAccountConnection
-> UpdateEnvironmentAccountConnection -> Bool
(UpdateEnvironmentAccountConnection
-> UpdateEnvironmentAccountConnection -> Bool)
-> (UpdateEnvironmentAccountConnection
-> UpdateEnvironmentAccountConnection -> Bool)
-> Eq UpdateEnvironmentAccountConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnvironmentAccountConnection
-> UpdateEnvironmentAccountConnection -> Bool
$c/= :: UpdateEnvironmentAccountConnection
-> UpdateEnvironmentAccountConnection -> Bool
== :: UpdateEnvironmentAccountConnection
-> UpdateEnvironmentAccountConnection -> Bool
$c== :: UpdateEnvironmentAccountConnection
-> UpdateEnvironmentAccountConnection -> Bool
Prelude.Eq, ReadPrec [UpdateEnvironmentAccountConnection]
ReadPrec UpdateEnvironmentAccountConnection
Int -> ReadS UpdateEnvironmentAccountConnection
ReadS [UpdateEnvironmentAccountConnection]
(Int -> ReadS UpdateEnvironmentAccountConnection)
-> ReadS [UpdateEnvironmentAccountConnection]
-> ReadPrec UpdateEnvironmentAccountConnection
-> ReadPrec [UpdateEnvironmentAccountConnection]
-> Read UpdateEnvironmentAccountConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnvironmentAccountConnection]
$creadListPrec :: ReadPrec [UpdateEnvironmentAccountConnection]
readPrec :: ReadPrec UpdateEnvironmentAccountConnection
$creadPrec :: ReadPrec UpdateEnvironmentAccountConnection
readList :: ReadS [UpdateEnvironmentAccountConnection]
$creadList :: ReadS [UpdateEnvironmentAccountConnection]
readsPrec :: Int -> ReadS UpdateEnvironmentAccountConnection
$creadsPrec :: Int -> ReadS UpdateEnvironmentAccountConnection
Prelude.Read, Int -> UpdateEnvironmentAccountConnection -> ShowS
[UpdateEnvironmentAccountConnection] -> ShowS
UpdateEnvironmentAccountConnection -> String
(Int -> UpdateEnvironmentAccountConnection -> ShowS)
-> (UpdateEnvironmentAccountConnection -> String)
-> ([UpdateEnvironmentAccountConnection] -> ShowS)
-> Show UpdateEnvironmentAccountConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnvironmentAccountConnection] -> ShowS
$cshowList :: [UpdateEnvironmentAccountConnection] -> ShowS
show :: UpdateEnvironmentAccountConnection -> String
$cshow :: UpdateEnvironmentAccountConnection -> String
showsPrec :: Int -> UpdateEnvironmentAccountConnection -> ShowS
$cshowsPrec :: Int -> UpdateEnvironmentAccountConnection -> ShowS
Prelude.Show, (forall x.
UpdateEnvironmentAccountConnection
-> Rep UpdateEnvironmentAccountConnection x)
-> (forall x.
Rep UpdateEnvironmentAccountConnection x
-> UpdateEnvironmentAccountConnection)
-> Generic UpdateEnvironmentAccountConnection
forall x.
Rep UpdateEnvironmentAccountConnection x
-> UpdateEnvironmentAccountConnection
forall x.
UpdateEnvironmentAccountConnection
-> Rep UpdateEnvironmentAccountConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEnvironmentAccountConnection x
-> UpdateEnvironmentAccountConnection
$cfrom :: forall x.
UpdateEnvironmentAccountConnection
-> Rep UpdateEnvironmentAccountConnection x
Prelude.Generic)
newUpdateEnvironmentAccountConnection ::
Prelude.Text ->
Prelude.Text ->
UpdateEnvironmentAccountConnection
newUpdateEnvironmentAccountConnection :: Text -> Text -> UpdateEnvironmentAccountConnection
newUpdateEnvironmentAccountConnection Text
pId_ Text
pRoleArn_ =
UpdateEnvironmentAccountConnection' :: Text -> Text -> UpdateEnvironmentAccountConnection
UpdateEnvironmentAccountConnection'
{ $sel:id:UpdateEnvironmentAccountConnection' :: Text
id = Text
pId_,
$sel:roleArn:UpdateEnvironmentAccountConnection' :: Text
roleArn = Text
pRoleArn_
}
updateEnvironmentAccountConnection_id :: Lens.Lens' UpdateEnvironmentAccountConnection Prelude.Text
updateEnvironmentAccountConnection_id :: (Text -> f Text)
-> UpdateEnvironmentAccountConnection
-> f UpdateEnvironmentAccountConnection
updateEnvironmentAccountConnection_id = (UpdateEnvironmentAccountConnection -> Text)
-> (UpdateEnvironmentAccountConnection
-> Text -> UpdateEnvironmentAccountConnection)
-> Lens
UpdateEnvironmentAccountConnection
UpdateEnvironmentAccountConnection
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentAccountConnection' {Text
id :: Text
$sel:id:UpdateEnvironmentAccountConnection' :: UpdateEnvironmentAccountConnection -> Text
id} -> Text
id) (\s :: UpdateEnvironmentAccountConnection
s@UpdateEnvironmentAccountConnection' {} Text
a -> UpdateEnvironmentAccountConnection
s {$sel:id:UpdateEnvironmentAccountConnection' :: Text
id = Text
a} :: UpdateEnvironmentAccountConnection)
updateEnvironmentAccountConnection_roleArn :: Lens.Lens' UpdateEnvironmentAccountConnection Prelude.Text
updateEnvironmentAccountConnection_roleArn :: (Text -> f Text)
-> UpdateEnvironmentAccountConnection
-> f UpdateEnvironmentAccountConnection
updateEnvironmentAccountConnection_roleArn = (UpdateEnvironmentAccountConnection -> Text)
-> (UpdateEnvironmentAccountConnection
-> Text -> UpdateEnvironmentAccountConnection)
-> Lens
UpdateEnvironmentAccountConnection
UpdateEnvironmentAccountConnection
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentAccountConnection' {Text
roleArn :: Text
$sel:roleArn:UpdateEnvironmentAccountConnection' :: UpdateEnvironmentAccountConnection -> Text
roleArn} -> Text
roleArn) (\s :: UpdateEnvironmentAccountConnection
s@UpdateEnvironmentAccountConnection' {} Text
a -> UpdateEnvironmentAccountConnection
s {$sel:roleArn:UpdateEnvironmentAccountConnection' :: Text
roleArn = Text
a} :: UpdateEnvironmentAccountConnection)
instance
Core.AWSRequest
UpdateEnvironmentAccountConnection
where
type
AWSResponse UpdateEnvironmentAccountConnection =
UpdateEnvironmentAccountConnectionResponse
request :: UpdateEnvironmentAccountConnection
-> Request UpdateEnvironmentAccountConnection
request = Service
-> UpdateEnvironmentAccountConnection
-> Request UpdateEnvironmentAccountConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateEnvironmentAccountConnection
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateEnvironmentAccountConnection)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateEnvironmentAccountConnection))
-> Logger
-> Service
-> Proxy UpdateEnvironmentAccountConnection
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateEnvironmentAccountConnection)))
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
-> EnvironmentAccountConnection
-> UpdateEnvironmentAccountConnectionResponse
UpdateEnvironmentAccountConnectionResponse'
(Int
-> EnvironmentAccountConnection
-> UpdateEnvironmentAccountConnectionResponse)
-> Either String Int
-> Either
String
(EnvironmentAccountConnection
-> UpdateEnvironmentAccountConnectionResponse)
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
(EnvironmentAccountConnection
-> UpdateEnvironmentAccountConnectionResponse)
-> Either String EnvironmentAccountConnection
-> Either String UpdateEnvironmentAccountConnectionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String EnvironmentAccountConnection
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"environmentAccountConnection")
)
instance
Prelude.Hashable
UpdateEnvironmentAccountConnection
instance
Prelude.NFData
UpdateEnvironmentAccountConnection
instance
Core.ToHeaders
UpdateEnvironmentAccountConnection
where
toHeaders :: UpdateEnvironmentAccountConnection -> ResponseHeaders
toHeaders =
ResponseHeaders
-> UpdateEnvironmentAccountConnection -> 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.UpdateEnvironmentAccountConnection" ::
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
UpdateEnvironmentAccountConnection
where
toJSON :: UpdateEnvironmentAccountConnection -> Value
toJSON UpdateEnvironmentAccountConnection' {Text
roleArn :: Text
id :: Text
$sel:roleArn:UpdateEnvironmentAccountConnection' :: UpdateEnvironmentAccountConnection -> Text
$sel:id:UpdateEnvironmentAccountConnection' :: UpdateEnvironmentAccountConnection -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
]
)
instance
Core.ToPath
UpdateEnvironmentAccountConnection
where
toPath :: UpdateEnvironmentAccountConnection -> ByteString
toPath = ByteString -> UpdateEnvironmentAccountConnection -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
UpdateEnvironmentAccountConnection
where
toQuery :: UpdateEnvironmentAccountConnection -> QueryString
toQuery = QueryString -> UpdateEnvironmentAccountConnection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateEnvironmentAccountConnectionResponse = UpdateEnvironmentAccountConnectionResponse'
{
UpdateEnvironmentAccountConnectionResponse -> Int
httpStatus :: Prelude.Int,
UpdateEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
environmentAccountConnection :: EnvironmentAccountConnection
}
deriving (UpdateEnvironmentAccountConnectionResponse
-> UpdateEnvironmentAccountConnectionResponse -> Bool
(UpdateEnvironmentAccountConnectionResponse
-> UpdateEnvironmentAccountConnectionResponse -> Bool)
-> (UpdateEnvironmentAccountConnectionResponse
-> UpdateEnvironmentAccountConnectionResponse -> Bool)
-> Eq UpdateEnvironmentAccountConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnvironmentAccountConnectionResponse
-> UpdateEnvironmentAccountConnectionResponse -> Bool
$c/= :: UpdateEnvironmentAccountConnectionResponse
-> UpdateEnvironmentAccountConnectionResponse -> Bool
== :: UpdateEnvironmentAccountConnectionResponse
-> UpdateEnvironmentAccountConnectionResponse -> Bool
$c== :: UpdateEnvironmentAccountConnectionResponse
-> UpdateEnvironmentAccountConnectionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEnvironmentAccountConnectionResponse]
ReadPrec UpdateEnvironmentAccountConnectionResponse
Int -> ReadS UpdateEnvironmentAccountConnectionResponse
ReadS [UpdateEnvironmentAccountConnectionResponse]
(Int -> ReadS UpdateEnvironmentAccountConnectionResponse)
-> ReadS [UpdateEnvironmentAccountConnectionResponse]
-> ReadPrec UpdateEnvironmentAccountConnectionResponse
-> ReadPrec [UpdateEnvironmentAccountConnectionResponse]
-> Read UpdateEnvironmentAccountConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnvironmentAccountConnectionResponse]
$creadListPrec :: ReadPrec [UpdateEnvironmentAccountConnectionResponse]
readPrec :: ReadPrec UpdateEnvironmentAccountConnectionResponse
$creadPrec :: ReadPrec UpdateEnvironmentAccountConnectionResponse
readList :: ReadS [UpdateEnvironmentAccountConnectionResponse]
$creadList :: ReadS [UpdateEnvironmentAccountConnectionResponse]
readsPrec :: Int -> ReadS UpdateEnvironmentAccountConnectionResponse
$creadsPrec :: Int -> ReadS UpdateEnvironmentAccountConnectionResponse
Prelude.Read, Int -> UpdateEnvironmentAccountConnectionResponse -> ShowS
[UpdateEnvironmentAccountConnectionResponse] -> ShowS
UpdateEnvironmentAccountConnectionResponse -> String
(Int -> UpdateEnvironmentAccountConnectionResponse -> ShowS)
-> (UpdateEnvironmentAccountConnectionResponse -> String)
-> ([UpdateEnvironmentAccountConnectionResponse] -> ShowS)
-> Show UpdateEnvironmentAccountConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnvironmentAccountConnectionResponse] -> ShowS
$cshowList :: [UpdateEnvironmentAccountConnectionResponse] -> ShowS
show :: UpdateEnvironmentAccountConnectionResponse -> String
$cshow :: UpdateEnvironmentAccountConnectionResponse -> String
showsPrec :: Int -> UpdateEnvironmentAccountConnectionResponse -> ShowS
$cshowsPrec :: Int -> UpdateEnvironmentAccountConnectionResponse -> ShowS
Prelude.Show, (forall x.
UpdateEnvironmentAccountConnectionResponse
-> Rep UpdateEnvironmentAccountConnectionResponse x)
-> (forall x.
Rep UpdateEnvironmentAccountConnectionResponse x
-> UpdateEnvironmentAccountConnectionResponse)
-> Generic UpdateEnvironmentAccountConnectionResponse
forall x.
Rep UpdateEnvironmentAccountConnectionResponse x
-> UpdateEnvironmentAccountConnectionResponse
forall x.
UpdateEnvironmentAccountConnectionResponse
-> Rep UpdateEnvironmentAccountConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEnvironmentAccountConnectionResponse x
-> UpdateEnvironmentAccountConnectionResponse
$cfrom :: forall x.
UpdateEnvironmentAccountConnectionResponse
-> Rep UpdateEnvironmentAccountConnectionResponse x
Prelude.Generic)
newUpdateEnvironmentAccountConnectionResponse ::
Prelude.Int ->
EnvironmentAccountConnection ->
UpdateEnvironmentAccountConnectionResponse
newUpdateEnvironmentAccountConnectionResponse :: Int
-> EnvironmentAccountConnection
-> UpdateEnvironmentAccountConnectionResponse
newUpdateEnvironmentAccountConnectionResponse
Int
pHttpStatus_
EnvironmentAccountConnection
pEnvironmentAccountConnection_ =
UpdateEnvironmentAccountConnectionResponse' :: Int
-> EnvironmentAccountConnection
-> UpdateEnvironmentAccountConnectionResponse
UpdateEnvironmentAccountConnectionResponse'
{ $sel:httpStatus:UpdateEnvironmentAccountConnectionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:environmentAccountConnection:UpdateEnvironmentAccountConnectionResponse' :: EnvironmentAccountConnection
environmentAccountConnection =
EnvironmentAccountConnection
pEnvironmentAccountConnection_
}
updateEnvironmentAccountConnectionResponse_httpStatus :: Lens.Lens' UpdateEnvironmentAccountConnectionResponse Prelude.Int
updateEnvironmentAccountConnectionResponse_httpStatus :: (Int -> f Int)
-> UpdateEnvironmentAccountConnectionResponse
-> f UpdateEnvironmentAccountConnectionResponse
updateEnvironmentAccountConnectionResponse_httpStatus = (UpdateEnvironmentAccountConnectionResponse -> Int)
-> (UpdateEnvironmentAccountConnectionResponse
-> Int -> UpdateEnvironmentAccountConnectionResponse)
-> Lens
UpdateEnvironmentAccountConnectionResponse
UpdateEnvironmentAccountConnectionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentAccountConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEnvironmentAccountConnectionResponse' :: UpdateEnvironmentAccountConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEnvironmentAccountConnectionResponse
s@UpdateEnvironmentAccountConnectionResponse' {} Int
a -> UpdateEnvironmentAccountConnectionResponse
s {$sel:httpStatus:UpdateEnvironmentAccountConnectionResponse' :: Int
httpStatus = Int
a} :: UpdateEnvironmentAccountConnectionResponse)
updateEnvironmentAccountConnectionResponse_environmentAccountConnection :: Lens.Lens' UpdateEnvironmentAccountConnectionResponse EnvironmentAccountConnection
updateEnvironmentAccountConnectionResponse_environmentAccountConnection :: (EnvironmentAccountConnection -> f EnvironmentAccountConnection)
-> UpdateEnvironmentAccountConnectionResponse
-> f UpdateEnvironmentAccountConnectionResponse
updateEnvironmentAccountConnectionResponse_environmentAccountConnection = (UpdateEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection)
-> (UpdateEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
-> UpdateEnvironmentAccountConnectionResponse)
-> Lens
UpdateEnvironmentAccountConnectionResponse
UpdateEnvironmentAccountConnectionResponse
EnvironmentAccountConnection
EnvironmentAccountConnection
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentAccountConnectionResponse' {EnvironmentAccountConnection
environmentAccountConnection :: EnvironmentAccountConnection
$sel:environmentAccountConnection:UpdateEnvironmentAccountConnectionResponse' :: UpdateEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
environmentAccountConnection} -> EnvironmentAccountConnection
environmentAccountConnection) (\s :: UpdateEnvironmentAccountConnectionResponse
s@UpdateEnvironmentAccountConnectionResponse' {} EnvironmentAccountConnection
a -> UpdateEnvironmentAccountConnectionResponse
s {$sel:environmentAccountConnection:UpdateEnvironmentAccountConnectionResponse' :: EnvironmentAccountConnection
environmentAccountConnection = EnvironmentAccountConnection
a} :: UpdateEnvironmentAccountConnectionResponse)
instance
Prelude.NFData
UpdateEnvironmentAccountConnectionResponse