{-# 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.CreateTrafficPolicyInstance
-- 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 resource record sets in a specified hosted zone based on the
-- settings in a specified traffic policy version. In addition,
-- @CreateTrafficPolicyInstance@ associates the resource record sets with a
-- specified domain name (such as example.com) or subdomain name (such as
-- www.example.com). Amazon Route 53 responds to DNS queries for the domain
-- or subdomain name by using the resource record sets that
-- @CreateTrafficPolicyInstance@ created.
module Amazonka.Route53.CreateTrafficPolicyInstance
  ( -- * Creating a Request
    CreateTrafficPolicyInstance (..),
    newCreateTrafficPolicyInstance,

    -- * Request Lenses
    createTrafficPolicyInstance_hostedZoneId,
    createTrafficPolicyInstance_name,
    createTrafficPolicyInstance_ttl,
    createTrafficPolicyInstance_trafficPolicyId,
    createTrafficPolicyInstance_trafficPolicyVersion,

    -- * Destructuring the Response
    CreateTrafficPolicyInstanceResponse (..),
    newCreateTrafficPolicyInstanceResponse,

    -- * Response Lenses
    createTrafficPolicyInstanceResponse_httpStatus,
    createTrafficPolicyInstanceResponse_trafficPolicyInstance,
    createTrafficPolicyInstanceResponse_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 resource record sets
-- that you want to create based on a specified traffic policy.
--
-- /See:/ 'newCreateTrafficPolicyInstance' smart constructor.
data CreateTrafficPolicyInstance = CreateTrafficPolicyInstance'
  { -- | The ID of the hosted zone that you want Amazon Route 53 to create
    -- resource record sets in by using the configuration in a traffic policy.
    CreateTrafficPolicyInstance -> ResourceId
hostedZoneId :: ResourceId,
    -- | The domain name (such as example.com) or subdomain name (such as
    -- www.example.com) for which Amazon Route 53 responds to DNS queries by
    -- using the resource record sets that Route 53 creates for this traffic
    -- policy instance.
    CreateTrafficPolicyInstance -> Text
name :: Prelude.Text,
    -- | (Optional) The TTL that you want Amazon Route 53 to assign to all of the
    -- resource record sets that it creates in the specified hosted zone.
    CreateTrafficPolicyInstance -> Natural
ttl :: Prelude.Natural,
    -- | The ID of the traffic policy that you want to use to create resource
    -- record sets in the specified hosted zone.
    CreateTrafficPolicyInstance -> Text
trafficPolicyId :: Prelude.Text,
    -- | The version of the traffic policy that you want to use to create
    -- resource record sets in the specified hosted zone.
    CreateTrafficPolicyInstance -> Natural
trafficPolicyVersion :: Prelude.Natural
  }
  deriving (CreateTrafficPolicyInstance -> CreateTrafficPolicyInstance -> Bool
(CreateTrafficPolicyInstance
 -> CreateTrafficPolicyInstance -> Bool)
-> (CreateTrafficPolicyInstance
    -> CreateTrafficPolicyInstance -> Bool)
-> Eq CreateTrafficPolicyInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrafficPolicyInstance -> CreateTrafficPolicyInstance -> Bool
$c/= :: CreateTrafficPolicyInstance -> CreateTrafficPolicyInstance -> Bool
== :: CreateTrafficPolicyInstance -> CreateTrafficPolicyInstance -> Bool
$c== :: CreateTrafficPolicyInstance -> CreateTrafficPolicyInstance -> Bool
Prelude.Eq, ReadPrec [CreateTrafficPolicyInstance]
ReadPrec CreateTrafficPolicyInstance
Int -> ReadS CreateTrafficPolicyInstance
ReadS [CreateTrafficPolicyInstance]
(Int -> ReadS CreateTrafficPolicyInstance)
-> ReadS [CreateTrafficPolicyInstance]
-> ReadPrec CreateTrafficPolicyInstance
-> ReadPrec [CreateTrafficPolicyInstance]
-> Read CreateTrafficPolicyInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrafficPolicyInstance]
$creadListPrec :: ReadPrec [CreateTrafficPolicyInstance]
readPrec :: ReadPrec CreateTrafficPolicyInstance
$creadPrec :: ReadPrec CreateTrafficPolicyInstance
readList :: ReadS [CreateTrafficPolicyInstance]
$creadList :: ReadS [CreateTrafficPolicyInstance]
readsPrec :: Int -> ReadS CreateTrafficPolicyInstance
$creadsPrec :: Int -> ReadS CreateTrafficPolicyInstance
Prelude.Read, Int -> CreateTrafficPolicyInstance -> ShowS
[CreateTrafficPolicyInstance] -> ShowS
CreateTrafficPolicyInstance -> String
(Int -> CreateTrafficPolicyInstance -> ShowS)
-> (CreateTrafficPolicyInstance -> String)
-> ([CreateTrafficPolicyInstance] -> ShowS)
-> Show CreateTrafficPolicyInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrafficPolicyInstance] -> ShowS
$cshowList :: [CreateTrafficPolicyInstance] -> ShowS
show :: CreateTrafficPolicyInstance -> String
$cshow :: CreateTrafficPolicyInstance -> String
showsPrec :: Int -> CreateTrafficPolicyInstance -> ShowS
$cshowsPrec :: Int -> CreateTrafficPolicyInstance -> ShowS
Prelude.Show, (forall x.
 CreateTrafficPolicyInstance -> Rep CreateTrafficPolicyInstance x)
-> (forall x.
    Rep CreateTrafficPolicyInstance x -> CreateTrafficPolicyInstance)
-> Generic CreateTrafficPolicyInstance
forall x.
Rep CreateTrafficPolicyInstance x -> CreateTrafficPolicyInstance
forall x.
CreateTrafficPolicyInstance -> Rep CreateTrafficPolicyInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTrafficPolicyInstance x -> CreateTrafficPolicyInstance
$cfrom :: forall x.
CreateTrafficPolicyInstance -> Rep CreateTrafficPolicyInstance x
Prelude.Generic)

