{-# 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.Route53.CreateTrafficPolicyVersion
-- 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 version of an existing traffic policy. When you create a
-- new version of a traffic policy, you specify the ID of the traffic
-- policy that you want to update and a JSON-formatted document that
-- describes the new version. You use traffic policies to create multiple
-- DNS resource record sets for one domain name (such as example.com) or
-- one subdomain name (such as www.example.com). You can create a maximum
-- of 1000 versions of a traffic policy. If you reach the limit and need to
-- create another version, you\'ll need to start a new traffic policy.
module Amazonka.Route53.CreateTrafficPolicyVersion
  ( -- * Creating a Request
    CreateTrafficPolicyVersion (..),
    newCreateTrafficPolicyVersion,

    -- * Request Lenses
    createTrafficPolicyVersion_comment,
    createTrafficPolicyVersion_id,
    createTrafficPolicyVersion_document,

    -- * Destructuring the Response
    CreateTrafficPolicyVersionResponse (..),
    newCreateTrafficPolicyVersionResponse,

    -- * Response Lenses
    createTrafficPolicyVersionResponse_httpStatus,
    createTrafficPolicyVersionResponse_trafficPolicy,
    createTrafficPolicyVersionResponse_location,
  )
where

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

-- | A complex type that contains information about the traffic policy that
-- you want to create a new version for.
--
-- /See:/ 'newCreateTrafficPolicyVersion' smart constructor.
data CreateTrafficPolicyVersion = CreateTrafficPolicyVersion'
  { -- | The comment that you specified in the @CreateTrafficPolicyVersion@
    -- request, if any.
    CreateTrafficPolicyVersion -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The ID of the traffic policy for which you want to create a new version.
    CreateTrafficPolicyVersion -> Text
id :: Prelude.Text,
    -- | The definition of this version of the traffic policy, in JSON format.
    -- You specified the JSON in the @CreateTrafficPolicyVersion@ request. For
    -- more information about the JSON format, see
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateTrafficPolicy.html CreateTrafficPolicy>.
    CreateTrafficPolicyVersion -> Text
document :: Prelude.Text
  }
  deriving (CreateTrafficPolicyVersion -> CreateTrafficPolicyVersion -> Bool
(CreateTrafficPolicyVersion -> CreateTrafficPolicyVersion -> Bool)
-> (CreateTrafficPolicyVersion
    -> CreateTrafficPolicyVersion -> Bool)
-> Eq CreateTrafficPolicyVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrafficPolicyVersion -> CreateTrafficPolicyVersion -> Bool
$c/= :: CreateTrafficPolicyVersion -> CreateTrafficPolicyVersion -> Bool
== :: CreateTrafficPolicyVersion -> CreateTrafficPolicyVersion -> Bool
$c== :: CreateTrafficPolicyVersion -> CreateTrafficPolicyVersion -> Bool
Prelude.Eq, ReadPrec [CreateTrafficPolicyVersion]
ReadPrec CreateTrafficPolicyVersion
Int -> ReadS CreateTrafficPolicyVersion
ReadS [CreateTrafficPolicyVersion]
(Int -> ReadS CreateTrafficPolicyVersion)
-> ReadS [CreateTrafficPolicyVersion]
-> ReadPrec CreateTrafficPolicyVersion
-> ReadPrec [CreateTrafficPolicyVersion]
-> Read CreateTrafficPolicyVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrafficPolicyVersion]
$creadListPrec :: ReadPrec [CreateTrafficPolicyVersion]
readPrec :: ReadPrec CreateTrafficPolicyVersion
$creadPrec :: ReadPrec CreateTrafficPolicyVersion
readList :: ReadS [CreateTrafficPolicyVersion]
$creadList :: ReadS [CreateTrafficPolicyVersion]
readsPrec :: Int -> ReadS CreateTrafficPolicyVersion
$creadsPrec :: Int -> ReadS CreateTrafficPolicyVersion
Prelude.Read, Int -> CreateTrafficPolicyVersion -> ShowS
[CreateTrafficPolicyVersion] -> ShowS
CreateTrafficPolicyVersion -> String
(Int -> CreateTrafficPolicyVersion -> ShowS)
-> (CreateTrafficPolicyVersion -> String)
-> ([CreateTrafficPolicyVersion] -> ShowS)
-> Show CreateTrafficPolicyVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrafficPolicyVersion] -> ShowS
$cshowList :: [CreateTrafficPolicyVersion] -> ShowS
show :: CreateTrafficPolicyVersion -> String
$cshow :: CreateTrafficPolicyVersion -> String
showsPrec :: Int -> CreateTrafficPolicyVersion -> ShowS
$cshowsPrec :: Int -> CreateTrafficPolicyVersion -> ShowS
Prelude.Show, (forall x.
 CreateTrafficPolicyVersion -> Rep CreateTrafficPolicyVersion x)
