{-# 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.ResourceViews.ZoneViews.Insert
(
ZoneViewsInsertResource
, zoneViewsInsert
, ZoneViewsInsert
, zviProject
, zviZone
, zviPayload
) where
import Network.Google.Prelude
import Network.Google.ResourceViews.Types
type ZoneViewsInsertResource =
"resourceviews" :>
"v1beta2" :>
"projects" :>
Capture "project" Text :>
"zones" :>
Capture "zone" Text :>
"resourceViews" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ResourceView :>
Post '[JSON] Operation
-- | Create a resource view.
--
-- /See:/ 'zoneViewsInsert' smart constructor.
data ZoneViewsInsert = ZoneViewsInsert'
{ _zviProject :: !Text
, _zviZone :: !Text
, _zviPayload :: !ResourceView
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'ZoneViewsInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'zviProject'
--
-- * 'zviZone'
--
-- * 'zviPayload'
zoneViewsInsert
:: Text -- ^ 'zviProject'
-> Text -- ^ 'zviZone'
-> ResourceView -- ^ 'zviPayload'
-> ZoneViewsInsert
zoneViewsInsert pZviProject_ pZviZone_ pZviPayload_ =
ZoneViewsInsert'
{ _zviProject = pZviProject_
, _zviZone = pZviZone_
, _zviPayload = pZviPayload_
}
-- | The project name of the resource view.
zviProject :: Lens' ZoneViewsInsert Text
zviProject
= lens _zviProject (\ s a -> s{_zviProject = a})
-- | The zone name of the resource view.
zviZone :: Lens' ZoneViewsInsert Text
zviZone = lens _zviZone (\ s a -> s{_zviZone = a})
-- | Multipart request metadata.
zviPayload :: Lens' ZoneViewsInsert ResourceView
zviPayload
= lens _zviPayload (\ s a -> s{_zviPayload = a})
instance GoogleRequest ZoneViewsInsert where
type Rs ZoneViewsInsert = Operation
type Scopes ZoneViewsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/ndev.cloudman"]
requestClient ZoneViewsInsert'{..}
= go _zviProject _zviZone (Just AltJSON) _zviPayload
resourceViewsService
where go
= buildClient
(Proxy :: Proxy ZoneViewsInsertResource)
mempty