{-# 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.Schemas.Insert
(
SchemasInsertResource
, schemasInsert
, SchemasInsert
, siPayload
, siCustomerId
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type SchemasInsertResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customerId" Text :>
"schemas" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Schema :> Post '[JSON] Schema
data SchemasInsert = SchemasInsert'
{ _siPayload :: !Schema
, _siCustomerId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
schemasInsert
:: Schema
-> Text
-> SchemasInsert
schemasInsert pSiPayload_ pSiCustomerId_ =
SchemasInsert'
{ _siPayload = pSiPayload_
, _siCustomerId = pSiCustomerId_
}
siPayload :: Lens' SchemasInsert Schema
siPayload
= lens _siPayload (\ s a -> s{_siPayload = a})
siCustomerId :: Lens' SchemasInsert Text
siCustomerId
= lens _siCustomerId (\ s a -> s{_siCustomerId = a})
instance GoogleRequest SchemasInsert where
type Rs SchemasInsert = Schema
type Scopes SchemasInsert =
'["https://www.googleapis.com/auth/admin.directory.userschema"]
requestClient SchemasInsert'{..}
= go _siCustomerId (Just AltJSON) _siPayload
directoryService
where go
= buildClient (Proxy :: Proxy SchemasInsertResource)
mempty