{-# 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.CreateCloudFrontOriginAccessIdentity
-- 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 a new origin access identity. If you\'re using Amazon S3 for
-- your origin, you can use an origin access identity to require users to
-- access your content using a CloudFront URL instead of the Amazon S3 URL.
-- For more information about how to use origin access identities, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html Serving Private Content through CloudFront>
-- in the /Amazon CloudFront Developer Guide/.
module Amazonka.CloudFront.CreateCloudFrontOriginAccessIdentity
  ( -- * Creating a Request
    CreateCloudFrontOriginAccessIdentity (..),
    newCreateCloudFrontOriginAccessIdentity,

    -- * Request Lenses
    createCloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig,

    -- * Destructuring the Response
    CreateCloudFrontOriginAccessIdentityResponse (..),
    newCreateCloudFrontOriginAccessIdentityResponse,

    -- * Response Lenses
    createCloudFrontOriginAccessIdentityResponse_eTag,
    createCloudFrontOriginAccessIdentityResponse_location,
    createCloudFrontOriginAccessIdentityResponse_cloudFrontOriginAccessIdentity,
    createCloudFrontOriginAccessIdentityResponse_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

-- | The request to create a new origin access identity (OAI). An origin
-- access identity is a special CloudFront user that you can associate with
-- Amazon S3 origins, so that you can secure all or just some of your
-- Amazon S3 content. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html Restricting Access to Amazon S3 Content by Using an Origin Access Identity>
-- in the /Amazon CloudFront Developer Guide/.
--
-- /See:/ 'newCreateCloudFrontOriginAccessIdentity' smart constructor.
data CreateCloudFrontOriginAccessIdentity = CreateCloudFrontOriginAccessIdentity'
  { -- | The current configuration information for the identity.
    CreateCloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig :: CloudFrontOriginAccessIdentityConfig
  }
  deriving (CreateCloudFrontOriginAccessIdentity
-> CreateCloudFrontOriginAccessIdentity -> Bool
(CreateCloudFrontOriginAccessIdentity
 -> CreateCloudFrontOriginAccessIdentity -> Bool)
-> (CreateCloudFrontOriginAccessIdentity
    -> CreateCloudFrontOriginAccessIdentity -> Bool)
-> Eq CreateCloudFrontOriginAccessIdentity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCloudFrontOriginAccessIdentity
-> CreateCloudFrontOriginAccessIdentity -> Bool
$c/= :: CreateCloudFrontOriginAccessIdentity
-> CreateCloudFrontOriginAccessIdentity -> Bool
== :: CreateCloudFrontOriginAccessIdentity
-> CreateCloudFrontOriginAccessIdentity -> Bool
$c== :: CreateCloudFrontOriginAccessIdentity
-> CreateCloudFrontOriginAccessIdentity -> Bool
Prelude.Eq, ReadPrec [CreateCloudFrontOriginAccessIdentity]
ReadPrec CreateCloudFrontOriginAccessIdentity
Int -> ReadS CreateCloudFrontOriginAccessIdentity
ReadS [CreateCloudFrontOriginAccessIdentity]
(Int -> ReadS CreateCloudFrontOriginAccessIdentity)
-> ReadS [CreateCloudFrontOriginAccessIdentity]
-> ReadPrec CreateCloudFrontOriginAccessIdentity
-> ReadPrec [CreateCloudFrontOriginAccessIdentity]
-> Read CreateCloudFrontOriginAccessIdentity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCloudFrontOriginAccessIdentity]
$creadListPrec :: ReadPrec [CreateCloudFrontOriginAccessIdentity]
readPrec :: ReadPrec CreateCloudFrontOriginAccessIdentity
$creadPrec :: ReadPrec CreateCloudFrontOriginAccessIdentity
readList :: ReadS [CreateCloudFrontOriginAccessIdentity]
$creadList :: ReadS [CreateCloudFrontOriginAccessIdentity]
readsPrec :: Int -> ReadS CreateCloudFrontOriginAccessIdentity
$creadsPrec :: Int -> ReadS CreateCloudFrontOriginAccessIdentity
Prelude.Read, Int -> CreateCloudFrontOriginAccessIdentity -> ShowS
[CreateCloudFrontOriginAccessIdentity] -> ShowS
CreateCloudFrontOriginAccessIdentity -> String
(Int -> CreateCloudFrontOriginAccessIdentity -> ShowS)
-> (CreateCloudFrontOriginAccessIdentity -> String)
-> ([CreateCloudFrontOriginAccessIdentity] -> ShowS)
-> Show CreateCloudFrontOriginAccessIdentity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCloudFrontOriginAccessIdentity] -> ShowS
$cshowList :: [CreateCloudFrontOriginAccessIdentity] -> ShowS
show :: CreateCloudFrontOriginAccessIdentity -> String
$cshow :: CreateCloudFrontOriginAccessIdentity -> String
showsPrec :: Int -> CreateCloudFrontOriginAccessIdentity -> ShowS
$cshowsPrec :: Int -> CreateCloudFrontOriginAccessIdentity -> ShowS
Prelude.Show, (forall x.
 CreateCloudFrontOriginAccessIdentity
 -> Rep CreateCloudFrontOriginAccessIdentity x)
-> (forall x.
    Rep CreateCloudFrontOriginAccessIdentity x
    -> CreateCloudFrontOriginAccessIdentity)
-> Generic CreateCloudFrontOriginAccessIdentity
forall x.
Rep CreateCloudFrontOriginAccessIdentity x
-> CreateCloudFrontOriginAccessIdentity
forall x.
CreateCloudFrontOriginAccessIdentity
-> Rep CreateCloudFrontOriginAccessIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCloudFrontOriginAccessIdentity x
-> CreateCloudFrontOriginAccessIdentity
$cfrom :: forall x.
CreateCloudFrontOriginAccessIdentity
-> Rep CreateCloudFrontOriginAccessIdentity x
Prelude.Generic)

