{-# 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.Interconnects.Insert
    (
    
      InterconnectsInsertResource
    
    , interconnectsInsert
    , InterconnectsInsert
    
    , intnRequestId
    , intnProject
    , intnPayload
    ) where
import           Network.Google.Compute.Types
import           Network.Google.Prelude
type InterconnectsInsertResource =
     "compute" :>
       "v1" :>
         "projects" :>
           Capture "project" Text :>
             "global" :>
               "interconnects" :>
                 QueryParam "requestId" Text :>
                   QueryParam "alt" AltJSON :>
                     ReqBody '[JSON] Interconnect :>
                       Post '[JSON] Operation
data InterconnectsInsert = InterconnectsInsert'
    { _intnRequestId :: !(Maybe Text)
    , _intnProject   :: !Text
    , _intnPayload   :: !Interconnect
    } deriving (Eq,Show,Data,Typeable,Generic)
interconnectsInsert
    :: Text 
    -> Interconnect 
    -> InterconnectsInsert
interconnectsInsert pIntnProject_ pIntnPayload_ =
    InterconnectsInsert'
    { _intnRequestId = Nothing
    , _intnProject = pIntnProject_
    , _intnPayload = pIntnPayload_
    }
intnRequestId :: Lens' InterconnectsInsert (Maybe Text)
intnRequestId
  = lens _intnRequestId
      (\ s a -> s{_intnRequestId = a})
intnProject :: Lens' InterconnectsInsert Text
intnProject
  = lens _intnProject (\ s a -> s{_intnProject = a})
intnPayload :: Lens' InterconnectsInsert Interconnect
intnPayload
  = lens _intnPayload (\ s a -> s{_intnPayload = a})
instance GoogleRequest InterconnectsInsert where
        type Rs InterconnectsInsert = Operation
        type Scopes InterconnectsInsert =
             '["https://www.googleapis.com/auth/cloud-platform",
               "https://www.googleapis.com/auth/compute"]
        requestClient InterconnectsInsert'{..}
          = go _intnProject _intnRequestId (Just AltJSON)
              _intnPayload
              computeService
          where go
                  = buildClient
                      (Proxy :: Proxy InterconnectsInsertResource)
                      mempty