{-# 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.ImageBuilder.CreateDistributionConfiguration
-- 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 distribution configuration. Distribution configurations
-- define and configure the outputs of your pipeline.
module Amazonka.ImageBuilder.CreateDistributionConfiguration
  ( -- * Creating a Request
    CreateDistributionConfiguration (..),
    newCreateDistributionConfiguration,

    -- * Request Lenses
    createDistributionConfiguration_description,
    createDistributionConfiguration_tags,
    createDistributionConfiguration_name,
    createDistributionConfiguration_distributions,
    createDistributionConfiguration_clientToken,

    -- * Destructuring the Response
    CreateDistributionConfigurationResponse (..),
    newCreateDistributionConfigurationResponse,

    -- * Response Lenses
    createDistributionConfigurationResponse_requestId,
    createDistributionConfigurationResponse_clientToken,
    createDistributionConfigurationResponse_distributionConfigurationArn,
    createDistributionConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types
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:/ 'newCreateDistributionConfiguration' smart constructor.
data CreateDistributionConfiguration = CreateDistributionConfiguration'
  { -- | The description of the distribution configuration.
    CreateDistributionConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags of the distribution configuration.
    CreateDistributionConfiguration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the distribution configuration.
    CreateDistributionConfiguration -> Text
name :: Prelude.Text,
    -- | The distributions of the distribution configuration.
    CreateDistributionConfiguration -> [Distribution]
distributions :: [Distribution],
    -- | The idempotency token of the distribution configuration.
    CreateDistributionConfiguration -> Text
clientToken :: Prelude.Text
  }
  deriving (CreateDistributionConfiguration
-> CreateDistributionConfiguration -> Bool
(CreateDistributionConfiguration
 -> CreateDistributionConfiguration -> Bool)
-> (CreateDistributionConfiguration
    -> CreateDistributionConfiguration -> Bool)
-> Eq CreateDistributionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDistributionConfiguration
-> CreateDistributionConfiguration -> Bool
$c/= :: CreateDistributionConfiguration
-> CreateDistributionConfiguration -> Bool
== :: CreateDistributionConfiguration
-> CreateDistributionConfiguration -> Bool
$c== :: CreateDistributionConfiguration
-> CreateDistributionConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateDistributionConfiguration]
ReadPrec CreateDistributionConfiguration
Int -> ReadS CreateDistributionConfiguration
ReadS [CreateDistributionConfiguration]
(Int -> ReadS CreateDistributionConfiguration)
-> ReadS [CreateDistributionConfiguration]
-> ReadPrec CreateDistributionConfiguration
-> ReadPrec [CreateDistributionConfiguration]
-> Read CreateDistributionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDistributionConfiguration]
$creadListPrec :: ReadPrec [CreateDistributionConfiguration]
readPrec :: ReadPrec CreateDistributionConfiguration
$creadPrec :: ReadPrec CreateDistributionConfiguration
readList :: ReadS [CreateDistributionConfiguration]
$creadList :: ReadS [CreateDistributionConfiguration]
readsPrec :: Int -> ReadS CreateDistributionConfiguration
$creadsPrec :: Int -> ReadS CreateDistributionConfiguration
Prelude.Read, Int -> CreateDistributionConfiguration -> ShowS
[CreateDistributionConfiguration] -> ShowS
CreateDistributionConfiguration -> String
(Int -> CreateDistributionConfiguration -> ShowS)
-> (CreateDistributionConfiguration -> String)
-> ([CreateDistributionConfiguration] -> ShowS)
-> Show CreateDistributionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDistributionConfiguration] -> ShowS
$cshowList :: [CreateDistributionConfiguration] -> ShowS
show :: CreateDistributionConfiguration -> String
$cshow :: CreateDistributionConfiguration -> String
showsPrec :: Int -> CreateDistributionConfiguration -> ShowS
$cshowsPrec :: Int -> CreateDistributionConfiguration -> ShowS
Prelude.Show, (forall x.
 CreateDistributionConfiguration
 -> Rep CreateDistributionConfiguration x)
-> (forall x.
    Rep CreateDistributionConfiguration x
    -> CreateDistributionConfiguration)