-- |
-- Create a value of 'CreateCloudFrontOriginAccessIdentity' 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:
--
-- 'cloudFrontOriginAccessIdentityConfig', 'createCloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig' - The current configuration information for the identity.
newCreateCloudFrontOriginAccessIdentity ::
  -- | 'cloudFrontOriginAccessIdentityConfig'
  CloudFrontOriginAccessIdentityConfig ->
  CreateCloudFrontOriginAccessIdentity
newCreateCloudFrontOriginAccessIdentity :: CloudFrontOriginAccessIdentityConfig
-> CreateCloudFrontOriginAccessIdentity
newCreateCloudFrontOriginAccessIdentity
  CloudFrontOriginAccessIdentityConfig
pCloudFrontOriginAccessIdentityConfig_ =
    CreateCloudFrontOriginAccessIdentity' :: CloudFrontOriginAccessIdentityConfig
-> CreateCloudFrontOriginAccessIdentity
CreateCloudFrontOriginAccessIdentity'
      { $sel:cloudFrontOriginAccessIdentityConfig:CreateCloudFrontOriginAccessIdentity' :: CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig =
          CloudFrontOriginAccessIdentityConfig
pCloudFrontOriginAccessIdentityConfig_
      }

-- | The current configuration information for the identity.
createCloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig :: Lens.Lens' CreateCloudFrontOriginAccessIdentity CloudFrontOriginAccessIdentityConfig
createCloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig :: (CloudFrontOriginAccessIdentityConfig
 -> f CloudFrontOriginAccessIdentityConfig)
-> CreateCloudFrontOriginAccessIdentity
-> f CreateCloudFrontOriginAccessIdentity
createCloudFrontOriginAccessIdentity_cloudFrontOriginAccessIdentityConfig = (CreateCloudFrontOriginAccessIdentity
 -> CloudFrontOriginAccessIdentityConfig)
