module Network.Google.Resource.Coordinate.Jobs.Insert
(
JobsInsertResource
, jobsInsert
, JobsInsert
, jiNote
, jiTeamId
, jiCustomerPhoneNumber
, jiCustomerName
, jiAddress
, jiPayload
, jiAssignee
, jiLat
, jiLng
, jiTitle
, jiCustomField
) where
import Network.Google.MapsCoordinate.Types
import Network.Google.Prelude
type JobsInsertResource =
"coordinate" :>
"v1" :>
"teams" :>
Capture "teamId" Text :>
"jobs" :>
QueryParam "address" Text :>
QueryParam "lat" (Textual Double) :>
QueryParam "lng" (Textual Double) :>
QueryParam "title" Text :>
QueryParam "note" Text :>
QueryParam "customerPhoneNumber" Text :>
QueryParam "customerName" Text :>
QueryParam "assignee" Text :>
QueryParams "customField" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Job :> Post '[JSON] Job
data JobsInsert = JobsInsert'
{ _jiNote :: !(Maybe Text)
, _jiTeamId :: !Text
, _jiCustomerPhoneNumber :: !(Maybe Text)
, _jiCustomerName :: !(Maybe Text)
, _jiAddress :: !Text
, _jiPayload :: !Job
, _jiAssignee :: !(Maybe Text)
, _jiLat :: !(Textual Double)
, _jiLng :: !(Textual Double)
, _jiTitle :: !Text
, _jiCustomField :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
jobsInsert
:: Text
-> Text
-> Job
-> Double
-> Double
-> Text
-> JobsInsert
jobsInsert pJiTeamId_ pJiAddress_ pJiPayload_ pJiLat_ pJiLng_ pJiTitle_ =
JobsInsert'
{ _jiNote = Nothing
, _jiTeamId = pJiTeamId_
, _jiCustomerPhoneNumber = Nothing
, _jiCustomerName = Nothing
, _jiAddress = pJiAddress_
, _jiPayload = pJiPayload_
, _jiAssignee = Nothing
, _jiLat = _Coerce # pJiLat_
, _jiLng = _Coerce # pJiLng_
, _jiTitle = pJiTitle_
, _jiCustomField = Nothing
}
jiNote :: Lens' JobsInsert (Maybe Text)
jiNote = lens _jiNote (\ s a -> s{_jiNote = a})
jiTeamId :: Lens' JobsInsert Text
jiTeamId = lens _jiTeamId (\ s a -> s{_jiTeamId = a})
jiCustomerPhoneNumber :: Lens' JobsInsert (Maybe Text)
jiCustomerPhoneNumber
= lens _jiCustomerPhoneNumber
(\ s a -> s{_jiCustomerPhoneNumber = a})
jiCustomerName :: Lens' JobsInsert (Maybe Text)
jiCustomerName
= lens _jiCustomerName
(\ s a -> s{_jiCustomerName = a})
jiAddress :: Lens' JobsInsert Text
jiAddress
= lens _jiAddress (\ s a -> s{_jiAddress = a})
jiPayload :: Lens' JobsInsert Job
jiPayload
= lens _jiPayload (\ s a -> s{_jiPayload = a})
jiAssignee :: Lens' JobsInsert (Maybe Text)
jiAssignee
= lens _jiAssignee (\ s a -> s{_jiAssignee = a})
jiLat :: Lens' JobsInsert Double
jiLat
= lens _jiLat (\ s a -> s{_jiLat = a}) . _Coerce
jiLng :: Lens' JobsInsert Double
jiLng
= lens _jiLng (\ s a -> s{_jiLng = a}) . _Coerce
jiTitle :: Lens' JobsInsert Text
jiTitle = lens _jiTitle (\ s a -> s{_jiTitle = a})
jiCustomField :: Lens' JobsInsert [Text]
jiCustomField
= lens _jiCustomField
(\ s a -> s{_jiCustomField = a})
. _Default
. _Coerce
instance GoogleRequest JobsInsert where
type Rs JobsInsert = Job
type Scopes JobsInsert =
'["https://www.googleapis.com/auth/coordinate"]
requestClient JobsInsert'{..}
= go _jiTeamId (Just _jiAddress) (Just _jiLat)
(Just _jiLng)
(Just _jiTitle)
_jiNote
_jiCustomerPhoneNumber
_jiCustomerName
_jiAssignee
(_jiCustomField ^. _Default)
(Just AltJSON)
_jiPayload
mapsCoordinateService
where go
= buildClient (Proxy :: Proxy JobsInsertResource)
mempty