-> Generic CreateDistributionConfiguration
forall x.
Rep CreateDistributionConfiguration x
-> CreateDistributionConfiguration
forall x.
CreateDistributionConfiguration
-> Rep CreateDistributionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDistributionConfiguration x
-> CreateDistributionConfiguration
$cfrom :: forall x.
CreateDistributionConfiguration
-> Rep CreateDistributionConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateDistributionConfiguration' 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:
--
-- 'description', 'createDistributionConfiguration_description' - The description of the distribution configuration.
--
-- 'tags', 'createDistributionConfiguration_tags' - The tags of the distribution configuration.
--
-- 'name', 'createDistributionConfiguration_name' - The name of the distribution configuration.
--
-- 'distributions', 'createDistributionConfiguration_distributions' - The distributions of the distribution configuration.
--
-- 'clientToken', 'createDistributionConfiguration_clientToken' - The idempotency token of the distribution configuration.
newCreateDistributionConfiguration ::
  -- | 'name'
  Prelude.Text ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateDistributionConfiguration
newCreateDistributionConfiguration :: Text -> Text -> CreateDistributionConfiguration
newCreateDistributionConfiguration
  Text
pName_
  Text
pClientToken_ =
    CreateDistributionConfiguration' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> [Distribution]
-> Text
-> CreateDistributionConfiguration
CreateDistributionConfiguration'
      { $sel:description:CreateDistributionConfiguration' :: Maybe Text
description =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateDistributionConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateDistributionConfiguration' :: Text
name = Text
pName_,
        $sel:distributions:CreateDistributionConfiguration' :: [Distribution]
distributions = [Distribution]
forall a. Monoid a => a
Prelude.mempty,
        $sel:clientToken:CreateDistributionConfiguration' :: Text
clientToken = Text
pClientToken_
      }

-- | The description of the distribution configuration.
createDistributionConfiguration_description :: Lens.Lens' CreateDistributionConfiguration (Prelude.Maybe Prelude.Text)
createDistributionConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> CreateDistributionConfiguration
-> f CreateDistributionConfiguration
createDistributionConfiguration_description = (CreateDistributionConfiguration -> Maybe Text)
-> (CreateDistributionConfiguration
    -> Maybe Text -> CreateDistributionConfiguration)
-> Lens
     CreateDistributionConfiguration
     CreateDistributionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateDistributionConfiguration
s@CreateDistributionConfiguration' {} Maybe Text
a -> CreateDistributionConfiguration
s {$sel:description:CreateDistributionConfiguration' :: Maybe Text
description = Maybe Text
a} :: CreateDistributionConfiguration)

-- | The tags of the distribution configuration.
createDistributionConfiguration_tags :: Lens.Lens' CreateDistributionConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDistributionConfiguration_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDistributionConfiguration
-> f CreateDistributionConfiguration
createDistributionConfiguration_tags = (CreateDistributionConfiguration -> Maybe (HashMap Text Text))
-> (CreateDistributionConfiguration
    -> Maybe (HashMap Text Text) -> CreateDistributionConfiguration)
-> Lens
     CreateDistributionConfiguration
     CreateDistributionConfiguration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfiguration' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDistributionConfiguration
s@CreateDistributionConfiguration' {} Maybe (HashMap Text Text)
a -> CreateDistributionConfiguration
s {$sel:tags:CreateDistributionConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDistributionConfiguration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateDistributionConfiguration
 -> f CreateDistributionConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDistributionConfiguration
-> f CreateDistributionConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the distribution configuration.
createDistributionConfiguration_name :: Lens.Lens' CreateDistributionConfiguration Prelude.Text
createDistributionConfiguration_name :: (Text -> f Text)
-> CreateDistributionConfiguration
-> f CreateDistributionConfiguration
createDistributionConfiguration_name = (CreateDistributionConfiguration -> Text)
-> (CreateDistributionConfiguration
    -> Text -> CreateDistributionConfiguration)
-> Lens
     CreateDistributionConfiguration
     CreateDistributionConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfiguration' {Text
name :: Text
$sel:name:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Text
name} -> Text
name) (\s :: CreateDistributionConfiguration
s@CreateDistributionConfiguration' {} Text
a -> CreateDistributionConfiguration
s {$sel:name:CreateDistributionConfiguration' :: Text
name = Text
a} :: CreateDistributionConfiguration)

