gogol-compute-0.1.1: gen/Network/Google/Resource/Compute/URLMaps/InvalidateCache.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.Compute.URLMaps.InvalidateCache
-- Copyright : (c) 2015-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)
--
-- Initiates a cache invalidation operation, invalidating the specified
-- path, scoped to the specified UrlMap.
--
-- /See:/ <https://developers.google.com/compute/docs/reference/latest/ Compute Engine API Reference> for @compute.urlMaps.invalidateCache@.
module Network.Google.Resource.Compute.URLMaps.InvalidateCache
(
-- * REST Resource
URLMapsInvalidateCacheResource
-- * Creating a Request
, urlMapsInvalidateCache
, URLMapsInvalidateCache
-- * Request Lenses
, umicURLMap
, umicProject
, umicPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
-- | A resource alias for @compute.urlMaps.invalidateCache@ method which the
-- 'URLMapsInvalidateCache' request conforms to.
type URLMapsInvalidateCacheResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"urlMaps" :>
Capture "urlMap" Text :>
"invalidateCache" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CacheInvalidationRule :>
Post '[JSON] Operation
-- | Initiates a cache invalidation operation, invalidating the specified
-- path, scoped to the specified UrlMap.
--
-- /See:/ 'urlMapsInvalidateCache' smart constructor.
data URLMapsInvalidateCache = URLMapsInvalidateCache'
{ _umicURLMap :: !Text
, _umicProject :: !Text
, _umicPayload :: !CacheInvalidationRule
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'URLMapsInvalidateCache' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'umicURLMap'
--
-- * 'umicProject'
--
-- * 'umicPayload'
urlMapsInvalidateCache
:: Text -- ^ 'umicURLMap'
-> Text -- ^ 'umicProject'
-> CacheInvalidationRule -- ^ 'umicPayload'
-> URLMapsInvalidateCache
urlMapsInvalidateCache pUmicURLMap_ pUmicProject_ pUmicPayload_ =
URLMapsInvalidateCache'
{ _umicURLMap = pUmicURLMap_
, _umicProject = pUmicProject_
, _umicPayload = pUmicPayload_
}
-- | Name of the UrlMap scoping this request.
umicURLMap :: Lens' URLMapsInvalidateCache Text
umicURLMap
= lens _umicURLMap (\ s a -> s{_umicURLMap = a})
-- | Project ID for this request.
umicProject :: Lens' URLMapsInvalidateCache Text
umicProject
= lens _umicProject (\ s a -> s{_umicProject = a})
-- | Multipart request metadata.
umicPayload :: Lens' URLMapsInvalidateCache CacheInvalidationRule
umicPayload
= lens _umicPayload (\ s a -> s{_umicPayload = a})
instance GoogleRequest URLMapsInvalidateCache where
type Rs URLMapsInvalidateCache = Operation
type Scopes URLMapsInvalidateCache =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient URLMapsInvalidateCache'{..}
= go _umicProject _umicURLMap (Just AltJSON)
_umicPayload
computeService
where go
= buildClient
(Proxy :: Proxy URLMapsInvalidateCacheResource)
mempty