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

    -- * Request Lenses
    updateOriginRequestPolicy_ifMatch,
    updateOriginRequestPolicy_originRequestPolicyConfig,
    updateOriginRequestPolicy_id,

    -- * Destructuring the Response
    UpdateOriginRequestPolicyResponse (..),
    newUpdateOriginRequestPolicyResponse,

    -- * Response Lenses
    updateOriginRequestPolicyResponse_eTag,
    updateOriginRequestPolicyResponse_originRequestPolicy,
    updateOriginRequestPolicyResponse_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:/ 'newUpdateOriginRequestPolicy' smart constructor.
data UpdateOriginRequestPolicy = UpdateOriginRequestPolicy'
  { -- | The version of the origin request policy that you are updating. The
    -- version is returned in the origin request policy’s @ETag@ field in the
    -- response to @GetOriginRequestPolicyConfig@.
    UpdateOriginRequestPolicy -> Maybe Text
ifMatch :: Prelude.Maybe Prelude.Text,
    -- | An origin request policy configuration.
    UpdateOriginRequestPolicy -> OriginRequestPolicyConfig
originRequestPolicyConfig :: OriginRequestPolicyConfig,
    -- | The unique identifier for the origin request policy that you are
    -- updating. The identifier is returned in a cache behavior’s
    -- @OriginRequestPolicyId@ field in the response to
    -- @GetDistributionConfig@.
    UpdateOriginRequestPolicy -> Text
id :: Prelude.Text
  }
  deriving (UpdateOriginRequestPolicy -> UpdateOriginRequestPolicy -> Bool
(UpdateOriginRequestPolicy -> UpdateOriginRequestPolicy -> Bool)
-> (UpdateOriginRequestPolicy -> UpdateOriginRequestPolicy -> Bool)
-> Eq UpdateOriginRequestPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateOriginRequestPolicy -> UpdateOriginRequestPolicy -> Bool
$c/= :: UpdateOriginRequestPolicy -> UpdateOriginRequestPolicy -> Bool
== :: UpdateOriginRequestPolicy -> UpdateOriginRequestPolicy -> Bool
$c== :: UpdateOriginRequestPolicy -> UpdateOriginRequestPolicy -> Bool
Prelude.Eq, ReadPrec [UpdateOriginRequestPolicy]
ReadPrec UpdateOriginRequestPolicy
Int -> ReadS UpdateOriginRequestPolicy
ReadS [UpdateOriginRequestPolicy]
(Int -> ReadS UpdateOriginRequestPolicy)
-> ReadS [UpdateOriginRequestPolicy]
-> ReadPrec UpdateOriginRequestPolicy
-> ReadPrec [UpdateOriginRequestPolicy]
-> Read UpdateOriginRequestPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateOriginRequestPolicy]
$creadListPrec :: ReadPrec [UpdateOriginRequestPolicy]
readPrec :: ReadPrec UpdateOriginRequestPolicy
$creadPrec :: ReadPrec UpdateOriginRequestPolicy
readList :: ReadS [UpdateOriginRequestPolicy]
$creadList :: ReadS [UpdateOriginRequestPolicy]
readsPrec :: Int -> ReadS UpdateOriginRequestPolicy
$creadsPrec :: Int -> ReadS UpdateOriginRequestPolicy
Prelude.Read, Int -> UpdateOriginRequestPolicy -> ShowS
[UpdateOriginRequestPolicy] -> ShowS
UpdateOriginRequestPolicy -> String
(Int -> UpdateOriginRequestPolicy -> ShowS)
-> (UpdateOriginRequestPolicy -> String)
-> ([UpdateOriginRequestPolicy] -> ShowS)
-> Show UpdateOriginRequestPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateOriginRequestPolicy] -> ShowS
$cshowList :: [UpdateOriginRequestPolicy] -> ShowS
show :: UpdateOriginRequestPolicy -> String
$cshow :: UpdateOriginRequestPolicy -> String
showsPrec :: Int -> UpdateOriginRequestPolicy -> ShowS
$cshowsPrec :: Int -> UpdateOriginRequestPolicy -> ShowS
Prelude.Show, (forall x.
 UpdateOriginRequestPolicy -> Rep UpdateOriginRequestPolicy x)
-> (forall x.
    Rep UpdateOriginRequestPolicy x -> UpdateOriginRequestPolicy)
-> Generic UpdateOriginRequestPolicy
forall x.
Rep UpdateOriginRequestPolicy x -> UpdateOriginRequestPolicy
forall x.
UpdateOriginRequestPolicy -> Rep UpdateOriginRequestPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateOriginRequestPolicy x -> UpdateOriginRequestPolicy
$cfrom :: forall x.
UpdateOriginRequestPolicy -> Rep UpdateOriginRequestPolicy x
Prelude.Generic)