-- | The distributions of the distribution configuration.
createDistributionConfiguration_distributions :: Lens.Lens' CreateDistributionConfiguration [Distribution]
createDistributionConfiguration_distributions :: ([Distribution] -> f [Distribution])
-> CreateDistributionConfiguration
-> f CreateDistributionConfiguration
createDistributionConfiguration_distributions = (CreateDistributionConfiguration -> [Distribution])
-> (CreateDistributionConfiguration
    -> [Distribution] -> CreateDistributionConfiguration)
-> Lens
     CreateDistributionConfiguration
     CreateDistributionConfiguration
     [Distribution]
     [Distribution]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfiguration' {[Distribution]
distributions :: [Distribution]
$sel:distributions:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> [Distribution]
distributions} -> [Distribution]
distributions) (\s :: CreateDistributionConfiguration
s@CreateDistributionConfiguration' {} [Distribution]
a -> CreateDistributionConfiguration
s {$sel:distributions:CreateDistributionConfiguration' :: [Distribution]
distributions = [Distribution]
a} :: CreateDistributionConfiguration) (([Distribution] -> f [Distribution])
 -> CreateDistributionConfiguration
 -> f CreateDistributionConfiguration)
-> (([Distribution] -> f [Distribution])
    -> [Distribution] -> f [Distribution])
-> ([Distribution] -> f [Distribution])
-> CreateDistributionConfiguration
-> f CreateDistributionConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Distribution] -> f [Distribution])
-> [Distribution] -> f [Distribution]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The idempotency token of the distribution configuration.
createDistributionConfiguration_clientToken :: Lens.Lens' CreateDistributionConfiguration Prelude.Text
createDistributionConfiguration_clientToken :: (Text -> f Text)
-> CreateDistributionConfiguration
-> f CreateDistributionConfiguration
createDistributionConfiguration_clientToken = (CreateDistributionConfiguration -> Text)
-> (CreateDistributionConfiguration
    -> Text -> CreateDistributionConfiguration)
-> Lens
     CreateDistributionConfiguration
     CreateDistributionConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfiguration' {Text
clientToken :: Text
$sel:clientToken:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Text
clientToken} -> Text
clientToken) (\s :: CreateDistributionConfiguration
s@CreateDistributionConfiguration' {} Text
a -> CreateDistributionConfiguration
s {$sel:clientToken:CreateDistributionConfiguration' :: Text
clientToken = Text
a} :: CreateDistributionConfiguration)

instance
  Core.AWSRequest
    CreateDistributionConfiguration
  where
  type
    AWSResponse CreateDistributionConfiguration =
      CreateDistributionConfigurationResponse
  request :: CreateDistributionConfiguration
-> Request CreateDistributionConfiguration
request = Service
-> CreateDistributionConfiguration
-> Request CreateDistributionConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDistributionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateDistributionConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDistributionConfiguration))
-> Logger
-> Service
-> Proxy CreateDistributionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateDistributionConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDistributionConfigurationResponse
CreateDistributionConfigurationResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateDistributionConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateDistributionConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"requestId")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> CreateDistributionConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Int -> CreateDistributionConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clientToken")
            Either
  String
  (Maybe Text -> Int -> CreateDistributionConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDistributionConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"distributionConfigurationArn")
            Either String (Int -> CreateDistributionConfigurationResponse)
-> Either String Int
-> Either String CreateDistributionConfigurationResponse
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
    CreateDistributionConfiguration

instance
  Prelude.NFData
    CreateDistributionConfiguration

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

instance Core.ToJSON CreateDistributionConfiguration where
  toJSON :: CreateDistributionConfiguration -> Value
toJSON CreateDistributionConfiguration' {[Distribution]
Maybe Text
Maybe (HashMap Text Text)
Text
clientToken :: Text
distributions :: [Distribution]
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:clientToken:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Text
$sel:distributions:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> [Distribution]
$sel:name:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Text
$sel:tags:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Maybe (HashMap Text Text)
$sel:description:CreateDistributionConfiguration' :: CreateDistributionConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"distributions" Text -> [Distribution] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Distribution]
distributions),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

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

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

