{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.StorageGateway.DescribeCache
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about the cache of a gateway. This operation is only
-- supported in the cached volume, tape, and file gateway types.
--
-- The response includes disk IDs that are configured as cache, and it
-- includes the amount of cache allocated and used.
module Amazonka.StorageGateway.DescribeCache
  ( -- * Creating a Request
    DescribeCache (..),
    newDescribeCache,

    -- * Request Lenses
    describeCache_gatewayARN,

    -- * Destructuring the Response
    DescribeCacheResponse (..),
    newDescribeCacheResponse,

    -- * Response Lenses
    describeCacheResponse_gatewayARN,
    describeCacheResponse_diskIds,
    describeCacheResponse_cacheUsedPercentage,
    describeCacheResponse_cacheHitPercentage,
    describeCacheResponse_cacheMissPercentage,
    describeCacheResponse_cacheAllocatedInBytes,
    describeCacheResponse_cacheDirtyPercentage,
    describeCacheResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StorageGateway.Types

-- | /See:/ 'newDescribeCache' smart constructor.
data DescribeCache = DescribeCache'
  { DescribeCache -> Text
gatewayARN :: Prelude.Text
  }
  deriving (DescribeCache -> DescribeCache -> Bool
(DescribeCache -> DescribeCache -> Bool)
-> (DescribeCache -> DescribeCache -> Bool) -> Eq DescribeCache
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCache -> DescribeCache -> Bool
$c/= :: DescribeCache -> DescribeCache -> Bool
== :: DescribeCache -> DescribeCache -> Bool
$c== :: DescribeCache -> DescribeCache -> Bool
Prelude.Eq, ReadPrec [DescribeCache]
ReadPrec DescribeCache
Int -> ReadS DescribeCache
ReadS [DescribeCache]
(Int -> ReadS DescribeCache)
-> ReadS [DescribeCache]
-> ReadPrec DescribeCache
-> ReadPrec [DescribeCache]
-> Read DescribeCache
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCache]
$creadListPrec :: ReadPrec [DescribeCache]
readPrec :: ReadPrec DescribeCache
$creadPrec :: ReadPrec DescribeCache
readList :: ReadS [DescribeCache]
$creadList :: ReadS [DescribeCache]
readsPrec :: Int -> ReadS DescribeCache
$creadsPrec :: Int -> ReadS DescribeCache
Prelude.Read, Int -> DescribeCache -> ShowS
[DescribeCache] -> ShowS
DescribeCache -> String
(Int -> DescribeCache -> ShowS)
-> (DescribeCache -> String)
-> ([DescribeCache] -> ShowS)
-> Show DescribeCache
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCache] -> ShowS
$cshowList :: [DescribeCache] -> ShowS
show :: DescribeCache -> String
$cshow :: DescribeCache -> String
showsPrec :: Int -> DescribeCache -> ShowS
$cshowsPrec :: Int -> DescribeCache -> ShowS
Prelude.Show, (forall x. DescribeCache -> Rep DescribeCache x)
-> (forall x. Rep DescribeCache x -> DescribeCache)
-> Generic DescribeCache
forall x. Rep DescribeCache x -> DescribeCache
forall x. DescribeCache -> Rep DescribeCache x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCache x -> DescribeCache
$cfrom :: forall x. DescribeCache -> Rep DescribeCache x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCache' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'gatewayARN', 'describeCache_gatewayARN' - Undocumented member.
newDescribeCache ::
  -- | 'gatewayARN'
  Prelude.Text ->
  DescribeCache
newDescribeCache :: Text -> DescribeCache
newDescribeCache Text
pGatewayARN_ =
  DescribeCache' :: Text -> DescribeCache
DescribeCache' {$sel:gatewayARN:DescribeCache' :: Text
gatewayARN = Text
pGatewayARN_}

-- | Undocumented member.
describeCache_gatewayARN :: Lens.Lens' DescribeCache Prelude.Text
describeCache_gatewayARN :: (Text -> f Text) -> DescribeCache -> f DescribeCache
describeCache_gatewayARN = (DescribeCache -> Text)
-> (DescribeCache -> Text -> DescribeCache)
-> Lens DescribeCache DescribeCache Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCache' {Text
gatewayARN :: Text
$sel:gatewayARN:DescribeCache' :: DescribeCache -> Text
gatewayARN} -> Text
gatewayARN) (\s :: DescribeCache
s@DescribeCache' {} Text
a -> DescribeCache
s {$sel:gatewayARN:DescribeCache' :: Text
gatewayARN = Text
a} :: DescribeCache)