-> (forall x.
    Rep CreateTrafficPolicyVersion x -> CreateTrafficPolicyVersion)
-> Generic CreateTrafficPolicyVersion
forall x.
Rep CreateTrafficPolicyVersion x -> CreateTrafficPolicyVersion
forall x.
CreateTrafficPolicyVersion -> Rep CreateTrafficPolicyVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTrafficPolicyVersion x -> CreateTrafficPolicyVersion
$cfrom :: forall x.
CreateTrafficPolicyVersion -> Rep CreateTrafficPolicyVersion x
Prelude.Generic)

-- |
-- Create a value of 'CreateTrafficPolicyVersion' 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:
--
-- 'comment', 'createTrafficPolicyVersion_comment' - The comment that you specified in the @CreateTrafficPolicyVersion@
-- request, if any.
--
-- 'id', 'createTrafficPolicyVersion_id' - The ID of the traffic policy for which you want to create a new version.
--
-- 'document', 'createTrafficPolicyVersion_document' - The definition of this version of the traffic policy, in JSON format.
-- You specified the JSON in the @CreateTrafficPolicyVersion@ request. For
-- more information about the JSON format, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateTrafficPolicy.html CreateTrafficPolicy>.
newCreateTrafficPolicyVersion ::
  -- | 'id'
  Prelude.Text ->
  -- | 'document'
  Prelude.Text ->
  CreateTrafficPolicyVersion
newCreateTrafficPolicyVersion :: Text -> Text -> CreateTrafficPolicyVersion
newCreateTrafficPolicyVersion Text
pId_ Text
pDocument_ =
  CreateTrafficPolicyVersion' :: Maybe Text -> Text -> Text -> CreateTrafficPolicyVersion
CreateTrafficPolicyVersion'
    { $sel:comment:CreateTrafficPolicyVersion' :: Maybe Text
comment =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateTrafficPolicyVersion' :: Text
id = Text
pId_,
      $sel:document:CreateTrafficPolicyVersion' :: Text
document = Text
pDocument_
    }

-- | The comment that you specified in the @CreateTrafficPolicyVersion@
-- request, if any.
createTrafficPolicyVersion_comment :: Lens.Lens' CreateTrafficPolicyVersion (Prelude.Maybe Prelude.Text)
createTrafficPolicyVersion_comment :: (Maybe Text -> f (Maybe Text))
-> CreateTrafficPolicyVersion -> f CreateTrafficPolicyVersion
createTrafficPolicyVersion_comment = (CreateTrafficPolicyVersion -> Maybe Text)
-> (CreateTrafficPolicyVersion
    -> Maybe Text -> CreateTrafficPolicyVersion)
-> Lens
     CreateTrafficPolicyVersion
     CreateTrafficPolicyVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyVersion' {Maybe Text
comment :: Maybe Text
$sel:comment:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Maybe Text
comment} -> Maybe Text
comment) (\s :: CreateTrafficPolicyVersion
s@CreateTrafficPolicyVersion' {} Maybe Text
a -> CreateTrafficPolicyVersion
s {$sel:comment:CreateTrafficPolicyVersion' :: Maybe Text
comment = Maybe Text
a} :: CreateTrafficPolicyVersion)

-- | The ID of the traffic policy for which you want to create a new version.
createTrafficPolicyVersion_id :: Lens.Lens' CreateTrafficPolicyVersion Prelude.Text
createTrafficPolicyVersion_id :: (Text -> f Text)
-> CreateTrafficPolicyVersion -> f CreateTrafficPolicyVersion
createTrafficPolicyVersion_id = (CreateTrafficPolicyVersion -> Text)
-> (CreateTrafficPolicyVersion
    -> Text -> CreateTrafficPolicyVersion)
-> Lens
     CreateTrafficPolicyVersion CreateTrafficPolicyVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyVersion' {Text
