{-# 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.CreateOriginRequestPolicy
-- 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)
--
-- Creates an origin request policy.
--
-- After you create an origin request policy, you can attach it to one or
-- more cache behaviors. When it’s attached to a cache behavior, the origin
-- request policy determines the values that CloudFront includes in
-- requests that it sends to the origin. Each request that CloudFront sends
-- to the origin includes the following:
--
-- -   The request body and the URL path (without the domain name) from the
--     viewer request.
--
-- -   The headers that CloudFront automatically includes in every origin
--     request, including @Host@, @User-Agent@, and @X-Amz-Cf-Id@.
--
-- -   All HTTP headers, cookies, and URL query strings that are specified
--     in the cache policy or the origin request policy. These can include
--     items from the viewer request and, in the case of headers,
--     additional ones that are added by CloudFront.
--
-- CloudFront sends a request when it can’t find a valid object in its
-- cache that matches the request. If you want to send values to the origin
-- and also include them in the cache key, use @CachePolicy@.
--
-- For more information about origin request policies, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html Controlling origin requests>
-- in the /Amazon CloudFront Developer Guide/.
module Amazonka.CloudFront.CreateOriginRequestPolicy
  ( -- * Creating a Request
    CreateOriginRequestPolicy (..),
    newCreateOriginRequestPolicy,

    -- * Request Lenses
    createOriginRequestPolicy_originRequestPolicyConfig,

    -- * Destructuring the Response
    CreateOriginRequestPolicyResponse (..),
    newCreateOriginRequestPolicyResponse,

    -- * Response Lenses
    createOriginRequestPolicyResponse_eTag,
    createOriginRequestPolicyResponse_location,
    createOriginRequestPolicyResponse_originRequestPolicy,
    createOriginRequestPolicyResponse_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:/ 'newCreateOriginRequestPolicy' smart constructor.
data CreateOriginRequestPolicy = CreateOriginRequestPolicy'
  { -- | An origin request policy configuration.
    CreateOriginRequestPolicy -> OriginRequestPolicyConfig
originRequestPolicyConfig :: OriginRequestPolicyConfig
  }
  deriving (CreateOriginRequestPolicy -> CreateOriginRequestPolicy -> Bool
(CreateOriginRequestPolicy -> CreateOriginRequestPolicy -> Bool)
-> (CreateOriginRequestPolicy -> CreateOriginRequestPolicy -> Bool)
-> Eq CreateOriginRequestPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateOriginRequestPolicy -> CreateOriginRequestPolicy -> Bool
$c/= :: CreateOriginRequestPolicy -> CreateOriginRequestPolicy -> Bool
== :: CreateOriginRequestPolicy -> CreateOriginRequestPolicy -> Bool
$c== :: CreateOriginRequestPolicy -> CreateOriginRequestPolicy -> Bool
Prelude.Eq, ReadPrec [CreateOriginRequestPolicy]
ReadPrec CreateOriginRequestPolicy
Int -> ReadS CreateOriginRequestPolicy
ReadS [CreateOriginRequestPolicy]
(Int -> ReadS CreateOriginRequestPolicy)
-> ReadS [CreateOriginRequestPolicy]
-> ReadPrec CreateOriginRequestPolicy
-> ReadPrec [CreateOriginRequestPolicy]
-> Read CreateOriginRequestPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateOriginRequestPolicy]
$creadListPrec :: ReadPrec [CreateOriginRequestPolicy]
readPrec :: ReadPrec CreateOriginRequestPolicy
$creadPrec :: ReadPrec CreateOriginRequestPolicy
readList :: ReadS [CreateOriginRequestPolicy]
$creadList :: ReadS [CreateOriginRequestPolicy]
readsPrec :: Int -> ReadS CreateOriginRequestPolicy
$creadsPrec :: Int -> ReadS CreateOriginRequestPolicy
Prelude.Read, Int -> CreateOriginRequestPolicy -> ShowS
[CreateOriginRequestPolicy] -> ShowS
CreateOriginRequestPolicy -> String
(Int -> CreateOriginRequestPolicy -> ShowS)
-> (CreateOriginRequestPolicy -> String)
-> ([CreateOriginRequestPolicy] -> ShowS)
-> Show CreateOriginRequestPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateOriginRequestPolicy] -> ShowS
$cshowList :: [CreateOriginRequestPolicy] -> ShowS
show :: CreateOriginRequestPolicy -> String
$cshow :: CreateOriginRequestPolicy -> String
showsPrec :: Int -> CreateOriginRequestPolicy -> ShowS
$cshowsPrec :: Int -> CreateOriginRequestPolicy -> ShowS
Prelude.Show, (forall x.
 CreateOriginRequestPolicy -> Rep CreateOriginRequestPolicy x)
-> (forall x.
    Rep CreateOriginRequestPolicy x -> CreateOriginRequestPolicy)
-> Generic CreateOriginRequestPolicy
forall x.
Rep CreateOriginRequestPolicy x -> CreateOriginRequestPolicy
forall x.
CreateOriginRequestPolicy -> Rep CreateOriginRequestPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateOriginRequestPolicy x -> CreateOriginRequestPolicy
$cfrom :: forall x.
CreateOriginRequestPolicy -> Rep CreateOriginRequestPolicy x
Prelude.Generic)

-- |
-- Create a value of 'CreateOriginRequestPolicy' 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:
--
-- 'originRequestPolicyConfig', 'createOriginRequestPolicy_originRequestPolicyConfig' - An origin request policy configuration.
newCreateOriginRequestPolicy ::
  -- | 'originRequestPolicyConfig'
  OriginRequestPolicyConfig ->
  CreateOriginRequestPolicy