-> (CreateCloudFrontOriginAccessIdentity
    -> CloudFrontOriginAccessIdentityConfig
    -> CreateCloudFrontOriginAccessIdentity)
-> Lens
     CreateCloudFrontOriginAccessIdentity
     CreateCloudFrontOriginAccessIdentity
     CloudFrontOriginAccessIdentityConfig
     CloudFrontOriginAccessIdentityConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCloudFrontOriginAccessIdentity' {CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig :: CloudFrontOriginAccessIdentityConfig
$sel:cloudFrontOriginAccessIdentityConfig:CreateCloudFrontOriginAccessIdentity' :: CreateCloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig} -> CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig) (\s :: CreateCloudFrontOriginAccessIdentity
s@CreateCloudFrontOriginAccessIdentity' {} CloudFrontOriginAccessIdentityConfig
a -> CreateCloudFrontOriginAccessIdentity
s {$sel:cloudFrontOriginAccessIdentityConfig:CreateCloudFrontOriginAccessIdentity' :: CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig = CloudFrontOriginAccessIdentityConfig
a} :: CreateCloudFrontOriginAccessIdentity)

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

instance
  Prelude.NFData
    CreateCloudFrontOriginAccessIdentity

instance
  Core.ToElement
    CreateCloudFrontOriginAccessIdentity
  where
  toElement :: CreateCloudFrontOriginAccessIdentity -> Element