id :: Text
$sel:id:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Text
id} -> Text
id) (\s :: CreateTrafficPolicyVersion
s@CreateTrafficPolicyVersion' {} Text
a -> CreateTrafficPolicyVersion
s {$sel:id:CreateTrafficPolicyVersion' :: Text
id = Text
a} :: CreateTrafficPolicyVersion)

-- | The definition of this version of the traffic policy, in JSON format.
-- You specified the JSON in the @CreateTrafficPolicyVersion@ request. For
-- more information about the JSON format, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateTrafficPolicy.html CreateTrafficPolicy>.
createTrafficPolicyVersion_document :: Lens.Lens' CreateTrafficPolicyVersion Prelude.Text
createTrafficPolicyVersion_document :: (Text -> f Text)
-> CreateTrafficPolicyVersion -> f CreateTrafficPolicyVersion
createTrafficPolicyVersion_document = (CreateTrafficPolicyVersion -> Text)
-> (CreateTrafficPolicyVersion
    -> Text -> CreateTrafficPolicyVersion)
-> Lens
     CreateTrafficPolicyVersion CreateTrafficPolicyVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyVersion' {Text
document :: Text
$sel:document:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Text
document} -> Text
document) (\s :: CreateTrafficPolicyVersion
s@CreateTrafficPolicyVersion' {} Text
a -> CreateTrafficPolicyVersion
s {$sel:document:CreateTrafficPolicyVersion' :: Text
document = Text
a} :: CreateTrafficPolicyVersion)

instance Core.AWSRequest CreateTrafficPolicyVersion where
  type
    AWSResponse CreateTrafficPolicyVersion =
      CreateTrafficPolicyVersionResponse
  request :: CreateTrafficPolicyVersion -> Request CreateTrafficPolicyVersion
request = Service
-> CreateTrafficPolicyVersion -> Request CreateTrafficPolicyVersion
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateTrafficPolicyVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateTrafficPolicyVersion)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse CreateTrafficPolicyVersion))
-> Logger
-> Service
-> Proxy CreateTrafficPolicyVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateTrafficPolicyVersion)))
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 ->
          Int -> TrafficPolicy -> Text -> CreateTrafficPolicyVersionResponse
CreateTrafficPolicyVersionResponse'
            (Int
 -> TrafficPolicy -> Text -> CreateTrafficPolicyVersionResponse)
-> Either String Int
-> Either
     String
     (TrafficPolicy -> Text -> CreateTrafficPolicyVersionResponse)
forall (f :: * -> *) a b. Functor 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))
            Either
  String
  (TrafficPolicy -> Text -> CreateTrafficPolicyVersionResponse)
-> Either String TrafficPolicy
-> Either String (Text -> CreateTrafficPolicyVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String TrafficPolicy
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TrafficPolicy")
            Either String (Text -> CreateTrafficPolicyVersionResponse)
-> Either String Text
-> Either String CreateTrafficPolicyVersionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String Text
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String a
Core..# HeaderName
"Location")
      )

instance Prelude.Hashable CreateTrafficPolicyVersion

instance Prelude.NFData CreateTrafficPolicyVersion

instance Core.ToElement CreateTrafficPolicyVersion where
  toElement :: CreateTrafficPolicyVersion -> Element
toElement =
    Name -> CreateTrafficPolicyVersion -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{https://route53.amazonaws.com/doc/2013-04-01/}CreateTrafficPolicyVersionRequest"

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

instance Core.ToPath CreateTrafficPolicyVersion where
  toPath :: CreateTrafficPolicyVersion -> ByteString
toPath CreateTrafficPolicyVersion' {Maybe Text
Text
document :: Text
id :: Text
comment :: Maybe Text
$sel:document:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Text
$sel:id:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Text
$sel:comment:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2013-04-01/trafficpolicy/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]

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

instance Core.ToXML CreateTrafficPolicyVersion where
  toXML :: CreateTrafficPolicyVersion -> XML
toXML CreateTrafficPolicyVersion' {Maybe Text
Text
document :: Text
id :: Text
comment :: Maybe Text
$sel:document:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Text
$sel:id:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Text
$sel:comment:CreateTrafficPolicyVersion' :: CreateTrafficPolicyVersion -> Maybe Text
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"Comment" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
comment,
        Name
"Document" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
document
      ]

