{-# 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.CloudFront.UpdateCachePolicy
-- 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)
--
-- Updates a cache policy configuration.
--
-- When you update a cache policy configuration, all the fields are updated
-- with the values provided in the request. You cannot update some fields
-- independent of others. To update a cache policy configuration:
--
-- 1.  Use @GetCachePolicyConfig@ to get the current configuration.
--
-- 2.  Locally modify the fields in the cache policy configuration that you
--     want to update.
--
-- 3.  Call @UpdateCachePolicy@ by providing the entire cache policy
--     configuration, including the fields that you modified and those that
--     you didn’t.
module Amazonka.CloudFront.UpdateCachePolicy
  ( -- * Creating a Request
    UpdateCachePolicy (..),
    newUpdateCachePolicy,

    -- * Request Lenses
    updateCachePolicy_ifMatch,
    updateCachePolicy_cachePolicyConfig,
    updateCachePolicy_id,

    -- * Destructuring the Response
    UpdateCachePolicyResponse (..),
    newUpdateCachePolicyResponse,

    -- * Response Lenses
    updateCachePolicyResponse_cachePolicy,
    updateCachePolicyResponse_eTag,
    updateCachePolicyResponse_httpStatus,
  )
where

import Amazonka.CloudFront.Types
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

-- | /See:/ 'newUpdateCachePolicy' smart constructor.
data UpdateCachePolicy = UpdateCachePolicy'
  { -- | The version of the cache policy that you are updating. The version is
    -- returned in the cache policy’s @ETag@ field in the response to
    -- @GetCachePolicyConfig@.
    UpdateCachePolicy -> Maybe Text
ifMatch :: Prelude.Maybe Prelude.Text,
    -- | A cache policy configuration.
    UpdateCachePolicy -> CachePolicyConfig
cachePolicyConfig :: CachePolicyConfig,
    -- | The unique identifier for the cache policy that you are updating. The
    -- identifier is returned in a cache behavior’s @CachePolicyId@ field in
    -- the response to @GetDistributionConfig@.
    UpdateCachePolicy -> Text
id :: Prelude.Text
  }
  deriving (UpdateCachePolicy -> UpdateCachePolicy -> Bool
(UpdateCachePolicy -> UpdateCachePolicy -> Bool)
-> (UpdateCachePolicy -> UpdateCachePolicy -> Bool)
-> Eq UpdateCachePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCachePolicy -> UpdateCachePolicy -> Bool
$c/= :: UpdateCachePolicy -> UpdateCachePolicy -> Bool
== :: UpdateCachePolicy -> UpdateCachePolicy -> Bool
$c== :: UpdateCachePolicy -> UpdateCachePolicy -> Bool
Prelude.Eq, ReadPrec [UpdateCachePolicy]
ReadPrec UpdateCachePolicy
Int -> ReadS UpdateCachePolicy
ReadS [UpdateCachePolicy]
(Int -> ReadS UpdateCachePolicy)
-> ReadS [UpdateCachePolicy]
-> ReadPrec UpdateCachePolicy
-> ReadPrec [UpdateCachePolicy]
-> Read UpdateCachePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCachePolicy]
$creadListPrec :: ReadPrec [UpdateCachePolicy]
readPrec :: ReadPrec UpdateCachePolicy
$creadPrec :: ReadPrec UpdateCachePolicy
readList :: ReadS [UpdateCachePolicy]
$creadList :: ReadS [UpdateCachePolicy]
readsPrec :: Int -> ReadS UpdateCachePolicy
$creadsPrec :: Int -> ReadS UpdateCachePolicy
Prelude.Read, Int -> UpdateCachePolicy -> ShowS
[UpdateCachePolicy] -> ShowS
UpdateCachePolicy -> String
(Int -> UpdateCachePolicy -> ShowS)
-> (UpdateCachePolicy -> String)
-> ([UpdateCachePolicy] -> ShowS)
-> Show UpdateCachePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCachePolicy] -> ShowS
$cshowList :: [UpdateCachePolicy] -> ShowS
show :: UpdateCachePolicy -> String
$cshow :: UpdateCachePolicy -> String
showsPrec :: Int -> UpdateCachePolicy -> ShowS
$cshowsPrec :: Int -> UpdateCachePolicy -> ShowS
Prelude.Show, (forall x. UpdateCachePolicy -> Rep UpdateCachePolicy x)
-> (forall x. Rep UpdateCachePolicy x -> UpdateCachePolicy)
-> Generic UpdateCachePolicy
forall x. Rep UpdateCachePolicy x -> UpdateCachePolicy
forall x. UpdateCachePolicy -> Rep UpdateCachePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCachePolicy x -> UpdateCachePolicy
$cfrom :: forall x. UpdateCachePolicy -> Rep UpdateCachePolicy x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCachePolicy' 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:
--
-- 'ifMatch', 'updateCachePolicy_ifMatch' - The version of the cache policy that you are updating. The version is
-- returned in the cache policy’s @ETag@ field in the response to
-- @GetCachePolicyConfig@.
--
-- 'cachePolicyConfig', 'updateCachePolicy_cachePolicyConfig' - A cache policy configuration.
--
-- 'id', 'updateCachePolicy_id' - The unique identifier for the cache policy that you are updating. The
-- identifier is returned in a cache behavior’s @CachePolicyId@ field in
-- the response to @GetDistributionConfig@.
newUpdateCachePolicy ::
  -- | 'cachePolicyConfig'
  CachePolicyConfig ->
  -- | 'id'
  Prelude.Text ->
  UpdateCachePolicy