instance Core.AWSRequest DescribeCache where
  type
    AWSResponse DescribeCache =
      DescribeCacheResponse
  request :: DescribeCache -> Request DescribeCache
request = Service -> DescribeCache -> Request DescribeCache
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeCache
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeCache)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeCache))
-> Logger
-> Service
-> Proxy DescribeCache
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeCache)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Integer
-> Maybe Double
-> Int
-> DescribeCacheResponse
DescribeCacheResponse'
            (Maybe Text
 -> Maybe [Text]
 -> Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> Maybe Integer
 -> Maybe Double
 -> Int
 -> DescribeCacheResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Double
      -> Int
      -> DescribeCacheResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GatewayARN")
            Either
  String
  (Maybe [Text]
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Double
   -> Int
   -> DescribeCacheResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Double
      -> Int
      -> DescribeCacheResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DiskIds" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Double
   -> Int
   -> DescribeCacheResponse)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Double
      -> Int
      -> DescribeCacheResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Double)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CacheUsedPercentage")
            Either
  String
  (Maybe Double
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Double
   -> Int
   -> DescribeCacheResponse)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Integer -> Maybe Double -> Int -> DescribeCacheResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Double)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CacheHitPercentage")
            Either
  String
  (Maybe Double
   -> Maybe Integer -> Maybe Double -> Int -> DescribeCacheResponse)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Integer -> Maybe Double -> Int -> DescribeCacheResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Double)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CacheMissPercentage")
            Either
  String
  (Maybe Integer -> Maybe Double -> Int -> DescribeCacheResponse)
-> Either String (Maybe Integer)
-> Either String (Maybe Double -> Int -> DescribeCacheResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CacheAllocatedInBytes")
            Either String (Maybe Double -> Int -> DescribeCacheResponse)
-> Either String (Maybe Double)
-> Either String (Int -> DescribeCacheResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Double)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CacheDirtyPercentage")
            Either String (Int -> DescribeCacheResponse)
-> Either String Int -> Either String DescribeCacheResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeCache

instance Prelude.NFData DescribeCache

instance Core.ToHeaders DescribeCache where
  toHeaders :: DescribeCache -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeCache -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StorageGateway_20130630.DescribeCache" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeCache where
  toJSON :: DescribeCache -> Value
toJSON DescribeCache' {Text
gatewayARN :: Text
$sel:gatewayARN:DescribeCache' :: DescribeCache -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GatewayARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayARN)]
      )

instance Core.ToPath DescribeCache where
  toPath :: DescribeCache -> ByteString
toPath = ByteString -> DescribeCache -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeCache where
  toQuery :: DescribeCache -> QueryString
