{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- |
-- Module      : Gogol.Vault.Matters.Close
-- Copyright   : (c) 2015-2025 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+gogol@gmail.com>
--               Toni Cebrián <toni@tonicebrian.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Closes the specified matter. Returns the matter with updated state.
--
-- /See:/ <https://developers.google.com/vault Google Vault API Reference> for @vault.matters.close@.
module Gogol.Vault.Matters.Close
  ( -- * Resource
    VaultMattersCloseResource,

    -- ** Constructing a Request
    VaultMattersClose (..),
    newVaultMattersClose,
  )
where

import Gogol.Prelude qualified as Core
import Gogol.Vault.Types

-- | A resource alias for @vault.matters.close@ method which the
-- 'VaultMattersClose' request conforms to.
type VaultMattersCloseResource =
  "v1"
    Core.:> "matters"
    Core.:> Core.CaptureMode "matterId" "close" Core.Text
    Core.:> Core.QueryParam "$.xgafv" Xgafv
    Core.:> Core.QueryParam "access_token" Core.Text
    Core.:> Core.QueryParam "callback" Core.Text
    Core.:> Core.QueryParam "uploadType" Core.Text
    Core.:> Core.QueryParam "upload_protocol" Core.Text
    Core.:> Core.QueryParam "alt" Core.AltJSON
    Core.:> Core.ReqBody '[Core.JSON] CloseMatterRequest
    Core.:> Core.Post '[Core.JSON] CloseMatterResponse

-- | Closes the specified matter. Returns the matter with updated state.
--
-- /See:/ 'newVaultMattersClose' smart constructor.
data VaultMattersClose = VaultMattersClose
  { -- | V1 error format.
    VaultMattersClose -> Maybe Xgafv
xgafv :: (Core.Maybe Xgafv),
    -- | OAuth access token.
    VaultMattersClose -> Maybe Text
accessToken :: (Core.Maybe Core.Text),
    -- | JSONP
    VaultMattersClose -> Maybe Text
callback :: (Core.Maybe Core.Text),
    -- | The matter ID.
    VaultMattersClose -> Text
matterId :: Core.Text,
    -- | Multipart request metadata.
    VaultMattersClose -> CloseMatterRequest
payload :: CloseMatterRequest,
    -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
    VaultMattersClose -> Maybe Text
uploadType :: (Core.Maybe Core.Text),
    -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
    VaultMattersClose -> Maybe Text
uploadProtocol :: (Core.Maybe Core.Text)
  }
  deriving (VaultMattersClose -> VaultMattersClose -> Bool
(VaultMattersClose -> VaultMattersClose -> Bool)
-> (VaultMattersClose -> VaultMattersClose -> Bool)
-> Eq VaultMattersClose
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VaultMattersClose -> VaultMattersClose -> Bool
== :: VaultMattersClose -> VaultMattersClose -> Bool
$c/= :: VaultMattersClose -> VaultMattersClose -> Bool
/= :: VaultMattersClose -> VaultMattersClose -> Bool
Core.Eq, Int -> VaultMattersClose -> ShowS
[VaultMattersClose] -> ShowS
VaultMattersClose -> String
(Int -> VaultMattersClose -> ShowS)
-> (VaultMattersClose -> String)
-> ([VaultMattersClose] -> ShowS)
-> Show VaultMattersClose
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VaultMattersClose -> ShowS
showsPrec :: Int -> VaultMattersClose -> ShowS
$cshow :: VaultMattersClose -> String
show :: VaultMattersClose -> String
$cshowList :: [VaultMattersClose] -> ShowS
showList :: [VaultMattersClose] -> ShowS
Core.Show, (forall x. VaultMattersClose -> Rep VaultMattersClose x)
-> (forall x. Rep VaultMattersClose x -> VaultMattersClose)
-> Generic VaultMattersClose
forall x. Rep VaultMattersClose x -> VaultMattersClose
forall x. VaultMattersClose -> Rep VaultMattersClose x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. VaultMattersClose -> Rep VaultMattersClose x
from :: forall x. VaultMattersClose -> Rep VaultMattersClose x
$cto :: forall x. Rep VaultMattersClose x -> VaultMattersClose
to :: forall x. Rep VaultMattersClose x -> VaultMattersClose
Core.Generic)

-- | Creates a value of 'VaultMattersClose' with the minimum fields required to make a request.
newVaultMattersClose ::
  -- |  The matter ID. See 'matterId'.
  Core.Text ->
  -- |  Multipart request metadata. See 'payload'.
  CloseMatterRequest ->
  VaultMattersClose
newVaultMattersClose :: Text -> CloseMatterRequest -> VaultMattersClose
newVaultMattersClose Text
matterId CloseMatterRequest
payload =
  VaultMattersClose
    { xgafv :: Maybe Xgafv
xgafv = Maybe Xgafv
forall a. Maybe a
Core.Nothing,
      accessToken :: Maybe Text
accessToken = Maybe Text
forall a. Maybe a
Core.Nothing,
      callback :: Maybe Text
callback = Maybe Text
forall a. Maybe a
Core.Nothing,
      matterId :: Text
matterId = Text
matterId,
      payload :: CloseMatterRequest
payload = CloseMatterRequest
payload,
      uploadType :: Maybe Text
uploadType = Maybe Text
forall a. Maybe a
Core.Nothing,
      uploadProtocol :: Maybe Text
uploadProtocol = Maybe Text
forall a. Maybe a
Core.Nothing
    }

instance Core.GoogleRequest VaultMattersClose where
  type Rs VaultMattersClose = CloseMatterResponse
  type Scopes VaultMattersClose = '[Ediscovery'FullControl]
  requestClient :: VaultMattersClose -> GClient (Rs VaultMattersClose)
requestClient VaultMattersClose {Maybe Text
Maybe Xgafv
Text
CloseMatterRequest
xgafv :: VaultMattersClose -> Maybe Xgafv
accessToken :: VaultMattersClose -> Maybe Text
callback :: VaultMattersClose -> Maybe Text
matterId :: VaultMattersClose -> Text
payload :: VaultMattersClose -> CloseMatterRequest
uploadType :: VaultMattersClose -> Maybe Text
uploadProtocol :: VaultMattersClose -> Maybe Text
xgafv :: Maybe Xgafv
accessToken :: Maybe Text
callback :: Maybe Text
matterId :: Text
payload :: CloseMatterRequest
uploadType :: Maybe Text
uploadProtocol :: Maybe Text
..} =
    Text
-> Maybe Xgafv
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AltJSON
-> CloseMatterRequest
-> ServiceConfig
-> GClient CloseMatterResponse
go
      Text
matterId
      Maybe Xgafv
xgafv
      Maybe Text
accessToken
      Maybe Text
callback
      Maybe Text
uploadType
      Maybe Text
uploadProtocol
      (AltJSON -> Maybe AltJSON
forall a. a -> Maybe a
Core.Just AltJSON
Core.AltJSON)
      CloseMatterRequest
payload
      ServiceConfig
vaultService
    where
      go :: Fn VaultMattersCloseResource
go =
        Proxy VaultMattersCloseResource
-> Request -> Fn VaultMattersCloseResource
forall {k} (fn :: k).
GoogleClient fn =>
Proxy fn -> Request -> Fn fn
Core.buildClient
          (Proxy VaultMattersCloseResource
forall {k} (t :: k). Proxy t
Core.Proxy :: Core.Proxy VaultMattersCloseResource)
          Request
forall a. Monoid a => a
Core.mempty