-- | A complex type that contains the response information for the
-- @CreateTrafficPolicyVersion@ request.
--
-- /See:/ 'newCreateTrafficPolicyVersionResponse' smart constructor.
data CreateTrafficPolicyVersionResponse = CreateTrafficPolicyVersionResponse'
  { -- | The response's http status code.
    CreateTrafficPolicyVersionResponse -> Int
httpStatus :: Prelude.Int,
    -- | A complex type that contains settings for the new version of the traffic
    -- policy.
    CreateTrafficPolicyVersionResponse -> TrafficPolicy
trafficPolicy :: TrafficPolicy,
    -- | A unique URL that represents a new traffic policy version.
    CreateTrafficPolicyVersionResponse -> Text
location :: Prelude.Text
  }
  deriving (CreateTrafficPolicyVersionResponse
-> CreateTrafficPolicyVersionResponse -> Bool
(CreateTrafficPolicyVersionResponse
 -> CreateTrafficPolicyVersionResponse -> Bool)
-> (CreateTrafficPolicyVersionResponse
    -> CreateTrafficPolicyVersionResponse -> Bool)
-> Eq CreateTrafficPolicyVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrafficPolicyVersionResponse
-> CreateTrafficPolicyVersionResponse -> Bool
$c/= :: CreateTrafficPolicyVersionResponse
-> CreateTrafficPolicyVersionResponse -> Bool
== :: CreateTrafficPolicyVersionResponse
-> CreateTrafficPolicyVersionResponse -> Bool
$c== :: CreateTrafficPolicyVersionResponse
-> CreateTrafficPolicyVersionResponse -> Bool
Prelude.Eq, ReadPrec [CreateTrafficPolicyVersionResponse]
ReadPrec CreateTrafficPolicyVersionResponse
Int -> ReadS CreateTrafficPolicyVersionResponse
ReadS [CreateTrafficPolicyVersionResponse]
(Int -> ReadS CreateTrafficPolicyVersionResponse)
-> ReadS [CreateTrafficPolicyVersionResponse]
-> ReadPrec CreateTrafficPolicyVersionResponse
-> ReadPrec [CreateTrafficPolicyVersionResponse]
-> Read CreateTrafficPolicyVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrafficPolicyVersionResponse]
$creadListPrec :: ReadPrec [CreateTrafficPolicyVersionResponse]
readPrec :: ReadPrec CreateTrafficPolicyVersionResponse
$creadPrec :: ReadPrec CreateTrafficPolicyVersionResponse
readList :: ReadS [CreateTrafficPolicyVersionResponse]
$creadList :: ReadS [CreateTrafficPolicyVersionResponse]
readsPrec :: Int -> ReadS CreateTrafficPolicyVersionResponse
$creadsPrec :: Int -> ReadS CreateTrafficPolicyVersionResponse
Prelude.Read, Int -> CreateTrafficPolicyVersionResponse -> ShowS
[CreateTrafficPolicyVersionResponse] -> ShowS
CreateTrafficPolicyVersionResponse -> String
(Int -> CreateTrafficPolicyVersionResponse -> ShowS)
-> (CreateTrafficPolicyVersionResponse -> String)
-> ([CreateTrafficPolicyVersionResponse] -> ShowS)
-> Show CreateTrafficPolicyVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrafficPolicyVersionResponse] -> ShowS
$cshowList :: [CreateTrafficPolicyVersionResponse] -> ShowS
show :: CreateTrafficPolicyVersionResponse -> String
$cshow :: CreateTrafficPolicyVersionResponse -> String
showsPrec :: Int -> CreateTrafficPolicyVersionResponse -> ShowS
$cshowsPrec :: Int -> CreateTrafficPolicyVersionResponse -> ShowS
Prelude.Show, (forall x.
 CreateTrafficPolicyVersionResponse
 -> Rep CreateTrafficPolicyVersionResponse x)
-> (forall x.
    Rep CreateTrafficPolicyVersionResponse x
    -> CreateTrafficPolicyVersionResponse)
