{-# 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
-- | Create schema.
--
-- /See:/ 'schemasInsert' smart constructor.
data SchemasInsert = SchemasInsert'
{ _siPayload :: !Schema
, _siCustomerId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'SchemasInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'siPayload'
--
-- * 'siCustomerId'
schemasInsert
:: Schema -- ^ 'siPayload'
-> Text -- ^ 'siCustomerId'
-> SchemasInsert
schemasInsert pSiPayload_ pSiCustomerId_ =
SchemasInsert'
{ _siPayload = pSiPayload_
, _siCustomerId = pSiCustomerId_
}
-- | Multipart request metadata.
siPayload :: Lens' SchemasInsert Schema
siPayload
= lens _siPayload (\ s a -> s{_siPayload = a})
-- | Immutable id of the Google Apps account
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