{-# 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.People.ContactGroups.Create
(
ContactGroupsCreateResource
, contactGroupsCreate
, ContactGroupsCreate
, cgcXgafv
, cgcUploadProtocol
, cgcAccessToken
, cgcUploadType
, cgcPayload
, cgcCallback
) where
import Network.Google.People.Types
import Network.Google.Prelude
type ContactGroupsCreateResource =
"v1" :>
"contactGroups" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateContactGroupRequest :>
Post '[JSON] ContactGroup
data ContactGroupsCreate = ContactGroupsCreate'
{ _cgcXgafv :: !(Maybe Xgafv)
, _cgcUploadProtocol :: !(Maybe Text)
, _cgcAccessToken :: !(Maybe Text)
, _cgcUploadType :: !(Maybe Text)
, _cgcPayload :: !CreateContactGroupRequest
, _cgcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
contactGroupsCreate
:: CreateContactGroupRequest
-> ContactGroupsCreate
contactGroupsCreate pCgcPayload_ =
ContactGroupsCreate'
{ _cgcXgafv = Nothing
, _cgcUploadProtocol = Nothing
, _cgcAccessToken = Nothing
, _cgcUploadType = Nothing
, _cgcPayload = pCgcPayload_
, _cgcCallback = Nothing
}
cgcXgafv :: Lens' ContactGroupsCreate (Maybe Xgafv)
cgcXgafv = lens _cgcXgafv (\ s a -> s{_cgcXgafv = a})
cgcUploadProtocol :: Lens' ContactGroupsCreate (Maybe Text)
cgcUploadProtocol
= lens _cgcUploadProtocol
(\ s a -> s{_cgcUploadProtocol = a})
cgcAccessToken :: Lens' ContactGroupsCreate (Maybe Text)
cgcAccessToken
= lens _cgcAccessToken
(\ s a -> s{_cgcAccessToken = a})
cgcUploadType :: Lens' ContactGroupsCreate (Maybe Text)
cgcUploadType
= lens _cgcUploadType
(\ s a -> s{_cgcUploadType = a})
cgcPayload :: Lens' ContactGroupsCreate CreateContactGroupRequest
cgcPayload
= lens _cgcPayload (\ s a -> s{_cgcPayload = a})
cgcCallback :: Lens' ContactGroupsCreate (Maybe Text)
cgcCallback
= lens _cgcCallback (\ s a -> s{_cgcCallback = a})
instance GoogleRequest ContactGroupsCreate where
type Rs ContactGroupsCreate = ContactGroup
type Scopes ContactGroupsCreate =
'["https://www.googleapis.com/auth/contacts"]
requestClient ContactGroupsCreate'{..}
= go _cgcXgafv _cgcUploadProtocol _cgcAccessToken
_cgcUploadType
_cgcCallback
(Just AltJSON)
_cgcPayload
peopleService
where go
= buildClient
(Proxy :: Proxy ContactGroupsCreateResource)
mempty