-- |
-- Create a value of 'UpdateOriginRequestPolicy' 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', 'updateOriginRequestPolicy_ifMatch' - The version of the origin request policy that you are updating. The
-- version is returned in the origin request policy’s @ETag@ field in the
-- response to @GetOriginRequestPolicyConfig@.
--
-- 'originRequestPolicyConfig', 'updateOriginRequestPolicy_originRequestPolicyConfig' - An origin request policy configuration.
--
-- 'id', 'updateOriginRequestPolicy_id' - The unique identifier for the origin request policy that you are
-- updating. The identifier is returned in a cache behavior’s
-- @OriginRequestPolicyId@ field in the response to
-- @GetDistributionConfig@.
newUpdateOriginRequestPolicy ::
  -- | 'originRequestPolicyConfig'
  OriginRequestPolicyConfig ->
  -- | 'id'
  Prelude.Text ->
  UpdateOriginRequestPolicy
newUpdateOriginRequestPolicy :: OriginRequestPolicyConfig -> Text -> UpdateOriginRequestPolicy
newUpdateOriginRequestPolicy
  OriginRequestPolicyConfig
pOriginRequestPolicyConfig_
  Text
pId_ =
    UpdateOriginRequestPolicy' :: Maybe Text
-> OriginRequestPolicyConfig -> Text -> UpdateOriginRequestPolicy
UpdateOriginRequestPolicy'
      { $sel:ifMatch:UpdateOriginRequestPolicy' :: Maybe Text
ifMatch =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:originRequestPolicyConfig:UpdateOriginRequestPolicy' :: OriginRequestPolicyConfig
originRequestPolicyConfig =
          OriginRequestPolicyConfig
pOriginRequestPolicyConfig_,
        $sel:id:UpdateOriginRequestPolicy' :: Text
id = Text
pId_
      }

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

-- | An origin request policy configuration.
updateOriginRequestPolicy_originRequestPolicyConfig :: Lens.Lens' UpdateOriginRequestPolicy OriginRequestPolicyConfig
updateOriginRequestPolicy_originRequestPolicyConfig :: (OriginRequestPolicyConfig -> f OriginRequestPolicyConfig)
-> UpdateOriginRequestPolicy -> f UpdateOriginRequestPolicy
updateOriginRequestPolicy_originRequestPolicyConfig = (UpdateOriginRequestPolicy -> OriginRequestPolicyConfig)
-> (UpdateOriginRequestPolicy
    -> OriginRequestPolicyConfig -> UpdateOriginRequestPolicy)
-> Lens
     UpdateOriginRequestPolicy
     UpdateOriginRequestPolicy
     OriginRequestPolicyConfig
     OriginRequestPolicyConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOriginRequestPolicy' {OriginRequestPolicyConfig
originRequestPolicyConfig :: OriginRequestPolicyConfig
$sel:originRequestPolicyConfig:UpdateOriginRequestPolicy' :: UpdateOriginRequestPolicy -> OriginRequestPolicyConfig
originRequestPolicyConfig} -> OriginRequestPolicyConfig
originRequestPolicyConfig) (\s :: UpdateOriginRequestPolicy
s@UpdateOriginRequestPolicy' {} OriginRequestPolicyConfig
a -> UpdateOriginRequestPolicy
s {$sel:originRequestPolicyConfig:UpdateOriginRequestPolicy' :: OriginRequestPolicyConfig
originRequestPolicyConfig = OriginRequestPolicyConfig
a} :: UpdateOriginRequestPolicy)

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

instance Core.AWSRequest UpdateOriginRequestPolicy where
  type
    AWSResponse UpdateOriginRequestPolicy =
      UpdateOriginRequestPolicyResponse
  request :: UpdateOriginRequestPolicy -> Request UpdateOriginRequestPolicy
request = Service
-> UpdateOriginRequestPolicy -> Request UpdateOriginRequestPolicy
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateOriginRequestPolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateOriginRequestPolicy)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse UpdateOriginRequestPolicy))
-> Logger
-> Service
-> Proxy UpdateOriginRequestPolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateOriginRequestPolicy)))
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 Text
-> Maybe OriginRequestPolicy
-> Int
-> UpdateOriginRequestPolicyResponse
UpdateOriginRequestPolicyResponse'
            (Maybe Text
 -> Maybe OriginRequestPolicy
 -> Int
 -> UpdateOriginRequestPolicyResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe OriginRequestPolicy
      -> Int -> UpdateOriginRequestPolicyResponse)
forall (f :: * -> *) a b. Functor 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
  (Maybe OriginRequestPolicy
   -> Int -> UpdateOriginRequestPolicyResponse)
-> Either String (Maybe OriginRequestPolicy)
-> Either String (Int -> UpdateOriginRequestPolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node] -> Either String (Maybe OriginRequestPolicy)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either String (Int -> UpdateOriginRequestPolicyResponse)
-> Either String Int
-> Either String UpdateOriginRequestPolicyResponse
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 UpdateOriginRequestPolicy