-> Generic CreateTrafficPolicyVersionResponse
forall x.
Rep CreateTrafficPolicyVersionResponse x
-> CreateTrafficPolicyVersionResponse
forall x.
CreateTrafficPolicyVersionResponse
-> Rep CreateTrafficPolicyVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTrafficPolicyVersionResponse x
-> CreateTrafficPolicyVersionResponse
$cfrom :: forall x.
CreateTrafficPolicyVersionResponse
-> Rep CreateTrafficPolicyVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateTrafficPolicyVersionResponse' 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:
--
-- 'httpStatus', 'createTrafficPolicyVersionResponse_httpStatus' - The response's http status code.
--
-- 'trafficPolicy', 'createTrafficPolicyVersionResponse_trafficPolicy' - A complex type that contains settings for the new version of the traffic
-- policy.
--
-- 'location', 'createTrafficPolicyVersionResponse_location' - A unique URL that represents a new traffic policy version.
newCreateTrafficPolicyVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'trafficPolicy'
  TrafficPolicy ->
  -- | 'location'
  Prelude.Text ->
  CreateTrafficPolicyVersionResponse
newCreateTrafficPolicyVersionResponse :: Int -> TrafficPolicy -> Text -> CreateTrafficPolicyVersionResponse
newCreateTrafficPolicyVersionResponse
  Int
pHttpStatus_
  TrafficPolicy
pTrafficPolicy_
  Text
pLocation_ =
    CreateTrafficPolicyVersionResponse' :: Int -> TrafficPolicy -> Text -> CreateTrafficPolicyVersionResponse
CreateTrafficPolicyVersionResponse'
      { $sel:httpStatus:CreateTrafficPolicyVersionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:trafficPolicy:CreateTrafficPolicyVersionResponse' :: TrafficPolicy
trafficPolicy = TrafficPolicy
pTrafficPolicy_,
        $sel:location:CreateTrafficPolicyVersionResponse' :: Text
location = Text
pLocation_
      }

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

-- | A complex type that contains settings for the new version of the traffic
-- policy.
createTrafficPolicyVersionResponse_trafficPolicy :: Lens.Lens' CreateTrafficPolicyVersionResponse TrafficPolicy
createTrafficPolicyVersionResponse_trafficPolicy :: (TrafficPolicy -> f TrafficPolicy)
-> CreateTrafficPolicyVersionResponse
-> f CreateTrafficPolicyVersionResponse
createTrafficPolicyVersionResponse_trafficPolicy = (CreateTrafficPolicyVersionResponse -> TrafficPolicy)
-> (CreateTrafficPolicyVersionResponse
    -> TrafficPolicy -> CreateTrafficPolicyVersionResponse)
-> Lens
     CreateTrafficPolicyVersionResponse
     CreateTrafficPolicyVersionResponse
     TrafficPolicy
     TrafficPolicy
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyVersionResponse' {TrafficPolicy
trafficPolicy :: TrafficPolicy
$sel:trafficPolicy:CreateTrafficPolicyVersionResponse' :: CreateTrafficPolicyVersionResponse -> TrafficPolicy
trafficPolicy} -> TrafficPolicy
trafficPolicy) (\s :: CreateTrafficPolicyVersionResponse
s@CreateTrafficPolicyVersionResponse' {} TrafficPolicy
a -> CreateTrafficPolicyVersionResponse
s {$sel:trafficPolicy:CreateTrafficPolicyVersionResponse' :: TrafficPolicy
trafficPolicy = TrafficPolicy
a} :: CreateTrafficPolicyVersionResponse)

-- | A unique URL that represents a new traffic policy version.
createTrafficPolicyVersionResponse_location :: Lens.Lens' CreateTrafficPolicyVersionResponse Prelude.Text
createTrafficPolicyVersionResponse_location :: (Text -> f Text)
-> CreateTrafficPolicyVersionResponse
-> f CreateTrafficPolicyVersionResponse
createTrafficPolicyVersionResponse_location = (CreateTrafficPolicyVersionResponse -> Text)
-> (CreateTrafficPolicyVersionResponse
    -> Text -> CreateTrafficPolicyVersionResponse)
-> Lens
     CreateTrafficPolicyVersionResponse
     CreateTrafficPolicyVersionResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyVersionResponse' {Text
location :: Text
$sel:location:CreateTrafficPolicyVersionResponse' :: CreateTrafficPolicyVersionResponse -> Text
location} -> Text
location) (\s :: CreateTrafficPolicyVersionResponse
s@CreateTrafficPolicyVersionResponse' {} Text
a -> CreateTrafficPolicyVersionResponse
s {$sel:location:CreateTrafficPolicyVersionResponse' :: Text
location = Text
a} :: CreateTrafficPolicyVersionResponse)

instance
  Prelude.NFData
    CreateTrafficPolicyVersionResponse