{-# 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.Directory.DomainAliases.Insert
(
DomainAliasesInsertResource
, domainAliasesInsert
, DomainAliasesInsert
, daiPayload
, daiCustomer
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type DomainAliasesInsertResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customer" Text :>
"domainaliases" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DomainAlias :>
Post '[JSON] DomainAlias
data DomainAliasesInsert = DomainAliasesInsert'
{ _daiPayload :: !DomainAlias
, _daiCustomer :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
domainAliasesInsert
:: DomainAlias
-> Text
-> DomainAliasesInsert
domainAliasesInsert pDaiPayload_ pDaiCustomer_ =
DomainAliasesInsert'
{ _daiPayload = pDaiPayload_
, _daiCustomer = pDaiCustomer_
}
daiPayload :: Lens' DomainAliasesInsert DomainAlias
daiPayload
= lens _daiPayload (\ s a -> s{_daiPayload = a})
daiCustomer :: Lens' DomainAliasesInsert Text
daiCustomer
= lens _daiCustomer (\ s a -> s{_daiCustomer = a})
instance GoogleRequest DomainAliasesInsert where
type Rs DomainAliasesInsert = DomainAlias
type Scopes DomainAliasesInsert =
'["https://www.googleapis.com/auth/admin.directory.domain"]
requestClient DomainAliasesInsert'{..}
= go _daiCustomer (Just AltJSON) _daiPayload
directoryService
where go
= buildClient
(Proxy :: Proxy DomainAliasesInsertResource)
mempty