{-# 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.ProximityBeacon.Namespaces.Update
(
NamespacesUpdateResource
, namespacesUpdate
, NamespacesUpdate
, nuXgafv
, nuUploadProtocol
, nuPp
, nuAccessToken
, nuUploadType
, nuPayload
, nuNamespaceName
, nuBearerToken
, nuProjectId
, nuCallback
) where
import Network.Google.Prelude
import Network.Google.ProximityBeacon.Types
type NamespacesUpdateResource =
"v1beta1" :>
Capture "namespaceName" Text :>
QueryParam "$.xgafv" Text :>
QueryParam "upload_protocol" Text :>
QueryParam "pp" Bool :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "bearer_token" Text :>
QueryParam "projectId" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Namespace :> Put '[JSON] Namespace
-- | Updates the information about the specified namespace. Only the
-- namespace visibility can be updated.
--
-- /See:/ 'namespacesUpdate' smart constructor.
data NamespacesUpdate = NamespacesUpdate'
{ _nuXgafv :: !(Maybe Text)
, _nuUploadProtocol :: !(Maybe Text)
, _nuPp :: !Bool
, _nuAccessToken :: !(Maybe Text)
, _nuUploadType :: !(Maybe Text)
, _nuPayload :: !Namespace
, _nuNamespaceName :: !Text
, _nuBearerToken :: !(Maybe Text)
, _nuProjectId :: !(Maybe Text)
, _nuCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'NamespacesUpdate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'nuXgafv'
--
-- * 'nuUploadProtocol'
--
-- * 'nuPp'
--
-- * 'nuAccessToken'
--
-- * 'nuUploadType'
--
-- * 'nuPayload'
--
-- * 'nuNamespaceName'
--
-- * 'nuBearerToken'
--
-- * 'nuProjectId'
--
-- * 'nuCallback'
namespacesUpdate
:: Namespace -- ^ 'nuPayload'
-> Text -- ^ 'nuNamespaceName'
-> NamespacesUpdate
namespacesUpdate pNuPayload_ pNuNamespaceName_ =
NamespacesUpdate'
{ _nuXgafv = Nothing
, _nuUploadProtocol = Nothing
, _nuPp = True
, _nuAccessToken = Nothing
, _nuUploadType = Nothing
, _nuPayload = pNuPayload_
, _nuNamespaceName = pNuNamespaceName_
, _nuBearerToken = Nothing
, _nuProjectId = Nothing
, _nuCallback = Nothing
}
-- | V1 error format.
nuXgafv :: Lens' NamespacesUpdate (Maybe Text)
nuXgafv = lens _nuXgafv (\ s a -> s{_nuXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
nuUploadProtocol :: Lens' NamespacesUpdate (Maybe Text)
nuUploadProtocol
= lens _nuUploadProtocol
(\ s a -> s{_nuUploadProtocol = a})
-- | Pretty-print response.
nuPp :: Lens' NamespacesUpdate Bool
nuPp = lens _nuPp (\ s a -> s{_nuPp = a})
-- | OAuth access token.
nuAccessToken :: Lens' NamespacesUpdate (Maybe Text)
nuAccessToken
= lens _nuAccessToken
(\ s a -> s{_nuAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
nuUploadType :: Lens' NamespacesUpdate (Maybe Text)
nuUploadType
= lens _nuUploadType (\ s a -> s{_nuUploadType = a})
-- | Multipart request metadata.
nuPayload :: Lens' NamespacesUpdate Namespace
nuPayload
= lens _nuPayload (\ s a -> s{_nuPayload = a})
-- | Resource name of this namespace. Namespaces names have the format:
-- namespaces\/namespace.
nuNamespaceName :: Lens' NamespacesUpdate Text
nuNamespaceName
= lens _nuNamespaceName
(\ s a -> s{_nuNamespaceName = a})
-- | OAuth bearer token.
nuBearerToken :: Lens' NamespacesUpdate (Maybe Text)
nuBearerToken
= lens _nuBearerToken
(\ s a -> s{_nuBearerToken = a})
-- | The project id of the namespace to update. If the project id is not
-- specified then the project making the request is used. The project id
-- must match the project that owns the beacon. Optional.
nuProjectId :: Lens' NamespacesUpdate (Maybe Text)
nuProjectId
= lens _nuProjectId (\ s a -> s{_nuProjectId = a})
-- | JSONP
nuCallback :: Lens' NamespacesUpdate (Maybe Text)
nuCallback
= lens _nuCallback (\ s a -> s{_nuCallback = a})
instance GoogleRequest NamespacesUpdate where
type Rs NamespacesUpdate = Namespace
type Scopes NamespacesUpdate =
'["https://www.googleapis.com/auth/userlocation.beacon.registry"]
requestClient NamespacesUpdate'{..}
= go _nuNamespaceName _nuXgafv _nuUploadProtocol
(Just _nuPp)
_nuAccessToken
_nuUploadType
_nuBearerToken
_nuProjectId
_nuCallback
(Just AltJSON)
_nuPayload
proximityBeaconService
where go
= buildClient
(Proxy :: Proxy NamespacesUpdateResource)
mempty