newUpdateCachePolicy :: CachePolicyConfig -> Text -> UpdateCachePolicy
newUpdateCachePolicy CachePolicyConfig
pCachePolicyConfig_ Text
pId_ =
  UpdateCachePolicy' :: Maybe Text -> CachePolicyConfig -> Text -> UpdateCachePolicy
UpdateCachePolicy'
    { $sel:ifMatch:UpdateCachePolicy' :: Maybe Text
ifMatch = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cachePolicyConfig:UpdateCachePolicy' :: CachePolicyConfig
cachePolicyConfig = CachePolicyConfig
pCachePolicyConfig_,
      $sel:id:UpdateCachePolicy' :: Text
id = Text
pId_
    }

-- | The version of the cache policy that you are updating. The version is
-- returned in the cache policy’s @ETag@ field in the response to
-- @GetCachePolicyConfig@.
updateCachePolicy_ifMatch :: Lens.Lens' UpdateCachePolicy (Prelude.Maybe Prelude.Text)
updateCachePolicy_ifMatch :: (Maybe Text -> f (Maybe Text))
-> UpdateCachePolicy -> f UpdateCachePolicy
updateCachePolicy_ifMatch = (UpdateCachePolicy -> Maybe Text)
-> (UpdateCachePolicy -> Maybe Text -> UpdateCachePolicy)
-> Lens
     UpdateCachePolicy UpdateCachePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCachePolicy' {Maybe Text
ifMatch :: Maybe Text
$sel:ifMatch:UpdateCachePolicy' :: UpdateCachePolicy -> Maybe Text
ifMatch} -> Maybe Text
ifMatch) (\s :: UpdateCachePolicy
s@UpdateCachePolicy' {} Maybe Text
a -> UpdateCachePolicy
s {$sel:ifMatch:UpdateCachePolicy' :: Maybe Text
ifMatch = Maybe Text
a} :: UpdateCachePolicy)

-- | A cache policy configuration.
updateCachePolicy_cachePolicyConfig :: Lens.Lens' UpdateCachePolicy CachePolicyConfig
updateCachePolicy_cachePolicyConfig :: (CachePolicyConfig -> f CachePolicyConfig)
-> UpdateCachePolicy -> f UpdateCachePolicy
updateCachePolicy_cachePolicyConfig = (UpdateCachePolicy -> CachePolicyConfig)
-> (UpdateCachePolicy -> CachePolicyConfig -> UpdateCachePolicy)
-> Lens
     UpdateCachePolicy
     UpdateCachePolicy
     CachePolicyConfig
     CachePolicyConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCachePolicy' {CachePolicyConfig