-- |
-- Create a value of 'CreateTrafficPolicyInstance' 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:
--
-- 'hostedZoneId', 'createTrafficPolicyInstance_hostedZoneId' - The ID of the hosted zone that you want Amazon Route 53 to create
-- resource record sets in by using the configuration in a traffic policy.
--
-- 'name', 'createTrafficPolicyInstance_name' - The domain name (such as example.com) or subdomain name (such as
-- www.example.com) for which Amazon Route 53 responds to DNS queries by
-- using the resource record sets that Route 53 creates for this traffic
-- policy instance.
--
-- 'ttl', 'createTrafficPolicyInstance_ttl' - (Optional) The TTL that you want Amazon Route 53 to assign to all of the
-- resource record sets that it creates in the specified hosted zone.
--
-- 'trafficPolicyId', 'createTrafficPolicyInstance_trafficPolicyId' - The ID of the traffic policy that you want to use to create resource
-- record sets in the specified hosted zone.
--
-- 'trafficPolicyVersion', 'createTrafficPolicyInstance_trafficPolicyVersion' - The version of the traffic policy that you want to use to create
-- resource record sets in the specified hosted zone.
newCreateTrafficPolicyInstance ::
  -- | 'hostedZoneId'
  ResourceId ->
  -- | 'name'
  Prelude.Text ->
  -- | 'ttl'
  Prelude.Natural ->
  -- | 'trafficPolicyId'
  Prelude.Text ->
  -- | 'trafficPolicyVersion'
  Prelude.Natural ->
  CreateTrafficPolicyInstance
newCreateTrafficPolicyInstance :: ResourceId
-> Text
-> Natural
-> Text
-> Natural
-> CreateTrafficPolicyInstance
newCreateTrafficPolicyInstance
  ResourceId
pHostedZoneId_
  Text
pName_
  Natural
pTTL_
  Text
pTrafficPolicyId_
  Natural
pTrafficPolicyVersion_ =
    CreateTrafficPolicyInstance' :: ResourceId
-> Text
-> Natural
-> Text
-> Natural
-> CreateTrafficPolicyInstance
CreateTrafficPolicyInstance'
      { $sel:hostedZoneId:CreateTrafficPolicyInstance' :: ResourceId
hostedZoneId =
          ResourceId
pHostedZoneId_,
        $sel:name:CreateTrafficPolicyInstance' :: Text
name = Text
pName_,
        $sel:ttl:CreateTrafficPolicyInstance' :: Natural
ttl = Natural
pTTL_,
        $sel:trafficPolicyId:CreateTrafficPolicyInstance' :: Text
trafficPolicyId = Text
pTrafficPolicyId_,
        $sel:trafficPolicyVersion:CreateTrafficPolicyInstance' :: Natural
trafficPolicyVersion = Natural
pTrafficPolicyVersion_
      }

-- | The ID of the hosted zone that you want Amazon Route 53 to create
-- resource record sets in by using the configuration in a traffic policy.
createTrafficPolicyInstance_hostedZoneId :: Lens.Lens' CreateTrafficPolicyInstance ResourceId
createTrafficPolicyInstance_hostedZoneId :: (ResourceId -> f ResourceId)
-> CreateTrafficPolicyInstance -> f CreateTrafficPolicyInstance
createTrafficPolicyInstance_hostedZoneId = (CreateTrafficPolicyInstance -> ResourceId)
-> (CreateTrafficPolicyInstance
    -> ResourceId -> CreateTrafficPolicyInstance)
-> Lens
     CreateTrafficPolicyInstance
     CreateTrafficPolicyInstance
     ResourceId
     ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyInstance' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: CreateTrafficPolicyInstance
