{-# 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.Buckets.List
(
BucketsListResource
, bucketsList
, BucketsList
, blProject
, blPrefix
, blUserProject
, blProjection
, blPageToken
, blMaxResults
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsListResource =
"storage" :>
"v1" :>
"b" :>
QueryParam "project" Text :>
QueryParam "prefix" Text :>
QueryParam "userProject" Text :>
QueryParam "projection" BucketsListProjection :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :> Get '[JSON] Buckets
data BucketsList = BucketsList'
{ _blProject :: !Text
, _blPrefix :: !(Maybe Text)
, _blUserProject :: !(Maybe Text)
, _blProjection :: !(Maybe BucketsListProjection)
, _blPageToken :: !(Maybe Text)
, _blMaxResults :: !(Textual Word32)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketsList
:: Text
-> BucketsList
bucketsList pBlProject_ =
BucketsList'
{ _blProject = pBlProject_
, _blPrefix = Nothing
, _blUserProject = Nothing
, _blProjection = Nothing
, _blPageToken = Nothing
, _blMaxResults = 1000
}
blProject :: Lens' BucketsList Text
blProject
= lens _blProject (\ s a -> s{_blProject = a})
blPrefix :: Lens' BucketsList (Maybe Text)
blPrefix = lens _blPrefix (\ s a -> s{_blPrefix = a})
blUserProject :: Lens' BucketsList (Maybe Text)
blUserProject
= lens _blUserProject
(\ s a -> s{_blUserProject = a})
blProjection :: Lens' BucketsList (Maybe BucketsListProjection)
blProjection
= lens _blProjection (\ s a -> s{_blProjection = a})
blPageToken :: Lens' BucketsList (Maybe Text)
blPageToken
= lens _blPageToken (\ s a -> s{_blPageToken = a})
blMaxResults :: Lens' BucketsList Word32
blMaxResults
= lens _blMaxResults (\ s a -> s{_blMaxResults = a})
. _Coerce
instance GoogleRequest BucketsList where
type Rs BucketsList = Buckets
type Scopes BucketsList =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient BucketsList'{..}
= go (Just _blProject) _blPrefix _blUserProject
_blProjection
_blPageToken
(Just _blMaxResults)
(Just AltJSON)
storageService
where go
= buildClient (Proxy :: Proxy BucketsListResource)
mempty