{-# 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.GroupsMigration.Archive.Insert
(
ArchiveInsertResource
, archiveInsert
, ArchiveInsert
, aiGroupId
) where
import Network.Google.GroupsMigration.Types
import Network.Google.Prelude
type ArchiveInsertResource =
"groups" :>
"v1" :>
"groups" :>
Capture "groupId" Text :>
"archive" :>
QueryParam "alt" AltJSON :> Post '[JSON] Groups
:<|>
"upload" :>
"groups" :>
"v1" :>
"groups" :>
Capture "groupId" Text :>
"archive" :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" AltMedia :>
AltMedia :> Post '[JSON] Groups
newtype ArchiveInsert = ArchiveInsert'
{ _aiGroupId :: Text
} deriving (Eq,Show,Data,Typeable,Generic)
archiveInsert
:: Text
-> ArchiveInsert
archiveInsert pAiGroupId_ =
ArchiveInsert'
{ _aiGroupId = pAiGroupId_
}
aiGroupId :: Lens' ArchiveInsert Text
aiGroupId
= lens _aiGroupId (\ s a -> s{_aiGroupId = a})
instance GoogleRequest ArchiveInsert where
type Rs ArchiveInsert = Groups
type Scopes ArchiveInsert =
'["https://www.googleapis.com/auth/apps.groups.migration"]
requestClient ArchiveInsert'{..}
= go _aiGroupId (Just AltJSON) groupsMigrationService
where go :<|> _
= buildClient (Proxy :: Proxy ArchiveInsertResource)
mempty
instance GoogleRequest (MediaUpload ArchiveInsert)
where
type Rs (MediaUpload ArchiveInsert) = Groups
type Scopes (MediaUpload ArchiveInsert) =
Scopes ArchiveInsert
requestClient (MediaUpload ArchiveInsert'{..} body)
= go _aiGroupId (Just AltJSON) (Just AltMedia) body
groupsMigrationService
where _ :<|> go
= buildClient (Proxy :: Proxy ArchiveInsertResource)
mempty