{-# 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.Patch
(
CustomersPatchResource
, customersPatch
, CustomersPatch
, cpPayload
, cpCustomerId
) where
import Network.Google.AppsReseller.Types
import Network.Google.Prelude
type CustomersPatchResource =
"apps" :>
"reseller" :>
"v1" :>
"customers" :>
Capture "customerId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Customer :> Patch '[JSON] Customer
-- | Update a customer resource if one it exists and is owned by the
-- reseller. This method supports patch semantics.
--
-- /See:/ 'customersPatch' smart constructor.
data CustomersPatch = CustomersPatch'
{ _cpPayload :: !Customer
, _cpCustomerId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'CustomersPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cpPayload'
--
-- * 'cpCustomerId'
customersPatch
:: Customer -- ^ 'cpPayload'
-> Text -- ^ 'cpCustomerId'
-> CustomersPatch
customersPatch pCpPayload_ pCpCustomerId_ =
CustomersPatch'
{ _cpPayload = pCpPayload_
, _cpCustomerId = pCpCustomerId_
}
-- | Multipart request metadata.
cpPayload :: Lens' CustomersPatch Customer
cpPayload
= lens _cpPayload (\ s a -> s{_cpPayload = a})
-- | Id of the Customer
cpCustomerId :: Lens' CustomersPatch Text
cpCustomerId
= lens _cpCustomerId (\ s a -> s{_cpCustomerId = a})
instance GoogleRequest CustomersPatch where
type Rs CustomersPatch = Customer
type Scopes CustomersPatch =
'["https://www.googleapis.com/auth/apps.order"]
requestClient CustomersPatch'{..}
= go _cpCustomerId (Just AltJSON) _cpPayload
appsResellerService
where go
= buildClient (Proxy :: Proxy CustomersPatchResource)
mempty