{-# 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.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 matter with the given name and description. The initial state is open, and the owner is the method caller. Returns the created matter with default view.
--
-- /See:/ <https://developers.google.com/vault Google Vault API Reference> for @vault.matters.create@.
module Gogol.Vault.Matters.Create
  ( -- * Resource
    VaultMattersCreateResource,

    -- ** Constructing a Request
    VaultMattersCreate (..),
    newVaultMattersCreate,
  )
where

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

-- | A resource alias for @vault.matters.create@ method which the
-- 'VaultMattersCreate' request conforms to.
type VaultMattersCreateResource =
  "v1"
    Core.:> "matters"
    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] Matter
    Core.:> Core.Post '[Core.JSON] Matter

-- | Creates a matter with the given name and description. The initial state is open, and the owner is the method caller. Returns the created matter with default view.
--
-- /See:/ 'newVaultMattersCreate' smart constructor.
data VaultMattersCreate = VaultMattersCreate
  { -- | V1 error format.
    VaultMattersCreate -> Maybe Xgafv
xgafv :: (Core.Maybe Xgafv),
    -- | OAuth access token.
    VaultMattersCreate -> Maybe Text
accessToken :: (Core.Maybe Core.Text),
    -- | JSONP
    VaultMattersCreate -> Maybe Text
callback :: (Core.Maybe Core.Text),
    -- | Multipart request metadata.
    VaultMattersCreate -> Matter
payload :: Matter,
    -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
    VaultMattersCreate -> Maybe Text
uploadType :: (Core.Maybe Core.Text),
    -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
    VaultMattersCreate -> Maybe Text
uploadProtocol :: (Core.Maybe Core.Text)
  }
  deriving (VaultMattersCreate -> VaultMattersCreate -> Bool
(VaultMattersCreate -> VaultMattersCreate -> Bool)
-> (VaultMattersCreate -> VaultMattersCreate -> Bool)
-> Eq VaultMattersCreate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VaultMattersCreate -> VaultMattersCreate -> Bool
== :: VaultMattersCreate -> VaultMattersCreate -> Bool
$c/= :: VaultMattersCreate -> VaultMattersCreate -> Bool
/= :: VaultMattersCreate -> VaultMattersCreate -> Bool
Core.Eq, Int -> VaultMattersCreate -> ShowS
[VaultMattersCreate] -> ShowS
VaultMattersCreate -> String
(Int -> VaultMattersCreate -> ShowS)
-> (VaultMattersCreate -> String)
-> ([VaultMattersCreate] -> ShowS)
-> Show VaultMattersCreate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VaultMattersCreate -> ShowS
showsPrec :: Int -> VaultMattersCreate -> ShowS
$cshow :: VaultMattersCreate -> String
show :: VaultMattersCreate -> String
$cshowList :: [VaultMattersCreate] -> ShowS
showList :: [VaultMattersCreate] -> ShowS
Core.Show, (forall x. VaultMattersCreate -> Rep VaultMattersCreate x)
-> (forall x. Rep VaultMattersCreate x -> VaultMattersCreate)
-> Generic VaultMattersCreate
forall x. Rep VaultMattersCreate x -> VaultMattersCreate
forall x. VaultMattersCreate -> Rep VaultMattersCreate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. VaultMattersCreate -> Rep VaultMattersCreate x
from :: forall x. VaultMattersCreate -> Rep VaultMattersCreate x
$cto :: forall x. Rep VaultMattersCreate x -> VaultMattersCreate
to :: forall x. Rep VaultMattersCreate x -> VaultMattersCreate
Core.Generic)

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