{-# 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.Storage.Projects.HmacKeys.Create
(
ProjectsHmacKeysCreateResource
, projectsHmacKeysCreate
, ProjectsHmacKeysCreate
, phkcServiceAccountEmail
, phkcProjectId
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type ProjectsHmacKeysCreateResource =
"storage" :>
"v1" :>
"projects" :>
Capture "projectId" Text :>
"hmacKeys" :>
QueryParam "serviceAccountEmail" Text :>
QueryParam "alt" AltJSON :> Post '[JSON] HmacKey
data ProjectsHmacKeysCreate =
ProjectsHmacKeysCreate'
{ _phkcServiceAccountEmail :: !Text
, _phkcProjectId :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
projectsHmacKeysCreate
:: Text
-> Text
-> ProjectsHmacKeysCreate
projectsHmacKeysCreate pPhkcServiceAccountEmail_ pPhkcProjectId_ =
ProjectsHmacKeysCreate'
{ _phkcServiceAccountEmail = pPhkcServiceAccountEmail_
, _phkcProjectId = pPhkcProjectId_
}
phkcServiceAccountEmail :: Lens' ProjectsHmacKeysCreate Text
phkcServiceAccountEmail
= lens _phkcServiceAccountEmail
(\ s a -> s{_phkcServiceAccountEmail = a})
phkcProjectId :: Lens' ProjectsHmacKeysCreate Text
phkcProjectId
= lens _phkcProjectId
(\ s a -> s{_phkcProjectId = a})
instance GoogleRequest ProjectsHmacKeysCreate where
type Rs ProjectsHmacKeysCreate = HmacKey
type Scopes ProjectsHmacKeysCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control"]
requestClient ProjectsHmacKeysCreate'{..}
= go _phkcProjectId (Just _phkcServiceAccountEmail)
(Just AltJSON)
storageService
where go
= buildClient
(Proxy :: Proxy ProjectsHmacKeysCreateResource)
mempty