-- | /See:/ 'newCreateDistributionConfigurationResponse' smart constructor.
data CreateDistributionConfigurationResponse = CreateDistributionConfigurationResponse'
  { -- | The request ID that uniquely identifies this request.
    CreateDistributionConfigurationResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The idempotency token used to make this request idempotent.
    CreateDistributionConfigurationResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the distribution configuration that
    -- was created by this request.
    CreateDistributionConfigurationResponse -> Maybe Text
distributionConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateDistributionConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDistributionConfigurationResponse
-> CreateDistributionConfigurationResponse -> Bool
(CreateDistributionConfigurationResponse
 -> CreateDistributionConfigurationResponse -> Bool)
-> (CreateDistributionConfigurationResponse
    -> CreateDistributionConfigurationResponse -> Bool)
-> Eq CreateDistributionConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDistributionConfigurationResponse
-> CreateDistributionConfigurationResponse -> Bool
$c/= :: CreateDistributionConfigurationResponse
-> CreateDistributionConfigurationResponse -> Bool
== :: CreateDistributionConfigurationResponse
-> CreateDistributionConfigurationResponse -> Bool
$c== :: CreateDistributionConfigurationResponse
-> CreateDistributionConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreateDistributionConfigurationResponse]
ReadPrec CreateDistributionConfigurationResponse
Int -> ReadS CreateDistributionConfigurationResponse
ReadS [CreateDistributionConfigurationResponse]
(Int -> ReadS CreateDistributionConfigurationResponse)
-> ReadS [CreateDistributionConfigurationResponse]
-> ReadPrec CreateDistributionConfigurationResponse
-> ReadPrec [CreateDistributionConfigurationResponse]
-> Read CreateDistributionConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDistributionConfigurationResponse]
$creadListPrec :: ReadPrec [CreateDistributionConfigurationResponse]
readPrec :: ReadPrec CreateDistributionConfigurationResponse
$creadPrec :: ReadPrec CreateDistributionConfigurationResponse
readList :: ReadS [CreateDistributionConfigurationResponse]
$creadList :: ReadS [CreateDistributionConfigurationResponse]
readsPrec :: Int -> ReadS CreateDistributionConfigurationResponse
$creadsPrec :: Int -> ReadS CreateDistributionConfigurationResponse
Prelude.Read, Int -> CreateDistributionConfigurationResponse -> ShowS
[CreateDistributionConfigurationResponse] -> ShowS
CreateDistributionConfigurationResponse -> String
(Int -> CreateDistributionConfigurationResponse -> ShowS)
-> (CreateDistributionConfigurationResponse -> String)
-> ([CreateDistributionConfigurationResponse] -> ShowS)
-> Show CreateDistributionConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDistributionConfigurationResponse] -> ShowS
$cshowList :: [CreateDistributionConfigurationResponse] -> ShowS
show :: CreateDistributionConfigurationResponse -> String
$cshow :: CreateDistributionConfigurationResponse -> String
showsPrec :: Int -> CreateDistributionConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreateDistributionConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 CreateDistributionConfigurationResponse
 -> Rep CreateDistributionConfigurationResponse x)
-> (forall x.
    Rep CreateDistributionConfigurationResponse x
    -> CreateDistributionConfigurationResponse)
-> Generic CreateDistributionConfigurationResponse
forall x.
Rep CreateDistributionConfigurationResponse x
-> CreateDistributionConfigurationResponse
forall x.
CreateDistributionConfigurationResponse
-> Rep CreateDistributionConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDistributionConfigurationResponse x
-> CreateDistributionConfigurationResponse
$cfrom :: forall x.
CreateDistributionConfigurationResponse
-> Rep CreateDistributionConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDistributionConfigurationResponse' 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:
--
-- 'requestId', 'createDistributionConfigurationResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'clientToken', 'createDistributionConfigurationResponse_clientToken' - The idempotency token used to make this request idempotent.
--
-- 'distributionConfigurationArn', 'createDistributionConfigurationResponse_distributionConfigurationArn' - The Amazon Resource Name (ARN) of the distribution configuration that
-- was created by this request.
--
-- 'httpStatus', 'createDistributionConfigurationResponse_httpStatus' - The response's http status code.
newCreateDistributionConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDistributionConfigurationResponse
newCreateDistributionConfigurationResponse :: Int -> CreateDistributionConfigurationResponse
newCreateDistributionConfigurationResponse
  Int