cachePolicyConfig :: CachePolicyConfig
$sel:cachePolicyConfig:UpdateCachePolicy' :: UpdateCachePolicy -> CachePolicyConfig
cachePolicyConfig} -> CachePolicyConfig
cachePolicyConfig) (\s :: UpdateCachePolicy
s@UpdateCachePolicy' {} CachePolicyConfig
a -> UpdateCachePolicy
s {$sel:cachePolicyConfig:UpdateCachePolicy' :: CachePolicyConfig
cachePolicyConfig = CachePolicyConfig
a} :: UpdateCachePolicy)

-- | The unique identifier for the cache policy that you are updating. The
-- identifier is returned in a cache behavior’s @CachePolicyId@ field in
-- the response to @GetDistributionConfig@.
updateCachePolicy_id :: Lens.Lens' UpdateCachePolicy Prelude.Text
updateCachePolicy_id :: (Text -> f Text) -> UpdateCachePolicy -> f UpdateCachePolicy
updateCachePolicy_id = (UpdateCachePolicy -> Text)
-> (UpdateCachePolicy -> Text -> UpdateCachePolicy)
-> Lens UpdateCachePolicy UpdateCachePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCachePolicy' {Text
id :: Text
$sel:id:UpdateCachePolicy' :: UpdateCachePolicy -> Text
id} -> Text
id) (\s :: UpdateCachePolicy
s@UpdateCachePolicy' {} Text
a -> UpdateCachePolicy
s {$sel:id:UpdateCachePolicy' :: Text
id = Text
a} :: UpdateCachePolicy)

instance Core.AWSRequest UpdateCachePolicy where
  type
    AWSResponse UpdateCachePolicy =
      UpdateCachePolicyResponse
  request :: UpdateCachePolicy -> Request UpdateCachePolicy
request = Service -> UpdateCachePolicy -> Request UpdateCachePolicy
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateCachePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateCachePolicy)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse UpdateCachePolicy))
-> Logger
-> Service
-> Proxy UpdateCachePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateCachePolicy)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe CachePolicy -> Maybe Text -> Int -> UpdateCachePolicyResponse
UpdateCachePolicyResponse'
            (Maybe CachePolicy
 -> Maybe Text -> Int -> UpdateCachePolicyResponse)
-> Either String (Maybe CachePolicy)
-> Either String (Maybe Text -> Int -> UpdateCachePolicyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe CachePolicy)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either String (Maybe Text -> Int -> UpdateCachePolicyResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateCachePolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"ETag")
            Either String (Int -> UpdateCachePolicyResponse)
-> Either String Int -> Either String UpdateCachePolicyResponse
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 UpdateCachePolicy

instance Prelude.NFData UpdateCachePolicy

instance Core.ToElement UpdateCachePolicy where
  toElement :: UpdateCachePolicy -> Element
toElement UpdateCachePolicy' {Maybe Text
Text
CachePolicyConfig
id :: Text
cachePolicyConfig :: CachePolicyConfig
ifMatch :: Maybe Text
$sel:id:UpdateCachePolicy' :: UpdateCachePolicy -> Text
$sel:cachePolicyConfig:UpdateCachePolicy' :: UpdateCachePolicy -> CachePolicyConfig
$sel:ifMatch:UpdateCachePolicy' :: UpdateCachePolicy -> Maybe Text
..} =
    Name -> CachePolicyConfig -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{http://cloudfront.amazonaws.com/doc/2020-05-31/}CachePolicyConfig"
      CachePolicyConfig
cachePolicyConfig

instance Core.ToHeaders UpdateCachePolicy where
  toHeaders :: UpdateCachePolicy -> ResponseHeaders
toHeaders UpdateCachePolicy' {Maybe Text
Text
CachePolicyConfig
id :: Text
cachePolicyConfig :: CachePolicyConfig
ifMatch :: Maybe Text
$sel:id:UpdateCachePolicy' :: UpdateCachePolicy -> Text
$sel:cachePolicyConfig:UpdateCachePolicy' :: UpdateCachePolicy -> CachePolicyConfig
$sel:ifMatch:UpdateCachePolicy' :: UpdateCachePolicy -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat [HeaderName
"If-Match" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
ifMatch]

