{-# 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.ThreatMatches.Find
(
ThreatMatchesFindResource
, threatMatchesFind
, ThreatMatchesFind
, tmfXgafv
, tmfUploadProtocol
, tmfPp
, tmfAccessToken
, tmfUploadType
, tmfPayload
, tmfBearerToken
, tmfCallback
) where
import Network.Google.Prelude
import Network.Google.SafeBrowsing.Types
type ThreatMatchesFindResource =
"v4" :>
"threatMatches:find" :>
QueryParam "$.xgafv" Text :>
QueryParam "upload_protocol" Text :>
QueryParam "pp" Bool :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "bearer_token" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] FindThreatMatchesRequest :>
Post '[JSON] FindThreatMatchesResponse
-- | Finds the threat entries that match the Safe Browsing lists.
--
-- /See:/ 'threatMatchesFind' smart constructor.
data ThreatMatchesFind = ThreatMatchesFind'
{ _tmfXgafv :: !(Maybe Text)
, _tmfUploadProtocol :: !(Maybe Text)
, _tmfPp :: !Bool
, _tmfAccessToken :: !(Maybe Text)
, _tmfUploadType :: !(Maybe Text)
, _tmfPayload :: !FindThreatMatchesRequest
, _tmfBearerToken :: !(Maybe Text)
, _tmfCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'ThreatMatchesFind' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tmfXgafv'
--
-- * 'tmfUploadProtocol'
--
-- * 'tmfPp'
--
-- * 'tmfAccessToken'
--
-- * 'tmfUploadType'
--
-- * 'tmfPayload'
--
-- * 'tmfBearerToken'
--
-- * 'tmfCallback'
threatMatchesFind
:: FindThreatMatchesRequest -- ^ 'tmfPayload'
-> ThreatMatchesFind
threatMatchesFind pTmfPayload_ =
ThreatMatchesFind'
{ _tmfXgafv = Nothing
, _tmfUploadProtocol = Nothing
, _tmfPp = True
, _tmfAccessToken = Nothing
, _tmfUploadType = Nothing
, _tmfPayload = pTmfPayload_
, _tmfBearerToken = Nothing
, _tmfCallback = Nothing
}
-- | V1 error format.
tmfXgafv :: Lens' ThreatMatchesFind (Maybe Text)
tmfXgafv = lens _tmfXgafv (\ s a -> s{_tmfXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
tmfUploadProtocol :: Lens' ThreatMatchesFind (Maybe Text)
tmfUploadProtocol
= lens _tmfUploadProtocol
(\ s a -> s{_tmfUploadProtocol = a})
-- | Pretty-print response.
tmfPp :: Lens' ThreatMatchesFind Bool
tmfPp = lens _tmfPp (\ s a -> s{_tmfPp = a})
-- | OAuth access token.
tmfAccessToken :: Lens' ThreatMatchesFind (Maybe Text)
tmfAccessToken
= lens _tmfAccessToken
(\ s a -> s{_tmfAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
tmfUploadType :: Lens' ThreatMatchesFind (Maybe Text)
tmfUploadType
= lens _tmfUploadType
(\ s a -> s{_tmfUploadType = a})
-- | Multipart request metadata.
tmfPayload :: Lens' ThreatMatchesFind FindThreatMatchesRequest
tmfPayload
= lens _tmfPayload (\ s a -> s{_tmfPayload = a})
-- | OAuth bearer token.
tmfBearerToken :: Lens' ThreatMatchesFind (Maybe Text)
tmfBearerToken
= lens _tmfBearerToken
(\ s a -> s{_tmfBearerToken = a})
-- | JSONP
tmfCallback :: Lens' ThreatMatchesFind (Maybe Text)
tmfCallback
= lens _tmfCallback (\ s a -> s{_tmfCallback = a})
instance GoogleRequest ThreatMatchesFind where
type Rs ThreatMatchesFind = FindThreatMatchesResponse
type Scopes ThreatMatchesFind = '[]
requestClient ThreatMatchesFind'{..}
= go _tmfXgafv _tmfUploadProtocol (Just _tmfPp)
_tmfAccessToken
_tmfUploadType
_tmfBearerToken
_tmfCallback
(Just AltJSON)
_tmfPayload
safeBrowsingService
where go
= buildClient
(Proxy :: Proxy ThreatMatchesFindResource)
mempty