{-# 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.IAM.Projects.ServiceAccounts.Create
(
ProjectsServiceAccountsCreateResource
, projectsServiceAccountsCreate
, ProjectsServiceAccountsCreate
, psacXgafv
, psacUploadProtocol
, psacAccessToken
, psacUploadType
, psacPayload
, psacName
, psacCallback
) where
import Network.Google.IAM.Types
import Network.Google.Prelude
type ProjectsServiceAccountsCreateResource =
"v1" :>
Capture "name" Text :>
"serviceAccounts" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateServiceAccountRequest :>
Post '[JSON] ServiceAccount
data ProjectsServiceAccountsCreate = ProjectsServiceAccountsCreate'
{ _psacXgafv :: !(Maybe Xgafv)
, _psacUploadProtocol :: !(Maybe Text)
, _psacAccessToken :: !(Maybe Text)
, _psacUploadType :: !(Maybe Text)
, _psacPayload :: !CreateServiceAccountRequest
, _psacName :: !Text
, _psacCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsServiceAccountsCreate
:: CreateServiceAccountRequest
-> Text
-> ProjectsServiceAccountsCreate
projectsServiceAccountsCreate pPsacPayload_ pPsacName_ =
ProjectsServiceAccountsCreate'
{ _psacXgafv = Nothing
, _psacUploadProtocol = Nothing
, _psacAccessToken = Nothing
, _psacUploadType = Nothing
, _psacPayload = pPsacPayload_
, _psacName = pPsacName_
, _psacCallback = Nothing
}
psacXgafv :: Lens' ProjectsServiceAccountsCreate (Maybe Xgafv)
psacXgafv
= lens _psacXgafv (\ s a -> s{_psacXgafv = a})
psacUploadProtocol :: Lens' ProjectsServiceAccountsCreate (Maybe Text)
psacUploadProtocol
= lens _psacUploadProtocol
(\ s a -> s{_psacUploadProtocol = a})
psacAccessToken :: Lens' ProjectsServiceAccountsCreate (Maybe Text)
psacAccessToken
= lens _psacAccessToken
(\ s a -> s{_psacAccessToken = a})
psacUploadType :: Lens' ProjectsServiceAccountsCreate (Maybe Text)
psacUploadType
= lens _psacUploadType
(\ s a -> s{_psacUploadType = a})
psacPayload :: Lens' ProjectsServiceAccountsCreate CreateServiceAccountRequest
psacPayload
= lens _psacPayload (\ s a -> s{_psacPayload = a})
psacName :: Lens' ProjectsServiceAccountsCreate Text
psacName = lens _psacName (\ s a -> s{_psacName = a})
psacCallback :: Lens' ProjectsServiceAccountsCreate (Maybe Text)
psacCallback
= lens _psacCallback (\ s a -> s{_psacCallback = a})
instance GoogleRequest ProjectsServiceAccountsCreate
where
type Rs ProjectsServiceAccountsCreate =
ServiceAccount
type Scopes ProjectsServiceAccountsCreate =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ProjectsServiceAccountsCreate'{..}
= go _psacName _psacXgafv _psacUploadProtocol
_psacAccessToken
_psacUploadType
_psacCallback
(Just AltJSON)
_psacPayload
iAMService
where go
= buildClient
(Proxy ::
Proxy ProjectsServiceAccountsCreateResource)
mempty