instance Core.ToPath UpdateCachePolicy where
  toPath :: UpdateCachePolicy -> ByteString
toPath UpdateCachePolicy' {Maybe Text
Text
CachePolicyConfig
id :: Text
cachePolicyConfig :: CachePolicyConfig
ifMatch :: Maybe Text
$sel:id:UpdateCachePolicy' :: UpdateCachePolicy -> Text
$sel:cachePolicyConfig:UpdateCachePolicy' :: UpdateCachePolicy -> CachePolicyConfig
$sel:ifMatch:UpdateCachePolicy' :: UpdateCachePolicy -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2020-05-31/cache-policy/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]

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

-- | /See:/ 'newUpdateCachePolicyResponse' smart constructor.
data UpdateCachePolicyResponse = UpdateCachePolicyResponse'
  { -- | A cache policy.
    UpdateCachePolicyResponse -> Maybe CachePolicy
cachePolicy :: Prelude.Maybe CachePolicy,
    -- | The current version of the cache policy.
    UpdateCachePolicyResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateCachePolicyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateCachePolicyResponse -> UpdateCachePolicyResponse -> Bool
(UpdateCachePolicyResponse -> UpdateCachePolicyResponse -> Bool)
-> (UpdateCachePolicyResponse -> UpdateCachePolicyResponse -> Bool)
-> Eq UpdateCachePolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCachePolicyResponse -> UpdateCachePolicyResponse -> Bool
$c/= :: UpdateCachePolicyResponse -> UpdateCachePolicyResponse -> Bool
== :: UpdateCachePolicyResponse -> UpdateCachePolicyResponse -> Bool
$c== :: UpdateCachePolicyResponse -> UpdateCachePolicyResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCachePolicyResponse]
ReadPrec UpdateCachePolicyResponse
Int -> ReadS UpdateCachePolicyResponse
ReadS [UpdateCachePolicyResponse]
(Int -> ReadS UpdateCachePolicyResponse)
-> ReadS [UpdateCachePolicyResponse]
-> ReadPrec UpdateCachePolicyResponse
-> ReadPrec [UpdateCachePolicyResponse]
-> Read UpdateCachePolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCachePolicyResponse]
$creadListPrec :: ReadPrec [UpdateCachePolicyResponse]
readPrec :: ReadPrec UpdateCachePolicyResponse
$creadPrec :: ReadPrec UpdateCachePolicyResponse
readList :: ReadS [UpdateCachePolicyResponse]
$creadList :: ReadS [UpdateCachePolicyResponse]
readsPrec :: Int -> ReadS UpdateCachePolicyResponse
$creadsPrec :: Int -> ReadS UpdateCachePolicyResponse
Prelude.Read, Int -> UpdateCachePolicyResponse -> ShowS
[UpdateCachePolicyResponse] -> ShowS
UpdateCachePolicyResponse -> String
(Int -> UpdateCachePolicyResponse -> ShowS)
-> (UpdateCachePolicyResponse -> String)
-> ([UpdateCachePolicyResponse] -> ShowS)
-> Show UpdateCachePolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCachePolicyResponse] -> ShowS
$cshowList :: [UpdateCachePolicyResponse] -> ShowS
show :: UpdateCachePolicyResponse -> String
$cshow :: UpdateCachePolicyResponse -> String
showsPrec :: Int -> UpdateCachePolicyResponse -> ShowS
$cshowsPrec :: Int -> UpdateCachePolicyResponse -> ShowS
Prelude.Show, (forall x.
 UpdateCachePolicyResponse -> Rep UpdateCachePolicyResponse x)
