{-# 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.Holds.Create
-- 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)
--
-- Creates a hold in the specified matter.
--
-- /See:/ <https://developers.google.com/vault Google Vault API Reference> for @vault.matters.holds.create@.
module Gogol.Vault.Matters.Holds.Create
  ( -- * Resource
    VaultMattersHoldsCreateResource,

    -- ** Constructing a Request
    VaultMattersHoldsCreate (..),
    newVaultMattersHoldsCreate,
  )
where

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

-- | A resource alias for @vault.matters.holds.create@ method which the
-- 'VaultMattersHoldsCreate' request conforms to.
type VaultMattersHoldsCreateResource =
  "v1"
    Core.:> "matters"
    Core.:> Core.Capture "matterId" Core.Text
    Core.:> "holds"
    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] Hold
    Core.:> Core.Post '[Core.JSON] Hold

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

-- | Creates a value of 'VaultMattersHoldsCreate' with the minimum fields required to make a request.
newVaultMattersHoldsCreate ::
  -- |  The matter ID. See 'matterId'.
  Core.Text ->
  -- |  Multipart request metadata. See 'payload'.
  Hold ->
  VaultMattersHoldsCreate
newVaultMattersHoldsCreate :: Text -> Hold -> VaultMattersHoldsCreate
newVaultMattersHoldsCreate Text
matterId Hold
payload =
  VaultMattersHoldsCreate
    { 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 :: Hold
payload = Hold
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 VaultMattersHoldsCreate where
  type Rs VaultMattersHoldsCreate = Hold
  type Scopes VaultMattersHoldsCreate = '[Ediscovery'FullControl]
  requestClient :: VaultMattersHoldsCreate -> GClient (Rs VaultMattersHoldsCreate)
requestClient VaultMattersHoldsCreate {Maybe Text
Maybe Xgafv
Text
Hold
xgafv :: VaultMattersHoldsCreate -> Maybe Xgafv
accessToken :: VaultMattersHoldsCreate -> Maybe Text
callback :: VaultMattersHoldsCreate -> Maybe Text
matterId :: VaultMattersHoldsCreate -> Text
payload :: VaultMattersHoldsCreate -> Hold
uploadType :: VaultMattersHoldsCreate -> Maybe Text
uploadProtocol :: VaultMattersHoldsCreate -> Maybe Text
xgafv :: Maybe Xgafv
accessToken :: Maybe Text
callback :: Maybe Text
matterId :: Text
payload :: Hold
uploadType :: Maybe Text
uploadProtocol :: Maybe Text
..} =
    Text
-> Maybe Xgafv
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AltJSON
-> Hold
-> ServiceConfig
-> GClient Hold
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)
      Hold
payload
      ServiceConfig
vaultService
    where
      go :: Fn VaultMattersHoldsCreateResource
go =
        Proxy VaultMattersHoldsCreateResource
-> Request -> Fn VaultMattersHoldsCreateResource
forall {k} (fn :: k).
GoogleClient fn =>
Proxy fn -> Request -> Fn fn
Core.buildClient
          (Proxy VaultMattersHoldsCreateResource
forall {k} (t :: k). Proxy t
Core.Proxy :: Core.Proxy VaultMattersHoldsCreateResource)
          Request
forall a. Monoid a => a
Core.mempty