{-# 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.CreateTrafficPolicy
-- 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 traffic policy, which you use to create multiple DNS resource
-- record sets for one domain name (such as example.com) or one subdomain
-- name (such as www.example.com).
module Amazonka.Route53.CreateTrafficPolicy
  ( -- * Creating a Request
    CreateTrafficPolicy (..),
    newCreateTrafficPolicy,

    -- * Request Lenses
    createTrafficPolicy_comment,
    createTrafficPolicy_name,
    createTrafficPolicy_document,

    -- * Destructuring the Response
    CreateTrafficPolicyResponse (..),
    newCreateTrafficPolicyResponse,

    -- * Response Lenses
    createTrafficPolicyResponse_httpStatus,
    createTrafficPolicyResponse_trafficPolicy,
    createTrafficPolicyResponse_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.
--
-- /See:/ 'newCreateTrafficPolicy' smart constructor.
data CreateTrafficPolicy = CreateTrafficPolicy'
  { -- | (Optional) Any comments that you want to include about the traffic
    -- policy.
    CreateTrafficPolicy -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The name of the traffic policy.
    CreateTrafficPolicy -> Text
name :: Prelude.Text,
    -- | The definition of this traffic policy in JSON format. For more
    -- information, see
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html Traffic Policy Document Format>.
    CreateTrafficPolicy -> Text
document :: Prelude.Text
  }
  deriving (CreateTrafficPolicy -> CreateTrafficPolicy -> Bool
(CreateTrafficPolicy -> CreateTrafficPolicy -> Bool)
-> (CreateTrafficPolicy -> CreateTrafficPolicy -> Bool)
-> Eq CreateTrafficPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrafficPolicy -> CreateTrafficPolicy -> Bool
$c/= :: CreateTrafficPolicy -> CreateTrafficPolicy -> Bool
== :: CreateTrafficPolicy -> CreateTrafficPolicy -> Bool
$c== :: CreateTrafficPolicy -> CreateTrafficPolicy -> Bool
Prelude.Eq, ReadPrec [CreateTrafficPolicy]
ReadPrec CreateTrafficPolicy
Int -> ReadS CreateTrafficPolicy
ReadS [CreateTrafficPolicy]
(Int -> ReadS CreateTrafficPolicy)
-> ReadS [CreateTrafficPolicy]
-> ReadPrec CreateTrafficPolicy
-> ReadPrec [CreateTrafficPolicy]
-> Read CreateTrafficPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrafficPolicy]
$creadListPrec :: ReadPrec [CreateTrafficPolicy]
readPrec :: ReadPrec CreateTrafficPolicy
$creadPrec :: ReadPrec CreateTrafficPolicy
readList :: ReadS [CreateTrafficPolicy]
$creadList :: ReadS [CreateTrafficPolicy]
readsPrec :: Int -> ReadS CreateTrafficPolicy
$creadsPrec :: Int -> ReadS CreateTrafficPolicy
Prelude.Read, Int -> CreateTrafficPolicy -> ShowS
[CreateTrafficPolicy] -> ShowS
CreateTrafficPolicy -> String
(Int -> CreateTrafficPolicy -> ShowS)
-> (CreateTrafficPolicy -> String)
-> ([CreateTrafficPolicy] -> ShowS)
-> Show CreateTrafficPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrafficPolicy] -> ShowS
$cshowList :: [CreateTrafficPolicy] -> ShowS
show :: CreateTrafficPolicy -> String
$cshow :: CreateTrafficPolicy -> String
showsPrec :: Int -> CreateTrafficPolicy -> ShowS
$cshowsPrec :: Int -> CreateTrafficPolicy -> ShowS
Prelude.Show, (forall x. CreateTrafficPolicy -> Rep CreateTrafficPolicy x)
-> (forall x. Rep CreateTrafficPolicy x -> CreateTrafficPolicy)
-> Generic CreateTrafficPolicy
forall x. Rep CreateTrafficPolicy x -> CreateTrafficPolicy
forall x. CreateTrafficPolicy -> Rep CreateTrafficPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTrafficPolicy x -> CreateTrafficPolicy
$cfrom :: forall x. CreateTrafficPolicy -> Rep CreateTrafficPolicy x
Prelude.Generic)