toQuery = QueryString -> DescribeCache -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeCacheResponse' smart constructor.
data DescribeCacheResponse = DescribeCacheResponse'
  { DescribeCacheResponse -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | An array of strings that identify disks that are to be configured as
    -- working storage. Each string has a minimum length of 1 and maximum
    -- length of 300. You can get the disk IDs from the ListLocalDisks API.
    DescribeCacheResponse -> Maybe [Text]
diskIds :: Prelude.Maybe [Prelude.Text],
    -- | Percent use of the gateway\'s cache storage. This metric applies only to
    -- the gateway-cached volume setup. The sample is taken at the end of the
    -- reporting period.
    DescribeCacheResponse -> Maybe Double
cacheUsedPercentage :: Prelude.Maybe Prelude.Double,
    -- | Percent of application read operations from the file shares that are
    -- served from cache. The sample is taken at the end of the reporting
    -- period.
    DescribeCacheResponse -> Maybe Double
cacheHitPercentage :: Prelude.Maybe Prelude.Double,
    -- | Percent of application read operations from the file shares that are not
    -- served from cache. The sample is taken at the end of the reporting
    -- period.
    DescribeCacheResponse -> Maybe Double
cacheMissPercentage :: Prelude.Maybe Prelude.Double,
    -- | The amount of cache in bytes allocated to a gateway.
    DescribeCacheResponse -> Maybe Integer
cacheAllocatedInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The file share\'s contribution to the overall percentage of the
    -- gateway\'s cache that has not been persisted to Amazon Web Services. The
    -- sample is taken at the end of the reporting period.
    DescribeCacheResponse -> Maybe Double
cacheDirtyPercentage :: Prelude.Maybe Prelude.Double,
    -- | The response's http status code.
    DescribeCacheResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCacheResponse -> DescribeCacheResponse -> Bool
(DescribeCacheResponse -> DescribeCacheResponse -> Bool)
-> (DescribeCacheResponse -> DescribeCacheResponse -> Bool)
-> Eq DescribeCacheResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCacheResponse -> DescribeCacheResponse -> Bool
$c/= :: DescribeCacheResponse -> DescribeCacheResponse -> Bool
== :: DescribeCacheResponse -> DescribeCacheResponse -> Bool
$c== :: DescribeCacheResponse -> DescribeCacheResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCacheResponse]
ReadPrec DescribeCacheResponse
Int -> ReadS DescribeCacheResponse
ReadS [DescribeCacheResponse]
(Int -> ReadS DescribeCacheResponse)
-> ReadS [DescribeCacheResponse]
-> ReadPrec DescribeCacheResponse
-> ReadPrec [DescribeCacheResponse]
-> Read DescribeCacheResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCacheResponse]
$creadListPrec :: ReadPrec [DescribeCacheResponse]
readPrec :: ReadPrec DescribeCacheResponse
$creadPrec :: ReadPrec DescribeCacheResponse
readList :: ReadS [DescribeCacheResponse]
$creadList :: ReadS [DescribeCacheResponse]
readsPrec :: Int -> ReadS DescribeCacheResponse
$creadsPrec :: Int -> ReadS DescribeCacheResponse
Prelude.Read, Int -> DescribeCacheResponse -> ShowS
[DescribeCacheResponse] -> ShowS
DescribeCacheResponse -> String
(Int -> DescribeCacheResponse -> ShowS)
-> (DescribeCacheResponse -> String)
-> ([DescribeCacheResponse] -> ShowS)
-> Show DescribeCacheResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCacheResponse] -> ShowS
$cshowList :: [DescribeCacheResponse] -> ShowS
show :: DescribeCacheResponse -> String
$cshow :: DescribeCacheResponse -> String
showsPrec :: Int -> DescribeCacheResponse -> ShowS
$cshowsPrec :: Int -> DescribeCacheResponse -> ShowS
Prelude.Show, (forall x. DescribeCacheResponse -> Rep DescribeCacheResponse x)
-> (forall x. Rep DescribeCacheResponse x -> DescribeCacheResponse)
-> Generic DescribeCacheResponse
forall x. Rep DescribeCacheResponse x -> DescribeCacheResponse
forall x. DescribeCacheResponse -> Rep DescribeCacheResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCacheResponse x -> DescribeCacheResponse
$cfrom :: forall x. DescribeCacheResponse -> Rep DescribeCacheResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCacheResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'gatewayARN', 'describeCacheResponse_gatewayARN' - Undocumented member.
--
-- 'diskIds', 'describeCacheResponse_diskIds' - An array of strings that identify disks that are to be configured as
-- working storage. Each string has a minimum length of 1 and maximum
-- length of 300. You can get the disk IDs from the ListLocalDisks API.
--
-- 'cacheUsedPercentage', 'describeCacheResponse_cacheUsedPercentage' - Percent use of the gateway\'s cache storage. This metric applies only to
-- the gateway-cached volume setup. The sample is taken at the end of the
-- reporting period.
--
-- 'cacheHitPercentage', 'describeCacheResponse_cacheHitPercentage' - Percent of application read operations from the file shares that are
-- served from cache. The sample is taken at the end of the reporting
-- period.
--
-- 'cacheMissPercentage', 'describeCacheResponse_cacheMissPercentage' - Percent of application read operations from the file shares that are not
-- served from cache. The sample is taken at the end of the reporting
-- period.
--
-- 'cacheAllocatedInBytes', 'describeCacheResponse_cacheAllocatedInBytes' - The amount of cache in bytes allocated to a gateway.
--
-- 'cacheDirtyPercentage', 'describeCacheResponse_cacheDirtyPercentage' - The file share\'s contribution to the overall percentage of the
-- gateway\'s cache that has not been persisted to Amazon Web Services. The
-- sample is taken at the end of the reporting period.
--
-- 'httpStatus', 'describeCacheResponse_httpStatus' - The response's http status code.
newDescribeCacheResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCacheResponse
newDescribeCacheResponse :: Int -> DescribeCacheResponse
newDescribeCacheResponse Int
pHttpStatus_ =
  DescribeCacheResponse' :: Maybe Text
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Integer
-> Maybe Double
-> Int
-> DescribeCacheResponse
DescribeCacheResponse'
    { $sel:gatewayARN:DescribeCacheResponse' :: Maybe Text
gatewayARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:diskIds:DescribeCacheResponse' :: Maybe [Text]
diskIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheUsedPercentage:DescribeCacheResponse' :: Maybe Double
cacheUsedPercentage = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheHitPercentage:DescribeCacheResponse' :: Maybe Double
cacheHitPercentage = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheMissPercentage:DescribeCacheResponse' :: Maybe Double
cacheMissPercentage = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheAllocatedInBytes:DescribeCacheResponse' :: Maybe Integer
cacheAllocatedInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheDirtyPercentage:DescribeCacheResponse' :: Maybe Double
cacheDirtyPercentage = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCacheResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
describeCacheResponse_gatewayARN :: Lens.Lens' DescribeCacheResponse (Prelude.Maybe Prelude.Text)
describeCacheResponse_gatewayARN :: (Maybe Text -> f (Maybe Text))
-> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_gatewayARN = (DescribeCacheResponse -> Maybe Text)
-> (DescribeCacheResponse -> Maybe Text -> DescribeCacheResponse)
-> Lens
     DescribeCacheResponse
     DescribeCacheResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:DescribeCacheResponse' :: DescribeCacheResponse -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Maybe Text
a -> DescribeCacheResponse
s {$sel:gatewayARN:DescribeCacheResponse' :: Maybe Text
gatewayARN = Maybe Text
a} :: DescribeCacheResponse)