toElement CreateCloudFrontOriginAccessIdentity' {CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig :: CloudFrontOriginAccessIdentityConfig
$sel:cloudFrontOriginAccessIdentityConfig:CreateCloudFrontOriginAccessIdentity' :: CreateCloudFrontOriginAccessIdentity
-> CloudFrontOriginAccessIdentityConfig
..} =
    Name -> CloudFrontOriginAccessIdentityConfig -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{http://cloudfront.amazonaws.com/doc/2020-05-31/}CloudFrontOriginAccessIdentityConfig"
      CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig

instance
  Core.ToHeaders
    CreateCloudFrontOriginAccessIdentity
  where
  toHeaders :: CreateCloudFrontOriginAccessIdentity -> ResponseHeaders
toHeaders = ResponseHeaders
-> CreateCloudFrontOriginAccessIdentity -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance
  Core.ToPath
    CreateCloudFrontOriginAccessIdentity
  where
  toPath :: CreateCloudFrontOriginAccessIdentity -> ByteString
toPath =
    ByteString -> CreateCloudFrontOriginAccessIdentity -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/2020-05-31/origin-access-identity/cloudfront"

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

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

-- |
-- Create a value of 'CreateCloudFrontOriginAccessIdentityResponse' 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', 'createCloudFrontOriginAccessIdentityResponse_eTag' - The current version of the origin access identity created.
--
-- 'location', 'createCloudFrontOriginAccessIdentityResponse_location' - The fully qualified URI of the new origin access identity just created.
--
-- 'cloudFrontOriginAccessIdentity', 'createCloudFrontOriginAccessIdentityResponse_cloudFrontOriginAccessIdentity' - The origin access identity\'s information.
--
-- 'httpStatus', 'createCloudFrontOriginAccessIdentityResponse_httpStatus' - The response's http status code.
newCreateCloudFrontOriginAccessIdentityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCloudFrontOriginAccessIdentityResponse
newCreateCloudFrontOriginAccessIdentityResponse :: Int -> CreateCloudFrontOriginAccessIdentityResponse
newCreateCloudFrontOriginAccessIdentityResponse
  Int
pHttpStatus_ =
    CreateCloudFrontOriginAccessIdentityResponse' :: Maybe Text
-> Maybe Text
-> Maybe CloudFrontOriginAccessIdentity
-> Int
-> CreateCloudFrontOriginAccessIdentityResponse
CreateCloudFrontOriginAccessIdentityResponse'
      { $sel:eTag:CreateCloudFrontOriginAccessIdentityResponse' :: Maybe Text
eTag =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:location:CreateCloudFrontOriginAccessIdentityResponse' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:cloudFrontOriginAccessIdentity:CreateCloudFrontOriginAccessIdentityResponse' :: Maybe CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity =
          Maybe CloudFrontOriginAccessIdentity
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateCloudFrontOriginAccessIdentityResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The current version of the origin access identity created.
createCloudFrontOriginAccessIdentityResponse_eTag :: Lens.Lens' CreateCloudFrontOriginAccessIdentityResponse (Prelude.Maybe Prelude.Text)
createCloudFrontOriginAccessIdentityResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> CreateCloudFrontOriginAccessIdentityResponse
-> f CreateCloudFrontOriginAccessIdentityResponse
createCloudFrontOriginAccessIdentityResponse_eTag = (CreateCloudFrontOriginAccessIdentityResponse -> Maybe Text)
-> (CreateCloudFrontOriginAccessIdentityResponse
    -> Maybe Text -> CreateCloudFrontOriginAccessIdentityResponse)
-> Lens
     CreateCloudFrontOriginAccessIdentityResponse
     CreateCloudFrontOriginAccessIdentityResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCloudFrontOriginAccessIdentityResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:CreateCloudFrontOriginAccessIdentityResponse' :: CreateCloudFrontOriginAccessIdentityResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: CreateCloudFrontOriginAccessIdentityResponse
s@CreateCloudFrontOriginAccessIdentityResponse' {} Maybe Text
a -> CreateCloudFrontOriginAccessIdentityResponse
s {$sel:eTag:CreateCloudFrontOriginAccessIdentityResponse' :: Maybe Text
eTag = Maybe Text
a} :: CreateCloudFrontOriginAccessIdentityResponse)

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

-- | The origin access identity\'s information.
createCloudFrontOriginAccessIdentityResponse_cloudFrontOriginAccessIdentity :: Lens.Lens' CreateCloudFrontOriginAccessIdentityResponse (Prelude.Maybe CloudFrontOriginAccessIdentity)
createCloudFrontOriginAccessIdentityResponse_cloudFrontOriginAccessIdentity :: (Maybe CloudFrontOriginAccessIdentity
 -> f (Maybe CloudFrontOriginAccessIdentity))
-> CreateCloudFrontOriginAccessIdentityResponse
-> f CreateCloudFrontOriginAccessIdentityResponse
createCloudFrontOriginAccessIdentityResponse_cloudFrontOriginAccessIdentity = (CreateCloudFrontOriginAccessIdentityResponse
 -> Maybe CloudFrontOriginAccessIdentity)
-> (CreateCloudFrontOriginAccessIdentityResponse
    -> Maybe CloudFrontOriginAccessIdentity
    -> CreateCloudFrontOriginAccessIdentityResponse)
-> Lens
     CreateCloudFrontOriginAccessIdentityResponse
     CreateCloudFrontOriginAccessIdentityResponse
     (Maybe CloudFrontOriginAccessIdentity)
     (Maybe CloudFrontOriginAccessIdentity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCloudFrontOriginAccessIdentityResponse' {Maybe CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity :: Maybe CloudFrontOriginAccessIdentity
$sel:cloudFrontOriginAccessIdentity:CreateCloudFrontOriginAccessIdentityResponse' :: CreateCloudFrontOriginAccessIdentityResponse
-> Maybe CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity} -> Maybe CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity) (\s :: CreateCloudFrontOriginAccessIdentityResponse
s@CreateCloudFrontOriginAccessIdentityResponse' {} Maybe CloudFrontOriginAccessIdentity
a -> CreateCloudFrontOriginAccessIdentityResponse
s {$sel:cloudFrontOriginAccessIdentity:CreateCloudFrontOriginAccessIdentityResponse' :: Maybe CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity = Maybe CloudFrontOriginAccessIdentity
a} :: CreateCloudFrontOriginAccessIdentityResponse)

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

instance
  Prelude.NFData
    CreateCloudFrontOriginAccessIdentityResponse