{-# 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.SafeBrowsing.ThreatHits.Create
(
ThreatHitsCreateResource
, threatHitsCreate
, ThreatHitsCreate
, thcXgafv
, thcUploadProtocol
, thcAccessToken
, thcUploadType
, thcPayload
, thcCallback
) where
import Network.Google.Prelude
import Network.Google.SafeBrowsing.Types
type ThreatHitsCreateResource =
"v4" :>
"threatHits" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ThreatHit :> Post '[JSON] Empty
data ThreatHitsCreate = ThreatHitsCreate'
{ _thcXgafv :: !(Maybe Xgafv)
, _thcUploadProtocol :: !(Maybe Text)
, _thcAccessToken :: !(Maybe Text)
, _thcUploadType :: !(Maybe Text)
, _thcPayload :: !ThreatHit
, _thcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
threatHitsCreate
:: ThreatHit
-> ThreatHitsCreate
threatHitsCreate pThcPayload_ =
ThreatHitsCreate'
{ _thcXgafv = Nothing
, _thcUploadProtocol = Nothing
, _thcAccessToken = Nothing
, _thcUploadType = Nothing
, _thcPayload = pThcPayload_
, _thcCallback = Nothing
}
thcXgafv :: Lens' ThreatHitsCreate (Maybe Xgafv)
thcXgafv = lens _thcXgafv (\ s a -> s{_thcXgafv = a})
thcUploadProtocol :: Lens' ThreatHitsCreate (Maybe Text)
thcUploadProtocol
= lens _thcUploadProtocol
(\ s a -> s{_thcUploadProtocol = a})
thcAccessToken :: Lens' ThreatHitsCreate (Maybe Text)
thcAccessToken
= lens _thcAccessToken
(\ s a -> s{_thcAccessToken = a})
thcUploadType :: Lens' ThreatHitsCreate (Maybe Text)
thcUploadType
= lens _thcUploadType
(\ s a -> s{_thcUploadType = a})
thcPayload :: Lens' ThreatHitsCreate ThreatHit
thcPayload
= lens _thcPayload (\ s a -> s{_thcPayload = a})
thcCallback :: Lens' ThreatHitsCreate (Maybe Text)
thcCallback
= lens _thcCallback (\ s a -> s{_thcCallback = a})
instance GoogleRequest ThreatHitsCreate where
type Rs ThreatHitsCreate = Empty
type Scopes ThreatHitsCreate = '[]
requestClient ThreatHitsCreate'{..}
= go _thcXgafv _thcUploadProtocol _thcAccessToken
_thcUploadType
_thcCallback
(Just AltJSON)
_thcPayload
safeBrowsingService
where go
= buildClient
(Proxy :: Proxy ThreatHitsCreateResource)
mempty