{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE OverloadedStrings  #-}
{-# LANGUAGE RecordWildCards    #-}
{-# LANGUAGE TypeFamilies       #-}

{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds   #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Network.AWS.APIGateway.DeleteIntegration
-- Copyright   : (c) 2013-2016 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Represents a delete integration.
--
--
module Network.AWS.APIGateway.DeleteIntegration
    (
    -- * Creating a Request
      deleteIntegration
    , DeleteIntegration
    -- * Request Lenses
    , delRestAPIId
    , delResourceId
    , delHttpMethod

    -- * Destructuring the Response
    , deleteIntegrationResponse'
    , DeleteIntegrationResponse'
    ) where

import           Network.AWS.APIGateway.Types
import           Network.AWS.APIGateway.Types.Product
import           Network.AWS.Lens
import           Network.AWS.Prelude
import           Network.AWS.Request
import           Network.AWS.Response

-- | Represents a delete integration request.
--
--
--
-- /See:/ 'deleteIntegration' smart constructor.
data DeleteIntegration = DeleteIntegration'
    { _delRestAPIId  :: !Text
    , _delResourceId :: !Text
    , _delHttpMethod :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DeleteIntegration' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'delRestAPIId' - Specifies a delete integration request's API identifier.
--
-- * 'delResourceId' - Specifies a delete integration request's resource identifier.
--
-- * 'delHttpMethod' - Specifies a delete integration request's HTTP method.
deleteIntegration
    :: Text -- ^ 'delRestAPIId'
    -> Text -- ^ 'delResourceId'
    -> Text -- ^ 'delHttpMethod'
    -> DeleteIntegration
deleteIntegration pRestAPIId_ pResourceId_ pHttpMethod_ =
    DeleteIntegration'
    { _delRestAPIId = pRestAPIId_
    , _delResourceId = pResourceId_
    , _delHttpMethod = pHttpMethod_
    }

-- | Specifies a delete integration request's API identifier.
delRestAPIId :: Lens' DeleteIntegration Text
delRestAPIId = lens _delRestAPIId (\ s a -> s{_delRestAPIId = a});

-- | Specifies a delete integration request's resource identifier.
delResourceId :: Lens' DeleteIntegration Text
delResourceId = lens _delResourceId (\ s a -> s{_delResourceId = a});

-- | Specifies a delete integration request's HTTP method.
delHttpMethod :: Lens' DeleteIntegration Text
delHttpMethod = lens _delHttpMethod (\ s a -> s{_delHttpMethod = a});

instance AWSRequest DeleteIntegration where
        type Rs DeleteIntegration =
             DeleteIntegrationResponse'
        request = delete apiGateway
        response = receiveNull DeleteIntegrationResponse''

instance Hashable DeleteIntegration

instance NFData DeleteIntegration

instance ToHeaders DeleteIntegration where
        toHeaders
          = const
              (mconcat
                 ["Accept" =# ("application/json" :: ByteString)])

instance ToPath DeleteIntegration where
        toPath DeleteIntegration'{..}
          = mconcat
              ["/restapis/", toBS _delRestAPIId, "/resources/",
               toBS _delResourceId, "/methods/",
               toBS _delHttpMethod, "/integration"]

instance ToQuery DeleteIntegration where
        toQuery = const mempty

-- | /See:/ 'deleteIntegrationResponse'' smart constructor.
data DeleteIntegrationResponse' =
    DeleteIntegrationResponse''
    deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DeleteIntegrationResponse'' with the minimum fields required to make a request.
--
deleteIntegrationResponse'
    :: DeleteIntegrationResponse'
deleteIntegrationResponse' = DeleteIntegrationResponse''

instance NFData DeleteIntegrationResponse'