{-# 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.People.CreateContact
(
PeopleCreateContactResource
, peopleCreateContact
, PeopleCreateContact
, pccParent
, pccXgafv
, pccUploadProtocol
, pccAccessToken
, pccUploadType
, pccPayload
, pccCallback
) where
import Network.Google.People.Types
import Network.Google.Prelude
type PeopleCreateContactResource =
"v1" :>
"people:createContact" :>
QueryParam "parent" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Person :> Post '[JSON] Person
data PeopleCreateContact = PeopleCreateContact'
{ _pccParent :: !(Maybe Text)
, _pccXgafv :: !(Maybe Xgafv)
, _pccUploadProtocol :: !(Maybe Text)
, _pccAccessToken :: !(Maybe Text)
, _pccUploadType :: !(Maybe Text)
, _pccPayload :: !Person
, _pccCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
peopleCreateContact
:: Person
-> PeopleCreateContact
peopleCreateContact pPccPayload_ =
PeopleCreateContact'
{ _pccParent = Nothing
, _pccXgafv = Nothing
, _pccUploadProtocol = Nothing
, _pccAccessToken = Nothing
, _pccUploadType = Nothing
, _pccPayload = pPccPayload_
, _pccCallback = Nothing
}
pccParent :: Lens' PeopleCreateContact (Maybe Text)
pccParent
= lens _pccParent (\ s a -> s{_pccParent = a})
pccXgafv :: Lens' PeopleCreateContact (Maybe Xgafv)
pccXgafv = lens _pccXgafv (\ s a -> s{_pccXgafv = a})
pccUploadProtocol :: Lens' PeopleCreateContact (Maybe Text)
pccUploadProtocol
= lens _pccUploadProtocol
(\ s a -> s{_pccUploadProtocol = a})
pccAccessToken :: Lens' PeopleCreateContact (Maybe Text)
pccAccessToken
= lens _pccAccessToken
(\ s a -> s{_pccAccessToken = a})
pccUploadType :: Lens' PeopleCreateContact (Maybe Text)
pccUploadType
= lens _pccUploadType
(\ s a -> s{_pccUploadType = a})
pccPayload :: Lens' PeopleCreateContact Person
pccPayload
= lens _pccPayload (\ s a -> s{_pccPayload = a})
pccCallback :: Lens' PeopleCreateContact (Maybe Text)
pccCallback
= lens _pccCallback (\ s a -> s{_pccCallback = a})
instance GoogleRequest PeopleCreateContact where
type Rs PeopleCreateContact = Person
type Scopes PeopleCreateContact =
'["https://www.googleapis.com/auth/contacts"]
requestClient PeopleCreateContact'{..}
= go _pccParent _pccXgafv _pccUploadProtocol
_pccAccessToken
_pccUploadType
_pccCallback
(Just AltJSON)
_pccPayload
peopleService
where go
= buildClient
(Proxy :: Proxy PeopleCreateContactResource)
mempty