{-# 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.BigtableAdmin.Projects.Instances.Delete
-- Copyright   : (c) 2015-2016 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete an instance from a project.
--
-- /See:/ <https://cloud.google.com/bigtable/ Cloud Bigtable Admin API Reference> for @bigtableadmin.projects.instances.delete@.
module Network.Google.Resource.BigtableAdmin.Projects.Instances.Delete
    (
    -- * REST Resource
      ProjectsInstancesDeleteResource

    -- * Creating a Request
    , projectsInstancesDelete
    , ProjectsInstancesDelete

    -- * Request Lenses
    , pidXgafv
    , pidUploadProtocol
    , pidAccessToken
    , pidUploadType
    , pidName
    , pidCallback
    ) where

import           Network.Google.BigtableAdmin.Types
import           Network.Google.Prelude

-- | A resource alias for @bigtableadmin.projects.instances.delete@ method which the
-- 'ProjectsInstancesDelete' request conforms to.
type ProjectsInstancesDeleteResource =
     "v2" :>
       Capture "name" Text :>
         QueryParam "$.xgafv" Xgafv :>
           QueryParam "upload_protocol" Text :>
             QueryParam "access_token" Text :>
               QueryParam "uploadType" Text :>
                 QueryParam "callback" Text :>
                   QueryParam "alt" AltJSON :> Delete '[JSON] Empty

-- | Delete an instance from a project.
--
-- /See:/ 'projectsInstancesDelete' smart constructor.
data ProjectsInstancesDelete = ProjectsInstancesDelete'
    { _pidXgafv          :: !(Maybe Xgafv)
    , _pidUploadProtocol :: !(Maybe Text)
    , _pidAccessToken    :: !(Maybe Text)
    , _pidUploadType     :: !(Maybe Text)
    , _pidName           :: !Text
    , _pidCallback       :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProjectsInstancesDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pidXgafv'
--
-- * 'pidUploadProtocol'
--
-- * 'pidAccessToken'
--
-- * 'pidUploadType'
--
-- * 'pidName'
--
-- * 'pidCallback'
projectsInstancesDelete
    :: Text -- ^ 'pidName'
    -> ProjectsInstancesDelete
projectsInstancesDelete pPidName_ =
    ProjectsInstancesDelete'
    { _pidXgafv = Nothing
    , _pidUploadProtocol = Nothing
    , _pidAccessToken = Nothing
    , _pidUploadType = Nothing
    , _pidName = pPidName_
    , _pidCallback = Nothing
    }

-- | V1 error format.
pidXgafv :: Lens' ProjectsInstancesDelete (Maybe Xgafv)
pidXgafv = lens _pidXgafv (\ s a -> s{_pidXgafv = a})

-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pidUploadProtocol :: Lens' ProjectsInstancesDelete (Maybe Text)
pidUploadProtocol
  = lens _pidUploadProtocol
      (\ s a -> s{_pidUploadProtocol = a})

-- | OAuth access token.
pidAccessToken :: Lens' ProjectsInstancesDelete (Maybe Text)
pidAccessToken
  = lens _pidAccessToken
      (\ s a -> s{_pidAccessToken = a})

-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pidUploadType :: Lens' ProjectsInstancesDelete (Maybe Text)
pidUploadType
  = lens _pidUploadType
      (\ s a -> s{_pidUploadType = a})

-- | The unique name of the instance to be deleted. Values are of the form
-- \`projects\/\/instances\/\`.
pidName :: Lens' ProjectsInstancesDelete Text
pidName = lens _pidName (\ s a -> s{_pidName = a})

-- | JSONP
pidCallback :: Lens' ProjectsInstancesDelete (Maybe Text)
pidCallback
  = lens _pidCallback (\ s a -> s{_pidCallback = a})

instance GoogleRequest ProjectsInstancesDelete where
        type Rs ProjectsInstancesDelete = Empty
        type Scopes ProjectsInstancesDelete =
             '["https://www.googleapis.com/auth/bigtable.admin",
               "https://www.googleapis.com/auth/bigtable.admin.cluster",
               "https://www.googleapis.com/auth/bigtable.admin.instance",
               "https://www.googleapis.com/auth/cloud-bigtable.admin",
               "https://www.googleapis.com/auth/cloud-bigtable.admin.cluster",
               "https://www.googleapis.com/auth/cloud-platform"]
        requestClient ProjectsInstancesDelete'{..}
          = go _pidName _pidXgafv _pidUploadProtocol
              _pidAccessToken
              _pidUploadType
              _pidCallback
              (Just AltJSON)
              bigtableAdminService
          where go
                  = buildClient
                      (Proxy :: Proxy ProjectsInstancesDeleteResource)
                      mempty