instance Prelude.NFData UpdateOriginRequestPolicy

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

instance Core.ToHeaders UpdateOriginRequestPolicy where
  toHeaders :: UpdateOriginRequestPolicy -> ResponseHeaders
toHeaders UpdateOriginRequestPolicy' {Maybe Text
Text
OriginRequestPolicyConfig
id :: Text
originRequestPolicyConfig :: OriginRequestPolicyConfig
ifMatch :: Maybe Text
$sel:id:UpdateOriginRequestPolicy' :: UpdateOriginRequestPolicy -> Text
$sel:originRequestPolicyConfig:UpdateOriginRequestPolicy' :: UpdateOriginRequestPolicy -> OriginRequestPolicyConfig
$sel:ifMatch:UpdateOriginRequestPolicy' :: UpdateOriginRequestPolicy -> 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 UpdateOriginRequestPolicy where
  toPath :: UpdateOriginRequestPolicy -> ByteString
toPath UpdateOriginRequestPolicy' {Maybe Text
Text
OriginRequestPolicyConfig
id :: Text
originRequestPolicyConfig :: OriginRequestPolicyConfig
ifMatch :: Maybe Text
$sel:id:UpdateOriginRequestPolicy' :: UpdateOriginRequestPolicy -> Text
$sel:originRequestPolicyConfig:UpdateOriginRequestPolicy' :: UpdateOriginRequestPolicy -> OriginRequestPolicyConfig
$sel:ifMatch:UpdateOriginRequestPolicy' :: UpdateOriginRequestPolicy -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2020-05-31/origin-request-policy/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]

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

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

-- |
-- Create a value of 'UpdateOriginRequestPolicyResponse' 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:
--
-- 'eTag', 'updateOriginRequestPolicyResponse_eTag' - The current version of the origin request policy.
--
-- 'originRequestPolicy', 'updateOriginRequestPolicyResponse_originRequestPolicy' - An origin request policy.
--
-- 'httpStatus', 'updateOriginRequestPolicyResponse_httpStatus' - The response's http status code.
newUpdateOriginRequestPolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateOriginRequestPolicyResponse
newUpdateOriginRequestPolicyResponse :: Int -> UpdateOriginRequestPolicyResponse
newUpdateOriginRequestPolicyResponse Int
pHttpStatus_ =
  UpdateOriginRequestPolicyResponse' :: Maybe Text
-> Maybe OriginRequestPolicy
-> Int
-> UpdateOriginRequestPolicyResponse
UpdateOriginRequestPolicyResponse'
    { $sel:eTag:UpdateOriginRequestPolicyResponse' :: Maybe Text
eTag =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:originRequestPolicy:UpdateOriginRequestPolicyResponse' :: Maybe OriginRequestPolicy
originRequestPolicy = Maybe OriginRequestPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateOriginRequestPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An origin request policy.
updateOriginRequestPolicyResponse_originRequestPolicy :: Lens.Lens' UpdateOriginRequestPolicyResponse (Prelude.Maybe OriginRequestPolicy)
updateOriginRequestPolicyResponse_originRequestPolicy :: (Maybe OriginRequestPolicy -> f (Maybe OriginRequestPolicy))
-> UpdateOriginRequestPolicyResponse
-> f UpdateOriginRequestPolicyResponse
updateOriginRequestPolicyResponse_originRequestPolicy = (UpdateOriginRequestPolicyResponse -> Maybe OriginRequestPolicy)
-> (UpdateOriginRequestPolicyResponse
    -> Maybe OriginRequestPolicy -> UpdateOriginRequestPolicyResponse)
-> Lens
     UpdateOriginRequestPolicyResponse
     UpdateOriginRequestPolicyResponse
     (Maybe OriginRequestPolicy)
     (Maybe OriginRequestPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOriginRequestPolicyResponse' {Maybe OriginRequestPolicy
originRequestPolicy :: Maybe OriginRequestPolicy
$sel:originRequestPolicy:UpdateOriginRequestPolicyResponse' :: UpdateOriginRequestPolicyResponse -> Maybe OriginRequestPolicy
originRequestPolicy} -> Maybe OriginRequestPolicy
originRequestPolicy) (\s :: UpdateOriginRequestPolicyResponse
s@UpdateOriginRequestPolicyResponse' {} Maybe OriginRequestPolicy
a -> UpdateOriginRequestPolicyResponse
s {$sel:originRequestPolicy:UpdateOriginRequestPolicyResponse' :: Maybe OriginRequestPolicy
originRequestPolicy = Maybe OriginRequestPolicy
a} :: UpdateOriginRequestPolicyResponse)

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

instance
  Prelude.NFData
    UpdateOriginRequestPolicyResponse