-- |
-- Create a value of 'CreateTrafficPolicy' 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', 'createTrafficPolicy_comment' - (Optional) Any comments that you want to include about the traffic
-- policy.
--
-- 'name', 'createTrafficPolicy_name' - The name of the traffic policy.
--
-- 'document', 'createTrafficPolicy_document' - The definition of this traffic policy in JSON format. For more
-- information, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html Traffic Policy Document Format>.
newCreateTrafficPolicy ::
  -- | 'name'
  Prelude.Text ->
  -- | 'document'
  Prelude.Text ->
  CreateTrafficPolicy
newCreateTrafficPolicy :: Text -> Text -> CreateTrafficPolicy
newCreateTrafficPolicy Text
pName_ Text
pDocument_ =
  CreateTrafficPolicy' :: Maybe Text -> Text -> Text -> CreateTrafficPolicy
CreateTrafficPolicy'
    { $sel:comment:CreateTrafficPolicy' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateTrafficPolicy' :: Text
name = Text
pName_,
      $sel:document:CreateTrafficPolicy' :: Text
document = Text
pDocument_
    }

-- | (Optional) Any comments that you want to include about the traffic
-- policy.
createTrafficPolicy_comment :: Lens.Lens' CreateTrafficPolicy (Prelude.Maybe Prelude.Text)
createTrafficPolicy_comment :: (Maybe Text -> f (Maybe Text))
-> CreateTrafficPolicy -> f CreateTrafficPolicy
createTrafficPolicy_comment = (CreateTrafficPolicy -> Maybe Text)
-> (CreateTrafficPolicy -> Maybe Text -> CreateTrafficPolicy)
-> Lens
     CreateTrafficPolicy CreateTrafficPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicy' {Maybe Text
comment :: Maybe Text
$sel:comment:CreateTrafficPolicy' :: CreateTrafficPolicy -> Maybe Text
comment} -> Maybe Text
comment) (\s :: CreateTrafficPolicy
s@CreateTrafficPolicy' {} Maybe Text
a -> CreateTrafficPolicy
s {$sel:comment:CreateTrafficPolicy' :: Maybe Text
comment = Maybe Text
a} :: CreateTrafficPolicy)

-- | The name of the traffic policy.
createTrafficPolicy_name :: Lens.Lens' CreateTrafficPolicy Prelude.Text
createTrafficPolicy_name :: (Text -> f Text) -> CreateTrafficPolicy -> f CreateTrafficPolicy
createTrafficPolicy_name = (CreateTrafficPolicy -> Text)
-> (CreateTrafficPolicy -> Text -> CreateTrafficPolicy)
-> Lens CreateTrafficPolicy CreateTrafficPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicy' {Text
name :: Text
$sel:name:CreateTrafficPolicy' :: CreateTrafficPolicy -> Text
name} -> Text
name) (\s :: CreateTrafficPolicy
s@CreateTrafficPolicy' {} Text
a -> CreateTrafficPolicy
s {$sel:name:CreateTrafficPolicy' :: Text
name = Text
a} :: CreateTrafficPolicy)

-- | The definition of this traffic policy in JSON format. For more
-- information, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html Traffic Policy Document Format>.
createTrafficPolicy_document :: Lens.Lens' CreateTrafficPolicy Prelude.Text
createTrafficPolicy_document :: (Text -> f Text) -> CreateTrafficPolicy -> f CreateTrafficPolicy
createTrafficPolicy_document = (CreateTrafficPolicy -> Text)
-> (CreateTrafficPolicy -> Text -> CreateTrafficPolicy)
-> Lens CreateTrafficPolicy CreateTrafficPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicy' {Text
document :: Text
$sel:document:CreateTrafficPolicy' :: CreateTrafficPolicy -> Text
document} -> Text
document) (\s :: CreateTrafficPolicy
s@CreateTrafficPolicy' {} Text
a -> CreateTrafficPolicy
s {$sel:document:CreateTrafficPolicy' :: Text
document = Text
a} :: CreateTrafficPolicy)

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

instance Prelude.NFData CreateTrafficPolicy

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

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

instance Core.ToPath CreateTrafficPolicy where
  toPath :: CreateTrafficPolicy -> ByteString
toPath = ByteString -> CreateTrafficPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/trafficpolicy"

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

instance Core.ToXML CreateTrafficPolicy where
  toXML :: CreateTrafficPolicy -> XML
