{-# 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.UpdateBasePathMapping -- Copyright : (c) 2013-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Changes information about the < BasePathMapping> resource. module Network.AWS.APIGateway.UpdateBasePathMapping ( -- * Creating a Request updateBasePathMapping , UpdateBasePathMapping -- * Request Lenses , ubpmPatchOperations , ubpmDomainName , ubpmBasePath -- * Destructuring the Response , basePathMapping , BasePathMapping -- * Response Lenses , bpmStage , bpmBasePath , bpmRestAPIId ) 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 -- | A request to change information about the < BasePathMapping> resource. -- -- /See:/ 'updateBasePathMapping' smart constructor. data UpdateBasePathMapping = UpdateBasePathMapping' { _ubpmPatchOperations :: !(Maybe [PatchOperation]) , _ubpmDomainName :: !Text , _ubpmBasePath :: !Text } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'UpdateBasePathMapping' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ubpmPatchOperations' -- -- * 'ubpmDomainName' -- -- * 'ubpmBasePath' updateBasePathMapping :: Text -- ^ 'ubpmDomainName' -> Text -- ^ 'ubpmBasePath' -> UpdateBasePathMapping updateBasePathMapping pDomainName_ pBasePath_ = UpdateBasePathMapping' { _ubpmPatchOperations = Nothing , _ubpmDomainName = pDomainName_ , _ubpmBasePath = pBasePath_ } -- | A list of operations describing the updates to apply to the specified -- resource. The patches are applied in the order specified in the list. ubpmPatchOperations :: Lens' UpdateBasePathMapping [PatchOperation] ubpmPatchOperations = lens _ubpmPatchOperations (\ s a -> s{_ubpmPatchOperations = a}) . _Default . _Coerce; -- | The domain name of the < BasePathMapping> resource to change. ubpmDomainName :: Lens' UpdateBasePathMapping Text ubpmDomainName = lens _ubpmDomainName (\ s a -> s{_ubpmDomainName = a}); -- | The base path of the < BasePathMapping> resource to change. ubpmBasePath :: Lens' UpdateBasePathMapping Text ubpmBasePath = lens _ubpmBasePath (\ s a -> s{_ubpmBasePath = a}); instance AWSRequest UpdateBasePathMapping where type Rs UpdateBasePathMapping = BasePathMapping request = patchJSON apiGateway response = receiveJSON (\ s h x -> eitherParseJSON x) instance Hashable UpdateBasePathMapping instance NFData UpdateBasePathMapping instance ToHeaders UpdateBasePathMapping where toHeaders = const (mconcat ["Accept" =# ("application/json" :: ByteString)]) instance ToJSON UpdateBasePathMapping where toJSON UpdateBasePathMapping'{..} = object (catMaybes [("patchOperations" .=) <$> _ubpmPatchOperations]) instance ToPath UpdateBasePathMapping where toPath UpdateBasePathMapping'{..} = mconcat ["/domainnames/", toBS _ubpmDomainName, "/basepathmappings/", toBS _ubpmBasePath] instance ToQuery UpdateBasePathMapping where toQuery = const mempty