s@CreateTrafficPolicyInstance' {} ResourceId
a -> CreateTrafficPolicyInstance
s {$sel:hostedZoneId:CreateTrafficPolicyInstance' :: ResourceId
hostedZoneId = ResourceId
a} :: CreateTrafficPolicyInstance)

-- | The domain name (such as example.com) or subdomain name (such as
-- www.example.com) for which Amazon Route 53 responds to DNS queries by
-- using the resource record sets that Route 53 creates for this traffic
-- policy instance.
createTrafficPolicyInstance_name :: Lens.Lens' CreateTrafficPolicyInstance Prelude.Text
createTrafficPolicyInstance_name :: (Text -> f Text)
-> CreateTrafficPolicyInstance -> f CreateTrafficPolicyInstance
createTrafficPolicyInstance_name = (CreateTrafficPolicyInstance -> Text)
-> (CreateTrafficPolicyInstance
    -> Text -> CreateTrafficPolicyInstance)
-> Lens
     CreateTrafficPolicyInstance CreateTrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyInstance' {Text
name :: Text
$sel:name:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Text
name} -> Text
name) (\s :: CreateTrafficPolicyInstance
s@CreateTrafficPolicyInstance' {} Text
a -> CreateTrafficPolicyInstance
s {$sel:name:CreateTrafficPolicyInstance' :: Text
name = Text
a} :: CreateTrafficPolicyInstance)

-- | (Optional) The TTL that you want Amazon Route 53 to assign to all of the
-- resource record sets that it creates in the specified hosted zone.
createTrafficPolicyInstance_ttl :: Lens.Lens' CreateTrafficPolicyInstance Prelude.Natural
createTrafficPolicyInstance_ttl :: (Natural -> f Natural)
-> CreateTrafficPolicyInstance -> f CreateTrafficPolicyInstance
createTrafficPolicyInstance_ttl = (CreateTrafficPolicyInstance -> Natural)
-> (CreateTrafficPolicyInstance
    -> Natural -> CreateTrafficPolicyInstance)
-> Lens
     CreateTrafficPolicyInstance
     CreateTrafficPolicyInstance
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyInstance' {Natural
ttl :: Natural
$sel:ttl:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Natural
ttl} -> Natural
ttl) (\s :: CreateTrafficPolicyInstance
s@CreateTrafficPolicyInstance' {} Natural
a -> CreateTrafficPolicyInstance
s {$sel:ttl:CreateTrafficPolicyInstance' :: Natural
ttl = Natural
a} :: CreateTrafficPolicyInstance)

-- | The ID of the traffic policy that you want to use to create resource
-- record sets in the specified hosted zone.
createTrafficPolicyInstance_trafficPolicyId :: Lens.Lens' CreateTrafficPolicyInstance Prelude.Text
createTrafficPolicyInstance_trafficPolicyId :: (Text -> f Text)
-> CreateTrafficPolicyInstance -> f CreateTrafficPolicyInstance
createTrafficPolicyInstance_trafficPolicyId = (CreateTrafficPolicyInstance -> Text)
-> (CreateTrafficPolicyInstance
    -> Text -> CreateTrafficPolicyInstance)
-> Lens
     CreateTrafficPolicyInstance CreateTrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyInstance' {Text
trafficPolicyId :: Text
$sel:trafficPolicyId:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Text
trafficPolicyId} -> Text
trafficPolicyId) (\s :: CreateTrafficPolicyInstance
s@CreateTrafficPolicyInstance' {} Text
a -> CreateTrafficPolicyInstance
s {$sel:trafficPolicyId:CreateTrafficPolicyInstance' :: Text
trafficPolicyId = Text
a} :: CreateTrafficPolicyInstance)

-- | The version of the traffic policy that you want to use to create
-- resource record sets in the specified hosted zone.
createTrafficPolicyInstance_trafficPolicyVersion :: Lens.Lens' CreateTrafficPolicyInstance Prelude.Natural
createTrafficPolicyInstance_trafficPolicyVersion :: (Natural -> f Natural)
-> CreateTrafficPolicyInstance -> f CreateTrafficPolicyInstance
createTrafficPolicyInstance_trafficPolicyVersion = (CreateTrafficPolicyInstance -> Natural)
-> (CreateTrafficPolicyInstance
    -> Natural -> CreateTrafficPolicyInstance)
-> Lens
     CreateTrafficPolicyInstance
     CreateTrafficPolicyInstance
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyInstance' {Natural
trafficPolicyVersion :: Natural
$sel:trafficPolicyVersion:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Natural
trafficPolicyVersion} -> Natural
trafficPolicyVersion) (\s :: CreateTrafficPolicyInstance
s@CreateTrafficPolicyInstance' {} Natural
a -> CreateTrafficPolicyInstance
s {$sel:trafficPolicyVersion:CreateTrafficPolicyInstance' :: Natural
trafficPolicyVersion = Natural
a} :: CreateTrafficPolicyInstance)

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