toXML CreateTrafficPolicy' {Maybe Text
Text
document :: Text
name :: Text
comment :: Maybe Text
$sel:document:CreateTrafficPolicy' :: CreateTrafficPolicy -> Text
$sel:name:CreateTrafficPolicy' :: CreateTrafficPolicy -> Text
$sel:comment:CreateTrafficPolicy' :: CreateTrafficPolicy -> 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
"Name" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
name,
        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
-- @CreateTrafficPolicy@ request.
--
-- /See:/ 'newCreateTrafficPolicyResponse' smart constructor.
data CreateTrafficPolicyResponse = CreateTrafficPolicyResponse'
  { -- | The response's http status code.
    CreateTrafficPolicyResponse -> Int
httpStatus :: Prelude.Int,
    -- | A complex type that contains settings for the new traffic policy.
    CreateTrafficPolicyResponse -> TrafficPolicy
trafficPolicy :: TrafficPolicy,
    -- | A unique URL that represents a new traffic policy.
    CreateTrafficPolicyResponse -> Text
location :: Prelude.Text
  }
  deriving (CreateTrafficPolicyResponse -> CreateTrafficPolicyResponse -> Bool
(CreateTrafficPolicyResponse
 -> CreateTrafficPolicyResponse -> Bool)
-> (CreateTrafficPolicyResponse
    -> CreateTrafficPolicyResponse -> Bool)
-> Eq CreateTrafficPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrafficPolicyResponse -> CreateTrafficPolicyResponse -> Bool
$c/= :: CreateTrafficPolicyResponse -> CreateTrafficPolicyResponse -> Bool
== :: CreateTrafficPolicyResponse -> CreateTrafficPolicyResponse -> Bool
$c== :: CreateTrafficPolicyResponse -> CreateTrafficPolicyResponse -> Bool
Prelude.Eq, ReadPrec [CreateTrafficPolicyResponse]
ReadPrec CreateTrafficPolicyResponse
Int -> ReadS CreateTrafficPolicyResponse
ReadS [CreateTrafficPolicyResponse]
(Int -> ReadS CreateTrafficPolicyResponse)
-> ReadS [CreateTrafficPolicyResponse]
-> ReadPrec CreateTrafficPolicyResponse
-> ReadPrec [CreateTrafficPolicyResponse]
-> Read CreateTrafficPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrafficPolicyResponse]
$creadListPrec :: ReadPrec [CreateTrafficPolicyResponse]
readPrec :: ReadPrec CreateTrafficPolicyResponse
$creadPrec :: ReadPrec CreateTrafficPolicyResponse
readList :: ReadS [CreateTrafficPolicyResponse]
$creadList :: ReadS [CreateTrafficPolicyResponse]
readsPrec :: Int -> ReadS CreateTrafficPolicyResponse
$creadsPrec :: Int -> ReadS CreateTrafficPolicyResponse
Prelude.Read, Int -> CreateTrafficPolicyResponse -> ShowS
[CreateTrafficPolicyResponse] -> ShowS
CreateTrafficPolicyResponse -> String
(Int -> CreateTrafficPolicyResponse -> ShowS)
-> (CreateTrafficPolicyResponse -> String)
-> ([CreateTrafficPolicyResponse] -> ShowS)
-> Show CreateTrafficPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrafficPolicyResponse] -> ShowS
$cshowList :: [CreateTrafficPolicyResponse] -> ShowS
show :: CreateTrafficPolicyResponse -> String
$cshow :: CreateTrafficPolicyResponse -> String
showsPrec :: Int -> CreateTrafficPolicyResponse -> ShowS
$cshowsPrec :: Int -> CreateTrafficPolicyResponse -> ShowS
Prelude.Show, (forall x.
 CreateTrafficPolicyResponse -> Rep CreateTrafficPolicyResponse x)
-> (forall x.
    Rep CreateTrafficPolicyResponse x -> CreateTrafficPolicyResponse)
-> Generic CreateTrafficPolicyResponse
forall x.
Rep CreateTrafficPolicyResponse x -> CreateTrafficPolicyResponse
forall x.
CreateTrafficPolicyResponse -> Rep CreateTrafficPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTrafficPolicyResponse x -> CreateTrafficPolicyResponse
$cfrom :: forall x.
CreateTrafficPolicyResponse -> Rep CreateTrafficPolicyResponse x
Prelude.Generic)

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

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

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

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

instance Prelude.NFData CreateTrafficPolicyResponse