{-# 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.Reseller.Customers.Insert
(
CustomersInsertResource
, customersInsert
, CustomersInsert
, ciPayload
, ciCustomerAuthToken
) where
import Network.Google.AppsReseller.Types
import Network.Google.Prelude
type CustomersInsertResource =
"apps" :>
"reseller" :>
"v1" :>
"customers" :>
QueryParam "customerAuthToken" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Customer :> Post '[JSON] Customer
data CustomersInsert = CustomersInsert'
{ _ciPayload :: !Customer
, _ciCustomerAuthToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
customersInsert
:: Customer
-> CustomersInsert
customersInsert pCiPayload_ =
CustomersInsert'
{ _ciPayload = pCiPayload_
, _ciCustomerAuthToken = Nothing
}
ciPayload :: Lens' CustomersInsert Customer
ciPayload
= lens _ciPayload (\ s a -> s{_ciPayload = a})
ciCustomerAuthToken :: Lens' CustomersInsert (Maybe Text)
ciCustomerAuthToken
= lens _ciCustomerAuthToken
(\ s a -> s{_ciCustomerAuthToken = a})
instance GoogleRequest CustomersInsert where
type Rs CustomersInsert = Customer
type Scopes CustomersInsert =
'["https://www.googleapis.com/auth/apps.order"]
requestClient CustomersInsert'{..}
= go _ciCustomerAuthToken (Just AltJSON) _ciPayload
appsResellerService
where go
= buildClient
(Proxy :: Proxy CustomersInsertResource)
mempty