{-# 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.AcceptEnvironmentAccountConnection
(
AcceptEnvironmentAccountConnection (..),
newAcceptEnvironmentAccountConnection,
acceptEnvironmentAccountConnection_id,
AcceptEnvironmentAccountConnectionResponse (..),
newAcceptEnvironmentAccountConnectionResponse,
acceptEnvironmentAccountConnectionResponse_httpStatus,
acceptEnvironmentAccountConnectionResponse_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 AcceptEnvironmentAccountConnection = AcceptEnvironmentAccountConnection'
{
AcceptEnvironmentAccountConnection -> Text
id :: Prelude.Text
}
deriving (AcceptEnvironmentAccountConnection
-> AcceptEnvironmentAccountConnection -> Bool
(AcceptEnvironmentAccountConnection
-> AcceptEnvironmentAccountConnection -> Bool)
-> (AcceptEnvironmentAccountConnection
-> AcceptEnvironmentAccountConnection -> Bool)
-> Eq AcceptEnvironmentAccountConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptEnvironmentAccountConnection
-> AcceptEnvironmentAccountConnection -> Bool
$c/= :: AcceptEnvironmentAccountConnection
-> AcceptEnvironmentAccountConnection -> Bool
== :: AcceptEnvironmentAccountConnection
-> AcceptEnvironmentAccountConnection -> Bool
$c== :: AcceptEnvironmentAccountConnection
-> AcceptEnvironmentAccountConnection -> Bool
Prelude.Eq, ReadPrec [AcceptEnvironmentAccountConnection]
ReadPrec AcceptEnvironmentAccountConnection
Int -> ReadS AcceptEnvironmentAccountConnection
ReadS [AcceptEnvironmentAccountConnection]
(Int -> ReadS AcceptEnvironmentAccountConnection)
-> ReadS [AcceptEnvironmentAccountConnection]
-> ReadPrec AcceptEnvironmentAccountConnection
-> ReadPrec [AcceptEnvironmentAccountConnection]
-> Read AcceptEnvironmentAccountConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptEnvironmentAccountConnection]
$creadListPrec :: ReadPrec [AcceptEnvironmentAccountConnection]
readPrec :: ReadPrec AcceptEnvironmentAccountConnection
$creadPrec :: ReadPrec AcceptEnvironmentAccountConnection
readList :: ReadS [AcceptEnvironmentAccountConnection]
$creadList :: ReadS [AcceptEnvironmentAccountConnection]
readsPrec :: Int -> ReadS AcceptEnvironmentAccountConnection
$creadsPrec :: Int -> ReadS AcceptEnvironmentAccountConnection
Prelude.Read, Int -> AcceptEnvironmentAccountConnection -> ShowS
[AcceptEnvironmentAccountConnection] -> ShowS
AcceptEnvironmentAccountConnection -> String
(Int -> AcceptEnvironmentAccountConnection -> ShowS)
-> (AcceptEnvironmentAccountConnection -> String)
-> ([AcceptEnvironmentAccountConnection] -> ShowS)
-> Show AcceptEnvironmentAccountConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptEnvironmentAccountConnection] -> ShowS
$cshowList :: [AcceptEnvironmentAccountConnection] -> ShowS
show :: AcceptEnvironmentAccountConnection -> String
$cshow :: AcceptEnvironmentAccountConnection -> String
showsPrec :: Int -> AcceptEnvironmentAccountConnection -> ShowS
$cshowsPrec :: Int -> AcceptEnvironmentAccountConnection -> ShowS
Prelude.Show, (forall x.
AcceptEnvironmentAccountConnection
-> Rep AcceptEnvironmentAccountConnection x)
-> (forall x.
Rep AcceptEnvironmentAccountConnection x
-> AcceptEnvironmentAccountConnection)
-> Generic AcceptEnvironmentAccountConnection
forall x.
Rep AcceptEnvironmentAccountConnection x
-> AcceptEnvironmentAccountConnection
forall x.
AcceptEnvironmentAccountConnection
-> Rep AcceptEnvironmentAccountConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcceptEnvironmentAccountConnection x
-> AcceptEnvironmentAccountConnection
$cfrom :: forall x.
AcceptEnvironmentAccountConnection
-> Rep AcceptEnvironmentAccountConnection x
Prelude.Generic)
newAcceptEnvironmentAccountConnection ::
Prelude.Text ->
AcceptEnvironmentAccountConnection
newAcceptEnvironmentAccountConnection :: Text -> AcceptEnvironmentAccountConnection
newAcceptEnvironmentAccountConnection Text
pId_ =
AcceptEnvironmentAccountConnection' :: Text -> AcceptEnvironmentAccountConnection
AcceptEnvironmentAccountConnection' {$sel:id:AcceptEnvironmentAccountConnection' :: Text
id = Text
pId_}
acceptEnvironmentAccountConnection_id :: Lens.Lens' AcceptEnvironmentAccountConnection Prelude.Text
acceptEnvironmentAccountConnection_id :: (Text -> f Text)
-> AcceptEnvironmentAccountConnection
-> f AcceptEnvironmentAccountConnection
acceptEnvironmentAccountConnection_id = (AcceptEnvironmentAccountConnection -> Text)
-> (AcceptEnvironmentAccountConnection
-> Text -> AcceptEnvironmentAccountConnection)
-> Lens
AcceptEnvironmentAccountConnection
AcceptEnvironmentAccountConnection
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptEnvironmentAccountConnection' {Text
id :: Text
$sel:id:AcceptEnvironmentAccountConnection' :: AcceptEnvironmentAccountConnection -> Text
id} -> Text
id) (\s :: AcceptEnvironmentAccountConnection
s@AcceptEnvironmentAccountConnection' {} Text
a -> AcceptEnvironmentAccountConnection
s {$sel:id:AcceptEnvironmentAccountConnection' :: Text
id = Text
a} :: AcceptEnvironmentAccountConnection)
instance
Core.AWSRequest
AcceptEnvironmentAccountConnection
where
type
AWSResponse AcceptEnvironmentAccountConnection =
AcceptEnvironmentAccountConnectionResponse
request :: AcceptEnvironmentAccountConnection
-> Request AcceptEnvironmentAccountConnection
request = Service
-> AcceptEnvironmentAccountConnection
-> Request AcceptEnvironmentAccountConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AcceptEnvironmentAccountConnection
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AcceptEnvironmentAccountConnection)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AcceptEnvironmentAccountConnection))
-> Logger
-> Service
-> Proxy AcceptEnvironmentAccountConnection
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AcceptEnvironmentAccountConnection)))
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
-> AcceptEnvironmentAccountConnectionResponse
AcceptEnvironmentAccountConnectionResponse'
(Int
-> EnvironmentAccountConnection
-> AcceptEnvironmentAccountConnectionResponse)
-> Either String Int
-> Either
String
(EnvironmentAccountConnection
-> AcceptEnvironmentAccountConnectionResponse)
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
-> AcceptEnvironmentAccountConnectionResponse)
-> Either String EnvironmentAccountConnection
-> Either String AcceptEnvironmentAccountConnectionResponse
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
AcceptEnvironmentAccountConnection
instance
Prelude.NFData
AcceptEnvironmentAccountConnection
instance
Core.ToHeaders
AcceptEnvironmentAccountConnection
where
toHeaders :: AcceptEnvironmentAccountConnection -> ResponseHeaders
toHeaders =
ResponseHeaders
-> AcceptEnvironmentAccountConnection -> 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.AcceptEnvironmentAccountConnection" ::
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
AcceptEnvironmentAccountConnection
where
toJSON :: AcceptEnvironmentAccountConnection -> Value
toJSON AcceptEnvironmentAccountConnection' {Text
id :: Text
$sel:id:AcceptEnvironmentAccountConnection' :: AcceptEnvironmentAccountConnection -> 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)])
instance
Core.ToPath
AcceptEnvironmentAccountConnection
where
toPath :: AcceptEnvironmentAccountConnection -> ByteString
toPath = ByteString -> AcceptEnvironmentAccountConnection -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
AcceptEnvironmentAccountConnection
where
toQuery :: AcceptEnvironmentAccountConnection -> QueryString
toQuery = QueryString -> AcceptEnvironmentAccountConnection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AcceptEnvironmentAccountConnectionResponse = AcceptEnvironmentAccountConnectionResponse'
{
AcceptEnvironmentAccountConnectionResponse -> Int
httpStatus :: Prelude.Int,
AcceptEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
environmentAccountConnection :: EnvironmentAccountConnection
}
deriving (AcceptEnvironmentAccountConnectionResponse
-> AcceptEnvironmentAccountConnectionResponse -> Bool
(AcceptEnvironmentAccountConnectionResponse
-> AcceptEnvironmentAccountConnectionResponse -> Bool)
-> (AcceptEnvironmentAccountConnectionResponse
-> AcceptEnvironmentAccountConnectionResponse -> Bool)
-> Eq AcceptEnvironmentAccountConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptEnvironmentAccountConnectionResponse
-> AcceptEnvironmentAccountConnectionResponse -> Bool
$c/= :: AcceptEnvironmentAccountConnectionResponse
-> AcceptEnvironmentAccountConnectionResponse -> Bool
== :: AcceptEnvironmentAccountConnectionResponse
-> AcceptEnvironmentAccountConnectionResponse -> Bool
$c== :: AcceptEnvironmentAccountConnectionResponse
-> AcceptEnvironmentAccountConnectionResponse -> Bool
Prelude.Eq, ReadPrec [AcceptEnvironmentAccountConnectionResponse]
ReadPrec AcceptEnvironmentAccountConnectionResponse
Int -> ReadS AcceptEnvironmentAccountConnectionResponse
ReadS [AcceptEnvironmentAccountConnectionResponse]
(Int -> ReadS AcceptEnvironmentAccountConnectionResponse)
-> ReadS [AcceptEnvironmentAccountConnectionResponse]
-> ReadPrec AcceptEnvironmentAccountConnectionResponse
-> ReadPrec [AcceptEnvironmentAccountConnectionResponse]
-> Read AcceptEnvironmentAccountConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptEnvironmentAccountConnectionResponse]
$creadListPrec :: ReadPrec [AcceptEnvironmentAccountConnectionResponse]
readPrec :: ReadPrec AcceptEnvironmentAccountConnectionResponse
$creadPrec :: ReadPrec AcceptEnvironmentAccountConnectionResponse
readList :: ReadS [AcceptEnvironmentAccountConnectionResponse]
$creadList :: ReadS [AcceptEnvironmentAccountConnectionResponse]
readsPrec :: Int -> ReadS AcceptEnvironmentAccountConnectionResponse
$creadsPrec :: Int -> ReadS AcceptEnvironmentAccountConnectionResponse
Prelude.Read, Int -> AcceptEnvironmentAccountConnectionResponse -> ShowS
[AcceptEnvironmentAccountConnectionResponse] -> ShowS
AcceptEnvironmentAccountConnectionResponse -> String
(Int -> AcceptEnvironmentAccountConnectionResponse -> ShowS)
-> (AcceptEnvironmentAccountConnectionResponse -> String)
-> ([AcceptEnvironmentAccountConnectionResponse] -> ShowS)
-> Show AcceptEnvironmentAccountConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptEnvironmentAccountConnectionResponse] -> ShowS
$cshowList :: [AcceptEnvironmentAccountConnectionResponse] -> ShowS
show :: AcceptEnvironmentAccountConnectionResponse -> String
$cshow :: AcceptEnvironmentAccountConnectionResponse -> String
showsPrec :: Int -> AcceptEnvironmentAccountConnectionResponse -> ShowS
$cshowsPrec :: Int -> AcceptEnvironmentAccountConnectionResponse -> ShowS
Prelude.Show, (forall x.
AcceptEnvironmentAccountConnectionResponse
-> Rep AcceptEnvironmentAccountConnectionResponse x)
-> (forall x.
Rep AcceptEnvironmentAccountConnectionResponse x
-> AcceptEnvironmentAccountConnectionResponse)
-> Generic AcceptEnvironmentAccountConnectionResponse
forall x.
Rep AcceptEnvironmentAccountConnectionResponse x
-> AcceptEnvironmentAccountConnectionResponse
forall x.
AcceptEnvironmentAccountConnectionResponse
-> Rep AcceptEnvironmentAccountConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcceptEnvironmentAccountConnectionResponse x
-> AcceptEnvironmentAccountConnectionResponse
$cfrom :: forall x.
AcceptEnvironmentAccountConnectionResponse
-> Rep AcceptEnvironmentAccountConnectionResponse x
Prelude.Generic)
newAcceptEnvironmentAccountConnectionResponse ::
Prelude.Int ->
EnvironmentAccountConnection ->
AcceptEnvironmentAccountConnectionResponse
newAcceptEnvironmentAccountConnectionResponse :: Int
-> EnvironmentAccountConnection
-> AcceptEnvironmentAccountConnectionResponse
newAcceptEnvironmentAccountConnectionResponse
Int
pHttpStatus_
EnvironmentAccountConnection
pEnvironmentAccountConnection_ =
AcceptEnvironmentAccountConnectionResponse' :: Int
-> EnvironmentAccountConnection
-> AcceptEnvironmentAccountConnectionResponse
AcceptEnvironmentAccountConnectionResponse'
{ $sel:httpStatus:AcceptEnvironmentAccountConnectionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:environmentAccountConnection:AcceptEnvironmentAccountConnectionResponse' :: EnvironmentAccountConnection
environmentAccountConnection =
EnvironmentAccountConnection
pEnvironmentAccountConnection_
}
acceptEnvironmentAccountConnectionResponse_httpStatus :: Lens.Lens' AcceptEnvironmentAccountConnectionResponse Prelude.Int
acceptEnvironmentAccountConnectionResponse_httpStatus :: (Int -> f Int)
-> AcceptEnvironmentAccountConnectionResponse
-> f AcceptEnvironmentAccountConnectionResponse
acceptEnvironmentAccountConnectionResponse_httpStatus = (AcceptEnvironmentAccountConnectionResponse -> Int)
-> (AcceptEnvironmentAccountConnectionResponse
-> Int -> AcceptEnvironmentAccountConnectionResponse)
-> Lens
AcceptEnvironmentAccountConnectionResponse
AcceptEnvironmentAccountConnectionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptEnvironmentAccountConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:AcceptEnvironmentAccountConnectionResponse' :: AcceptEnvironmentAccountConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AcceptEnvironmentAccountConnectionResponse
s@AcceptEnvironmentAccountConnectionResponse' {} Int
a -> AcceptEnvironmentAccountConnectionResponse
s {$sel:httpStatus:AcceptEnvironmentAccountConnectionResponse' :: Int
httpStatus = Int
a} :: AcceptEnvironmentAccountConnectionResponse)
acceptEnvironmentAccountConnectionResponse_environmentAccountConnection :: Lens.Lens' AcceptEnvironmentAccountConnectionResponse EnvironmentAccountConnection
acceptEnvironmentAccountConnectionResponse_environmentAccountConnection :: (EnvironmentAccountConnection -> f EnvironmentAccountConnection)
-> AcceptEnvironmentAccountConnectionResponse
-> f AcceptEnvironmentAccountConnectionResponse
acceptEnvironmentAccountConnectionResponse_environmentAccountConnection = (AcceptEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection)
-> (AcceptEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
-> AcceptEnvironmentAccountConnectionResponse)
-> Lens
AcceptEnvironmentAccountConnectionResponse
AcceptEnvironmentAccountConnectionResponse
EnvironmentAccountConnection
EnvironmentAccountConnection
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptEnvironmentAccountConnectionResponse' {EnvironmentAccountConnection
environmentAccountConnection :: EnvironmentAccountConnection
$sel:environmentAccountConnection:AcceptEnvironmentAccountConnectionResponse' :: AcceptEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
environmentAccountConnection} -> EnvironmentAccountConnection
environmentAccountConnection) (\s :: AcceptEnvironmentAccountConnectionResponse
s@AcceptEnvironmentAccountConnectionResponse' {} EnvironmentAccountConnection
a -> AcceptEnvironmentAccountConnectionResponse
s {$sel:environmentAccountConnection:AcceptEnvironmentAccountConnectionResponse' :: EnvironmentAccountConnection
environmentAccountConnection = EnvironmentAccountConnection
a} :: AcceptEnvironmentAccountConnectionResponse)
instance
Prelude.NFData
AcceptEnvironmentAccountConnectionResponse