{-# 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.AndroidEnterprise.ServiceAccountkeys.Insert
(
ServiceAccountkeysInsertResource
, serviceAccountkeysInsert
, ServiceAccountkeysInsert
, saiEnterpriseId
, saiPayload
) where
import Network.Google.AndroidEnterprise.Types
import Network.Google.Prelude
type ServiceAccountkeysInsertResource =
"androidenterprise" :>
"v1" :>
"enterprises" :>
Capture "enterpriseId" Text :>
"serviceAccountKeys" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ServiceAccountKey :>
Post '[JSON] ServiceAccountKey
data ServiceAccountkeysInsert = ServiceAccountkeysInsert'
{ _saiEnterpriseId :: !Text
, _saiPayload :: !ServiceAccountKey
} deriving (Eq,Show,Data,Typeable,Generic)
serviceAccountkeysInsert
:: Text
-> ServiceAccountKey
-> ServiceAccountkeysInsert
serviceAccountkeysInsert pSaiEnterpriseId_ pSaiPayload_ =
ServiceAccountkeysInsert'
{ _saiEnterpriseId = pSaiEnterpriseId_
, _saiPayload = pSaiPayload_
}
saiEnterpriseId :: Lens' ServiceAccountkeysInsert Text
saiEnterpriseId
= lens _saiEnterpriseId
(\ s a -> s{_saiEnterpriseId = a})
saiPayload :: Lens' ServiceAccountkeysInsert ServiceAccountKey
saiPayload
= lens _saiPayload (\ s a -> s{_saiPayload = a})
instance GoogleRequest ServiceAccountkeysInsert where
type Rs ServiceAccountkeysInsert = ServiceAccountKey
type Scopes ServiceAccountkeysInsert =
'["https://www.googleapis.com/auth/androidenterprise"]
requestClient ServiceAccountkeysInsert'{..}
= go _saiEnterpriseId (Just AltJSON) _saiPayload
androidEnterpriseService
where go
= buildClient
(Proxy :: Proxy ServiceAccountkeysInsertResource)
mempty