-- | An array of strings that identify disks that are to be configured as
-- working storage. Each string has a minimum length of 1 and maximum
-- length of 300. You can get the disk IDs from the ListLocalDisks API.
describeCacheResponse_diskIds :: Lens.Lens' DescribeCacheResponse (Prelude.Maybe [Prelude.Text])
describeCacheResponse_diskIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_diskIds = (DescribeCacheResponse -> Maybe [Text])
-> (DescribeCacheResponse -> Maybe [Text] -> DescribeCacheResponse)
-> Lens
     DescribeCacheResponse
     DescribeCacheResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Maybe [Text]
diskIds :: Maybe [Text]
$sel:diskIds:DescribeCacheResponse' :: DescribeCacheResponse -> Maybe [Text]
diskIds} -> Maybe [Text]
diskIds) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Maybe [Text]
a -> DescribeCacheResponse
s {$sel:diskIds:DescribeCacheResponse' :: Maybe [Text]
diskIds = Maybe [Text]
a} :: DescribeCacheResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeCacheResponse -> f DescribeCacheResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeCacheResponse
-> f DescribeCacheResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Percent use of the gateway\'s cache storage. This metric applies only to
-- the gateway-cached volume setup. The sample is taken at the end of the
-- reporting period.
describeCacheResponse_cacheUsedPercentage :: Lens.Lens' DescribeCacheResponse (Prelude.Maybe Prelude.Double)
describeCacheResponse_cacheUsedPercentage :: (Maybe Double -> f (Maybe Double))
-> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_cacheUsedPercentage = (DescribeCacheResponse -> Maybe Double)
-> (DescribeCacheResponse -> Maybe Double -> DescribeCacheResponse)
-> Lens
     DescribeCacheResponse
     DescribeCacheResponse
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Maybe Double
cacheUsedPercentage :: Maybe Double
$sel:cacheUsedPercentage:DescribeCacheResponse' :: DescribeCacheResponse -> Maybe Double
cacheUsedPercentage} -> Maybe Double
cacheUsedPercentage) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Maybe Double
a -> DescribeCacheResponse
s {$sel:cacheUsedPercentage:DescribeCacheResponse' :: Maybe Double
cacheUsedPercentage = Maybe Double
a} :: DescribeCacheResponse)

-- | Percent of application read operations from the file shares that are
-- served from cache. The sample is taken at the end of the reporting
-- period.
describeCacheResponse_cacheHitPercentage :: Lens.Lens' DescribeCacheResponse (Prelude.Maybe Prelude.Double)
describeCacheResponse_cacheHitPercentage :: (Maybe Double -> f (Maybe Double))
-> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_cacheHitPercentage = (DescribeCacheResponse -> Maybe Double)
-> (DescribeCacheResponse -> Maybe Double -> DescribeCacheResponse)
-> Lens
     DescribeCacheResponse
     DescribeCacheResponse
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Maybe Double
cacheHitPercentage :: Maybe Double
$sel:cacheHitPercentage:DescribeCacheResponse' :: DescribeCacheResponse -> Maybe Double
cacheHitPercentage} -> Maybe Double
cacheHitPercentage) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Maybe Double
a -> DescribeCacheResponse
s {$sel:cacheHitPercentage:DescribeCacheResponse' :: Maybe Double
cacheHitPercentage = Maybe Double
a} :: DescribeCacheResponse)