-> (forall x.
    Rep UpdateCachePolicyResponse x -> UpdateCachePolicyResponse)
-> Generic UpdateCachePolicyResponse
forall x.
Rep UpdateCachePolicyResponse x -> UpdateCachePolicyResponse
forall x.
UpdateCachePolicyResponse -> Rep UpdateCachePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCachePolicyResponse x -> UpdateCachePolicyResponse
$cfrom :: forall x.
UpdateCachePolicyResponse -> Rep UpdateCachePolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCachePolicyResponse' 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:
--
-- 'cachePolicy', 'updateCachePolicyResponse_cachePolicy' - A cache policy.
--
-- 'eTag', 'updateCachePolicyResponse_eTag' - The current version of the cache policy.
--
-- 'httpStatus', 'updateCachePolicyResponse_httpStatus' - The response's http status code.
newUpdateCachePolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateCachePolicyResponse
newUpdateCachePolicyResponse :: Int -> UpdateCachePolicyResponse
newUpdateCachePolicyResponse Int
pHttpStatus_ =
  UpdateCachePolicyResponse' :: Maybe CachePolicy -> Maybe Text -> Int -> UpdateCachePolicyResponse
UpdateCachePolicyResponse'
    { $sel:cachePolicy:UpdateCachePolicyResponse' :: Maybe CachePolicy
cachePolicy =
        Maybe CachePolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:eTag:UpdateCachePolicyResponse' :: Maybe Text
eTag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateCachePolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A cache policy.
updateCachePolicyResponse_cachePolicy :: Lens.Lens' UpdateCachePolicyResponse (Prelude.Maybe CachePolicy)
updateCachePolicyResponse_cachePolicy :: (Maybe CachePolicy -> f (Maybe CachePolicy))
-> UpdateCachePolicyResponse -> f UpdateCachePolicyResponse
updateCachePolicyResponse_cachePolicy = (UpdateCachePolicyResponse -> Maybe CachePolicy)
-> (UpdateCachePolicyResponse
    -> Maybe CachePolicy -> UpdateCachePolicyResponse)
-> Lens
     UpdateCachePolicyResponse
     UpdateCachePolicyResponse
     (Maybe CachePolicy)
     (Maybe CachePolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCachePolicyResponse' {Maybe CachePolicy
cachePolicy :: Maybe CachePolicy
$sel:cachePolicy:UpdateCachePolicyResponse' :: UpdateCachePolicyResponse -> Maybe CachePolicy
cachePolicy} -> Maybe CachePolicy
cachePolicy) (\s :: UpdateCachePolicyResponse
s@UpdateCachePolicyResponse' {} Maybe CachePolicy
a -> UpdateCachePolicyResponse
s {$sel:cachePolicy:UpdateCachePolicyResponse' :: Maybe CachePolicy
cachePolicy = Maybe CachePolicy
a} :: UpdateCachePolicyResponse)

-- | The current version of the cache policy.
updateCachePolicyResponse_eTag :: Lens.Lens' UpdateCachePolicyResponse (Prelude.Maybe Prelude.Text)
updateCachePolicyResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> UpdateCachePolicyResponse -> f UpdateCachePolicyResponse
updateCachePolicyResponse_eTag = (UpdateCachePolicyResponse -> Maybe Text)
-> (UpdateCachePolicyResponse
    -> Maybe Text -> UpdateCachePolicyResponse)
-> Lens
     UpdateCachePolicyResponse
     UpdateCachePolicyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCachePolicyResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:UpdateCachePolicyResponse' :: UpdateCachePolicyResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: UpdateCachePolicyResponse
s@UpdateCachePolicyResponse' {} Maybe Text
a -> UpdateCachePolicyResponse
s {$sel:eTag:UpdateCachePolicyResponse' :: Maybe Text
eTag = Maybe Text
a} :: UpdateCachePolicyResponse)

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

instance Prelude.NFData UpdateCachePolicyResponse