{-# 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.Keys.Create
(
ProjectsServiceAccountsKeysCreateResource
, projectsServiceAccountsKeysCreate
, ProjectsServiceAccountsKeysCreate
, psakcXgafv
, psakcUploadProtocol
, psakcAccessToken
, psakcUploadType
, psakcPayload
, psakcName
, psakcCallback
) where
import Network.Google.IAM.Types
import Network.Google.Prelude
type ProjectsServiceAccountsKeysCreateResource =
"v1" :>
Capture "name" Text :>
"keys" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateServiceAccountKeyRequest :>
Post '[JSON] ServiceAccountKey
data ProjectsServiceAccountsKeysCreate = ProjectsServiceAccountsKeysCreate'
{ _psakcXgafv :: !(Maybe Xgafv)
, _psakcUploadProtocol :: !(Maybe Text)
, _psakcAccessToken :: !(Maybe Text)
, _psakcUploadType :: !(Maybe Text)
, _psakcPayload :: !CreateServiceAccountKeyRequest
, _psakcName :: !Text
, _psakcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsServiceAccountsKeysCreate
:: CreateServiceAccountKeyRequest
-> Text
-> ProjectsServiceAccountsKeysCreate
projectsServiceAccountsKeysCreate pPsakcPayload_ pPsakcName_ =
ProjectsServiceAccountsKeysCreate'
{ _psakcXgafv = Nothing
, _psakcUploadProtocol = Nothing
, _psakcAccessToken = Nothing
, _psakcUploadType = Nothing
, _psakcPayload = pPsakcPayload_
, _psakcName = pPsakcName_
, _psakcCallback = Nothing
}
psakcXgafv :: Lens' ProjectsServiceAccountsKeysCreate (Maybe Xgafv)
psakcXgafv
= lens _psakcXgafv (\ s a -> s{_psakcXgafv = a})
psakcUploadProtocol :: Lens' ProjectsServiceAccountsKeysCreate (Maybe Text)
psakcUploadProtocol
= lens _psakcUploadProtocol
(\ s a -> s{_psakcUploadProtocol = a})
psakcAccessToken :: Lens' ProjectsServiceAccountsKeysCreate (Maybe Text)
psakcAccessToken
= lens _psakcAccessToken
(\ s a -> s{_psakcAccessToken = a})
psakcUploadType :: Lens' ProjectsServiceAccountsKeysCreate (Maybe Text)
psakcUploadType
= lens _psakcUploadType
(\ s a -> s{_psakcUploadType = a})
psakcPayload :: Lens' ProjectsServiceAccountsKeysCreate CreateServiceAccountKeyRequest
psakcPayload
= lens _psakcPayload (\ s a -> s{_psakcPayload = a})
psakcName :: Lens' ProjectsServiceAccountsKeysCreate Text
psakcName
= lens _psakcName (\ s a -> s{_psakcName = a})
psakcCallback :: Lens' ProjectsServiceAccountsKeysCreate (Maybe Text)
psakcCallback
= lens _psakcCallback
(\ s a -> s{_psakcCallback = a})
instance GoogleRequest
ProjectsServiceAccountsKeysCreate where
type Rs ProjectsServiceAccountsKeysCreate =
ServiceAccountKey
type Scopes ProjectsServiceAccountsKeysCreate =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ProjectsServiceAccountsKeysCreate'{..}
= go _psakcName _psakcXgafv _psakcUploadProtocol
_psakcAccessToken
_psakcUploadType
_psakcCallback
(Just AltJSON)
_psakcPayload
iAMService
where go
= buildClient
(Proxy ::
Proxy ProjectsServiceAccountsKeysCreateResource)
mempty