packages feed

unkai-storage-0.1.0.1: gen/Unkai/Storage/AnywhereCaches/Get.hs

{-# 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      : Unkai.Storage.AnywhereCaches.Get
-- Copyright   : (c) 2015-2025 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Nadeem Bitar <nadeem@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the metadata of an Anywhere Cache instance.
--
-- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.anywhereCaches.get@.
module Unkai.Storage.AnywhereCaches.Get
  ( -- * Resource
    StorageAnywhereCachesGetResource,

    -- ** Constructing a Request
    StorageAnywhereCachesGet (..),
    newStorageAnywhereCachesGet,
  )
where

import Unkai.Prelude qualified as Core
import Unkai.Storage.Types

-- | A resource alias for @storage.anywhereCaches.get@ method which the
-- 'StorageAnywhereCachesGet' request conforms to.
type StorageAnywhereCachesGetResource =
  "storage"
    Core.:> "v1"
    Core.:> "b"
    Core.:> Core.Capture "bucket" Core.Text
    Core.:> "anywhereCaches"
    Core.:> Core.Capture "anywhereCacheId" Core.Text
    Core.:> Core.QueryParam "alt" Core.AltJSON
    Core.:> Core.Get '[Core.JSON] AnywhereCache

-- | Returns the metadata of an Anywhere Cache instance.
--
-- /See:/ 'newStorageAnywhereCachesGet' smart constructor.
data StorageAnywhereCachesGet = StorageAnywhereCachesGet
  { -- | The ID of requested Anywhere Cache instance.
    anywhereCacheId :: Core.Text,
    -- | Name of the parent bucket.
    bucket :: Core.Text
  }
  deriving stock (Core.Eq, Core.Show, Core.Generic)

-- | Creates a value of 'StorageAnywhereCachesGet' with the minimum fields required to make a request.
newStorageAnywhereCachesGet ::
  -- |  Name of the parent bucket. See 'bucket'.
  Core.Text ->
  -- |  The ID of requested Anywhere Cache instance. See 'anywhereCacheId'.
  Core.Text ->
  StorageAnywhereCachesGet
newStorageAnywhereCachesGet bucket anywhereCacheId =
  StorageAnywhereCachesGet
    { anywhereCacheId = anywhereCacheId,
      bucket = bucket
    }

instance Core.GoogleRequest StorageAnywhereCachesGet where
  type Rs StorageAnywhereCachesGet = AnywhereCache
  type
    Scopes StorageAnywhereCachesGet =
      '[ CloudPlatform'FullControl,
         CloudPlatform'ReadOnly,
         Devstorage'FullControl,
         Devstorage'ReadOnly,
         Devstorage'ReadWrite
       ]
  requestClient StorageAnywhereCachesGet {..} =
    go bucket anywhereCacheId (Core.Just Core.AltJSON) storageService
    where
      go =
        Core.buildClient
          (Core.Proxy :: Core.Proxy StorageAnywhereCachesGetResource)
          Core.mempty