-- | Percent of application read operations from the file shares that are not
-- served from cache. The sample is taken at the end of the reporting
-- period.
describeCacheResponse_cacheMissPercentage :: Lens.Lens' DescribeCacheResponse (Prelude.Maybe Prelude.Double)
describeCacheResponse_cacheMissPercentage :: (Maybe Double -> f (Maybe Double))
-> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_cacheMissPercentage = (DescribeCacheResponse -> Maybe Double)
-> (DescribeCacheResponse -> Maybe Double -> DescribeCacheResponse)
-> Lens
     DescribeCacheResponse
     DescribeCacheResponse
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Maybe Double
cacheMissPercentage :: Maybe Double
$sel:cacheMissPercentage:DescribeCacheResponse' :: DescribeCacheResponse -> Maybe Double
cacheMissPercentage} -> Maybe Double
cacheMissPercentage) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Maybe Double
a -> DescribeCacheResponse
s {$sel:cacheMissPercentage:DescribeCacheResponse' :: Maybe Double
cacheMissPercentage = Maybe Double
a} :: DescribeCacheResponse)

-- | The amount of cache in bytes allocated to a gateway.
describeCacheResponse_cacheAllocatedInBytes :: Lens.Lens' DescribeCacheResponse (Prelude.Maybe Prelude.Integer)
describeCacheResponse_cacheAllocatedInBytes :: (Maybe Integer -> f (Maybe Integer))
-> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_cacheAllocatedInBytes = (DescribeCacheResponse -> Maybe Integer)
-> (DescribeCacheResponse
    -> Maybe Integer -> DescribeCacheResponse)
-> Lens
     DescribeCacheResponse
     DescribeCacheResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Maybe Integer
cacheAllocatedInBytes :: Maybe Integer
$sel:cacheAllocatedInBytes:DescribeCacheResponse' :: DescribeCacheResponse -> Maybe Integer
cacheAllocatedInBytes} -> Maybe Integer
cacheAllocatedInBytes) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Maybe Integer
a -> DescribeCacheResponse
s {$sel:cacheAllocatedInBytes:DescribeCacheResponse' :: Maybe Integer
cacheAllocatedInBytes = Maybe Integer
a} :: DescribeCacheResponse)

-- | The file share\'s contribution to the overall percentage of the
-- gateway\'s cache that has not been persisted to Amazon Web Services. The
-- sample is taken at the end of the reporting period.
describeCacheResponse_cacheDirtyPercentage :: Lens.Lens' DescribeCacheResponse (Prelude.Maybe Prelude.Double)
describeCacheResponse_cacheDirtyPercentage :: (Maybe Double -> f (Maybe Double))
-> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_cacheDirtyPercentage = (DescribeCacheResponse -> Maybe Double)
-> (DescribeCacheResponse -> Maybe Double -> DescribeCacheResponse)
-> Lens
     DescribeCacheResponse
     DescribeCacheResponse
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Maybe Double
cacheDirtyPercentage :: Maybe Double
$sel:cacheDirtyPercentage:DescribeCacheResponse' :: DescribeCacheResponse -> Maybe Double
cacheDirtyPercentage} -> Maybe Double
cacheDirtyPercentage) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Maybe Double
a -> DescribeCacheResponse
s {$sel:cacheDirtyPercentage:DescribeCacheResponse' :: Maybe Double
cacheDirtyPercentage = Maybe Double
a} :: DescribeCacheResponse)

-- | The response's http status code.
describeCacheResponse_httpStatus :: Lens.Lens' DescribeCacheResponse Prelude.Int
describeCacheResponse_httpStatus :: (Int -> f Int) -> DescribeCacheResponse -> f DescribeCacheResponse
describeCacheResponse_httpStatus = (DescribeCacheResponse -> Int)
-> (DescribeCacheResponse -> Int -> DescribeCacheResponse)
-> Lens DescribeCacheResponse DescribeCacheResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeCacheResponse' :: DescribeCacheResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeCacheResponse
s@DescribeCacheResponse' {} Int
a -> DescribeCacheResponse
s {$sel:httpStatus:DescribeCacheResponse' :: Int
httpStatus = Int
a} :: DescribeCacheResponse)

instance Prelude.NFData DescribeCacheResponse