pHttpStatus_ =
    CreateDistributionConfigurationResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDistributionConfigurationResponse
CreateDistributionConfigurationResponse'
      { $sel:requestId:CreateDistributionConfigurationResponse' :: Maybe Text
requestId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:CreateDistributionConfigurationResponse' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:distributionConfigurationArn:CreateDistributionConfigurationResponse' :: Maybe Text
distributionConfigurationArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateDistributionConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The request ID that uniquely identifies this request.
createDistributionConfigurationResponse_requestId :: Lens.Lens' CreateDistributionConfigurationResponse (Prelude.Maybe Prelude.Text)
createDistributionConfigurationResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateDistributionConfigurationResponse
-> f CreateDistributionConfigurationResponse
createDistributionConfigurationResponse_requestId = (CreateDistributionConfigurationResponse -> Maybe Text)
-> (CreateDistributionConfigurationResponse
    -> Maybe Text -> CreateDistributionConfigurationResponse)
-> Lens
     CreateDistributionConfigurationResponse
     CreateDistributionConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfigurationResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateDistributionConfigurationResponse' :: CreateDistributionConfigurationResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateDistributionConfigurationResponse
s@CreateDistributionConfigurationResponse' {} Maybe Text
a -> CreateDistributionConfigurationResponse
s {$sel:requestId:CreateDistributionConfigurationResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateDistributionConfigurationResponse)

-- | The idempotency token used to make this request idempotent.
createDistributionConfigurationResponse_clientToken :: Lens.Lens' CreateDistributionConfigurationResponse (Prelude.Maybe Prelude.Text)
createDistributionConfigurationResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateDistributionConfigurationResponse
-> f CreateDistributionConfigurationResponse
createDistributionConfigurationResponse_clientToken = (CreateDistributionConfigurationResponse -> Maybe Text)
-> (CreateDistributionConfigurationResponse
    -> Maybe Text -> CreateDistributionConfigurationResponse)
-> Lens
     CreateDistributionConfigurationResponse
     CreateDistributionConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfigurationResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateDistributionConfigurationResponse' :: CreateDistributionConfigurationResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateDistributionConfigurationResponse
s@CreateDistributionConfigurationResponse' {} Maybe Text
a -> CreateDistributionConfigurationResponse
s {$sel:clientToken:CreateDistributionConfigurationResponse' :: Maybe Text
clientToken = Maybe Text
a} :: CreateDistributionConfigurationResponse)

-- | The Amazon Resource Name (ARN) of the distribution configuration that
-- was created by this request.
createDistributionConfigurationResponse_distributionConfigurationArn :: Lens.Lens' CreateDistributionConfigurationResponse (Prelude.Maybe Prelude.Text)
createDistributionConfigurationResponse_distributionConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> CreateDistributionConfigurationResponse
-> f CreateDistributionConfigurationResponse
createDistributionConfigurationResponse_distributionConfigurationArn = (CreateDistributionConfigurationResponse -> Maybe Text)
-> (CreateDistributionConfigurationResponse
    -> Maybe Text -> CreateDistributionConfigurationResponse)
-> Lens
     CreateDistributionConfigurationResponse
     CreateDistributionConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionConfigurationResponse' {Maybe Text
distributionConfigurationArn :: Maybe Text
$sel:distributionConfigurationArn:CreateDistributionConfigurationResponse' :: CreateDistributionConfigurationResponse -> Maybe Text
distributionConfigurationArn} -> Maybe Text
distributionConfigurationArn) (\s :: CreateDistributionConfigurationResponse
s@CreateDistributionConfigurationResponse' {} Maybe Text
a -> CreateDistributionConfigurationResponse
s {$sel:distributionConfigurationArn:CreateDistributionConfigurationResponse' :: Maybe Text
distributionConfigurationArn = Maybe Text
a} :: CreateDistributionConfigurationResponse)

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

instance
  Prelude.NFData
    CreateDistributionConfigurationResponse