instance Prelude.NFData CreateTrafficPolicyInstance

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

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

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

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

instance Core.ToXML CreateTrafficPolicyInstance where
  toXML :: CreateTrafficPolicyInstance -> XML
toXML CreateTrafficPolicyInstance' {Natural
Text
ResourceId
trafficPolicyVersion :: Natural
trafficPolicyId :: Text
ttl :: Natural
name :: Text
hostedZoneId :: ResourceId
$sel:trafficPolicyVersion:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Natural
$sel:trafficPolicyId:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Text
$sel:ttl:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Natural
$sel:name:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> Text
$sel:hostedZoneId:CreateTrafficPolicyInstance' :: CreateTrafficPolicyInstance -> ResourceId
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"HostedZoneId" Name -> ResourceId -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ResourceId
hostedZoneId,
        Name
"Name" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
name,
        Name
"TTL" Name -> Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Natural
ttl,
        Name
"TrafficPolicyId" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
trafficPolicyId,
        Name
"TrafficPolicyVersion" Name -> Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Natural
trafficPolicyVersion
      ]

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

-- |
-- Create a value of 'CreateTrafficPolicyInstanceResponse' 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', 'createTrafficPolicyInstanceResponse_httpStatus' - The response's http status code.
--
-- 'trafficPolicyInstance', 'createTrafficPolicyInstanceResponse_trafficPolicyInstance' - A complex type that contains settings for the new traffic policy
-- instance.
--
-- 'location', 'createTrafficPolicyInstanceResponse_location' - A unique URL that represents a new traffic policy instance.
newCreateTrafficPolicyInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'trafficPolicyInstance'
  TrafficPolicyInstance ->
  -- | 'location'
  Prelude.Text ->
  CreateTrafficPolicyInstanceResponse
newCreateTrafficPolicyInstanceResponse :: Int
-> TrafficPolicyInstance
-> Text
-> CreateTrafficPolicyInstanceResponse
newCreateTrafficPolicyInstanceResponse
  Int
pHttpStatus_
  TrafficPolicyInstance
pTrafficPolicyInstance_
  Text
pLocation_ =
    CreateTrafficPolicyInstanceResponse' :: Int
-> TrafficPolicyInstance
-> Text
-> CreateTrafficPolicyInstanceResponse
CreateTrafficPolicyInstanceResponse'
      { $sel:httpStatus:CreateTrafficPolicyInstanceResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:trafficPolicyInstance:CreateTrafficPolicyInstanceResponse' :: TrafficPolicyInstance
trafficPolicyInstance =
          TrafficPolicyInstance
pTrafficPolicyInstance_,
        $sel:location:CreateTrafficPolicyInstanceResponse' :: Text
location = Text
pLocation_
      }

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

-- | A complex type that contains settings for the new traffic policy
-- instance.
createTrafficPolicyInstanceResponse_trafficPolicyInstance :: Lens.Lens' CreateTrafficPolicyInstanceResponse TrafficPolicyInstance
createTrafficPolicyInstanceResponse_trafficPolicyInstance :: (TrafficPolicyInstance -> f TrafficPolicyInstance)
-> CreateTrafficPolicyInstanceResponse
-> f CreateTrafficPolicyInstanceResponse
createTrafficPolicyInstanceResponse_trafficPolicyInstance = (CreateTrafficPolicyInstanceResponse -> TrafficPolicyInstance)
-> (CreateTrafficPolicyInstanceResponse
    -> TrafficPolicyInstance -> CreateTrafficPolicyInstanceResponse)
-> Lens
     CreateTrafficPolicyInstanceResponse
     CreateTrafficPolicyInstanceResponse
     TrafficPolicyInstance
     TrafficPolicyInstance
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrafficPolicyInstanceResponse' {TrafficPolicyInstance
trafficPolicyInstance :: TrafficPolicyInstance
$sel:trafficPolicyInstance:CreateTrafficPolicyInstanceResponse' :: CreateTrafficPolicyInstanceResponse -> TrafficPolicyInstance
trafficPolicyInstance} -> TrafficPolicyInstance
trafficPolicyInstance) (\s :: CreateTrafficPolicyInstanceResponse
s@CreateTrafficPolicyInstanceResponse' {} TrafficPolicyInstance
a -> CreateTrafficPolicyInstanceResponse
s {$sel:trafficPolicyInstance:CreateTrafficPolicyInstanceResponse' :: TrafficPolicyInstance
trafficPolicyInstance = TrafficPolicyInstance
a} :: CreateTrafficPolicyInstanceResponse)

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

instance
  Prelude.NFData
    CreateTrafficPolicyInstanceResponse