{-# 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.PlusDomains.Circles.Insert
(
CirclesInsertResource
, circlesInsert
, CirclesInsert
, ciPayload
, ciUserId
) where
import Network.Google.PlusDomains.Types
import Network.Google.Prelude
type CirclesInsertResource =
"plusDomains" :>
"v1" :>
"people" :>
Capture "userId" Text :>
"circles" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Circle :> Post '[JSON] Circle
-- | Create a new circle for the authenticated user.
--
-- /See:/ 'circlesInsert' smart constructor.
data CirclesInsert = CirclesInsert'
{ _ciPayload :: !Circle
, _ciUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'CirclesInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ciPayload'
--
-- * 'ciUserId'
circlesInsert
:: Circle -- ^ 'ciPayload'
-> Text -- ^ 'ciUserId'
-> CirclesInsert
circlesInsert pCiPayload_ pCiUserId_ =
CirclesInsert'
{ _ciPayload = pCiPayload_
, _ciUserId = pCiUserId_
}
-- | Multipart request metadata.
ciPayload :: Lens' CirclesInsert Circle
ciPayload
= lens _ciPayload (\ s a -> s{_ciPayload = a})
-- | The ID of the user to create the circle on behalf of. The value \"me\"
-- can be used to indicate the authenticated user.
ciUserId :: Lens' CirclesInsert Text
ciUserId = lens _ciUserId (\ s a -> s{_ciUserId = a})
instance GoogleRequest CirclesInsert where
type Rs CirclesInsert = Circle
type Scopes CirclesInsert =
'["https://www.googleapis.com/auth/plus.circles.write",
"https://www.googleapis.com/auth/plus.login",
"https://www.googleapis.com/auth/plus.me"]
requestClient CirclesInsert'{..}
= go _ciUserId (Just AltJSON) _ciPayload
plusDomainsService
where go
= buildClient (Proxy :: Proxy CirclesInsertResource)
mempty