module Network.AWS.DirectConnect.ConfirmConnection
(
ConfirmConnection
, confirmConnection
, ccConnectionId
, ConfirmConnectionResponse
, confirmConnectionResponse
, ccr1ConnectionState
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.DirectConnect.Types
import qualified GHC.Exts
newtype ConfirmConnection = ConfirmConnection
{ _ccConnectionId :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
confirmConnection :: Text
-> ConfirmConnection
confirmConnection p1 = ConfirmConnection
{ _ccConnectionId = p1
}
ccConnectionId :: Lens' ConfirmConnection Text
ccConnectionId = lens _ccConnectionId (\s a -> s { _ccConnectionId = a })
newtype ConfirmConnectionResponse = ConfirmConnectionResponse
{ _ccr1ConnectionState :: Maybe ConnectionState
} deriving (Eq, Show)
confirmConnectionResponse :: ConfirmConnectionResponse
confirmConnectionResponse = ConfirmConnectionResponse
{ _ccr1ConnectionState = Nothing
}
ccr1ConnectionState :: Lens' ConfirmConnectionResponse (Maybe ConnectionState)
ccr1ConnectionState =
lens _ccr1ConnectionState (\s a -> s { _ccr1ConnectionState = a })
instance ToPath ConfirmConnection where
toPath = const "/"
instance ToQuery ConfirmConnection where
toQuery = const mempty
instance ToHeaders ConfirmConnection
instance ToJSON ConfirmConnection where
toJSON ConfirmConnection{..} = object
[ "connectionId" .= _ccConnectionId
]
instance AWSRequest ConfirmConnection where
type Sv ConfirmConnection = DirectConnect
type Rs ConfirmConnection = ConfirmConnectionResponse
request = post "ConfirmConnection"
response = jsonResponse
instance FromJSON ConfirmConnectionResponse where
parseJSON = withObject "ConfirmConnectionResponse" $ \o -> ConfirmConnectionResponse
<$> o .:? "connectionState"