newCreateOriginRequestPolicy :: OriginRequestPolicyConfig -> CreateOriginRequestPolicy
newCreateOriginRequestPolicy
  OriginRequestPolicyConfig
pOriginRequestPolicyConfig_ =
    CreateOriginRequestPolicy' :: OriginRequestPolicyConfig -> CreateOriginRequestPolicy
CreateOriginRequestPolicy'
      { $sel:originRequestPolicyConfig:CreateOriginRequestPolicy' :: OriginRequestPolicyConfig
originRequestPolicyConfig =
          OriginRequestPolicyConfig
pOriginRequestPolicyConfig_
      }

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

instance Core.AWSRequest CreateOriginRequestPolicy where
  type
    AWSResponse CreateOriginRequestPolicy =
      CreateOriginRequestPolicyResponse
  request :: CreateOriginRequestPolicy -> Request CreateOriginRequestPolicy
request = Service
-> CreateOriginRequestPolicy -> Request CreateOriginRequestPolicy
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateOriginRequestPolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateOriginRequestPolicy)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse CreateOriginRequestPolicy))
-> Logger
-> Service
-> Proxy CreateOriginRequestPolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateOriginRequestPolicy)))
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 Text
-> Maybe OriginRequestPolicy
-> Int
-> CreateOriginRequestPolicyResponse
CreateOriginRequestPolicyResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe OriginRequestPolicy
 -> Int
 -> CreateOriginRequestPolicyResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe OriginRequestPolicy
      -> Int
      -> CreateOriginRequestPolicyResponse)
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 Text
   -> Maybe OriginRequestPolicy
   -> Int
   -> CreateOriginRequestPolicyResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe OriginRequestPolicy
      -> Int -> CreateOriginRequestPolicyResponse)
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
"Location")
            Either
  String
  (Maybe OriginRequestPolicy
   -> Int -> CreateOriginRequestPolicyResponse)
-> Either String (Maybe OriginRequestPolicy)
-> Either String (Int -> CreateOriginRequestPolicyResponse)
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 -> CreateOriginRequestPolicyResponse)
-> Either String Int
-> Either String CreateOriginRequestPolicyResponse
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 CreateOriginRequestPolicy

instance Prelude.NFData CreateOriginRequestPolicy

instance Core.ToElement CreateOriginRequestPolicy where
  toElement :: CreateOriginRequestPolicy -> Element
toElement CreateOriginRequestPolicy' {OriginRequestPolicyConfig
originRequestPolicyConfig :: OriginRequestPolicyConfig
$sel:originRequestPolicyConfig:CreateOriginRequestPolicy' :: CreateOriginRequestPolicy -> OriginRequestPolicyConfig
..} =
    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 CreateOriginRequestPolicy where
  toHeaders :: CreateOriginRequestPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateOriginRequestPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath CreateOriginRequestPolicy where
  toPath :: CreateOriginRequestPolicy -> ByteString
toPath =
    ByteString -> CreateOriginRequestPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2020-05-31/origin-request-policy"

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

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

-- |
-- Create a value of 'CreateOriginRequestPolicyResponse' 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', 'createOriginRequestPolicyResponse_eTag' - The current version of the origin request policy.
--
-- 'location', 'createOriginRequestPolicyResponse_location' - The fully qualified URI of the origin request policy just created.
--
-- 'originRequestPolicy', 'createOriginRequestPolicyResponse_originRequestPolicy' - An origin request policy.
--
-- 'httpStatus', 'createOriginRequestPolicyResponse_httpStatus' - The response's http status code.
newCreateOriginRequestPolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateOriginRequestPolicyResponse
newCreateOriginRequestPolicyResponse :: Int -> CreateOriginRequestPolicyResponse
newCreateOriginRequestPolicyResponse Int
pHttpStatus_ =
  CreateOriginRequestPolicyResponse' :: Maybe Text
-> Maybe Text
-> Maybe OriginRequestPolicy
-> Int
-> CreateOriginRequestPolicyResponse
CreateOriginRequestPolicyResponse'
    { $sel:eTag:CreateOriginRequestPolicyResponse' :: Maybe Text
eTag =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:CreateOriginRequestPolicyResponse' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:originRequestPolicy:CreateOriginRequestPolicyResponse' :: Maybe OriginRequestPolicy
originRequestPolicy = Maybe OriginRequestPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateOriginRequestPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The fully qualified URI of the origin request policy just created.
createOriginRequestPolicyResponse_location :: Lens.Lens' CreateOriginRequestPolicyResponse (Prelude.Maybe Prelude.Text)
createOriginRequestPolicyResponse_location :: (Maybe Text -> f (Maybe Text))
-> CreateOriginRequestPolicyResponse
-> f CreateOriginRequestPolicyResponse
createOriginRequestPolicyResponse_location = (CreateOriginRequestPolicyResponse -> Maybe Text)
-> (CreateOriginRequestPolicyResponse
    -> Maybe Text -> CreateOriginRequestPolicyResponse)
-> Lens
     CreateOriginRequestPolicyResponse
     CreateOriginRequestPolicyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOriginRequestPolicyResponse' {Maybe Text
location :: Maybe Text
$sel:location:CreateOriginRequestPolicyResponse' :: CreateOriginRequestPolicyResponse -> Maybe Text
location} -> Maybe Text
location) (\s :: CreateOriginRequestPolicyResponse
s@CreateOriginRequestPolicyResponse' {} Maybe Text
a -> CreateOriginRequestPolicyResponse
s {$sel:location:CreateOriginRequestPolicyResponse' :: Maybe Text
location = Maybe Text
a} :: CreateOriginRequestPolicyResponse)

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

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

instance
  Prelude.NFData
    CreateOriginRequestPolicyResponse